示例#1
0
        private void HandleSelectServerRequest(SelectServerRequest packet)
        {
            if (packet.ChosenServerId == 0)
            {
                var connectPacket = new ConnectToGameServerPacket();
                connectPacket.GameServerIp   = new byte[] { 127, 0, 0, 1 };
                connectPacket.Seed           = connectPacket.GameServerIp;
                connectPacket.GameServerPort = 30000;

                SendToClient(connectPacket.Serialize());
            }
            else
            {
                throw new NotImplementedException($"Unexpected server id {packet.ChosenServerId}, it must be always 0");
            }
        }
示例#2
0
 private void HandleSelectServerRequest(SelectServerRequest packet)
 {
     SelectedServer = servers.First(s => s.Id == packet.ChosenServerId);
 }