Esempio n. 1
0
 public MultiplayerServer(int port, IMultiplayerServerListener serverListener, IMultiplayerClientListener clientListener)
 {
     this.serverListener = serverListener;
     this.clientListener = clientListener;
     serverSocket        = new TcpListener(IPAddress.Any, port);
     serverSocket.Start();
 }
Esempio n. 2
0
        public MultiplayerClient(string server, int port, IMultiplayerClientListener clientListener)
            : this(new TcpClient(server, port), null, clientListener)
        {
            tcpClient.Client.Send(new byte[] { 1 });

            serverSide = false;
        }
Esempio n. 3
0
 public MultiplayerServer(int port, IMultiplayerServerListener serverListener, IMultiplayerClientListener clientListener)
 {
     this.serverListener = serverListener;
     this.clientListener = clientListener;
     serverSocket = new TcpListener(IPAddress.Any, port);
     serverSocket.Start();
 }
Esempio n. 4
0
        public MultiplayerClient(string server, int port, IMultiplayerClientListener clientListener)
            : this(new TcpClient(server, port), null, clientListener)
        {
            tcpClient.Client.Send(new byte[] { 1 });

            serverSide = false;
        }
Esempio n. 5
0
        public MultiplayerClient(TcpClient tcpClient, MultiplayerServer server, IMultiplayerClientListener clientListener)
        {
            this.stats = MultiplayerStats.Singleton;
            this.clientListener = clientListener;

            this.server = server;
            this.tcpClient = tcpClient;

            this.tcpClient.NoDelay = true;
            this.tcpClient.Client.Blocking = false;

            serverSide = true;
        }
Esempio n. 6
0
        public MultiplayerClient(TcpClient tcpClient, MultiplayerServer server, IMultiplayerClientListener clientListener)
        {
            this.stats          = MultiplayerStats.Singleton;
            this.clientListener = clientListener;

            this.server    = server;
            this.tcpClient = tcpClient;

            this.tcpClient.NoDelay         = true;
            this.tcpClient.Client.Blocking = false;

            serverSide = true;
        }