mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 11:00:32 +00:00
List Server Example: read IP from bytes again after list server IPv6 bug was fixed
This commit is contained in:
parent
4ee787b0eb
commit
fdd35bc840
@ -148,8 +148,9 @@ void ParseMessage(byte[] bytes)
|
||||
// note: we don't use ReadString here because the list server
|
||||
// doesn't know C#'s '7-bit-length + utf8' encoding for strings
|
||||
BinaryReader reader = new BinaryReader(new MemoryStream(bytes, false), Encoding.UTF8);
|
||||
ushort ipLength = reader.ReadUInt16();
|
||||
string ip = Encoding.UTF8.GetString(reader.ReadBytes(ipLength));
|
||||
byte ipBytesLength = reader.ReadByte();
|
||||
byte[] ipBytes = reader.ReadBytes(ipBytesLength);
|
||||
string ip = new IPAddress(ipBytes).ToString();
|
||||
//ushort port = reader.ReadUInt16(); <- not all Transports use a port. assume default.
|
||||
ushort players = reader.ReadUInt16();
|
||||
ushort capacity = reader.ReadUInt16();
|
||||
|
Loading…
Reference in New Issue
Block a user