예제 #1
0
 public void Send(ChatType chatType, int chatID, string content)
 {
     var chat = new ChatData
     {
         Version = NextVersion,
         FromUserID = _user.UserId.ToInt(),
         FromUserName = _user.NickName,
         ToUserID = 0,
         ChatType = chatType,
         ChatID = chatID,
         Content = content,
         SendDate = DateTime.Now,
         RoomId = _user.Property.RoomId,
         TableId = _user.Property.TableId
     };
     _user.Property.ChatDate = DateTime.Now;
     Send(chat);
 }
예제 #2
0
 public void SendWhisper(GameUser toUser, string content)
 {
     if (_user == null || toUser == null)
     {
         throw new Exception("发送人或接收人为空值");
     }
     _user.Property.ChatDate = DateTime.Now;
     var chat = new ChatData
     {
         Version = 0,
         FromUserID = _user.UserId,
         FromUserName = _user.NickName,
         ToUserID = toUser.UserId.ToInt(),
         ChatType = ChatType.Whisper,
         Content = content,
         SendDate = DateTime.Now,
         RoomId = _user.Property.RoomId,
         TableId = _user.Property.TableId
     };
     SendWhisper(toUser.UserId.ToInt(), chat);
 }
예제 #3
0
 public void SystemSend(ChatType chatType, string content)
 {
     //if (chatType == ChatType.Whisper) return;
     var chat = new ChatData
     {
         Version = NextVersion,
         FromUserID = LanguageManager.GetLang().SystemUserId,
         FromUserName = LanguageManager.GetLang().KingName,
         ToUserID = 0,
         ChatType = chatType,
         Content = content,
         SendDate = DateTime.Now,
         RoomId = _user.Property.RoomId,
         TableId = _user.Property.TableId
     };
     Send(chat);
 }