Пример #1
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;
            }
        }
Пример #2
0
 BattlenetRpcErrorCode HandleOnGameAccountStateUpdated(GameAccountStateNotification request)
 {
     Log.outError(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method AccountListener.OnGameAccountStateUpdated: {1}", GetCallerInfo(), request.ToString());
     return(BattlenetRpcErrorCode.RpcNotImplemented);
 }
    private void HandleAccountNotify_GameAccountStateUpdated(RPCContext context)
    {
        GameAccountStateNotification notification = GameAccountStateNotification.ParseFrom(context.Payload);

        base.ApiLog.LogDebug("HandleAccountNotify_GameAccountStateUpdated, data=" + notification);
    }