public void SendPeerInfo()
{
if (this.m_HostMigration)
{
PeerListMessage msg = new PeerListMessage();
List<PeerInfoMessage> list = new List<PeerInfoMessage>();
for (int i = 0; i < NetworkServer.connections.Count; i++)
{
NetworkConnection connection = NetworkServer.connections[i];
if (connection != null)
{
string str;
int num2;
NetworkID kid;
NodeID eid;
byte num3;
PeerInfoMessage item = new PeerInfoMessage();
NetworkTransport.GetConnectionInfo(NetworkServer.serverHostId, connection.connectionId, out str, out num2, out kid, out eid, out num3);
item.connectionId = connection.connectionId;
item.port = num2;
if (i == 0)
{
item.port = NetworkServer.listenPort;
item.isHost = true;
item.address = "<host>";
}
else
{
item.address = str;
item.isHost = false;
}
List<PeerInfoPlayer> list2 = new List<PeerInfoPlayer>();
for (int k = 0; k < connection.playerControllers.Count; k++)
{
PlayerController controller = connection.playerControllers[k];
if ((controller != null) && (controller.unetView != null))
{
PeerInfoPlayer player;
player.netId = controller.unetView.netId;
player.playerControllerId = controller.unetView.playerControllerId;
list2.Add(player);
}
}
if (connection.clientOwnedObjects != null)
{
foreach (NetworkInstanceId id in connection.clientOwnedObjects)
{
GameObject obj2 = NetworkServer.FindLocalObject(id);
if ((obj2 != null) && (obj2.GetComponent<NetworkIdentity>().playerControllerId == -1))
{
PeerInfoPlayer player2;
player2.netId = id;
player2.playerControllerId = -1;
list2.Add(player2);
}
}
}
if (list2.Count > 0)
{
item.playerIds = list2.ToArray();
}
list.Add(item);
}
}
msg.peers = list.ToArray();
for (int j = 0; j < NetworkServer.connections.Count; j++)
{
NetworkConnection connection2 = NetworkServer.connections[j];
if (connection2 != null)
{
msg.oldServerConnectionId = connection2.connectionId;
connection2.Send(11, msg);
}
}
}
}