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 := "