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
e242e72b
Commit
e242e72b
authored
Apr 21, 2022
by
Jaida Wu
Browse files
Drop independent log server
Signed-off-by:
Jaida Wu
<
mlgmxyysd@meowcat.org
>
parent
b38d5b19
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/main/java/emu/grasscutter/Config.java
View file @
e242e72b
...
@@ -13,9 +13,6 @@ public final class Config {
...
@@ -13,9 +13,6 @@ public final class Config {
public
String
GameServerPublicIp
=
""
;
public
String
GameServerPublicIp
=
""
;
public
int
GameServerPort
=
22102
;
public
int
GameServerPort
=
22102
;
public
int
OverseaLogPort
=
8888
;
public
int
UploadLogPort
=
80
;
public
String
DatabaseUrl
=
"mongodb://localhost:27017"
;
public
String
DatabaseUrl
=
"mongodb://localhost:27017"
;
public
String
DatabaseCollection
=
"grasscutter"
;
public
String
DatabaseCollection
=
"grasscutter"
;
...
...
src/main/java/emu/grasscutter/server/dispatch/DispatchServer.java
View file @
e242e72b
...
@@ -405,25 +405,18 @@ public final class DispatchServer {
...
@@ -405,25 +405,18 @@ public final class DispatchServer {
"/perf/config/verify"
,
"/perf/config/verify"
,
new
DispatchHttpJsonHandler
(
"{\"code\":0}"
)
new
DispatchHttpJsonHandler
(
"{\"code\":0}"
)
);
);
// Start server
server
.
start
();
Grasscutter
.
getLogger
().
info
(
"Dispatch server started on port "
+
getAddress
().
getPort
());
// Logging servers
// Logging servers
HttpServer
overseaLogServer
=
HttpServer
.
create
(
new
InetSocketAddress
(
Grasscutter
.
getConfig
().
DispatchServerIp
,
Grasscutter
.
getConfig
().
OverseaLogPort
),
0
);
server
.
createContext
(
// overseauspider.yuanshen.com
overseaLogServer
.
createContext
(
// overseauspider.yuanshen.com
"/log"
,
"/log"
,
new
DispatchHttpJsonHandler
(
"{\"code\":0}"
)
new
DispatchHttpJsonHandler
(
"{\"code\":0}"
)
);
);
overseaLogServer
.
start
();
Grasscutter
.
getLogger
().
info
(
"Log server (overseauspider) started on port "
+
8888
);
HttpServer
uploadLogServer
=
HttpServer
.
create
(
new
InetSocketAddress
(
Grasscutter
.
getConfig
().
DispatchServerIp
,
Grasscutter
.
getConfig
().
UploadLogPort
),
0
);
server
.
createContext
(
// log-upload-os.mihoyo.com
uploadLogServer
.
createContext
(
// log-upload-os.mihoyo.com
"/crash/dataUpload"
,
"/crash/dataUpload"
,
new
DispatchHttpJsonHandler
(
"{\"code\":0}"
)
new
DispatchHttpJsonHandler
(
"{\"code\":0}"
)
);
);
uploadLogS
erver
.
createContext
(
"/gacha"
,
t
->
{
s
erver
.
createContext
(
"/gacha"
,
t
->
{
//Create a response form the request query parameters
//Create a response form the request query parameters
String
response
=
"<!doctype html><html lang=\"en\"><head><title>Gacha</title></head><body></body></html>"
;
String
response
=
"<!doctype html><html lang=\"en\"><head><title>Gacha</title></head><body></body></html>"
;
//Set the response header status and length
//Set the response header status and length
...
@@ -434,8 +427,9 @@ public final class DispatchServer {
...
@@ -434,8 +427,9 @@ public final class DispatchServer {
os
.
write
(
response
.
getBytes
());
os
.
write
(
response
.
getBytes
());
os
.
close
();
os
.
close
();
});
});
uploadLogServer
.
start
();
// Start server
Grasscutter
.
getLogger
().
info
(
"Log server (log-upload-os) started on port "
+
Grasscutter
.
getConfig
().
UploadLogPort
);
server
.
start
();
Grasscutter
.
getLogger
().
info
(
"Dispatch server started on port "
+
getAddress
().
getPort
());
}
}
private
Map
<
String
,
String
>
parseQueryString
(
String
qs
)
{
private
Map
<
String
,
String
>
parseQueryString
(
String
qs
)
{
...
...
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