mirror of
https://github.com/Mezeporta/Erupe.git
synced 2025-12-16 08:55:31 +01:00
RealClientMode replaced for ClientID
This commit is contained in:
@@ -18,12 +18,12 @@ func encodeServerInfo(config *_config.Config, s *Server, local bool) []byte {
|
||||
|
||||
for serverIdx, si := range serverInfos {
|
||||
// Prevent MezFes Worlds displaying on Z1
|
||||
if config.RealClientMode <= _config.Z1 {
|
||||
if config.ClientID <= _config.Z1 {
|
||||
if si.Type == 6 {
|
||||
continue
|
||||
}
|
||||
}
|
||||
if config.RealClientMode <= _config.G6 {
|
||||
if config.ClientID <= _config.G6 {
|
||||
if si.Type == 5 {
|
||||
continue
|
||||
}
|
||||
@@ -42,22 +42,22 @@ func encodeServerInfo(config *_config.Config, s *Server, local bool) []byte {
|
||||
bf.WriteUint16(uint16(len(si.Channels)))
|
||||
bf.WriteUint8(si.Type)
|
||||
bf.WriteUint8(uint8(((gametime.TimeAdjusted().Unix() / 86400) + int64(serverIdx)) % 3))
|
||||
if s.erupeConfig.RealClientMode >= _config.G1 {
|
||||
if s.erupeConfig.ClientID >= _config.G1 {
|
||||
bf.WriteUint8(si.Recommended)
|
||||
}
|
||||
|
||||
fullName := append(append(stringsupport.UTF8ToSJIS(si.Name), []byte{0x00}...), stringsupport.UTF8ToSJIS(si.Description)...)
|
||||
if s.erupeConfig.RealClientMode >= _config.G1 && s.erupeConfig.RealClientMode <= _config.G5 {
|
||||
if s.erupeConfig.ClientID >= _config.G1 && s.erupeConfig.ClientID <= _config.G5 {
|
||||
bf.WriteUint8(uint8(len(fullName)))
|
||||
bf.WriteBytes(fullName)
|
||||
} else {
|
||||
if s.erupeConfig.RealClientMode >= _config.G51 {
|
||||
if s.erupeConfig.ClientID >= _config.G51 {
|
||||
bf.WriteUint8(0) // Ignored
|
||||
}
|
||||
bf.WriteBytes(stringsupport.PaddedString(string(fullName), 65, false))
|
||||
}
|
||||
|
||||
if s.erupeConfig.RealClientMode >= _config.GG {
|
||||
if s.erupeConfig.ClientID >= _config.GG {
|
||||
bf.WriteUint32(si.AllowedClientFlags)
|
||||
}
|
||||
|
||||
@@ -112,7 +112,7 @@ func makeSv2Resp(config *_config.Config, s *Server, local bool) []byte {
|
||||
serverInfos := config.Entrance.Entries
|
||||
// Decrease by the number of MezFes Worlds
|
||||
var mf int
|
||||
if config.RealClientMode <= _config.Z1 {
|
||||
if config.ClientID <= _config.Z1 {
|
||||
for _, si := range serverInfos {
|
||||
if si.Type == 6 {
|
||||
mf++
|
||||
@@ -121,7 +121,7 @@ func makeSv2Resp(config *_config.Config, s *Server, local bool) []byte {
|
||||
}
|
||||
// and Return Worlds
|
||||
var ret int
|
||||
if config.RealClientMode <= _config.G6 {
|
||||
if config.ClientID <= _config.G6 {
|
||||
for _, si := range serverInfos {
|
||||
if si.Type == 5 {
|
||||
ret++
|
||||
@@ -135,7 +135,7 @@ func makeSv2Resp(config *_config.Config, s *Server, local bool) []byte {
|
||||
}
|
||||
|
||||
respType := "SV2"
|
||||
if config.RealClientMode <= _config.G32 {
|
||||
if config.ClientID <= _config.G32 {
|
||||
respType = "SVR"
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user