mirror of
https://github.com/Mezeporta/Erupe.git
synced 2025-12-23 20:35:04 +01:00
entrance server response improvements
This commit is contained in:
@@ -81,7 +81,7 @@ type EntranceServerInfo struct {
|
||||
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).
|
||||
|
||||
Description string // Server description
|
||||
// 4096(PC, PS3/PS4)?, 8258(PC, PS3/PS4)?, 8192 == nothing?
|
||||
// THIS ONLY EXISTS IF Binary8Header.type == "SV2", NOT "SVR"!
|
||||
AllowedClientFlags uint32
|
||||
|
||||
@@ -50,11 +50,18 @@ func encodeServerInfo(serverInfos []config.EntranceServerInfo, s *Server) []byte
|
||||
bf.WriteUint8(si.Type)
|
||||
bf.WriteUint8(season)
|
||||
bf.WriteUint8(si.Recommended)
|
||||
shiftjisName, err := stringsupport.ConvertUTF8ToShiftJIS(si.Name)
|
||||
sjisName, err := stringsupport.ConvertUTF8ToShiftJIS(si.Name)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
bf.WriteBytes(paddedString(string(shiftjisName), 66))
|
||||
sjisDesc, err := stringsupport.ConvertUTF8ToShiftJIS(si.Description)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
combined := append([]byte{0x00}, sjisName...)
|
||||
combined = append(combined, []byte{0x00}...)
|
||||
combined = append(combined, sjisDesc...)
|
||||
bf.WriteBytes(paddedString(string(combined), 66))
|
||||
bf.WriteUint32(si.AllowedClientFlags)
|
||||
|
||||
for channelIdx, ci := range si.Channels {
|
||||
|
||||
Reference in New Issue
Block a user