Beispiel #1
0
        BattlenetRpcErrorCode HandleGetAllValuesForAttribute(GetAllValuesForAttributeRequest request, GetAllValuesForAttributeResponse response)
        {
            if (request.AttributeKey == "Command_RealmListRequest_v1_b9")
            {
                Global.RealmMgr.WriteSubRegions(response);
                return(BattlenetRpcErrorCode.Ok);
            }

            return(BattlenetRpcErrorCode.RpcNotImplemented);
        }
Beispiel #2
0
        public static async void HandleGetAllValuesForAttributeRequest(GetAllValuesForAttributeRequest getAllValuesForAttributeRequest, BnetSession session)
        {
            if (getAllValuesForAttributeRequest.AttributeKey == "Command_RealmListRequest_v1_b9")
            {
                var getAllValuesForAttributeResponse = new GetAllValuesForAttributeResponse();

                getAllValuesForAttributeResponse.AttributeValue.Add(new Variant {
                    StringValue = "0-0-0"
                });

                await session.Send(getAllValuesForAttributeResponse);
            }
        }
Beispiel #3
0
        public void GetAllValuesForAttribute(string attributeKey, int context)
        {
            GetAllValuesForAttributeRequest getAllValuesForAttributeRequest = new GetAllValuesForAttributeRequest();

            getAllValuesForAttributeRequest.AttributeKey = attributeKey;
            if (this.m_rpcConnection == null)
            {
                base.ApiLog.LogError("GetAllValuesForAttribute could not send, connection not valid : " + getAllValuesForAttributeRequest.ToString());
                return;
            }
            RPCContext rpccontext = this.m_rpcConnection.QueueRequest(this.m_gameUtilitiesService.Id, 10u, getAllValuesForAttributeRequest, new RPCContextDelegate(this.GetAllValuesForAttributeCallback), 0u);

            rpccontext.Context = context;
        }
