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

@@ -44,8 +44,8 @@ type SaveDumpOptions struct {
// Discord holds the discord integration config. // Discord holds the discord integration config.
type Discord struct { type Discord struct {
Enabled bool Enabled bool
BotToken string BotToken string
ServerID string ServerID string
RealtimeChannelID string RealtimeChannelID string
DevRoles []string DevRoles []string
@@ -80,11 +80,11 @@ type Entrance struct {
// EntranceServerInfo represents an entry in the serverlist. // EntranceServerInfo represents an entry in the serverlist.
type EntranceServerInfo struct { type EntranceServerInfo struct {
IP string IP string
Type uint8 // Server type. 0=?, 1=open, 2=cities, 3=newbie, 4=bar Type uint8 // Server type. 0=?, 1=open, 2=cities, 3=newbie, 4=bar
Season uint8 // Server activity. 0 = green, 1 = orange, 2 = blue Season uint8 // Server activity. 0 = green, 1 = orange, 2 = blue
Recommended uint8 // Something to do with server recommendation on 0, 3, and 5. 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 Description string // Server description
// 4096(PC, PS3/PS4)?, 8258(PC, PS3/PS4)?, 8192 == nothing? // 4096(PC, PS3/PS4)?, 8258(PC, PS3/PS4)?, 8192 == nothing?
// THIS ONLY EXISTS IF Binary8Header.type == "SV2", NOT "SVR"! // THIS ONLY EXISTS IF Binary8Header.type == "SV2", NOT "SVR"!
@@ -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

@@ -22,7 +22,7 @@ func encodeServerInfo(config *config.Config, s *Server) []byte {
bf := byteframe.NewByteFrame() bf := byteframe.NewByteFrame()
for serverIdx, si := range serverInfos { 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) err := s.db.QueryRow("SELECT season FROM servers WHERE server_id=$1", sid).Scan(&season)
if err != nil { if err != nil {
panic(err) panic(err)
@@ -37,14 +37,14 @@ 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 {
sid = (4096 + serverIdx * 256) + (16 + channelIdx) sid = (4096 + serverIdx*256) + (16 + channelIdx)
bf.WriteUint16(ci.Port) bf.WriteUint16(ci.Port)
bf.WriteUint16(16 + uint16(channelIdx)) bf.WriteUint16(16 + uint16(channelIdx))
bf.WriteUint16(ci.MaxPlayers) 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.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,16 +99,15 @@ 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))
ps.Uint16(bf, "", false) // filters
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(0xCA104E20) bf.WriteUint32(0xCA104E20)
ps.Uint16(bf, "", false) // encryption ps.Uint16(bf, "", false) // encryption
bf.WriteUint8(0x00) bf.WriteUint8(0x00)
bf.WriteUint32(0xCA110001) bf.WriteUint32(0xCA110001)
bf.WriteUint32(0x4E200000) bf.WriteUint32(0x4E200000)
@@ -127,12 +126,14 @@ 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()))
bf.WriteUint8(2) // Unk // End time
bf.WriteUint32(0) // Single tickets bf.WriteUint32(uint32(channelserver.Time_Current_Adjusted().Add(24 * time.Hour * 7).Unix()))
bf.WriteUint32(0) // Group tickets bf.WriteUint8(2) // Unk
bf.WriteUint8(8) // Stalls open bf.WriteUint32(20) // Single tickets
bf.WriteUint32(0) // Group tickets
bf.WriteUint8(8) // Stalls open
bf.WriteUint8(0xA) // Unk bf.WriteUint8(0xA) // Unk
bf.WriteUint8(0x3) // Pachinko bf.WriteUint8(0x3) // Pachinko
bf.WriteUint8(0x6) // Nyanrendo bf.WriteUint8(0x6) // Nyanrendo
@@ -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