예제 #1
0
        /// <summary>
        /// 聊天计费倍率设置
        /// </summary>
        /// <param name="messageString"></param>
        private void ProChatFeeRateSet(string messageString)
        {
            var client = _connections.GetConnection(Context.ConnectionId);

            if (client == null || client.Nodeid == 0)
            {
                this.OnReconnected();
                return;
            }
            var chatFeeRateSet = new ChatFeeRateSet(messageString);

            MessageInfo("调用聊天计费倍率设置逻辑之前");
            var result = chatFeeRateFacade.ProChatFeeRateSet(chatFeeRateSet.ToBytes(), client.Nodeid);

            MessageInfo("调用聊天计费倍率设置逻辑之后");
            if (result.Count == 0)
            {
                MessageInfo("调用聊天计费倍率设置逻辑失败");
            }
            foreach (var item in result)
            {
                var receiveClient = _connections.GetConnections().Values.FirstOrDefault(c => c.Nodeid == item.GetNodeid());
                SendChatMessage(receiveClient, item.ToJson());
            }
        }
예제 #2
0
 /// <summary>
 /// 向服务器发送"倍率设置"消息
 /// </summary>
 /// <param name="chatFeeRateSet"></param>
 /// <returns></returns>
 public bool SendMessageRateSet(ChatFeeRateSet chatFeeRateSet)
 {
     SendData(chatFeeRateSet.ToBytes());
     OnRaiseMsgSendEvent(chatFeeRateSet.Header.Command_Id, chatFeeRateSet, "发送消息:" + chatFeeRateSet.ToString());
     return(true);
 }