mirror of
https://github.com/Mezeporta/Erupe.git
synced 2025-12-15 00:15:08 +01:00
add S6 Entrance compatibility
This commit is contained in:
@@ -3,12 +3,11 @@ package entranceserver
|
|||||||
import (
|
import (
|
||||||
"encoding/binary"
|
"encoding/binary"
|
||||||
"encoding/hex"
|
"encoding/hex"
|
||||||
|
"erupe-ce/common/stringsupport"
|
||||||
_config "erupe-ce/config"
|
_config "erupe-ce/config"
|
||||||
"fmt"
|
"fmt"
|
||||||
"net"
|
"net"
|
||||||
|
|
||||||
"erupe-ce/common/stringsupport"
|
|
||||||
|
|
||||||
"erupe-ce/common/byteframe"
|
"erupe-ce/common/byteframe"
|
||||||
"erupe-ce/server/channelserver"
|
"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.WriteUint16(uint16(len(si.Channels)))
|
||||||
bf.WriteUint8(si.Type)
|
bf.WriteUint8(si.Type)
|
||||||
bf.WriteUint8(season)
|
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(stringsupport.UTF8ToSJIS(si.Name), []byte{0x00}...)
|
||||||
combined = append(combined, stringsupport.UTF8ToSJIS(si.Description)...)
|
combined = append(combined, stringsupport.UTF8ToSJIS(si.Description)...)
|
||||||
bf.WriteUint8(uint8(len(combined)))
|
bf.WriteUint8(uint8(len(combined)))
|
||||||
|
|||||||
Reference in New Issue
Block a user