Fix entrance server IPv4 encoding

This commit is contained in:
Andrew Gutekanst
2020-01-01 10:35:14 -05:00
parent fbcd878e72
commit 953870867e
2 changed files with 2 additions and 2 deletions

View File

@@ -43,7 +43,7 @@ func handleEntranceServerConnection(conn net.Conn) {
ChannelInfo{ ChannelInfo{
Port: 54001, Port: 54001,
MaxPlayers: 100, MaxPlayers: 100,
CurrentPlayers: 3, CurrentPlayers: 0,
Unk4: 0, Unk4: 0,
Unk5: 0, Unk5: 0,
Unk6: 0, Unk6: 0,

View File

@@ -54,7 +54,7 @@ func encodeServerInfo(serverInfos []ServerInfo) []byte {
bf := byteframe.NewByteFrame() bf := byteframe.NewByteFrame()
for serverIdx, si := range serverInfos { for serverIdx, si := range serverInfos {
bf.WriteUint32(binary.LittleEndian.Uint32(si.IP)) bf.WriteUint32(binary.LittleEndian.Uint32(si.IP.To4()))
bf.WriteUint16(16 + uint16(serverIdx)) bf.WriteUint16(16 + uint16(serverIdx))
bf.WriteUint16(si.Unk2) bf.WriteUint16(si.Unk2)
bf.WriteUint16(uint16(len(si.Channels))) bf.WriteUint16(uint16(len(si.Channels)))