|
@@ -35,21 +35,23 @@ class GameClient {
|
|
'method' => 'POST',
|
|
'method' => 'POST',
|
|
'header' => implode("\r\n", [
|
|
'header' => implode("\r\n", [
|
|
'Content-Type: application/x-protobuf',
|
|
'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);
|
|
$context = stream_context_create($options);
|
|
|
|
|
|
try {
|
|
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);
|
|
$response = file_get_contents($url, false, $context);
|
|
|
|
|
|
if (strpos($response, '404 page not found') !== false) {
|
|
if (strpos($response, '404 page not found') !== false) {
|