From 9204afce1e166796e375be0baaf0594009bc3d4d Mon Sep 17 00:00:00 2001 From: wish Date: Fri, 29 Jul 2022 02:45:23 +1000 Subject: [PATCH] edit default configs --- Erupe/config.json | 18 +++++------ Erupe/config/config.go | 15 ++++----- Erupe/server/entranceserver/make_resp.go | 16 +++++----- Erupe/server/signserver/dsgn_resp.go | 39 ++++++++++++------------ 4 files changed, 43 insertions(+), 45 deletions(-) diff --git a/Erupe/config.json b/Erupe/config.json index eb59db613..bb1117b44 100644 --- a/Erupe/config.json +++ b/Erupe/config.json @@ -5,7 +5,7 @@ "devmodeoptions": { "serverName" : "", "cleandb": false, - "maxlauncherhr": true, + "maxlauncherhr": false, "LogInboundMessages": false, "LogOutboundMessages": false, "MaxHexdumpLength": 256, @@ -47,34 +47,34 @@ { "name": "Newbie", "description": "", "ip": "", "type": 3, "recommended": 2, "allowedclientflags": 0, "channels": [ - { "port": 54001, "MaxPlayers": 50, "Unk0": 319, "Unk1": 252, "Unk2": 248 }, - { "port": 54002, "MaxPlayers": 50, "Unk0": 319, "Unk1": 252, "Unk2": 248 } + { "port": 54001, "MaxPlayers": 100 }, + { "port": 54002, "MaxPlayers": 100 } ] }, { "name": "Normal", "description": "", "ip": "", "type": 1, "recommended": 0, "allowedclientflags": 0, "channels": [ - { "port": 54003, "MaxPlayers": 50, "Unk0": 319, "Unk1": 252, "Unk2": 248 }, - { "port": 54004, "MaxPlayers": 50, "Unk0": 319, "Unk1": 252, "Unk2": 248 } + { "port": 54003, "MaxPlayers": 100 }, + { "port": 54004, "MaxPlayers": 100 } ] }, { "name": "Cities", "description": "", "ip": "", "type": 2, "recommended": 0, "allowedclientflags": 0, "channels": [ - { "port": 54005, "MaxPlayers": 50, "Unk0": 319, "Unk1": 252, "Unk2": 248 } + { "port": 54005, "MaxPlayers": 100 } ] }, { "name": "Tavern", "description": "", "ip": "", "type": 4, "recommended": 0, "allowedclientflags": 0, "channels": [ - { "port": 54006, "MaxPlayers": 50, "Unk0": 319, "Unk1": 252, "Unk2": 248 } + { "port": 54006, "MaxPlayers": 100 } ] }, { "name": "Return", "description": "", "ip": "", "type": 5, "recommended": 0, "allowedclientflags": 0, "channels": [ - { "port": 54007, "MaxPlayers": 50, "Unk0": 319, "Unk1": 252, "Unk2": 248 } + { "port": 54007, "MaxPlayers": 100 } ] }, { "name": "MezFes", "description": "", "ip": "", "type": 6, "recommended": 6, "allowedclientflags": 0, "channels": [ - { "port": 54008, "MaxPlayers": 50, "Unk0": 319, "Unk1": 252, "Unk2": 248 } + { "port": 54008, "MaxPlayers": 100 } ] } ] diff --git a/Erupe/config/config.go b/Erupe/config/config.go index 5f0079fad..dfd4fd98d 100644 --- a/Erupe/config/config.go +++ b/Erupe/config/config.go @@ -44,8 +44,8 @@ type SaveDumpOptions struct { // Discord holds the discord integration config. type Discord struct { - Enabled bool - BotToken string + Enabled bool + BotToken string ServerID string RealtimeChannelID string DevRoles []string @@ -80,11 +80,11 @@ type Entrance struct { // EntranceServerInfo represents an entry in the serverlist. type EntranceServerInfo struct { - IP string - Type uint8 // Server type. 0=?, 1=open, 2=cities, 3=newbie, 4=bar - Season uint8 // Server activity. 0 = green, 1 = orange, 2 = blue + IP string + Type uint8 // Server type. 0=?, 1=open, 2=cities, 3=newbie, 4=bar + Season uint8 // Server activity. 0 = green, 1 = orange, 2 = blue Recommended uint8 // Something to do with server recommendation on 0, 3, and 5. - Name string // Server name, 66 byte null terminated Shift-JIS(JP) or Big5(TW). + Name string // Server name, 66 byte null terminated Shift-JIS(JP) or Big5(TW). Description string // Server description // 4096(PC, PS3/PS4)?, 8258(PC, PS3/PS4)?, 8192 == nothing? // THIS ONLY EXISTS IF Binary8Header.type == "SV2", NOT "SVR"! @@ -98,9 +98,6 @@ type EntranceChannelInfo struct { Port uint16 MaxPlayers uint16 CurrentPlayers uint16 - Unk0 uint16 - Unk1 uint16 - Unk2 uint16 } // getOutboundIP4 gets the preferred outbound ip4 of this machine diff --git a/Erupe/server/entranceserver/make_resp.go b/Erupe/server/entranceserver/make_resp.go index 08f5a87ff..2a46a3630 100644 --- a/Erupe/server/entranceserver/make_resp.go +++ b/Erupe/server/entranceserver/make_resp.go @@ -22,7 +22,7 @@ func encodeServerInfo(config *config.Config, s *Server) []byte { bf := byteframe.NewByteFrame() for serverIdx, si := range serverInfos { - sid := (4096 + serverIdx * 256) + 16 + sid := (4096 + serverIdx*256) + 16 err := s.db.QueryRow("SELECT season FROM servers WHERE server_id=$1", sid).Scan(&season) if err != nil { panic(err) @@ -37,14 +37,14 @@ func encodeServerInfo(config *config.Config, s *Server) []byte { bf.WriteUint8(si.Type) bf.WriteUint8(season) bf.WriteUint8(si.Recommended) - combined := append([]byte{0x00}, stringsupport.UTF8ToSJIS(si.Name)...) - combined = append(combined, []byte{0x00}...) + bf.WriteUint8(0) // Prevents malformed server name + combined := append(stringsupport.UTF8ToSJIS(si.Name), []byte{0x00}...) combined = append(combined, stringsupport.UTF8ToSJIS(si.Description)...) - bf.WriteBytes(stringsupport.PaddedString(string(combined), 66, false)) + bf.WriteBytes(stringsupport.PaddedString(string(combined), 65, false)) bf.WriteUint32(si.AllowedClientFlags) for channelIdx, ci := range si.Channels { - sid = (4096 + serverIdx * 256) + (16 + channelIdx) + sid = (4096 + serverIdx*256) + (16 + channelIdx) bf.WriteUint16(ci.Port) bf.WriteUint16(16 + uint16(channelIdx)) bf.WriteUint16(ci.MaxPlayers) @@ -56,9 +56,9 @@ func encodeServerInfo(config *config.Config, s *Server) []byte { bf.WriteUint32(0) bf.WriteUint32(0) bf.WriteUint32(0) - bf.WriteUint16(ci.Unk0) - bf.WriteUint16(ci.Unk1) - bf.WriteUint16(ci.Unk2) + bf.WriteUint16(319) // Unk + bf.WriteUint16(252) // Unk + bf.WriteUint16(248) // Unk bf.WriteUint16(0x3039) } } diff --git a/Erupe/server/signserver/dsgn_resp.go b/Erupe/server/signserver/dsgn_resp.go index 103223dda..cebd7eac4 100644 --- a/Erupe/server/signserver/dsgn_resp.go +++ b/Erupe/server/signserver/dsgn_resp.go @@ -1,13 +1,13 @@ package signserver import ( + "erupe-ce/common/byteframe" + ps "erupe-ce/common/pascalstring" + "erupe-ce/common/stringsupport" + "erupe-ce/server/channelserver" "fmt" "math/rand" "time" - "erupe-ce/server/channelserver" - "erupe-ce/common/stringsupport" - ps "erupe-ce/common/pascalstring" - "erupe-ce/common/byteframe" "go.uber.org/zap" ) @@ -99,16 +99,15 @@ func (s *Session) makeSignInResp(uid int) []byte { } } - bf.WriteUint8(0) // notice_count + 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) - // noticeText := "
Welcome to Erupe SU9!
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) - - bf.WriteUint32(s.server.getLastCID(uid)) // last played character id - bf.WriteUint32(s.server.getUserRights(uid)) // course bitfield - ps.Uint16(bf, "", false) // filters + bf.WriteUint32(s.server.getLastCID(uid)) + bf.WriteUint32(s.server.getUserRights(uid)) + ps.Uint16(bf, "", false) // filters bf.WriteUint32(0xCA104E20) - ps.Uint16(bf, "", false) // encryption + ps.Uint16(bf, "", false) // encryption bf.WriteUint8(0x00) bf.WriteUint32(0xCA110001) bf.WriteUint32(0x4E200000) @@ -127,12 +126,14 @@ func (s *Session) makeSignInResp(uid int) []byte { mezfes := s.server.erupeConfig.DevModeOptions.MezFesEvent alt := false if mezfes { - bf.WriteUint32(uint32(channelserver.Time_Current_Adjusted().Add(-5 * time.Minute).Unix())) // Start time - bf.WriteUint32(uint32(channelserver.Time_Current_Adjusted().Add(24 * time.Hour * 7).Unix())) // End time - bf.WriteUint8(2) // Unk - bf.WriteUint32(0) // Single tickets - bf.WriteUint32(0) // Group tickets - bf.WriteUint8(8) // Stalls open + // Start time + bf.WriteUint32(uint32(channelserver.Time_Current_Adjusted().Add(-5 * time.Minute).Unix())) + // End time + bf.WriteUint32(uint32(channelserver.Time_Current_Adjusted().Add(24 * time.Hour * 7).Unix())) + bf.WriteUint8(2) // Unk + bf.WriteUint32(20) // Single tickets + bf.WriteUint32(0) // Group tickets + bf.WriteUint8(8) // Stalls open bf.WriteUint8(0xA) // Unk bf.WriteUint8(0x3) // Pachinko bf.WriteUint8(0x6) // Nyanrendo @@ -140,7 +141,7 @@ func (s *Session) makeSignInResp(uid int) []byte { if alt { bf.WriteUint8(0x2) // Tokotoko } else { - bf.WriteUint8(0x4) // Volpkun + bf.WriteUint8(0x4) // Volpakkun } bf.WriteUint8(0x8) // Battle cats bf.WriteUint8(0x5) // Gook