Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
ziqian zhang
Grasscutter
Commits
7e3bfed0
Commit
7e3bfed0
authored
May 11, 2022
by
coooookies
Committed by
Melledy
May 11, 2022
Browse files
Show server status to three-party game launcher
parent
04f6e734
Changes
1
Show whitespace changes
Inline
Side-by-side
src/main/java/emu/grasscutter/server/dispatch/DispatchServer.java
View file @
7e3bfed0
...
...
@@ -4,6 +4,7 @@ import com.google.gson.Gson;
import
com.google.gson.GsonBuilder
;
import
com.google.protobuf.ByteString
;
import
emu.grasscutter.GameConstants
;
import
emu.grasscutter.Grasscutter
;
import
emu.grasscutter.Grasscutter.ServerDebugMode
;
import
emu.grasscutter.Grasscutter.ServerRunMode
;
...
...
@@ -258,6 +259,15 @@ public final class DispatchServer {
httpServer
.
post
(
"/authentication/register"
,
(
req
,
res
)
->
this
.
getAuthHandler
().
handleRegister
(
req
,
res
));
httpServer
.
post
(
"/authentication/change_password"
,
(
req
,
res
)
->
this
.
getAuthHandler
().
handleChangePassword
(
req
,
res
));
// Server Status
httpServer
.
get
(
"/status/server"
,
(
req
,
res
)
->
{
int
playerCount
=
Grasscutter
.
getGameServer
().
getPlayers
().
size
();
String
version
=
GameConstants
.
VERSION
;
res
.
send
(
"{\"retcode\":0,\"status\":{\"playerCount\":"
+
playerCount
+
",\"version\":\""
+
version
+
"\"}}"
);
});
// Dispatch
httpServer
.
get
(
"/query_region_list"
,
(
req
,
res
)
->
{
// Log
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment