Ejemplo n.º 1
0
        public LobbyInitReadyCheck(ModdableChessGame game)
        {
            readyCheck = new ServerReadyCheckManager(game, TIMEOUT_PERIOD);

            onLobbyInitialized = game.Components.GetOrRegister <Message>((int)ComponentKeys.Server_LobbyInitialized, Message.Create);

            NetworkTracker.ServerMsgCallbacks.lobbyInitNotifyReady = OnReceivedNotice;
        }
Ejemplo n.º 2
0
        public BoardController(ModdableChessGame game)
        {
            info          = game.Components.GetOrRegister <ServerInformation>((int)ComponentKeys.ServerInformation, ServerInformation.Create);
            eotReadyCheck = new ServerReadyCheckManager(game, 10);
            eotReadyCheck.EnforceExtraData = true;

            NetworkTracker.ServerMsgCallbacks.boardActionReceived     = OnActionReceived;
            NetworkTracker.ServerMsgCallbacks.boardEndOfTurnReceived  = OnEoTReceived;
            NetworkTracker.ServerMsgCallbacks.boardEndOfTurnRefreshed = OnEoTRefreshed;
        }
Ejemplo n.º 3
0
        public LoadingManager(ModdableChessGame game)
        {
            info = game.Components.GetOrRegister <ServerInformation>((int)ComponentKeys.ServerInformation, ServerInformation.Create);
            //info.Connection.EnterStateMessenger.Subscribe(new SimpleListener<int>((s) => CheckServerConnection()));
            readyToPlay      = new ServerReadyCheckManager(game, 10);
            gameStateRefresh = new ServerReadyCheckManager(game, 10);
            gameStateRefresh.EnforceExtraData = true;

            NetworkTracker.ServerMsgCallbacks.loadingGameStateReceived = OnReceiveGameState;
            NetworkTracker.ServerMsgCallbacks.loadingGameStateRefresh  = OnGameStateRefresh;
            NetworkTracker.ServerMsgCallbacks.loadingErrorReceived     = OnReceiveError;
            NetworkTracker.ServerMsgCallbacks.loadingReadyReceived     = OnReceiveReady;
        }
        public ServerLobbyMessages(ModdableChessGame game)
        {
            combinedMods = new List <Mod>();
            hostMods     = new List <Mod>();
            clientMods   = new List <Mod>();
            nameMap      = new Dictionary <string, int>();
            readyChecker = new ServerReadyCheckManager(game, 10);

            game.Components.GetOrRegister <Message>((int)ComponentKeys.Server_LobbyInitialized, Message.Create)
            .Subscribe(new SimpleListener(OnLobbyInitialized));
            info = game.Components.GetOrRegister <ServerInformation>((int)ComponentKeys.ServerInformation, ServerInformation.Create);
            NetworkTracker.ServerMsgCallbacks.lobbyPickedTurnOrderReceived = ReceivedPickedTurnOrder;
            NetworkTracker.ServerMsgCallbacks.lobbyModsListReceived        = ReceivedModList;
            NetworkTracker.ServerMsgCallbacks.lobbyModsPickReceived        = ReceivedModPick;
            NetworkTracker.ServerMsgCallbacks.lobbyReadyReceived           = ReceivedReady;
        }