コード例 #1
0
        private void HandleAccountNotify_AccountStateUpdated(RPCContext context)
        {
            if (context == null || context.Payload == null)
            {
                base.ApiLog.LogWarning("HandleAccountNotify_AccountStateUpdated invalid context!");
                return;
            }
            AccountStateNotification accountStateNotification = AccountStateNotification.ParseFrom(context.Payload);

            if (accountStateNotification == null || !accountStateNotification.IsInitialized)
            {
                base.ApiLog.LogWarning("HandleAccountNotify_AccountStateUpdated unable to parse response!");
                return;
            }
            if (!accountStateNotification.HasState)
            {
                base.ApiLog.LogDebug("HandleAccountNotify_AccountStateUpdated HasState=false, data={0}", new object[] { accountStateNotification });
                return;
            }
            AccountState state = accountStateNotification.State;

            if (!state.HasAccountLevelInfo)
            {
                base.ApiLog.LogDebug("HandleAccountNotify_AccountStateUpdated HasAccountLevelInfo=false, data={0}", new object[] { accountStateNotification });
                return;
            }
            if (!state.AccountLevelInfo.HasPreferredRegion)
            {
                base.ApiLog.LogDebug("HandleAccountNotify_AccountStateUpdated HasPreferredRegion=false, data={0}", new object[] { accountStateNotification });
                return;
            }
            base.ApiLog.LogDebug("HandleAccountNotify_AccountStateUpdated, data={0}", new object[] { accountStateNotification });
        }
コード例 #2
0
 private void HandleAccountNotify_AccountStateUpdated(RPCContext context)
 {
     if ((context == null) || (context.Payload == null))
     {
         base.ApiLog.LogWarning("HandleAccountNotify_AccountStateUpdated invalid context!");
     }
     else
     {
         AccountStateNotification notification = AccountStateNotification.ParseFrom(context.Payload);
         if ((notification == null) || !notification.IsInitialized)
         {
             base.ApiLog.LogWarning("HandleAccountNotify_AccountStateUpdated unable to parse response!");
         }
         else if (!notification.HasState)
         {
             object[] args = new object[] { notification };
             base.ApiLog.LogDebug("HandleAccountNotify_AccountStateUpdated HasState=false, data={0}", args);
         }
         else
         {
             AccountState state = notification.State;
             if (!state.HasAccountLevelInfo)
             {
                 object[] objArray2 = new object[] { notification };
                 base.ApiLog.LogDebug("HandleAccountNotify_AccountStateUpdated HasAccountLevelInfo=false, data={0}", objArray2);
             }
             else if (!state.AccountLevelInfo.HasPreferredRegion)
             {
                 object[] objArray3 = new object[] { notification };
                 base.ApiLog.LogDebug("HandleAccountNotify_AccountStateUpdated HasPreferredRegion=false, data={0}", objArray3);
             }
             else
             {
                 object[] objArray4 = new object[] { notification };
                 base.ApiLog.LogDebug("HandleAccountNotify_AccountStateUpdated, data={0}", objArray4);
             }
         }
     }
 }
コード例 #3
0
 BattlenetRpcErrorCode HandleOnAccountStateUpdated(AccountStateNotification request)
 {
     Log.outError(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method AccountListener.OnAccountStateUpdated: {1}", GetCallerInfo(), request.ToString());
     return(BattlenetRpcErrorCode.RpcNotImplemented);
 }
コード例 #4
0
        public override void CallServerMethod(uint token, uint methodId, CodedInputStream stream)
        {
            switch (methodId)
            {
            case 1:
            {
                AccountStateNotification request = new AccountStateNotification();
                request.MergeFrom(stream);

                BattlenetRpcErrorCode status = HandleOnAccountStateUpdated(request);
                Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method AccountListener.OnAccountStateUpdated(AccountStateNotification: {1} status: {2}.", GetCallerInfo(), request.ToString(), status);
                if (status != 0)
                {
                    SendResponse(token, status);
                }
                break;
            }

            case 2:
            {
                GameAccountStateNotification request = new GameAccountStateNotification();
                request.MergeFrom(stream);

                BattlenetRpcErrorCode status = HandleOnGameAccountStateUpdated(request);
                Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method AccountListener.OnGameAccountStateUpdated(GameAccountStateNotification: {1} status: {2}.", GetCallerInfo(), request.ToString(), status);
                if (status != 0)
                {
                    SendResponse(token, status);
                }
                break;
            }

            case 3:
            {
                GameAccountNotification request = new GameAccountNotification();
                request.MergeFrom(stream);

                BattlenetRpcErrorCode status = HandleOnGameAccountsUpdated(request);
                Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method AccountListener.OnGameAccountsUpdated(GameAccountNotification: {1} status: {2}.", GetCallerInfo(), request.ToString(), status);
                if (status != 0)
                {
                    SendResponse(token, status);
                }
                break;
            }

            case 4:
            {
                GameAccountSessionNotification request = new GameAccountSessionNotification();
                request.MergeFrom(stream);

                BattlenetRpcErrorCode status = HandleOnGameSessionUpdated(request);
                Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method AccountListener.OnGameSessionUpdated(GameAccountSessionNotification: {1} status: {2}.", GetCallerInfo(), request.ToString(), status);
                if (status != 0)
                {
                    SendResponse(token, status);
                }
                break;
            }

            default:
                Log.outError(LogFilter.ServiceProtobuf, "Bad method id {0}.", methodId);
                SendResponse(token, BattlenetRpcErrorCode.RpcInvalidMethod);
                break;
            }
        }