public ModeratorTicketChatlogComposer(SupportTicket Ticket, RoomData RoomData, double Timestamp) : base(ServerPacketHeader.ModeratorTicketChatlogMessageComposer) { base.WriteInteger(Ticket.TicketId); base.WriteInteger(Ticket.SenderId); base.WriteInteger(Ticket.ReportedId); base.WriteInteger(RoomData.Id); base.WriteByte(1); base.WriteShort(2);//Count base.WriteString("roomName"); base.WriteByte(2); base.WriteString(RoomData.Name); base.WriteString("roomId"); base.WriteByte(1); base.WriteInteger(RoomData.Id); base.WriteShort(Ticket.ReportedChats.Count); foreach (string Chat in Ticket.ReportedChats) { Habbo Habbo = RocketEmulador.GetHabboById(Ticket.ReportedId); int time2 = ((int)RocketEmulador.GetUnixTimestamp() - Convert.ToInt32(Timestamp)) * 1000; DateTime time = new DateTime(time2); base.WriteString(time.ToString("hh:mm")); //base.WriteString(time2); //base.WriteInteger(((int)RocketEmulador.GetUnixTimestamp() - Convert.ToInt32(Timestamp)) * 1000); base.WriteInteger(Ticket.ReportedId); base.WriteString(Habbo != null ? Habbo.Username : "******"); base.WriteString(Chat); base.WriteBoolean(false); } }
public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet) { int userID = Packet.PopInt(); Boolean IsMe = Packet.PopBoolean(); Habbo targetData = RocketEmulador.GetHabboById(userID); if (targetData == null) { Session.SendNotification("An error occured whilst finding that user's profile."); return; } List <Group> Groups = RocketEmulador.GetGame().GetGroupManager().GetGroupsForUser(targetData.Id); int friendCount = 0; using (IQueryAdapter dbClient = RocketEmulador.GetDatabaseManager().GetQueryReactor()) { dbClient.SetQuery("SELECT COUNT(0) FROM `messenger_friendships` WHERE (`user_one_id` = @userid OR `user_two_id` = @userid)"); dbClient.AddParameter("userid", userID); friendCount = dbClient.getInteger(); } Session.SendMessage(new ProfileInformationComposer(targetData, Session, Groups, friendCount)); }
public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet) { if (Session == null || Session.GetHabbo() == null) { return; } if (!Session.GetHabbo().GetPermissions().HasRight("mod_tool")) { return; } int UserId = Packet.PopInt(); Habbo Habbo = RocketEmulador.GetHabboById(UserId); if (Habbo == null) { Session.SendNotification("Oops, we couldn't find this user."); return; } try { Session.SendMessage(new ModeratorUserChatlogComposer(UserId)); } catch { Session.SendNotification("Overflow :/"); } }
public bool Execute(params object[] Params) { if (Params == null || Params.Length == 0) { return(false); } Habbo Player = (Habbo)Params[0]; if (Player == null || Player.GetClient() == null) { return(false); } Habbo Owner = RocketEmulador.GetHabboById(Player.Id); if (Owner == null || !Owner.GetPermissions().HasRight("room_item_wired_rewards")) { Player.GetClient().SendMessage(new RoomNotificationComposer("supernoti", "message", "Você não tem permissão para utilizar este wired...")); } RoomUser User = Player.CurrentRoom.GetRoomUserManager().GetRoomUserByHabbo(Player.Username); if (User == null) { return(false); } if (string.IsNullOrEmpty(this.StringData)) { return(false); } string HandI = this.StringData; User.CarryItem(Convert.ToInt32(HandI)); return(true); }
public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet) { int GroupId = Packet.PopInt(); int UserId = Packet.PopInt(); Group Group = null; if (!RocketEmulador.GetGame().GetGroupManager().TryGetGroup(GroupId, out Group)) { return; } if ((Session.GetHabbo().Id != Group.CreatorId && !Group.IsAdmin(Session.GetHabbo().Id)) && !Session.GetHabbo().GetPermissions().HasRight("fuse_group_accept_any")) { return; } if (!Group.HasRequest(UserId)) { return; } Habbo Habbo = RocketEmulador.GetHabboById(UserId); if (Habbo == null) { Session.SendNotification("Oops, an error occurred whilst finding this user."); return; } Group.HandleRequest(UserId, true); Session.SendMessage(new GroupMemberUpdatedComposer(GroupId, Habbo, 4)); }
public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet) { int UserId = Packet.PopInt(); Habbo Habbo = RocketEmulador.GetHabboById(UserId); if (Habbo == null) { return; } Session.SendMessage(new HabboUserBadgesComposer(Habbo)); }
public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet) { if (Session == null || Session.GetHabbo() == null || !Session.GetHabbo().GetPermissions().HasRight("mod_trade_lock")) { return; } int UserId = Packet.PopInt(); string Message = Packet.PopString(); double Days = (Packet.PopInt() / 1440); string Unknown1 = Packet.PopString(); string Unknown2 = Packet.PopString(); double Length = (RocketEmulador.GetUnixTimestamp() + (Days * 86400)); Habbo Habbo = RocketEmulador.GetHabboById(UserId); if (Habbo == null) { Session.SendNotification("An error occoured whilst finding that user in the database."); return; } if (Habbo.GetPermissions().HasRight("mod_trade_lock") && !Session.GetHabbo().GetPermissions().HasRight("mod_trade_lock_any")) { Session.SendNotification("Oops, you cannot trade lock another user ranked 5 or higher."); return; } if (Days < 1) { Days = 1; } if (Days > 365) { Days = 365; } using (IQueryAdapter dbClient = RocketEmulador.GetDatabaseManager().GetQueryReactor()) { dbClient.RunQuery("UPDATE `user_info` SET `trading_locked` = '" + Length + "', `trading_locks_count` = `trading_locks_count` + '1' WHERE `user_id` = '" + Habbo.Id + "' LIMIT 1"); } if (Habbo.GetClient() != null) { Habbo.TradingLockExpiry = Length; Habbo.GetClient().SendNotification("Suas trocas foram banidas " + Days + " dia(s)!\r\rMotivo:\r\r" + Message); } }
public bool Execute(params object[] Params) { if (Params == null || Params.Length == 0) { return(false); } Habbo Owner = RocketEmulador.GetHabboById(Item.UserID); if (Owner == null || !Owner.GetPermissions().HasRight("room_item_wired_rewards")) { return(false); } Habbo Player = (Habbo)Params[0]; if (Player == null || Player.GetClient() == null) { return(false); } RoomUser User = Player.CurrentRoom.GetRoomUserManager().GetRoomUserByHabbo(Player.Username); if (User == null) { return(false); } if (String.IsNullOrEmpty(StringData)) { return(false); } int Amount; Amount = Convert.ToInt32(StringData); if (Amount > 6) { Player.GetClient().SendWhisper("A quantidade de diamantes passa dos limites"); return(false); } else { Player.GetClient().GetHabbo().Diamonds += Amount; Player.GetClient().SendMessage(new HabboActivityPointNotificationComposer(Player.GetClient().GetHabbo().Diamonds, Amount, 5)); Player.GetClient().SendNotification("Você recebeu " + Amount.ToString() + " ametista(s)!"); } return(true); }
public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet) { int GroupId = Packet.PopInt(); int UserId = Packet.PopInt(); Group Group = null; if (!RocketEmulador.GetGame().GetGroupManager().TryGetGroup(GroupId, out Group)) { return; } if (Session.GetHabbo().Id != Group.CreatorId || !Group.IsMember(UserId)) { return; } Habbo Habbo = RocketEmulador.GetHabboById(UserId); if (Habbo == null) { Session.SendNotification("Oops, an error occurred whilst finding this user."); return; } Group.TakeAdmin(UserId); Room Room = null; if (RocketEmulador.GetGame().GetRoomManager().TryGetRoom(Group.RoomId, out Room)) { RoomUser User = Room.GetRoomUserManager().GetRoomUserByHabbo(UserId); if (User != null) { if (User.Statusses.ContainsKey("flatctrl 3")) { User.RemoveStatus("flatctrl 3"); } User.UpdateNeeded = true; if (User.GetClient() != null) { User.GetClient().SendMessage(new YouAreControllerComposer(0)); } } } Session.SendMessage(new GroupMemberUpdatedComposer(GroupId, Habbo, 2)); }
public bool Execute(params object[] Params) { if (Params == null || Params.Length == 0) { return(false); } Habbo Owner = RocketEmulador.GetHabboById(Item.UserID); if (Owner == null || !Owner.GetPermissions().HasRight("room_item_wired_rewards")) { return(false); } Habbo Player = (Habbo)Params[0]; if (Player == null || Player.GetClient() == null) { return(false); } RoomUser User = Player.CurrentRoom.GetRoomUserManager().GetRoomUserByHabbo(Player.Username); if (User == null) { return(false); } if (String.IsNullOrEmpty(StringData)) { return(false); } if (Player.GetBadgeComponent().HasBadge(StringData)) { Player.GetClient().SendMessage(new WhisperComposer(User.VirtualId, "Você já tem esse emblema!", 0, User.LastBubble)); } else { Player.GetBadgeComponent().GiveBadge(StringData, true, Player.GetClient()); Player.GetClient().SendNotification("Você recebeu um emblema"); } return(true); }
public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet) { Habbo Habbo = RocketEmulador.GetHabboById(Packet.PopInt()); if (Habbo == null) { return; } var rand = new Random(); Habbo.Relationships = Habbo.Relationships.OrderBy(x => rand.Next()).ToDictionary(item => item.Key, item => item.Value); int Loves = Habbo.Relationships.Count(x => x.Value.Type == 1); int Likes = Habbo.Relationships.Count(x => x.Value.Type == 2); int Hates = Habbo.Relationships.Count(x => x.Value.Type == 3); Session.SendMessage(new GetRelationshipsComposer(Habbo, Loves, Likes, Hates)); }
public bool Execute(params object[] Params) { if (Params == null || Params.Length == 0) { return(false); } Habbo Owner = RocketEmulador.GetHabboById(this.Item.UserID); Habbo Player = (Habbo)Params[0]; if (Player == null || Player.GetClient() == null) { return(false); } if (Owner == null || !Owner.GetPermissions().HasRight("room_item_wired_rewards")) { Player.GetClient().SendMessage(new RoomNotificationComposer("supernoti", "message", "Você não tem permissão para utilizar este wired...")); return(false); } if (Player.CurrentRoom.GetRoomUserManager().GetRoomUserByHabbo(Player.Username) == null) { return(false); } if (string.IsNullOrEmpty(this.StringData)) { return(false); } if (Convert.ToInt32(this.StringData) > 6) { Player.GetClient().SendWhisper("A quantidade de moedas passa dos limites", 0); return(false); } string Credit = this.StringData; Player.Credits = (Player.Credits += Convert.ToInt32(Credit)); Player.GetClient().SendMessage(new CreditBalanceComposer(Player.Credits)); return(true); }
public bool Execute(params object[] Params) { if (Params == null || Params.Length == 0) { return(false); } Habbo Owner = RocketEmulador.GetHabboById(this.Item.UserID); Habbo Player = (Habbo)Params[0]; if (Player == null || Player.GetClient() == null) { return(false); } if (Owner == null || !Owner.GetPermissions().HasRight("room_item_wired_rewards")) { Player.GetClient().SendMessage(new RoomNotificationComposer("supernoti", "message", "Você não tem permissão para utilizar este wired...")); return(false); } if (Player.CurrentRoom.GetRoomUserManager().GetRoomUserByHabbo(Player.Username) == null) { return(false); } if (string.IsNullOrEmpty(this.StringData)) { return(false); } if (Convert.ToInt32(this.StringData) > 6) { Player.GetClient().SendWhisper("La cantidad de Duckets pasa de los limites.", 0); return(false); } string Ducket = this.StringData; Player.Duckets = (Player.Duckets += Convert.ToInt32(Ducket)); Player.GetClient().SendMessage(new HabboActivityPointNotificationComposer(Player.Duckets, Convert.ToInt32(Ducket), 0)); Player.GetClient().SendMessage(new RoomNotificationComposer("command_notification_credits", "message", "Has recibido " + Ducket + " ducket(s)!")); return(true); }
public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet) { if (Session == null || Session.GetHabbo() == null || !Session.GetHabbo().GetPermissions().HasRight("mod_mute")) { return; } int UserId = Packet.PopInt(); string Message = Packet.PopString(); double Length = (Packet.PopInt() * 60); //string Unknown1 = Packet.PopString(); //string Unknown2 = Packet.PopString(); Habbo Habbo = null; Habbo = RocketEmulador.GetHabboById(UserId); if (Habbo == null) { Session.SendNotification("An error occoured whilst finding that user in the database."); return; } if (Habbo.GetPermissions().HasRight("mod_mute") && !Session.GetHabbo().GetPermissions().HasRight("mod_mute_any")) { Session.SendNotification("Oops, you cannot mute that user."); return; } using (IQueryAdapter dbClient = RocketEmulador.GetDatabaseManager().GetQueryReactor()) { dbClient.RunQuery("UPDATE `users` SET `time_muted` = '" + Length + "' WHERE `id` = '" + Habbo.Id + "' LIMIT 1"); } if (Habbo.GetClient() != null) { Length = 3600; Habbo.TimeMuted = Length; Habbo.GetClient().SendNotification("Você foi mutado por um moderador: " + Message + " e durará " + Length + " segundos."); } }
public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet) { if (Session == null || Session.GetHabbo() == null || Session.GetHabbo().GetMessenger() == null) { return; } int User = Packet.PopInt(); int Type = Packet.PopInt(); if (!Session.GetHabbo().GetMessenger().FriendshipExists(User)) { Session.SendMessage(new BroadcastMessageAlertComposer("Oops, you can only set a relationship where a friendship exists.")); return; } if (Type < 0 || Type > 3) { Session.SendMessage(new BroadcastMessageAlertComposer("Oops, you've chosen an invalid relationship type.")); return; } if (Session.GetHabbo().Relationships.Count > 2000) { Session.SendMessage(new BroadcastMessageAlertComposer("Sorry, you're limited to a total of 2000 relationships.")); return; } using (IQueryAdapter dbClient = RocketEmulador.GetDatabaseManager().GetQueryReactor()) { if (Type == 0) { dbClient.SetQuery("SELECT `id` FROM `user_relationships` WHERE `user_id` = '" + Session.GetHabbo().Id + "' AND `target` = @target LIMIT 1"); dbClient.AddParameter("target", User); int Id = dbClient.getInteger(); dbClient.SetQuery("DELETE FROM `user_relationships` WHERE `user_id` = '" + Session.GetHabbo().Id + "' AND `target` = @target LIMIT 1"); dbClient.AddParameter("target", User); dbClient.RunQuery(); if (Session.GetHabbo().Relationships.ContainsKey(User)) { Session.GetHabbo().Relationships.Remove(User); } } else { dbClient.SetQuery("SELECT id FROM `user_relationships` WHERE `user_id` = '" + Session.GetHabbo().Id + "' AND `target` = @target LIMIT 1"); dbClient.AddParameter("target", User); int Id = dbClient.getInteger(); if (Id > 0) { dbClient.SetQuery("DELETE FROM `user_relationships` WHERE `user_id` = '" + Session.GetHabbo().Id + "' AND `target` = @target LIMIT 1"); dbClient.AddParameter("target", User); dbClient.RunQuery(); if (Session.GetHabbo().Relationships.ContainsKey(Id)) { Session.GetHabbo().Relationships.Remove(Id); } } dbClient.SetQuery("INSERT INTO `user_relationships` (`user_id`,`target`,`type`) VALUES ('" + Session.GetHabbo().Id + "', @target, @type)"); dbClient.AddParameter("target", User); dbClient.AddParameter("type", Type); int newId = Convert.ToInt32(dbClient.InsertQuery()); if (!Session.GetHabbo().Relationships.ContainsKey(User)) { Session.GetHabbo().Relationships.Add(User, new Relationship(newId, User, Type)); } } GameClient Client = RocketEmulador.GetGame().GetClientManager().GetClientByUserID(User); if (Client != null) { Session.GetHabbo().GetMessenger().UpdateFriend(User, Client, true); } else { Habbo Habbo = RocketEmulador.GetHabboById(User); if (Habbo != null) { MessengerBuddy Buddy = null; if (Session.GetHabbo().GetMessenger().TryGetFriend(User, out Buddy)) { Session.SendMessage(new FriendListUpdateComposer(Session, Buddy)); } } } } }
public Habbo GetDeleter() { return(RocketEmulador.GetHabboById(DeleterUserId)); }
public Habbo GetAuthor() { return(RocketEmulador.GetHabboById(UserId)); }
public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet) { if (Session == null || Session.GetHabbo() == null || !Session.GetHabbo().GetPermissions().HasRight("mod_soft_ban")) { return; } int UserId = Packet.PopInt(); string Message = Packet.PopString(); double Length = (Packet.PopInt() * 3600) + RocketEmulador.GetUnixTimestamp(); string Unknown1 = Packet.PopString(); string Unknown2 = Packet.PopString(); bool IPBan = Packet.PopBoolean(); bool MachineBan = Packet.PopBoolean(); if (MachineBan) { IPBan = false; } Habbo Habbo = RocketEmulador.GetHabboById(UserId); if (Habbo == null) { Session.SendNotification("An error occoured whilst finding that user in the database."); return; } if (Habbo.GetPermissions().HasRight("mod_tool") && !Session.GetHabbo().GetPermissions().HasRight("mod_ban_any")) { Session.SendNotification("Oops, you cannot ban that user."); return; } Message = (Message != null ? Message : "No reason specified."); string Username = Habbo.Username; using (IQueryAdapter dbClient = RocketEmulador.GetDatabaseManager().GetQueryReactor()) { dbClient.RunQuery("UPDATE `user_info` SET `bans` = `bans` + '1' WHERE `user_id` = '" + Habbo.Id + "' LIMIT 1"); } if (IPBan == false && MachineBan == false) { RocketEmulador.GetGame().GetModerationManager().BanUser(Session.GetHabbo().Username, ModerationBanType.USERNAME, Habbo.Username, Message, Length); } else if (IPBan == true) { RocketEmulador.GetGame().GetModerationManager().BanUser(Session.GetHabbo().Username, ModerationBanType.IP, Habbo.Username, Message, Length); } else if (MachineBan == true) { RocketEmulador.GetGame().GetModerationManager().BanUser(Session.GetHabbo().Username, ModerationBanType.IP, Habbo.Username, Message, Length); RocketEmulador.GetGame().GetModerationManager().BanUser(Session.GetHabbo().Username, ModerationBanType.USERNAME, Habbo.Username, Message, Length); RocketEmulador.GetGame().GetModerationManager().BanUser(Session.GetHabbo().Username, ModerationBanType.MACHINE, Habbo.Username, Message, Length); } GameClient TargetClient = RocketEmulador.GetGame().GetClientManager().GetClientByUsername(Habbo.Username); if (TargetClient != null) { TargetClient.Disconnect(); } }