Altercationz
:)
I seen a release from @Hypothesis which was a delete user command which didn't execute everything properly, or delete everything. This should do the trick.
Credits to him for the idea.
I don't know why'd you would need this as retros cant afford to lose any user nowadays.
But, if you want to delete some annoying kid here you go
- This command will check if the user has logged on within the last 3 days, if that happens to be true the user will not be deleted.
- I put a couple sql queries to delete pretty much everything to not keep useless data in your tables.
- I put a query which will give all of the user's rooms to you, never know if he has a sick room or something lmfao.
- Obviously if the user is online it won't delete their account.
- Can't delete anybody higher than rank 4.
so yeah, have fun.
Credits to him for the idea.
I don't know why'd you would need this as retros cant afford to lose any user nowadays.
But, if you want to delete some annoying kid here you go
- This command will check if the user has logged on within the last 3 days, if that happens to be true the user will not be deleted.
- I put a couple sql queries to delete pretty much everything to not keep useless data in your tables.
- I put a query which will give all of the user's rooms to you, never know if he has a sick room or something lmfao.
- Obviously if the user is online it won't delete their account.
- Can't delete anybody higher than rank 4.
so yeah, have fun.
Code:
using System;
using System.Linq;
using System.Text;
using System.Collections.Generic;
using Plus.Communication.Packets.Incoming;
using Plus.Communication.Packets.Outgoing.Rooms.Engine;
using Plus.Communication.Packets.Outgoing.Users;
using Plus.Database.Interfaces;
using Plus.HabboHotel.GameClients;
using Plus.Communication.Packets.Outgoing.Rooms.Chat;
using Plus.Utilities;
using Plus.HabboHotel.Users;
namespace Plus.HabboHotel.Rooms.Chat.Commands.Administrator
{
class
DeleteUserCommand : IChatCommand
{
public string PermissionRequired
{
get { return "command_delete"; }
}
public string Parameters
{
get { return "%username%"; }
}
public string Description
{
get { return "Delete a user."; }
}
public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params)
{
if (Params.Length == 1)
{
Session.SendWhisper("Oops, you forgot to enter the username! Command Usage: :delete (user)");
return;
}
Habbo User = PlusEnvironment.GetHabboByUsername(Params[1]);
DateTime Now = DateTime.Now;
double LastLogin = Convert.ToSingle(Now.AddDays(-3));
double OnlineNow = Convert.ToSingle(Now);
if (User.LastOnline == LastLogin)
{
Session.SendWhisper("The user " + Params[1] + " has logged on within the last 3 days, therefore it cannot be deleted.");
}
if (User.LastOnline == OnlineNow)
{
return;
}
if (Session.GetHabbo().Username == User.Username)
{
return;
}
if (User.Rank > 4)
{
return;
}
using (IQueryAdapter Adapter = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
{
Adapter.RunQuery("DELETE FROM `users` WHERE username = '" + User + "' LIMIT 1");
Adapter.RunQuery("DELETE FROM `user_stats` WHERE id = '" + User.Id + "' LIMIT 1");
Adapter.RunQuery("DELETE FROM `user_info` WHERE user_id = '" + User.Id + "' LIMIT 1");
Adapter.RunQuery("DELETE FROM `user_relationships` WHERE user_id = '" + User.Id + "' LIMIT 1");
Adapter.RunQuery("DELETE FROM `user_login_attemps WHERE userid = '" + User.Id + "' LIMIT 1");
Adapter.RunQuery("UPDATE `rooms` SET owner = '" + Session.GetHabbo().Id + "' WHERE owner = '" + User.Id + "' LIMIT 1");
Adapter.RunQuery("DELETE FROM `user_achievements` WHERE userid = '" + User.Id + "' LIMIT 1");
}
}
}
}