mirror of
https://github.com/Mezeporta/Erupe.git
synced 2025-12-12 23:14:36 +01:00
add S6 Entrance compatibility
This commit is contained in:
@@ -3,12 +3,11 @@ package entranceserver
|
||||
import (
|
||||
"encoding/binary"
|
||||
"encoding/hex"
|
||||
"erupe-ce/common/stringsupport"
|
||||
_config "erupe-ce/config"
|
||||
"fmt"
|
||||
"net"
|
||||
|
||||
"erupe-ce/common/stringsupport"
|
||||
|
||||
"erupe-ce/common/byteframe"
|
||||
"erupe-ce/server/channelserver"
|
||||
)
|
||||
@@ -53,9 +52,15 @@ func encodeServerInfo(config *_config.Config, s *Server, local bool) []byte {
|
||||
bf.WriteUint16(uint16(len(si.Channels)))
|
||||
bf.WriteUint8(si.Type)
|
||||
bf.WriteUint8(season)
|
||||
bf.WriteUint8(si.Recommended)
|
||||
if s.erupeConfig.RealClientMode >= _config.G1 {
|
||||
bf.WriteUint8(si.Recommended)
|
||||
}
|
||||
|
||||
if s.erupeConfig.RealClientMode <= _config.GG {
|
||||
if s.erupeConfig.RealClientMode <= _config.S6 {
|
||||
combined := append(stringsupport.UTF8ToSJIS(si.Name), []byte{0x00}...)
|
||||
combined = append(combined, stringsupport.UTF8ToSJIS(si.Description)...)
|
||||
bf.WriteBytes(stringsupport.PaddedString(string(combined), 65, false))
|
||||
} else if s.erupeConfig.RealClientMode <= _config.GG {
|
||||
combined := append(stringsupport.UTF8ToSJIS(si.Name), []byte{0x00}...)
|
||||
combined = append(combined, stringsupport.UTF8ToSJIS(si.Description)...)
|
||||
bf.WriteUint8(uint8(len(combined)))
|
||||
|
||||
Reference in New Issue
Block a user