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
4605c650
Commit
4605c650
authored
Apr 23, 2022
by
xtaodada
Browse files
Add PublicPort field to server
parent
104d1035
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/main/java/emu/grasscutter/Config.java
View file @
4605c650
...
@@ -54,6 +54,7 @@ public final class Config {
...
@@ -54,6 +54,7 @@ public final class Config {
public
String
Ip
=
"0.0.0.0"
;
public
String
Ip
=
"0.0.0.0"
;
public
String
PublicIp
=
"127.0.0.1"
;
public
String
PublicIp
=
"127.0.0.1"
;
public
int
Port
=
22102
;
public
int
Port
=
22102
;
public
int
PublicPort
=
0
;
public
String
DispatchServerDatabaseUrl
=
"mongodb://localhost:27017"
;
public
String
DispatchServerDatabaseUrl
=
"mongodb://localhost:27017"
;
public
String
DispatchServerDatabaseCollection
=
"grasscutter"
;
public
String
DispatchServerDatabaseCollection
=
"grasscutter"
;
...
...
src/main/java/emu/grasscutter/server/dispatch/DispatchServer.java
View file @
4605c650
...
@@ -108,7 +108,7 @@ public final class DispatchServer {
...
@@ -108,7 +108,7 @@ public final class DispatchServer {
RegionInfo
serverRegion
=
regionQuery
.
getRegionInfo
().
toBuilder
()
RegionInfo
serverRegion
=
regionQuery
.
getRegionInfo
().
toBuilder
()
.
setIp
((
Grasscutter
.
getConfig
().
getGameServerOptions
().
PublicIp
.
isEmpty
()
?
Grasscutter
.
getConfig
().
getGameServerOptions
().
Ip
:
Grasscutter
.
getConfig
().
getGameServerOptions
().
PublicIp
))
.
setIp
((
Grasscutter
.
getConfig
().
getGameServerOptions
().
PublicIp
.
isEmpty
()
?
Grasscutter
.
getConfig
().
getGameServerOptions
().
Ip
:
Grasscutter
.
getConfig
().
getGameServerOptions
().
PublicIp
))
.
setPort
(
Grasscutter
.
getConfig
().
getGameServerOptions
().
Port
)
.
setPort
(
Grasscutter
.
getConfig
().
getGameServerOptions
().
PublicPort
!=
0
?
Grasscutter
.
getConfig
().
getGameServerOptions
().
PublicPort
:
Grasscutter
.
getConfig
().
getGameServerOptions
().
Port
)
.
setSecretKey
(
ByteString
.
copyFrom
(
FileUtils
.
read
(
Grasscutter
.
getConfig
().
KEY_FOLDER
+
"dispatchSeed.bin"
)))
.
setSecretKey
(
ByteString
.
copyFrom
(
FileUtils
.
read
(
Grasscutter
.
getConfig
().
KEY_FOLDER
+
"dispatchSeed.bin"
)))
.
build
();
.
build
();
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketPlayerLoginRsp.java
View file @
4605c650
...
@@ -41,7 +41,7 @@ public class PacketPlayerLoginRsp extends GenshinPacket {
...
@@ -41,7 +41,7 @@ public class PacketPlayerLoginRsp extends GenshinPacket {
RegionInfo
serverRegion
=
regionQuery
.
getRegionInfo
().
toBuilder
()
RegionInfo
serverRegion
=
regionQuery
.
getRegionInfo
().
toBuilder
()
.
setIp
((
Grasscutter
.
getConfig
().
getGameServerOptions
().
PublicIp
.
isEmpty
()
?
Grasscutter
.
getConfig
().
getGameServerOptions
().
Ip
:
Grasscutter
.
getConfig
().
getGameServerOptions
().
PublicIp
))
.
setIp
((
Grasscutter
.
getConfig
().
getGameServerOptions
().
PublicIp
.
isEmpty
()
?
Grasscutter
.
getConfig
().
getGameServerOptions
().
Ip
:
Grasscutter
.
getConfig
().
getGameServerOptions
().
PublicIp
))
.
setPort
(
Grasscutter
.
getConfig
().
getGameServerOptions
().
Port
)
.
setPort
(
Grasscutter
.
getConfig
().
getGameServerOptions
().
PublicPort
!=
0
?
Grasscutter
.
getConfig
().
getGameServerOptions
().
PublicPort
:
Grasscutter
.
getConfig
().
getGameServerOptions
().
Port
)
.
setSecretKey
(
ByteString
.
copyFrom
(
FileUtils
.
read
(
Grasscutter
.
getConfig
().
KEY_FOLDER
+
"dispatchSeed.bin"
)))
.
setSecretKey
(
ByteString
.
copyFrom
(
FileUtils
.
read
(
Grasscutter
.
getConfig
().
KEY_FOLDER
+
"dispatchSeed.bin"
)))
.
build
();
.
build
();
...
...
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