mirror of
https://github.com/Mezeporta/Erupe.git
synced 2025-12-12 23:14:36 +01:00
move ProxyPort config out of DevMode
This commit is contained in:
@@ -13,6 +13,7 @@
|
|||||||
"DeleteOnSaveCorruption": false,
|
"DeleteOnSaveCorruption": false,
|
||||||
"ClientMode": "ZZ",
|
"ClientMode": "ZZ",
|
||||||
"QuestCacheExpiry": 300,
|
"QuestCacheExpiry": 300,
|
||||||
|
"ProxyPort": 0,
|
||||||
"DevMode": true,
|
"DevMode": true,
|
||||||
"DevModeOptions": {
|
"DevModeOptions": {
|
||||||
"AutoCreateAccount": true,
|
"AutoCreateAccount": true,
|
||||||
@@ -29,7 +30,6 @@
|
|||||||
"MezFesAlt": false,
|
"MezFesAlt": false,
|
||||||
"DisableTokenCheck": false,
|
"DisableTokenCheck": false,
|
||||||
"QuestDebugTools": false,
|
"QuestDebugTools": false,
|
||||||
"ProxyPort": 0,
|
|
||||||
"EarthStatusOverride": 0,
|
"EarthStatusOverride": 0,
|
||||||
"EarthIDOverride": 0,
|
"EarthIDOverride": 0,
|
||||||
"EarthMonsterOverride": 0,
|
"EarthMonsterOverride": 0,
|
||||||
|
|||||||
@@ -79,7 +79,8 @@ type Config struct {
|
|||||||
DeleteOnSaveCorruption bool // Attempts to save corrupted data will flag the save for deletion
|
DeleteOnSaveCorruption bool // Attempts to save corrupted data will flag the save for deletion
|
||||||
ClientMode string
|
ClientMode string
|
||||||
RealClientMode Mode
|
RealClientMode Mode
|
||||||
QuestCacheExpiry int // Number of seconds to keep quest data cached
|
QuestCacheExpiry int // Number of seconds to keep quest data cached
|
||||||
|
ProxyPort uint16 // Forces the game to connect to a channel server proxy
|
||||||
DevMode bool
|
DevMode bool
|
||||||
|
|
||||||
DevModeOptions DevModeOptions
|
DevModeOptions DevModeOptions
|
||||||
@@ -96,21 +97,20 @@ type Config struct {
|
|||||||
|
|
||||||
// DevModeOptions holds various debug/temporary options for use while developing Erupe.
|
// DevModeOptions holds various debug/temporary options for use while developing Erupe.
|
||||||
type DevModeOptions struct {
|
type DevModeOptions struct {
|
||||||
AutoCreateAccount bool // Automatically create accounts if they don't exist
|
AutoCreateAccount bool // Automatically create accounts if they don't exist
|
||||||
CleanDB bool // Automatically wipes the DB on server reset.
|
CleanDB bool // Automatically wipes the DB on server reset.
|
||||||
MaxLauncherHR bool // Sets the HR returned in the launcher to HR7 so that you can join non-beginner worlds.
|
MaxLauncherHR bool // Sets the HR returned in the launcher to HR7 so that you can join non-beginner worlds.
|
||||||
LogInboundMessages bool // Log all messages sent to the server
|
LogInboundMessages bool // Log all messages sent to the server
|
||||||
LogOutboundMessages bool // Log all messages sent to the clients
|
LogOutboundMessages bool // Log all messages sent to the clients
|
||||||
LogMessageData bool // Log all bytes transferred as a hexdump
|
LogMessageData bool // Log all bytes transferred as a hexdump
|
||||||
MaxHexdumpLength int // Maximum number of bytes printed when logs are enabled
|
MaxHexdumpLength int // Maximum number of bytes printed when logs are enabled
|
||||||
DivaEvent int // Diva Defense event status
|
DivaEvent int // Diva Defense event status
|
||||||
FestaEvent int // Hunter's Festa event status
|
FestaEvent int // Hunter's Festa event status
|
||||||
TournamentEvent int // VS Tournament event status
|
TournamentEvent int // VS Tournament event status
|
||||||
MezFesEvent bool // MezFes status
|
MezFesEvent bool // MezFes status
|
||||||
MezFesAlt bool // Swaps out Volpakkun for Tokotoko
|
MezFesAlt bool // Swaps out Volpakkun for Tokotoko
|
||||||
DisableTokenCheck bool // Disables checking login token exists in the DB (security risk!)
|
DisableTokenCheck bool // Disables checking login token exists in the DB (security risk!)
|
||||||
QuestDebugTools bool // Enable various quest debug logs
|
QuestDebugTools bool // Enable various quest debug logs
|
||||||
ProxyPort uint16 // Forces the game connect to a channel server proxy
|
|
||||||
EarthStatusOverride int32
|
EarthStatusOverride int32
|
||||||
EarthIDOverride int32
|
EarthIDOverride int32
|
||||||
EarthMonsterOverride int32
|
EarthMonsterOverride int32
|
||||||
|
|||||||
2
main.go
2
main.go
@@ -26,7 +26,7 @@ func cleanDB(db *sqlx.DB, config *_config.Config) {
|
|||||||
_ = db.MustExec("DELETE FROM guild_characters")
|
_ = db.MustExec("DELETE FROM guild_characters")
|
||||||
_ = db.MustExec("DELETE FROM guilds")
|
_ = db.MustExec("DELETE FROM guilds")
|
||||||
_ = db.MustExec("DELETE FROM characters")
|
_ = db.MustExec("DELETE FROM characters")
|
||||||
if !config.DevMode || config.DevModeOptions.ProxyPort == 0 {
|
if config.ProxyPort == 0 {
|
||||||
_ = db.MustExec("DELETE FROM sign_sessions")
|
_ = db.MustExec("DELETE FROM sign_sessions")
|
||||||
}
|
}
|
||||||
_ = db.MustExec("DELETE FROM users")
|
_ = db.MustExec("DELETE FROM users")
|
||||||
|
|||||||
@@ -69,8 +69,8 @@ func encodeServerInfo(config *_config.Config, s *Server, local bool) []byte {
|
|||||||
|
|
||||||
for channelIdx, ci := range si.Channels {
|
for channelIdx, ci := range si.Channels {
|
||||||
sid = (4096 + serverIdx*256) + (16 + channelIdx)
|
sid = (4096 + serverIdx*256) + (16 + channelIdx)
|
||||||
if _config.ErupeConfig.DevMode && _config.ErupeConfig.DevModeOptions.ProxyPort != 0 {
|
if _config.ErupeConfig.DevMode && _config.ErupeConfig.ProxyPort != 0 {
|
||||||
bf.WriteUint16(_config.ErupeConfig.DevModeOptions.ProxyPort)
|
bf.WriteUint16(_config.ErupeConfig.ProxyPort)
|
||||||
} else {
|
} else {
|
||||||
bf.WriteUint16(ci.Port)
|
bf.WriteUint16(ci.Port)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user