Ejemplo n.º 1
0
 BattlenetRpcErrorCode HandleOnChallengeUser(ChallengeUserRequest request)
 {
     Log.outError(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method ChallengeListener.OnChallengeUser: {1}",
                  GetCallerInfo(), request.ToString());
     return(BattlenetRpcErrorCode.RpcNotImplemented);
 }
Ejemplo n.º 2
0
        public override void CallServerMethod(uint token, uint methodId, CodedInputStream stream)
        {
            switch (methodId)
            {
            case 1:
            {
                ChallengeUserRequest request = new ChallengeUserRequest();
                request.MergeFrom(stream);


                BattlenetRpcErrorCode status = HandleOnChallengeUser(request);
                Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method ChallengeListener.OnChallengeUser(bgs.protocol.challenge.v1.ChallengeUserRequest: {1} status: {2}.",
                             GetCallerInfo(), request.ToString(), status);
                if (status != 0)
                {
                    SendResponse(token, status);
                }
                break;
            }

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


                BattlenetRpcErrorCode status = HandleOnChallengeResult(request);
                Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method ChallengeListener.OnChallengeResult(bgs.protocol.challenge.v1.ChallengeResultRequest: {1} status: {2}.",
                             GetCallerInfo(), request.ToString(), status);
                if (status != 0)
                {
                    SendResponse(token, status);
                }
                break;
            }

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


                BattlenetRpcErrorCode status = HandleOnExternalChallenge(request);
                Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method ChallengeListener.OnExternalChallenge(bgs.protocol.challenge.v1.ChallengeExternalRequest: {1} status: {2}.",
                             GetCallerInfo(), request.ToString(), status);
                if (status != 0)
                {
                    SendResponse(token, status);
                }
                break;
            }

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


                BattlenetRpcErrorCode status = HandleOnExternalChallengeResult(request);
                Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method ChallengeListener.OnExternalChallengeResult(bgs.protocol.challenge.v1.ChallengeExternalResult: {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;
            }
        }