mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
Login with yggdrasil server 'hitmc.cc' will get
```
Login failed : Invalid server response.
```
Print the raw response which is `result` in [/MinecraftClient/Protocol/ProtocolHandler.cs#L554](f6797cb4b5/MinecraftClient/Protocol/ProtocolHandler.cs (L554))
(Every test shows like this)
```
HTTP/1.1 200 OK
...
1e1
{"accessToken":"...","clientToken":"...","availableProfiles":[{"id":"..","name":".."},{"id":"..","na
f
me":"ok_bot"}]}
0
```
After splited by line:
- 1e1
- {"accessToken": ... ,"na
- f
- me":"ok_bot"}]}
- 0
The response when Login with 'littleskin.cn' which works fine is:
```
HTTP/1.1 200 OK
...
1e1
{"accessToken":"...","clientToken":"...","availableProfiles":[{"id":"..","name":".."},{"id":"..","name":"ok_bot"}]}
0
```
After splited by line:
- 1e1
- {"accessToken": ... ,"name":"ok_bot"}]}
- 0
-
-
So adding [1] and [3] will make both 'hitmc.cc' and 'littleskin.cn' work fine.
This commit is contained in:
parent
f6797cb4b5
commit
734de2a9ac
1 changed files with 2 additions and 1 deletions
|
|
@ -1100,7 +1100,8 @@ namespace MinecraftClient.Protocol
|
||||||
statusCode = int.Parse(raw_result.Split(' ')[1], NumberStyles.Any, CultureInfo.CurrentCulture);
|
statusCode = int.Parse(raw_result.Split(' ')[1], NumberStyles.Any, CultureInfo.CurrentCulture);
|
||||||
if (statusCode != 204)
|
if (statusCode != 204)
|
||||||
{
|
{
|
||||||
postResult = raw_result[(raw_result.IndexOf("\r\n\r\n") + 4)..].Split("\r\n")[1];
|
var splited = raw_result[(raw_result.IndexOf("\r\n\r\n") + 4)..].Split("\r\n");
|
||||||
|
postResult = splited[1] + splited[3];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue