예제 #1
0
 public ConnectedClient(NetworkStream connection, EndPoint endPoint, PR2Server gameServer, IHubProxy remoteServerHubProxy)
 {
     this.connection           = connection;
     this.endPoint             = endPoint;
     this.gameServer           = gameServer;
     this.remoteServerHubProxy = remoteServerHubProxy;
     this.hasher = new PacketCrypto();
 }
예제 #2
0
 public RightRoom(String name, PR2Server gameServer)
 {
     this.Name                  = name;
     this.gameServer            = gameServer;
     this.members               = new Dictionary <Int32, ConnectedClient>();
     this.occupiedSlots         = new Dictionary <String, OccupancyInfo>();
     this.membersSyncLock       = new Object();
     this.occupiedSlotsSyncLock = new Object();
 }
예제 #3
0
 public ChatRoom(String name, Boolean permament, PR2Server gameServer)
 {
     this.Name             = name;
     this.Permament        = permament;
     this.gameServer       = gameServer;
     this.members          = new Dictionary <Int32, ConnectedClient>();
     this.membersSyncLock  = new Object();
     this.messages         = new Queue <String>();
     this.messagesSyncLock = new Object();
     this.messages.Enqueue(String.Format("systemChat`Welcome to the chatroom {0}!", name));
 }
예제 #4
0
 /// <summary>
 /// Server constructor.
 /// </summary>
 /// <param name="ip">Listening address.</param>
 /// <param name="port">Listening port.</param>
 public MainServer(IPAddress ip, Int32 port, String hubConnectionURL, String name)
 {
     this.name                    = name;
     this.ipAddress               = ip;
     this.port                    = port;
     this.hubConnectionURL        = hubConnectionURL;
     this.listener                = new TcpListener(new IPEndPoint(ip, port));
     this.gameServer              = new PR2Server(name);
     this.keepAliveTimer          = new TimerTimer(GameConstants.KEEPALIVE_INTERVAL);
     this.keepAliveTimer.Elapsed += keepAliveTimer_Elapsed;
 }