Ejemplo n.º 1
0
 private void Server_Load(object sender, EventArgs e)
 {
     _listener = new AsyncSocketListener {
         AllowReceivingFiles = true
     };
     BindEvents();
     _listener.StartListening(13000);
 }
Ejemplo n.º 2
0
        public override void OnServerAddPlayer(NetworkConnection conn, short playerControllerId)
        {
            Transform startPosition = this.GetStartPosition();

            NetworkPlayer player = Instantiate <NetworkPlayer>(m_NetworkPlayerPrefab, startPosition.position, Quaternion.identity);

            NetworkServer.AddPlayerForConnection(conn, player.gameObject, playerControllerId);

            m_GameManager.RegisterNewPlayer(player, startPosition);

            int playerPort = s_BasePort + ++m_NumConnections;

            Debug.Log("Added player with player id: " + m_NumConnections);

            StartCoroutine(AsyncSocketListener.StartListening(conn, playerPort));
            player.RpcSetPlayerConnectionInfo(m_ExternalIp + ":" + playerPort);
        }
Ejemplo n.º 3
0
 public void SetUpServer(IPAddress ipAddress, int port)
 {
     listener = new AsyncSocketListener();
     listener.StartListening(ipAddress, port, System.Net.Sockets.ProtocolType.Tcp, view);
 }