Ejemplo n.º 1
0
        private void HandleChannelSubscriber_NotifySendMessage(RPCContext context)
        {
            SendMessageNotification sendMessageNotification = SendMessageNotification.ParseFrom(context.Payload);

            base.ApiLog.LogDebug("HandleChannelSubscriber_NotifySendMessage: " + sendMessageNotification);
            ChannelAPI.ChannelReferenceObject channelReferenceObject = this.GetChannelReferenceObject(context.Header.ObjectId);
            if (channelReferenceObject == null)
            {
                base.ApiLog.LogError("HandleChannelSubscriber_NotifySendMessage had unexpected traffic for objectId : " + context.Header.ObjectId);
                return;
            }
            ChannelAPI.ChannelType channelType = channelReferenceObject.m_channelData.m_channelType;
            if (channelType == ChannelAPI.ChannelType.PARTY_CHANNEL)
            {
                this.m_battleNet.Party.PartyMessageReceived(channelReferenceObject, sendMessageNotification);
            }
        }
Ejemplo n.º 2
0
		public override void NotifySendMessage(Google.ProtocolBuffers.IRpcController controller, SendMessageNotification request, Action<bnet.protocol.NO_RESPONSE> done) {
			throw new NotImplementedException();
		}
Ejemplo n.º 3
0
 public async Task SendMessage(SendMessageNotification messageNotification)
 {
     await Clients.All.BroadcastMessage(messageNotification);
 }
Ejemplo n.º 4
0
 BattlenetRpcErrorCode HandleOnSendMessage(SendMessageNotification request)
 {
     Log.outError(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method ChannelListener.OnSendMessage: {1}",
                  GetCallerInfo(), request.ToString());
     return(BattlenetRpcErrorCode.RpcNotImplemented);
 }
Ejemplo n.º 5
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;
            }
        }
Ejemplo n.º 6
0
 public override void NotifySendMessage(Google.ProtocolBuffers.IRpcController controller, SendMessageNotification request, Action <bnet.protocol.NO_RESPONSE> done)
 {
     throw new NotImplementedException();
 }