From 5e54a2052d06a0c26e7ad3692c4d5e8400ef188d Mon Sep 17 00:00:00 2001 From: wish Date: Tue, 2 Aug 2022 19:06:00 +1000 Subject: [PATCH] add customisation for login notice --- config.json | 2 ++ config/config.go | 2 ++ server/signserver/dsgn_resp.go | 10 +++++++--- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/config.json b/config.json index bb1117b44..dae257548 100644 --- a/config.json +++ b/config.json @@ -4,6 +4,8 @@ "devmode": true, "devmodeoptions": { "serverName" : "", + "hideLoginNotice": false, + "loginNotice": "
Welcome to Erupe SU9 Beta 2!
Erupe is experimental software, we are not liable for any
issues caused by installing the software!

■Report bugs on Discord!

■Test everything!

■Don't talk to softlocking NPCs!

■Fork the code on GitHub!

Thank you to all of the contributors,

this wouldn't exist without you.", "cleandb": false, "maxlauncherhr": false, "LogInboundMessages": false, diff --git a/config/config.go b/config/config.go index dfd4fd98d..5d6c65838 100644 --- a/config/config.go +++ b/config/config.go @@ -24,6 +24,8 @@ type Config struct { // DevModeOptions holds various debug/temporary options for use while developing Erupe. type DevModeOptions struct { ServerName string // To get specific instance server about (Current Players/Event Week) + HideLoginNotice bool // Hide the Erupe notice on login + LoginNotice string // MHFML string of the login notice displayed CleanDB bool // Automatically wipes the DB on server reset. MaxLauncherHR bool // Sets the HR returned in the launcher to HR9 so that you can join non-beginner worlds. FixedStageID bool // Causes all move_stage to use the ID sl1Ns200p0a0u0 to get you into all stages diff --git a/server/signserver/dsgn_resp.go b/server/signserver/dsgn_resp.go index 18ea4e543..17701002a 100644 --- a/server/signserver/dsgn_resp.go +++ b/server/signserver/dsgn_resp.go @@ -99,9 +99,13 @@ func (s *Session) makeSignInResp(uid int) []byte { } } - bf.WriteUint8(1) // Notice count - noticeText := "
Welcome to Erupe SU9 Beta 2!
Erupe is experimental software, we are not liable for any
issues caused by installing the software!

■Report bugs on Discord!

■Test everything!

■Don't talk to softlocking NPCs!

■Fork the code on GitHub!

Thank you to all of the contributors,

this wouldn't exist without you." - ps.Uint32(bf, noticeText, true) + if s.server.erupeConfig.DevModeOptions.HideLoginNotice { + bf.WriteUint8(0) + } else { + bf.WriteUint8(1) // Notice count + noticeText := s.server.erupeConfig.DevModeOptions.LoginNotice + ps.Uint32(bf, noticeText, true) + } bf.WriteUint32(s.server.getLastCID(uid)) bf.WriteUint32(s.server.getUserRights(uid))