public ModeratorRoomChatlogComposer(Room room, ICollection <ChatlogEntry> chats)
            : base(ServerPacketHeader.ModeratorRoomChatlogMessageComposer)
        {
            WriteByte(1);
            WriteShort(2);//Count
            WriteString("roomName");
            WriteByte(2);
            WriteString(room.Name);
            WriteString("roomId");
            WriteByte(1);
            WriteInteger(room.Id);

            WriteShort(chats.Count);
            foreach (var Entry in chats)
            {
                var Username = "******";
                if (Entry.PlayerNullable() != null)
                {
                    Username = Entry.PlayerNullable().Username;
                }

                WriteString(UnixUtilities.FromUnixTimestamp(Entry.Timestamp).ToShortTimeString());                     // time?
                WriteInteger(Entry.PlayerId);                                                                          // User Id
                WriteString(Username);                                                                                 // Username
                WriteString(!string.IsNullOrEmpty(Entry.Message) ? Entry.Message : "** user sent a blank message **"); // Message
                WriteBoolean(false);                                                                                   //TODO, AI's?
            }
        }
Пример #2
0
        public ModeratorUserChatlogComposer(Habbo habbo, List <KeyValuePair <RoomData, List <ChatlogEntry> > > chatlogs)
            : base(ServerPacketHeader.ModeratorUserChatlogMessageComposer)
        {
            WriteInteger(habbo.Id);
            WriteString(habbo.Username);

            WriteInteger(chatlogs.Count); // Room Visits Count
            foreach (var Chatlog in chatlogs)
            {
                WriteByte(1);
                WriteShort(2);//Count
                WriteString("roomName");
                WriteByte(2);
                WriteString(Chatlog.Key.Name); // room name
                WriteString("roomId");
                WriteByte(1);
                WriteInteger(Chatlog.Key.Id);

                WriteShort(Chatlog.Value.Count); // Chatlogs Count
                foreach (var Entry in Chatlog.Value)
                {
                    var Username = "******";
                    if (Entry.PlayerNullable() != null)
                    {
                        Username = Entry.PlayerNullable().Username;
                    }

                    WriteString(UnixUtilities.FromUnixTimestamp(Entry.Timestamp).ToShortTimeString());
                    WriteInteger(Entry.PlayerId);                                                                          // UserId of message
                    WriteString(Username);                                                                                 // Username of message
                    WriteString(!string.IsNullOrEmpty(Entry.Message) ? Entry.Message : "** user sent a blank message **"); // Message
                    WriteBoolean(habbo.Id == Entry.PlayerId);
                }
            }
        }
        public ModeratorTicketChatlogComposer(ModerationTicket ticket, RoomData roomData, double timestamp)
            : base(ServerPacketHeader.ModeratorTicketChatlogMessageComposer)
        {
            WriteInteger(ticket.Id);
            WriteInteger(ticket.Sender != null ? ticket.Sender.Id : 0);
            WriteInteger(ticket.Reported != null ? ticket.Reported.Id : 0);
            WriteInteger(roomData.Id);

            WriteByte(1);
            WriteShort(2);//Count
            WriteString("roomName");
            WriteByte(2);
            WriteString(roomData.Name);
            WriteString("roomId");
            WriteByte(1);
            WriteInteger(roomData.Id);

            WriteShort(ticket.ReportedChats.Count);
            foreach (var Chat in ticket.ReportedChats)
            {
                WriteString(UnixUtilities.FromUnixTimestamp(timestamp).ToShortTimeString());
                WriteInteger(ticket.Id);
                WriteString(ticket.Reported != null ? ticket.Reported.Username : "******");
                WriteString(Chat);
                WriteBoolean(false);
            }
        }
 public ModeratorSupportTicketComposer(int Id, ModerationTicket Ticket)
     : base(ServerPacketHeader.ModeratorSupportTicketMessageComposer)
 {
     WriteInteger(Ticket.Id);                                                                                             // Id
     WriteInteger(Ticket.GetStatus(Id));                                                                                  // Tab ID
     WriteInteger(Ticket.Type);                                                                                           // Type
     WriteInteger(Ticket.Category);                                                                                       // Category
     WriteInteger(Convert.ToInt32((DateTime.Now - UnixUtilities.FromUnixTimestamp(Ticket.Timestamp)).TotalMilliseconds)); // This should fix the overflow?
     WriteInteger(Ticket.Priority);                                                                                       // Priority
     WriteInteger(0);                                                                                                     //??
     WriteInteger(Ticket.Sender == null ? 0 : Ticket.Sender.Id);                                                          // Sender ID
     //base.WriteInteger(1);
     WriteString(Ticket.Sender == null ? string.Empty : Ticket.Sender.Username);                                          // Sender Name
     WriteInteger(Ticket.Reported == null ? 0 : Ticket.Reported.Id);                                                      // Reported ID
     WriteString(Ticket.Reported == null ? string.Empty : Ticket.Reported.Username);                                      // Reported Name
     WriteInteger(Ticket.Moderator == null ? 0 : Ticket.Moderator.Id);                                                    // Moderator ID
     WriteString(Ticket.Moderator == null ? string.Empty : Ticket.Moderator.Username);                                    // Mod Name
     WriteString(Ticket.Issue);                                                                                           // Issue
     WriteInteger(Ticket.Room == null ? 0 : Ticket.Room.Id);                                                              // Room Id
     WriteInteger(0);
     {
         // push String
         // push Integer
         // push Integer
     }
 }
