Ejemplo n.º 1
0
        public void OnUpdateGameSession(string rawUpdateGameSession, IAck ack)
        {
            log.DebugFormat("ServerState got the updateGameSession signal. rawGameSession : {0}", rawUpdateGameSession);

            if (!processReady)
            {
                log.Debug("Got an updated game session on inactive process. Sending false ack.");
                ack.Call(false);
                return;
            }
            log.Debug("Sending true ack.");
            ack.Call(true);

            Task.Run(() =>
            {
                Com.Amazon.Whitewater.Auxproxy.Pbuffer.UpdateGameSession updateGameSession =
                    JsonConvert.DeserializeObject <Com.Amazon.Whitewater.Auxproxy.Pbuffer.UpdateGameSession>(rawUpdateGameSession);
                GameSession gameSession   = GameSession.ParseFromBufferedGameSession(updateGameSession.GameSession);
                gameSessionId             = gameSession.GameSessionId;
                UpdateReason updateReason = UpdateReasonMapper.GetUpdateReasonForName(updateGameSession.UpdateReason);

                processParameters.OnUpdateGameSession(
                    new UpdateGameSession(gameSession, updateReason, updateGameSession.BackfillTicketId));
            });
        }
        public void OnUpdateGameSession(string rawUpdateGameSession, IAck ack)
        {
            log.DebugFormat("ServerState got the updateGameSession.  rawGameSessionUpdate : {0}", rawUpdateGameSession);
            if (!processReady)
            {
                log.Debug("Got a update game session call on inactive process. Sending false ack.");
                ack.Call(false);
                return;
            }
            log.Debug("OnUpdateGameSession: Sending true ack.");
            ack.Call(true);

            Task.Run(() =>
            {
                Protobuf.UpdateGameSession updateGameSession =
                    JsonConvert.DeserializeObject <Protobuf.UpdateGameSession>(rawUpdateGameSession);
                GameSession gameSession   = GameSession.ParseFromBufferedGameSession(updateGameSession.GameSession);
                UpdateReason updateReason = UpdateReasonMapper.GetUpdateReasonForName(updateGameSession.UpdateReason);

                processParameters.OnUpdateGameSession(
                    new UpdateGameSession(gameSession, updateReason, updateGameSession.BackfillTicketId));
            });
        }