mirror of
https://github.com/Mezeporta/Erupe.git
synced 2025-12-13 15:34:38 +01:00
add patch server option
This commit is contained in:
@@ -5,6 +5,8 @@
|
|||||||
"FeaturedWeapons": 2,
|
"FeaturedWeapons": 2,
|
||||||
"DevMode": true,
|
"DevMode": true,
|
||||||
"DevModeOptions": {
|
"DevModeOptions": {
|
||||||
|
"PatchServerManifest": "",
|
||||||
|
"PatchServerFile": "",
|
||||||
"AutoCreateAccount": true,
|
"AutoCreateAccount": true,
|
||||||
"EnableLauncherServer": false,
|
"EnableLauncherServer": false,
|
||||||
"HideLoginNotice": false,
|
"HideLoginNotice": false,
|
||||||
|
|||||||
@@ -30,6 +30,8 @@ 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 {
|
||||||
|
PatchServerManifest string // Manifest patch server override
|
||||||
|
PatchServerFile string // File patch server override
|
||||||
AutoCreateAccount bool // Automatically create accounts if they don't exist
|
AutoCreateAccount bool // Automatically create accounts if they don't exist
|
||||||
HideLoginNotice bool // Hide the Erupe notice on login
|
HideLoginNotice bool // Hide the Erupe notice on login
|
||||||
LoginNotice string // MHFML string of the login notice displayed
|
LoginNotice string // MHFML string of the login notice displayed
|
||||||
|
|||||||
@@ -43,12 +43,22 @@ func (s *Session) makeSignInResp(uid int) []byte {
|
|||||||
bf := byteframe.NewByteFrame()
|
bf := byteframe.NewByteFrame()
|
||||||
|
|
||||||
bf.WriteUint8(1) // resp_code
|
bf.WriteUint8(1) // resp_code
|
||||||
bf.WriteUint8(0) // file/patch server count
|
if s.server.erupeConfig.DevMode && s.server.erupeConfig.DevModeOptions.PatchServerManifest != "" && s.server.erupeConfig.DevModeOptions.PatchServerFile != "" {
|
||||||
|
bf.WriteUint8(2)
|
||||||
|
} else {
|
||||||
|
bf.WriteUint8(0)
|
||||||
|
}
|
||||||
bf.WriteUint8(1) // entrance server count
|
bf.WriteUint8(1) // entrance server count
|
||||||
bf.WriteUint8(uint8(len(chars))) // character count
|
bf.WriteUint8(uint8(len(chars))) // character count
|
||||||
bf.WriteUint32(0xFFFFFFFF) // login_token_number
|
bf.WriteUint32(0xFFFFFFFF) // login_token_number
|
||||||
bf.WriteBytes([]byte(token)) // login_token
|
bf.WriteBytes([]byte(token)) // login_token
|
||||||
bf.WriteUint32(uint32(time.Now().Unix())) // current time
|
bf.WriteUint32(uint32(time.Now().Unix())) // current time
|
||||||
|
if s.server.erupeConfig.DevMode {
|
||||||
|
if s.server.erupeConfig.DevModeOptions.PatchServerManifest != "" && s.server.erupeConfig.DevModeOptions.PatchServerFile != "" {
|
||||||
|
ps.Uint8(bf, s.server.erupeConfig.DevModeOptions.PatchServerManifest, false)
|
||||||
|
ps.Uint8(bf, s.server.erupeConfig.DevModeOptions.PatchServerFile, false)
|
||||||
|
}
|
||||||
|
}
|
||||||
ps.Uint8(bf, fmt.Sprintf("%s:%d", s.server.erupeConfig.Host, s.server.erupeConfig.Entrance.Port), false)
|
ps.Uint8(bf, fmt.Sprintf("%s:%d", s.server.erupeConfig.Host, s.server.erupeConfig.Entrance.Port), false)
|
||||||
|
|
||||||
lastPlayed := uint32(0)
|
lastPlayed := uint32(0)
|
||||||
|
|||||||
Reference in New Issue
Block a user