protected override void ReceiveMessage(ServerMessage message)
        {
            Logging.Print("LiveReplayCluster.receiveMessage :" + message.GetMessageType());

            switch (message.GetMessageType())
            {
            case ServerMessageType.INITIALIZE_LIVE_REPLAY:
                LiveReplayCluster.OnInitializeLiveReplayMessageReceived((InitializeLiveReplayMessage)message);
                break;

            case ServerMessageType.CLIENT_UPDATE_LIVE_REPLAY:
                LiveReplayCluster.OnClientUpdateLiveReplayMessageReceived((ClientUpdateLiveReplayMessage)message);
                break;

            case ServerMessageType.SERVER_UPDATE_LIVE_REPLAY:
                LiveReplayCluster.OnServerUpdateLiveReplayMessageReceived((ServerUpdateLiveReplayMessage)message);
                break;

            case ServerMessageType.END_LIVE_REPLAY:
                LiveReplayCluster.OnEndLiveReplayMessageReceived((EndLiveReplayMessage)message);
                break;

            case ServerMessageType.LIVE_REPLAY_ADD_SPECTATOR_REQUEST:
                LiveReplayCluster.OnLiveReplayAddSpectatorRequestMessageReceived((LiveReplayAddSpectatorRequestMessage)message);
                break;

            case ServerMessageType.LIVE_REPLAY_REMOVE_SPECTATOR:
                LiveReplayCluster.OnLiveReplayRemoveSpectatorMessageReceived((LiveReplayRemoveSpectatorMessage)message);
                break;
            }
        }
Esempio n. 2
0
        public static void Init()
        {
            LiveReplayManager.m_cluster     = new LiveReplayCluster(0);
            LiveReplayManager.m_liveReplays = new ConcurrentDictionary <long, LiveReplay>();
            LiveReplayManager.m_counters    = new int[256];

            LiveReplayManager.m_thread = new Thread(LiveReplayManager.Update);
            LiveReplayManager.m_thread.Start();
        }