jianxingxuejian / grasscutter-tools

A cross-platform client that combines launcher, command generation, and mod management to easily play Grasscutter; 一个结合了启动器、命令生成、MOD管理等功能的跨平台客户端,用于轻松游玩割草机。
https://null-grasscutter-tools.vercel.app/
MIT License
217 stars 21 forks source link

Successfully received the verification email, but got a network error message after enter. #29

Closed jianxingxuejian closed 1 year ago

jianxingxuejian commented 1 year ago

As a record, prepare to troubleshoot the cause and fix.

Lua12138 commented 1 year ago

image

Admin Auth / Player Auth , there are still such situations.

jianxingxuejian commented 1 year ago

When using local ip, you need to start the game, open the proxy to take effect, do not know why yet.

Lua12138 commented 1 year ago

I have opened the game.

When I enter a wrong credential:

curl -v -X POST 'http://localhost:443/plugin/admin/auth' -H 'Content-Type: application/json' -d '{"adminVoucher":"aaaaaaaaaaaaa"}'

> POST /plugin/admin/auth HTTP/1.1
> Host: localhost:443
> User-Agent: curl/7.64.0
> Accept: */*
> Content-Type: application/json
> Content-Length: 32
>
* upload completely sent off: 32 out of 32 bytes
< HTTP/1.1 200 OK
< Date: Wed, 28 Dec 2022 07:53:52 GMT
< Content-Type: application/json
< Content-Length: 43
< Server: Jetty(9.4.48.v20220622)
<
* Connection #0 to host localhost left intact
{"code":1006,"msg":"auth fail","data":null}

When I enter a correct credential:

curl -v -X POST 'http://localhost:443/plugin/admin/auth' -H 'Content-Type: application/json' -d '{"adminVoucher":"bd7b881d-b395-4ef7-a054-c10389f5fe43"}'

> POST /plugin/admin/auth HTTP/1.1
> Host: localhost:443
> User-Agent: curl/7.64.0
> Accept: */*
> Content-Type: application/json
> Content-Length: 55
>
* upload completely sent off: 55 out of 55 bytes
< HTTP/1.1 500 Server Error
< Date: Wed, 28 Dec 2022 07:55:16 GMT
< Content-Type: text/plain
< Content-Length: 21
< Server: Jetty(9.4.48.v20220622)
<
* Connection #0 to host localhost left intact
Internal server error

Because there are no more logs, from the source code, there may be an uncaught exception here.

jianxingxuejian commented 1 year ago

Did you follow the documentation? If you want to use the launcher, make sure the values of useEncryption and useInRouting in the server config.json file are both false, and then use the http address, like this: http:127.0.0.1:443, or configure the server with an https certificate, make sure the values of useEncryption and useInRouting are both true, and then you can use the https connection, like this: https:127.0.0.1 Other launchers like Cultivation also have this problem. I don't know how to avoid it, I have very little experience with network and Rust.

Lua12138 commented 1 year ago

Thanks, I didn't use the launcher, so I didn't modify the configuration of these two items in the configuration file. After I modified them just now, everything is okay.