Пример #1
0
    public void AnswerChallenge(ulong challengeID, string answer)
    {
        ChallengeAnsweredRequest message = new ChallengeAnsweredRequest();

        message.SetAnswer("pass");
        byte[] val = new byte[] { 2, 3, 4, 5, 6, 7, 0, 0 };
        message.SetData(val);
        if (message.IsInitialized)
        {
            RPCContext context = base.m_rpcConnection.QueueRequest(this.ChallengeService.Id, 2, message, new RPCContextDelegate(this.ChallengeAnsweredCallback), 0);
            this.s_pendingAnswers.Add(context.Header.Token, challengeID);
        }
    }
Пример #2
0
        public void AnswerChallenge(ulong challengeID, string answer)
        {
            ChallengeAnsweredRequest challengeAnsweredRequest = new ChallengeAnsweredRequest();

            challengeAnsweredRequest.SetAnswer("pass");
            byte[] data = new byte[]
            {
                2,
                3,
                4,
                5,
                6,
                7
            };
            challengeAnsweredRequest.SetData(data);
            if (!challengeAnsweredRequest.IsInitialized)
            {
                return;
            }
            RPCContext rpccontext = this.m_rpcConnection.QueueRequest(this.ChallengeService.Id, 2u, challengeAnsweredRequest, new RPCContextDelegate(this.ChallengeAnsweredCallback), 0u);

            this.s_pendingAnswers.Add(rpccontext.Header.Token, challengeID);
        }
Пример #3
0
        public override void CallServerMethod(uint token, uint methodId, CodedInputStream stream)
        {
            switch (methodId)
            {
            case 1:
            {
                ChallengePickedRequest request = new ChallengePickedRequest();
                request.MergeFrom(stream);


                ChallengePickedResponse response = new ChallengePickedResponse();
                BattlenetRpcErrorCode   status   = HandleChallengePicked(request, response);
                Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method ChallengeService.ChallengePicked(bgs.protocol.challenge.v1.ChallengePickedRequest: {1}) returned bgs.protocol.challenge.v1.ChallengePickedResponse: {2} status: {3}.",
                             GetCallerInfo(), request.ToString(), response.ToString(), status);
                if (status == 0)
                {
                    SendResponse(token, response);
                }
                else
                {
                    SendResponse(token, status);
                }
                break;
            }

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


                ChallengeAnsweredResponse response = new ChallengeAnsweredResponse();
                BattlenetRpcErrorCode     status   = HandleChallengeAnswered(request, response);
                Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method ChallengeService.ChallengeAnswered(bgs.protocol.challenge.v1.ChallengeAnsweredRequest: {1}) returned bgs.protocol.challenge.v1.ChallengeAnsweredResponse: {2} status: {3}.",
                             GetCallerInfo(), request.ToString(), response.ToString(), status);
                if (status == 0)
                {
                    SendResponse(token, response);
                }
                else
                {
                    SendResponse(token, status);
                }
                break;
            }

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


                NoData response = new NoData();
                BattlenetRpcErrorCode status = HandleChallengeCancelled(request, response);
                Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method ChallengeService.ChallengeCancelled(bgs.protocol.challenge.v1.ChallengeCancelledRequest: {1}) returned bgs.protocol.NoData: {2} status: {3}.",
                             GetCallerInfo(), request.ToString(), response.ToString(), status);
                if (status == 0)
                {
                    SendResponse(token, response);
                }
                else
                {
                    SendResponse(token, status);
                }
                break;
            }

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


                SendChallengeToUserResponse response = new SendChallengeToUserResponse();
                BattlenetRpcErrorCode       status   = HandleSendChallengeToUser(request, response);
                Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method ChallengeService.SendChallengeToUser(bgs.protocol.challenge.v1.SendChallengeToUserRequest: {1}) returned bgs.protocol.challenge.v1.SendChallengeToUserResponse: {2} status: {3}.",
                             GetCallerInfo(), request.ToString(), response.ToString(), status);
                if (status == 0)
                {
                    SendResponse(token, response);
                }
                else
                {
                    SendResponse(token, status);
                }
                break;
            }

            default:
                Log.outError(LogFilter.ServiceProtobuf, "Bad method id {0}.", methodId);
                SendResponse(token, BattlenetRpcErrorCode.RpcInvalidMethod);
                break;
            }
        }
Пример #4
0
 BattlenetRpcErrorCode HandleChallengeAnswered(ChallengeAnsweredRequest request, ChallengeAnsweredResponse response)
 {
     Log.outError(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method ChallengeService.ChallengeAnswered: {1}",
                  GetCallerInfo(), request.ToString());
     return(BattlenetRpcErrorCode.RpcNotImplemented);
 }
Пример #5
0
        public void AnswerChallenge(ulong challengeID, string answer)
        {
            ChallengeAnsweredRequest challengeAnsweredRequest = new ChallengeAnsweredRequest();

            challengeAnsweredRequest.SetAnswer("pass");
            challengeAnsweredRequest.SetData(new byte[] { typeof(< PrivateImplementationDetails >).GetField("$field-0702550BB56A81BC051BA8F9BCD15ACBBB08D7EF").FieldHandle });