예제 #1
0
 public Player(GameClient client)
 {
     Game = client.Game;
     Type = (int)PlayerType.Undefined;
     State = PlayerState.None;
     m_client = client;
     TurnSkip = 0;
 }
예제 #2
0
		public void Disconnect()
		{
			if(m_client==null){
				return;
			}
			m_client.Close();
			m_client = null;
		}
예제 #3
0
파일: GameRoom.cs 프로젝트: Buttys/YGOCore
 public void RemoveClient(GameClient client) 
 {
     m_clients.Remove(client);
 }
예제 #4
0
파일: GameRoom.cs 프로젝트: Buttys/YGOCore
 public void AddClient(GameClient client) 
 {
     m_clients.Add(client);
 }
예제 #5
0
		private void AcceptClient(){
			while(IsListening){
				GameClient client=null;
				try{
					TcpClient tcpClient=m_listener.AcceptTcpClient();
					client=new GameClient(tcpClient);
				}catch(Exception){
					client=null;
				}
				m_mutexClients.WaitOne();
				m_clients.Add(client);
				m_mutexClients.ReleaseMutex();
				Thread.Sleep(1);
			}
		}