private static void GetHostsRequestToClient(NetworkingPlayer sender, NetworkingStream stream)
{
int count = ObjectMapper.Map<int>(stream);
List<HostInfo> hostList = new List<HostInfo>();
for (int i = 0; i < count; i++)
{
hostList.Add(new HostInfo()
{
ipAddress = ObjectMapper.Map<string>(stream),
port = ObjectMapper.Map<ushort>(stream),
maxPlayers = ObjectMapper.Map<int>(stream),
name = ObjectMapper.Map<string>(stream),
password = ObjectMapper.Map<string>(stream),
gameType = ObjectMapper.Map<string>(stream),
connectedPlayers = ObjectMapper.Map<int>(stream),
comment = ObjectMapper.Map<string>(stream),
sceneName = ObjectMapper.Map<string>(stream)
});
}
Networking.Disconnect(PORT);
requestHostsCallback(hostList.ToArray());
}