xy 3 tuần trước cách đây
mục cha
commit
6dd1de102c
1 tập tin đã thay đổi với 9 bổ sung7 xóa
  1. 9 7
      src/client.php

+ 9 - 7
src/client.php

@@ -35,21 +35,23 @@ class GameClient {
                 'method' => 'POST',
                 'header' => implode("\r\n", [
                     'Content-Type: application/x-protobuf',
-                    'X-Protobuf-Schema: common.proto',
-                    'X-Protobuf-Message: common_pack.ReqLogin',
-                    'Accept: application/x-protobuf' // 明确要求返回 protobuf 格式
+                    'Accept: */*',
+                    'Accept-Language: zh-CN,zh;q=0.9',
+                    'Connection: keep-alive',
+                    'Referer: http://localhost:7456/'
                 ]),
-                'content' => $binaryData,
-                'ignore_errors' => false, // 改为 false 以捕获 HTTP 错误
-                'timeout' => 10
+                'content' => "\n\x03xy1\x12\x03123", // 与JS相同的二进制数据
+                'timeout' => 10,
+                'ignore_errors' => false
             ]
         ];
         
         $context = stream_context_create($options);
 
         try {
-            $url = 'http://120.76.130.29:8080/RegLogin';
+            $url = 'http://120.76.130.29:8080/ReqLogin'; 
 
+            $context = stream_context_create($options);
             $response = file_get_contents($url, false, $context);
             
             if (strpos($response, '404 page not found') !== false) {