Exemplo n.º 1
0
        internal async Task CreateNetworkConnection()
        {
            if (_networkConnection == null)
            {
                EmpireSerializer serializer = new EmpireSerializer();
                _networkConnection = new PacketConnection(serializer);
                await _networkConnection.StartTCPListener(_myPort, HandleRequest);

                await _networkConnection.StartUDPListener(_myPort, HandleUpdate);

                _serverSocket = await _networkConnection.ConnectToTCP(_gameData.HostIPAddress, _gameData.HostPort);

                _myAddress = _serverSocket.Information.LocalAddress.DisplayName;
            }
        }
Exemplo n.º 2
0
        public Lobby()
        {
            EmpireSerializer serializer = new EmpireSerializer();

            _connection = new PacketConnection(serializer);
        }