Beispiel #4
0
        public override void CallServerMethod(uint token, uint methodId, CodedInputStream stream)
        {
            switch (methodId)
            {
            case 1:
            {
                ClientRequest request = new ClientRequest();
                request.MergeFrom(stream);


                ClientResponse        response = new ClientResponse();
                BattlenetRpcErrorCode status   = HandleProcessClientRequest(request, response);
                Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method GameUtilitiesService.ProcessClientRequest(bgs.protocol.game_utilities.v1.ClientRequest: {1}) returned bgs.protocol.game_utilities.v1.ClientResponse: {2} status: {3}.",
                             GetCallerInfo(), request.ToString(), response.ToString(), status);
                if (status == 0)
                {
                    SendResponse(1, token, response);
                }
                else
                {
                    SendResponse(1, token, status);
                }
                break;
            }

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


                Bgs.Protocol.NoData   response = new Bgs.Protocol.NoData();
                BattlenetRpcErrorCode status   = HandlePresenceChannelCreated(request, response);
                Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method GameUtilitiesService.PresenceChannelCreated(bgs.protocol.game_utilities.v1.PresenceChannelCreatedRequest: {1}) returned bgs.protocol.NoData: {2} status: {3}.",
                             GetCallerInfo(), request.ToString(), response.ToString(), status);
                if (status == 0)
                {
                    SendResponse(2, token, response);
                }
                else
                {
                    SendResponse(2, token, status);
                }
                break;
            }

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


                GetPlayerVariablesResponse response = new GetPlayerVariablesResponse();
                BattlenetRpcErrorCode      status   = HandleGetPlayerVariables(request, response);
                Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method GameUtilitiesService.GetPlayerVariables(bgs.protocol.game_utilities.v1.GetPlayerVariablesRequest: {1}) returned bgs.protocol.game_utilities.v1.GetPlayerVariablesResponse: {2} status: {3}.",
                             GetCallerInfo(), request.ToString(), response.ToString(), status);
                if (status == 0)
                {
                    SendResponse(3, token, response);
                }
                else
                {
                    SendResponse(3, token, status);
                }
                break;
            }

            case 6:
            {
                ServerRequest request = new ServerRequest();
                request.MergeFrom(stream);


                ServerResponse        response = new ServerResponse();
                BattlenetRpcErrorCode status   = HandleProcessServerRequest(request, response);
                Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method GameUtilitiesService.ProcessServerRequest(bgs.protocol.game_utilities.v1.ServerRequest: {1}) returned bgs.protocol.game_utilities.v1.ServerResponse: {2} status: {3}.",
                             GetCallerInfo(), request.ToString(), response.ToString(), status);
                if (status == 0)
                {
                    SendResponse(6, token, response);
                }
                else
                {
                    SendResponse(6, token, status);
                }
                break;
            }

            case 7:
            {
                GameAccountOnlineNotification request = new GameAccountOnlineNotification();
                request.MergeFrom(stream);


                BattlenetRpcErrorCode status = HandleOnGameAccountOnline(request);
                Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method GameUtilitiesService.OnGameAccountOnline(bgs.protocol.game_utilities.v1.GameAccountOnlineNotification: {1}) status: {2}.",
                             GetCallerInfo(), request.ToString(), status);
                if (status != 0)
                {
                    SendResponse(7, token, status);
                }
                break;
            }

            case 8:
            {
                GameAccountOfflineNotification request = new GameAccountOfflineNotification();
                request.MergeFrom(stream);


                BattlenetRpcErrorCode status = HandleOnGameAccountOffline(request);
                Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method GameUtilitiesService.OnGameAccountOffline(bgs.protocol.game_utilities.v1.GameAccountOfflineNotification: {1}) status: {2}.",
                             GetCallerInfo(), request.ToString(), status);
                if (status != 0)
                {
                    SendResponse(8, token, status);
                }
                break;
            }

            case 9:
            {
                GetAchievementsFileRequest request = new GetAchievementsFileRequest();
                request.MergeFrom(stream);


                GetAchievementsFileResponse response = new GetAchievementsFileResponse();
                BattlenetRpcErrorCode       status   = HandleGetAchievementsFile(request, response);
                Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method GameUtilitiesService.GetAchievementsFile(bgs.protocol.game_utilities.v1.GetAchievementsFileRequest: {1}) returned bgs.protocol.game_utilities.v1.GetAchievementsFileResponse: {2} status: {3}.",
                             GetCallerInfo(), request.ToString(), response.ToString(), status);
                if (status == 0)
                {
                    SendResponse(9, token, response);
                }
                else
                {
                    SendResponse(9, token, status);
                }
                break;
            }

            case 10:
            {
                GetAllValuesForAttributeRequest request = new GetAllValuesForAttributeRequest();
                request.MergeFrom(stream);


                GetAllValuesForAttributeResponse response = new GetAllValuesForAttributeResponse();
                BattlenetRpcErrorCode            status   = HandleGetAllValuesForAttribute(request, response);
                Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method GameUtilitiesService.GetAllValuesForAttribute(bgs.protocol.game_utilities.v1.GetAllValuesForAttributeRequest: {1}) returned bgs.protocol.game_utilities.v1.GetAllValuesForAttributeResponse: {2} status: {3}.",
                             GetCallerInfo(), request.ToString(), response.ToString(), status);
                if (status == 0)
                {
                    SendResponse(10, token, response);
                }
                else
                {
                    SendResponse(10, token, status);
                }
                break;
            }

            default:
                Log.outError(LogFilter.ServiceProtobuf, "Bad method id {0}.", methodId);
                SendResponse(methodId, token, BattlenetRpcErrorCode.RpcInvalidMethod);
                break;
            }
        }
 BattlenetRpcErrorCode HandleGetAllValuesForAttribute(GetAllValuesForAttributeRequest request, GetAllValuesForAttributeResponse response)
 {
     return(_session.HandleGetAllValuesForAttribute(request, response));
 }
        public static async void HandleGetAllValuesForAttributeRequest(GetAllValuesForAttributeRequest getAllValuesForAttributeRequest, BnetSession session)
        {
            if (getAllValuesForAttributeRequest.AttributeKey == "Command_RealmListRequest_v1_b9")
            {
                var getAllValuesForAttributeResponse = new GetAllValuesForAttributeResponse();

                getAllValuesForAttributeResponse.AttributeValue.Add(new Variant { StringValue = "0-0-0" });

                await session.Send(getAllValuesForAttributeResponse);
            }
        }
        public static void HandleGetAllValuesForAttributeRequest(AuthSession session, GetAllValuesForAttributeRequest getAllValuesForAttributeRequest)
        {
            if (GameUtilitiesService.smethod_0(getAllValuesForAttributeRequest.AttributeKey, Module.smethod_34 <string>(1676619706u)))
            {
                while (true)
                {
IL_99:
                    uint arg_79_0 = 2982734585u;
                    while (true)
                    {
                        uint num;
                        switch ((num = (arg_79_0 ^ 4261002523u)) % 5u)
                        {
                        case 0u:
                            goto IL_99;

                        case 2u:
                        {
                            GetAllValuesForAttributeResponse getAllValuesForAttributeResponse;
                            getAllValuesForAttributeResponse.AttributeValue.Add(new Variant
                                {
                                    StringValue = Module.smethod_34 <string>(3567087365u)
                                });
                            arg_79_0 = (num * 326043060u ^ 433382969u);
                            continue;
                        }

                        case 3u:
                        {
                            GetAllValuesForAttributeResponse getAllValuesForAttributeResponse = new GetAllValuesForAttributeResponse();
                            arg_79_0 = (num * 1354836642u ^ 4091919859u);
                            continue;
                        }

                        case 4u:
                        {
                            GetAllValuesForAttributeResponse getAllValuesForAttributeResponse;
                            session.Send(getAllValuesForAttributeResponse);
                            arg_79_0 = (num * 122349368u ^ 2297805052u);
                            continue;
                        }
                        }
                        goto Block_2;
                    }
                }
                Block_2 :;
            }
        }