add support for multiple login notices

This commit is contained in:
wish
2023-03-09 20:12:59 +11:00
parent 29988f2bdd
commit 644a76cb9a
3 changed files with 14 additions and 11 deletions

View File

@@ -4,7 +4,9 @@
"Language": "en", "Language": "en",
"DisableSoftCrash": false, "DisableSoftCrash": false,
"HideLoginNotice": true, "HideLoginNotice": true,
"LoginNotice": "<BODY><CENTER><SIZE_3><C_4>Welcome to Erupe SU9.1!<BR><BODY><LEFT><SIZE_2><C_5>Erupe is experimental software<C_7>, we are not liable for any<BR><BODY>issues caused by installing the software!<BR><BODY><BR><BODY><C_4>■Report bugs on Discord!<C_7><BR><BODY><BR><BODY><C_4>■Test everything!<C_7><BR><BODY><BR><BODY><C_4>■Don't talk to softlocking NPCs!<C_7><BR><BODY><BR><BODY><C_4>■Fork the code on GitHub!<C_7><BR><BODY><BR><BODY>Thank you to all of the contributors,<BR><BODY><BR><BODY>this wouldn't exist without you.", "LoginNotices": [
"<BODY><CENTER><SIZE_3><C_4>Welcome to Erupe SU9.2!<BR><BODY><LEFT><SIZE_2><C_5>Erupe is experimental software<C_7>, we are not liable for any<BR><BODY>issues caused by installing the software!<BR><BODY><BR><BODY><C_4>■Report bugs on Discord!<C_7><BR><BODY><BR><BODY><C_4>■Test everything!<C_7><BR><BODY><BR><BODY><C_4>■Don't talk to softlocking NPCs!<C_7><BR><BODY><BR><BODY><C_4>■Fork the code on GitHub!<C_7><BR><BODY><BR><BODY>Thank you to all of the contributors,<BR><BODY><BR><BODY>this wouldn't exist without you."
],
"PatchServerManifest": "", "PatchServerManifest": "",
"PatchServerFile": "", "PatchServerFile": "",
"ScreenshotAPIURL": "", "ScreenshotAPIURL": "",

View File

@@ -15,13 +15,13 @@ type Config struct {
Host string `mapstructure:"Host"` Host string `mapstructure:"Host"`
BinPath string `mapstructure:"BinPath"` BinPath string `mapstructure:"BinPath"`
Language string Language string
DisableSoftCrash bool // Disables the 'Press Return to exit' dialog allowing scripts to reboot the server automatically DisableSoftCrash bool // Disables the 'Press Return to exit' dialog allowing scripts to reboot the server automatically
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 LoginNotices []string // MHFML string of the login notices displayed
PatchServerManifest string // Manifest patch server override PatchServerManifest string // Manifest patch server override
PatchServerFile string // File patch server override PatchServerFile string // File patch server override
ScreenshotAPIURL string // Destination for screenshots uploaded to BBS ScreenshotAPIURL string // Destination for screenshots uploaded to BBS
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
DevMode bool DevMode bool
DevModeOptions DevModeOptions DevModeOptions DevModeOptions

View File

@@ -111,9 +111,10 @@ func (s *Session) makeSignInResp(uid int) []byte {
if s.server.erupeConfig.HideLoginNotice { if s.server.erupeConfig.HideLoginNotice {
bf.WriteUint8(0) bf.WriteUint8(0)
} else { } else {
bf.WriteUint8(1) // Notice count bf.WriteUint8(uint8(len(s.server.erupeConfig.LoginNotices)))
noticeText := s.server.erupeConfig.LoginNotice for _, notice := range s.server.erupeConfig.LoginNotices {
ps.Uint32(bf, noticeText, true) ps.Uint32(bf, notice, true)
}
} }
bf.WriteUint32(s.server.getLastCID(uid)) bf.WriteUint32(s.server.getLastCID(uid))