mirror of
https://github.com/Mezeporta/Erupe.git
synced 2025-12-14 07:55:33 +01:00
Compare commits
4 Commits
v9.1.0-rc1
...
v9.1.0-rc2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a99939eba1 | ||
|
|
702471577b | ||
|
|
e943b54df4 | ||
|
|
82eeb79229 |
@@ -2,9 +2,11 @@
|
|||||||
"Host": "127.0.0.1",
|
"Host": "127.0.0.1",
|
||||||
"BinPath": "bin",
|
"BinPath": "bin",
|
||||||
"DisableSoftCrash": false,
|
"DisableSoftCrash": false,
|
||||||
"FeaturedWeapons": 2,
|
"FeaturedWeapons": 1,
|
||||||
"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
|
||||||
|
|||||||
@@ -28,7 +28,10 @@ func handleMsgSysGetFile(s *Session, p mhfpacket.MHFPacket) {
|
|||||||
// Read the scenario file.
|
// Read the scenario file.
|
||||||
data, err := ioutil.ReadFile(filepath.Join(s.server.erupeConfig.BinPath, fmt.Sprintf("scenarios/%s.bin", filename)))
|
data, err := ioutil.ReadFile(filepath.Join(s.server.erupeConfig.BinPath, fmt.Sprintf("scenarios/%s.bin", filename)))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
s.logger.Error(fmt.Sprintf("Failed to open file: %s/scenarios/%s.bin", s.server.erupeConfig.BinPath, filename))
|
||||||
|
// This will crash the game.
|
||||||
|
doAckBufSucceed(s, pkt.AckHandle, data)
|
||||||
|
return
|
||||||
}
|
}
|
||||||
doAckBufSucceed(s, pkt.AckHandle, data)
|
doAckBufSucceed(s, pkt.AckHandle, data)
|
||||||
} else {
|
} else {
|
||||||
@@ -48,7 +51,10 @@ func handleMsgSysGetFile(s *Session, p mhfpacket.MHFPacket) {
|
|||||||
// Get quest file.
|
// Get quest file.
|
||||||
data, err := ioutil.ReadFile(filepath.Join(s.server.erupeConfig.BinPath, fmt.Sprintf("quests/%s.bin", pkt.Filename)))
|
data, err := ioutil.ReadFile(filepath.Join(s.server.erupeConfig.BinPath, fmt.Sprintf("quests/%s.bin", pkt.Filename)))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
s.logger.Fatal(fmt.Sprintf("Failed to open quest file: quests/%s.bin", pkt.Filename))
|
s.logger.Error(fmt.Sprintf("Failed to open file: %s/quests/%s.bin", s.server.erupeConfig.BinPath, pkt.Filename))
|
||||||
|
// This will crash the game.
|
||||||
|
doAckBufSucceed(s, pkt.AckHandle, data)
|
||||||
|
return
|
||||||
}
|
}
|
||||||
doAckBufSucceed(s, pkt.AckHandle, data)
|
doAckBufSucceed(s, pkt.AckHandle, data)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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