コード例 #1
0
        internal ServerMessage SerializeOfflineMessages(OfflineMessage Message)
        {
            ServerMessage serverMessage = new ServerMessage(Outgoing.ConsoleChatMessageComposer);

            serverMessage.AppendUInt(Message.FromId);
            serverMessage.AppendString(Message.Message);
            serverMessage.AppendInt32(checked ((int)unchecked ((double)CyberEnvironment.GetUnixTimestamp() - Message.Timestamp)));
            return(serverMessage);
        }
コード例 #2
0
 internal void SendInstantMessage(uint ToId, string Message)
 {
     checked
     {
         if (AntiPublicistas.CheckPublicistas(Message))
         {
             GetClient().PublicistaCount += 1;
             this.GetClient().HandlePublicista(Message);
             return;
         }
         if (!this.FriendshipExists(ToId))
         {
             this.DeliverInstantMessageError(6, ToId);
             return;
         }
         GameClient clientByUserID = CyberEnvironment.GetGame().GetClientManager().GetClientByUserID(ToId);
         if (clientByUserID == null || clientByUserID.GetHabbo().GetMessenger() == null)
         {
             if (CyberEnvironment.OfflineMessages.ContainsKey(ToId))
             {
                 CyberEnvironment.OfflineMessages[ToId].Add(new OfflineMessage(this.GetClient().GetHabbo().Id, Message, (double)CyberEnvironment.GetUnixTimestamp()));
             }
             else
             {
                 CyberEnvironment.OfflineMessages.Add(ToId, new List <OfflineMessage>());
                 CyberEnvironment.OfflineMessages[ToId].Add(new OfflineMessage(this.GetClient().GetHabbo().Id, Message, (double)CyberEnvironment.GetUnixTimestamp()));
             }
             OfflineMessage.SaveMessage(CyberEnvironment.GetDatabaseManager().getQueryReactor(), ToId, this.GetClient().GetHabbo().Id, Message);
             return;
         }
         if (this.GetClient().GetHabbo().Muted)
         {
             this.DeliverInstantMessageError(4, ToId);
             return;
         }
         if (clientByUserID.GetHabbo().Muted)
         {
             this.DeliverInstantMessageError(3, ToId);
         }
         if (Message == "")
         {
             return;
         }
         clientByUserID.GetHabbo().GetMessenger().DeliverInstantMessage(Message, this.UserId);
         // CAUSES LAG: this.LogPM(this.UserId, ToId, Message);
     }
 }