Пример #1
0
 BattlenetRpcErrorCode HandleOnMemberAdded(MemberAddedNotification request)
 {
     Log.outError(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method ChannelListener.OnMemberAdded: {1}",
                  GetCallerInfo(), request.ToString());
     return(BattlenetRpcErrorCode.RpcNotImplemented);
 }
Пример #2
0
        public override void CallServerMethod(uint token, uint methodId, CodedInputStream stream)
        {
            switch (methodId)
            {
            case 1:
            {
                JoinNotification request = new JoinNotification();
                request.MergeFrom(stream);


                BattlenetRpcErrorCode status = HandleOnJoin(request);
                Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method ChannelListener.OnJoin(bgs.protocol.channel.v1.JoinNotification: {1}) status: {2}.",
                             GetCallerInfo(), request.ToString(), status);
                if (status != 0)
                {
                    SendResponse(token, status);
                }
                break;
            }

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


                BattlenetRpcErrorCode status = HandleOnMemberAdded(request);
                Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method ChannelListener.OnMemberAdded(bgs.protocol.channel.v1.MemberAddedNotification: {1}) status: {2}.",
                             GetCallerInfo(), request.ToString(), status);
                if (status != 0)
                {
                    SendResponse(token, status);
                }
                break;
            }

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


                BattlenetRpcErrorCode status = HandleOnLeave(request);
                Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method ChannelListener.OnLeave(bgs.protocol.channel.v1.LeaveNotification: {1}) status: {2}.",
                             GetCallerInfo(), request.ToString(), status);
                if (status != 0)
                {
                    SendResponse(token, status);
                }
                break;
            }

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


                BattlenetRpcErrorCode status = HandleOnMemberRemoved(request);
                Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method ChannelListener.OnMemberRemoved(bgs.protocol.channel.v1.MemberRemovedNotification: {1}) status: {2}.",
                             GetCallerInfo(), request.ToString(), status);
                if (status != 0)
                {
                    SendResponse(token, status);
                }
                break;
            }

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


                BattlenetRpcErrorCode status = HandleOnSendMessage(request);
                Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method ChannelListener.OnSendMessage(bgs.protocol.channel.v1.SendMessageNotification: {1}) status: {2}.",
                             GetCallerInfo(), request.ToString(), status);
                if (status != 0)
                {
                    SendResponse(token, status);
                }
                break;
            }

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


                BattlenetRpcErrorCode status = HandleOnUpdateChannelState(request);
                Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method ChannelListener.OnUpdateChannelState(bgs.protocol.channel.v1.UpdateChannelStateNotification: {1}) status: {2}.",
                             GetCallerInfo(), request.ToString(), status);
                if (status != 0)
                {
                    SendResponse(token, status);
                }
                break;
            }

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


                BattlenetRpcErrorCode status = HandleOnUpdateMemberState(request);
                Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method ChannelListener.OnUpdateMemberState(bgs.protocol.channel.v1.UpdateMemberStateNotification: {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;
            }
        }