private void HandleUpdateGameState(IEventData eventData)
        {
            if (log.IsDebugEnabled)
            {
                log.DebugFormat("HandleUpdateGameState");
            }

            var updateEvent = new UpdateGameEvent(this.Protocol, eventData);

            if (updateEvent.IsValid == false)
            {
                string msg = updateEvent.GetErrorMessage();
                log.ErrorFormat("UpdateGame contract error: {0}", msg);
                return;
            }

            if (log.IsDebugEnabled)
            {
                log.DebugFormat("HandleUpdateGameState: {0}, reinitialize: {1}", updateEvent.GameId, updateEvent.Reinitialize);
            }

            var ctx = this.Context;

            if (ctx != null)
            {
                ctx.HandleUpdateGameEvent(updateEvent);
            }
        }
Example #2
0
        protected virtual void HandleUpdateGameState(IEventData eventData)
        {
            if (log.IsDebugEnabled)
            {
                log.DebugFormat("HandleUpdateGameState");
            }

            var updateEvent = new UpdateGameEvent(this.Protocol, eventData);

            if (updateEvent.IsValid == false)
            {
                string msg = updateEvent.GetErrorMessage();
                log.ErrorFormat("UpdateGame contract error: {0}", msg);
                return;
            }

            this.application.DefaultApplication.OnGameUpdateOnGameServer(updateEvent, this);
        }