edit default configs

This commit is contained in:
wish
2022-07-29 02:45:23 +10:00
parent 3d8f214adb
commit 9204afce1e
4 changed files with 43 additions and 45 deletions

View File

@@ -5,7 +5,7 @@
"devmodeoptions": { "devmodeoptions": {
"serverName" : "", "serverName" : "",
"cleandb": false, "cleandb": false,
"maxlauncherhr": true, "maxlauncherhr": false,
"LogInboundMessages": false, "LogInboundMessages": false,
"LogOutboundMessages": false, "LogOutboundMessages": false,
"MaxHexdumpLength": 256, "MaxHexdumpLength": 256,
@@ -47,34 +47,34 @@
{ {
"name": "Newbie", "description": "", "ip": "", "type": 3, "recommended": 2, "allowedclientflags": 0, "name": "Newbie", "description": "", "ip": "", "type": 3, "recommended": 2, "allowedclientflags": 0,
"channels": [ "channels": [
{ "port": 54001, "MaxPlayers": 50, "Unk0": 319, "Unk1": 252, "Unk2": 248 }, { "port": 54001, "MaxPlayers": 100 },
{ "port": 54002, "MaxPlayers": 50, "Unk0": 319, "Unk1": 252, "Unk2": 248 } { "port": 54002, "MaxPlayers": 100 }
] ]
}, { }, {
"name": "Normal", "description": "", "ip": "", "type": 1, "recommended": 0, "allowedclientflags": 0, "name": "Normal", "description": "", "ip": "", "type": 1, "recommended": 0, "allowedclientflags": 0,
"channels": [ "channels": [
{ "port": 54003, "MaxPlayers": 50, "Unk0": 319, "Unk1": 252, "Unk2": 248 }, { "port": 54003, "MaxPlayers": 100 },
{ "port": 54004, "MaxPlayers": 50, "Unk0": 319, "Unk1": 252, "Unk2": 248 } { "port": 54004, "MaxPlayers": 100 }
] ]
}, { }, {
"name": "Cities", "description": "", "ip": "", "type": 2, "recommended": 0, "allowedclientflags": 0, "name": "Cities", "description": "", "ip": "", "type": 2, "recommended": 0, "allowedclientflags": 0,
"channels": [ "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, "name": "Tavern", "description": "", "ip": "", "type": 4, "recommended": 0, "allowedclientflags": 0,
"channels": [ "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, "name": "Return", "description": "", "ip": "", "type": 5, "recommended": 0, "allowedclientflags": 0,
"channels": [ "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, "name": "MezFes", "description": "", "ip": "", "type": 6, "recommended": 6, "allowedclientflags": 0,
"channels": [ "channels": [
{ "port": 54008, "MaxPlayers": 50, "Unk0": 319, "Unk1": 252, "Unk2": 248 } { "port": 54008, "MaxPlayers": 100 }
] ]
} }
] ]

View File

@@ -98,9 +98,6 @@ type EntranceChannelInfo struct {
Port uint16 Port uint16
MaxPlayers uint16 MaxPlayers uint16
CurrentPlayers uint16 CurrentPlayers uint16
Unk0 uint16
Unk1 uint16
Unk2 uint16
} }
// getOutboundIP4 gets the preferred outbound ip4 of this machine // getOutboundIP4 gets the preferred outbound ip4 of this machine

View File

@@ -37,10 +37,10 @@ func encodeServerInfo(config *config.Config, s *Server) []byte {
bf.WriteUint8(si.Type) bf.WriteUint8(si.Type)
bf.WriteUint8(season) bf.WriteUint8(season)
bf.WriteUint8(si.Recommended) bf.WriteUint8(si.Recommended)
combined := append([]byte{0x00}, stringsupport.UTF8ToSJIS(si.Name)...) bf.WriteUint8(0) // Prevents malformed server name
combined = append(combined, []byte{0x00}...) combined := append(stringsupport.UTF8ToSJIS(si.Name), []byte{0x00}...)
combined = append(combined, stringsupport.UTF8ToSJIS(si.Description)...) 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) bf.WriteUint32(si.AllowedClientFlags)
for channelIdx, ci := range si.Channels { for channelIdx, ci := range si.Channels {
@@ -56,9 +56,9 @@ func encodeServerInfo(config *config.Config, s *Server) []byte {
bf.WriteUint32(0) bf.WriteUint32(0)
bf.WriteUint32(0) bf.WriteUint32(0)
bf.WriteUint32(0) bf.WriteUint32(0)
bf.WriteUint16(ci.Unk0) bf.WriteUint16(319) // Unk
bf.WriteUint16(ci.Unk1) bf.WriteUint16(252) // Unk
bf.WriteUint16(ci.Unk2) bf.WriteUint16(248) // Unk
bf.WriteUint16(0x3039) bf.WriteUint16(0x3039)
} }
} }

View File

@@ -1,13 +1,13 @@
package signserver package signserver
import ( import (
"erupe-ce/common/byteframe"
ps "erupe-ce/common/pascalstring"
"erupe-ce/common/stringsupport"
"erupe-ce/server/channelserver"
"fmt" "fmt"
"math/rand" "math/rand"
"time" "time"
"erupe-ce/server/channelserver"
"erupe-ce/common/stringsupport"
ps "erupe-ce/common/pascalstring"
"erupe-ce/common/byteframe"
"go.uber.org/zap" "go.uber.org/zap"
) )
@@ -99,13 +99,12 @@ func (s *Session) makeSignInResp(uid int) []byte {
} }
} }
bf.WriteUint8(0) // notice_count bf.WriteUint8(1) // Notice count
noticeText := "<BODY><CENTER><SIZE_3><C_4>Welcome to Erupe SU9 Beta 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."
ps.Uint32(bf, noticeText, true)
// noticeText := "<BODY><CENTER><SIZE_3><C_4>Welcome to Erupe SU9!<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." bf.WriteUint32(s.server.getLastCID(uid))
// ps.Uint32(bf, noticeText, true) bf.WriteUint32(s.server.getUserRights(uid))
bf.WriteUint32(s.server.getLastCID(uid)) // last played character id
bf.WriteUint32(s.server.getUserRights(uid)) // course bitfield
ps.Uint16(bf, "", false) // filters ps.Uint16(bf, "", false) // filters
bf.WriteUint32(0xCA104E20) bf.WriteUint32(0xCA104E20)
ps.Uint16(bf, "", false) // encryption ps.Uint16(bf, "", false) // encryption
@@ -127,10 +126,12 @@ func (s *Session) makeSignInResp(uid int) []byte {
mezfes := s.server.erupeConfig.DevModeOptions.MezFesEvent mezfes := s.server.erupeConfig.DevModeOptions.MezFesEvent
alt := false alt := false
if mezfes { if mezfes {
bf.WriteUint32(uint32(channelserver.Time_Current_Adjusted().Add(-5 * time.Minute).Unix())) // Start time // Start time
bf.WriteUint32(uint32(channelserver.Time_Current_Adjusted().Add(24 * time.Hour * 7).Unix())) // End 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.WriteUint8(2) // Unk
bf.WriteUint32(0) // Single tickets bf.WriteUint32(20) // Single tickets
bf.WriteUint32(0) // Group tickets bf.WriteUint32(0) // Group tickets
bf.WriteUint8(8) // Stalls open bf.WriteUint8(8) // Stalls open
bf.WriteUint8(0xA) // Unk bf.WriteUint8(0xA) // Unk
@@ -140,7 +141,7 @@ func (s *Session) makeSignInResp(uid int) []byte {
if alt { if alt {
bf.WriteUint8(0x2) // Tokotoko bf.WriteUint8(0x2) // Tokotoko
} else { } else {
bf.WriteUint8(0x4) // Volpkun bf.WriteUint8(0x4) // Volpakkun
} }
bf.WriteUint8(0x8) // Battle cats bf.WriteUint8(0x8) // Battle cats
bf.WriteUint8(0x5) // Gook bf.WriteUint8(0x5) // Gook