Ejemplo n.º 1
0
 BattlenetRpcErrorCode HandleOnUpdateFriendState(UpdateFriendStateNotification request)
 {
     Log.outError(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method FriendsListener.OnUpdateFriendState: {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:
            {
                FriendNotification request = new FriendNotification();
                request.MergeFrom(stream);


                BattlenetRpcErrorCode status = HandleOnFriendAdded(request);
                Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method FriendsListener.OnFriendAdded(bgs.protocol.friends.v1.FriendNotification: {1}) status: {2}.",
                             GetCallerInfo(), request.ToString(), status);
                if (status != 0)
                {
                    SendResponse(token, status);
                }
                break;
            }

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


                BattlenetRpcErrorCode status = HandleOnFriendRemoved(request);
                Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method FriendsListener.OnFriendRemoved(bgs.protocol.friends.v1.FriendNotification: {1}) status: {2}.",
                             GetCallerInfo(), request.ToString(), status);
                if (status != 0)
                {
                    SendResponse(token, status);
                }
                break;
            }

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


                BattlenetRpcErrorCode status = HandleOnReceivedInvitationAdded(request);
                Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method FriendsListener.OnReceivedInvitationAdded(bgs.protocol.friends.v1.InvitationNotification: {1}) status: {2}.",
                             GetCallerInfo(), request.ToString(), status);
                if (status != 0)
                {
                    SendResponse(token, status);
                }
                break;
            }

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


                BattlenetRpcErrorCode status = HandleOnReceivedInvitationRemoved(request);
                Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method FriendsListener.OnReceivedInvitationRemoved(bgs.protocol.friends.v1.InvitationNotification: {1}) status: {2}.",
                             GetCallerInfo(), request.ToString(), status);
                if (status != 0)
                {
                    SendResponse(token, status);
                }
                break;
            }

            case 5:
            {
                InvitationNotification request = new InvitationNotification();
                request.MergeFrom(stream);


                BattlenetRpcErrorCode status = HandleOnSentInvitationAdded(request);
                Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method FriendsListener.OnSentInvitationAdded(bgs.protocol.friends.v1.InvitationNotification: {1}) status: {2}.",
                             GetCallerInfo(), request.ToString(), status);
                if (status != 0)
                {
                    SendResponse(token, status);
                }
                break;
            }

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


                BattlenetRpcErrorCode status = HandleOnSentInvitationRemoved(request);
                Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method FriendsListener.OnSentInvitationRemoved(bgs.protocol.friends.v1.InvitationNotification: {1}) status: {2}.",
                             GetCallerInfo(), request.ToString(), status);
                if (status != 0)
                {
                    SendResponse(token, status);
                }
                break;
            }

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


                BattlenetRpcErrorCode status = HandleOnUpdateFriendState(request);
                Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method FriendsListener.OnUpdateFriendState(bgs.protocol.friends.v1.UpdateFriendStateNotification: {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;
            }
        }