Пример #5
0
 public CallForHelpPendingCallsComposer(ModerationTicket ticket)
     : base(ServerPacketHeader.CallForHelpPendingCallsMessageComposer)
 {
     WriteInteger(1);// Count for whatever reason?
     {
         WriteString(ticket.Id.ToString());
         WriteString(UnixUtilities.FromUnixTimestamp(ticket.Timestamp).ToShortTimeString());// "11-02-2017 04:07:05";
         WriteString(ticket.Issue);
     }
 }
        public ModeratorUserRoomVisitsComposer(Habbo Data, Dictionary <double, RoomData> Visits)
            : base(ServerPacketHeader.ModeratorUserRoomVisitsMessageComposer)
        {
            WriteInteger(Data.Id);
            WriteString(Data.Username);
            WriteInteger(Visits.Count);

            foreach (var Visit in Visits)
            {
                WriteInteger(Visit.Value.Id);
                WriteString(Visit.Value.Name);
                WriteInteger(UnixUtilities.FromUnixTimestamp(Visit.Key).Hour);
                WriteInteger(UnixUtilities.FromUnixTimestamp(Visit.Key).Minute);
            }
        }
Пример #7
0
        public ModeratorInitComposer(ICollection <string> UserPresets, ICollection <string> RoomPresets, ICollection <ModerationTicket> Tickets)
            : base(ServerPacketHeader.ModeratorInitMessageComposer)
        {
            WriteInteger(Tickets.Count);
            foreach (var Ticket in Tickets)
            {
                WriteInteger(Ticket.Id);                                                                                             // Id
                WriteInteger(Ticket.GetStatus(Id));                                                                                  // Tab ID
                WriteInteger(Ticket.Type);                                                                                           // Type
                WriteInteger(Ticket.Category);                                                                                       // Category
                WriteInteger(Convert.ToInt32((DateTime.Now - UnixUtilities.FromUnixTimestamp(Ticket.Timestamp)).TotalMilliseconds)); // This should fix the overflow?
                WriteInteger(Ticket.Priority);                                                                                       // Priority
                WriteInteger(Ticket.Sender == null ? 0 : Ticket.Sender.Id);                                                          // Sender ID
                WriteInteger(1);
                WriteString(Ticket.Sender == null ? string.Empty : Ticket.Sender.Username);                                          // Sender Name
                WriteInteger(Ticket.Reported == null ? 0 : Ticket.Reported.Id);                                                      // Reported ID
                WriteString(Ticket.Reported == null ? string.Empty : Ticket.Reported.Username);                                      // Reported Name
                WriteInteger(Ticket.Moderator == null ? 0 : Ticket.Moderator.Id);                                                    // Moderator ID
                WriteString(Ticket.Moderator == null ? string.Empty : Ticket.Moderator.Username);                                    // Mod Name
                WriteString(Ticket.Issue);                                                                                           // Issue
                WriteInteger(Ticket.Room == null ? 0 : Ticket.Room.Id);                                                              // Room Id
                WriteInteger(0);                                                                                                     //LOOP
            }

            WriteInteger(UserPresets.Count);
            foreach (var pre in UserPresets)
            {
                WriteString(pre);
            }

            /*base.WriteInteger(UserActionPresets.Count);
             * foreach (KeyValuePair<string, List<ModerationPresetActionMessages>> Cat in UserActionPresets.ToList())
             * {
             *  base.WriteString(Cat.Key);
             *  base.WriteBoolean(true);
             *  base.WriteInteger(Cat.Value.Count);
             *  foreach (ModerationPresetActionMessages Preset in Cat.Value.ToList())
             *  {
             *      base.WriteString(Preset.Caption);
             *      base.WriteString(Preset.MessageText);
             *      base.WriteInteger(Preset.BanTime); // Account Ban Hours
             *      base.WriteInteger(Preset.IPBanTime); // IP Ban Hours
             *      base.WriteInteger(Preset.MuteTime); // Mute in Hours
             *      base.WriteInteger(0);//Trading lock duration
             *      base.WriteString(Preset.Notice + "\n\nPlease Note: Avatar ban is an IP ban!");
             *      base.WriteBoolean(false);//Show HabboWay
             *  }
             * }*/

            // TODO: Figure out
            WriteInteger(0);
            {
                //Loop a string.
            }

            WriteBoolean(true); // Ticket right
            WriteBoolean(true); // Chatlogs
            WriteBoolean(true); // User actions alert etc
            WriteBoolean(true); // Kick users
            WriteBoolean(true); // Ban users
            WriteBoolean(true); // Caution etc
            WriteBoolean(true); // Love you, Tom

            WriteInteger(RoomPresets.Count);
            foreach (var pre in RoomPresets)
            {
                WriteString(pre);
            }
        }