Ejemplo n.º 1
0
 public PlayerComm(TcpClient p, ServerMessageQueue smq, int mess, int pn)
 {
     player       = p;
     messages     = smq;
     playerStream = player.GetStream();
     messageSize  = mess;
     encoder      = new ASCIIEncoding();
     playerID     = pn;
     obsChanged   = false;
     joinLock     = new object();
 }
Ejemplo n.º 2
0
 public PlayerComm(TcpClient p, ServerMessageQueue smq, int mess, int pn)
 {
     player = p;
     messages = smq;
     playerStream = player.GetStream();
     messageSize = mess;
     encoder = new ASCIIEncoding();
     playerID = pn;
     obsChanged = false;
     joinLock = new object();
 }
Ejemplo n.º 3
0
 //constructor creates the socket and threads to listen to new connections
 public WondersServer(int p) 
 {
     playersList = new PlayerThreadData[7];
     port = p;
     listenSocket = new TcpListener(IPAddress.Any, port);
     mQueue = new ServerMessageQueue();
     ASCIIEncoding encoder = new ASCIIEncoding();
     full = encoder.GetBytes("full");
     serverLock = new object();
     change = false;
     timer = new CommTimer(mQueue);
 }
Ejemplo n.º 4
0
        //constructor creates the socket and threads to listen to new connections
        public WondersServer(int p)
        {
            playersList  = new PlayerThreadData[7];
            port         = p;
            listenSocket = new TcpListener(IPAddress.Any, port);
            mQueue       = new ServerMessageQueue();
            ASCIIEncoding encoder = new ASCIIEncoding();

            full       = encoder.GetBytes("full");
            serverLock = new object();
            change     = false;
            timer      = new CommTimer(mQueue);
        }
Ejemplo n.º 5
0
 public CommTimer(ServerMessageQueue q)
 {
     mQueue = q;
     timer = new System.Timers.Timer(2000);
     timer.Elapsed += new ElapsedEventHandler(OnTimedEvent);
 }
Ejemplo n.º 6
0
 public CommTimer(ServerMessageQueue q)
 {
     mQueue         = q;
     timer          = new System.Timers.Timer(2000);
     timer.Elapsed += new ElapsedEventHandler(OnTimedEvent);
 }