Example #1
0
        public virtual void OnNoticeReceived(AVIMNotice notice)
        {
            var response = new PlayResponse(notice.RawData);

            if (response.IsSuccessful)
            {
                if (Done != null)
                {
                    Done(Command, response);
                }
            }
            //Play.LogCommand(Command, null, Play.CommandType.WebSocket);
            //Play.LogCommand(null, response, Play.CommandType.WebSocket);
            if (EventCode != PlayEventCode.None)
            {
                var next = PlayStateMachine.Next(EventCode, response);
                if (response.IsSuccessful)
                {
                    Play.InvokeEvent(next);
                }
                else
                {
                    Play.InvokeEvent(next, response.ErrorCode, response.ErrorReason);
                }
            }
            Play.UnsubscribeNoticeReceived(this);
        }