Exemplo n.º 1
0
        public CGameServer()
        {
            this.operation_lock  = new object();
            this.loop_event      = new AutoResetEvent(false);
            this.user_operations = new Queue <CPacket>();

            this.room_manager           = new CGameRoomManager();
            this.matching_waiting_users = new List <CGameUser>();

            this.logic_thread1 = new Thread(gameloop);
            this.logic_thread1.Start();
        }
Exemplo n.º 2
0
        public CGameRoom(CGameRoomManager room_manager)
        {
            this.room_manager        = room_manager;
            this.players             = new List <CPlayer>();
            this.received_protocol   = new Dictionary <byte, PROTOCOL>();
            this.current_turn_player = 0;

            this.state_manager = new CStateManager <CPlayer, CPacket>();
            this.state_manager.add(STATE.READY, new CGameRoomReadyState(this));
            this.state_manager.add(STATE.PLAY, new CGameRoomPlayState(this));
            this.state_manager.change_state(STATE.READY);
        }
Exemplo n.º 3
0
        //----------------------------------------------------------------

        public CGameServer()
        {
            this.room_manager           = new CGameRoomManager();
            this.matching_waiting_users = new List <CGameUser>();
        }