internal class ModerationBanManager
{
private Hashtable bannedIPs = new Hashtable();
private Hashtable bannedUsernames = new Hashtable();
internal ModerationBanManager()
{
}
internal void BanUser(GameClient Client, string Moderator, double LengthSeconds, string Reason, bool IpBan)
{
IQueryAdapter adapter;
ModerationBanType uSERNAME = ModerationBanType.USERNAME;
string username = Client.GetHabbo().Username;
string query = "user";
double expire = ButterflyEnvironment.GetUnixTimestamp() + LengthSeconds;
if (IpBan)
{
uSERNAME = ModerationBanType.IP;
username = Client.GetConnection().getIp();
query = "ip";
}
ModerationBan ban = new ModerationBan(uSERNAME, username, Reason, expire);
if (ban.Type == ModerationBanType.IP)
{
if (this.bannedIPs.ContainsKey(username))
{
this.bannedIPs[username] = ban;
}
else
{
this.bannedIPs.Add(username, ban);
}
}
else if (this.bannedUsernames.ContainsKey(username))
{
this.bannedUsernames[username] = ban;
}
else
{
this.bannedUsernames.Add(username, ban);
}
using (adapter = ButterflyEnvironment.GetDatabaseManager().getQueryreactor())
{
adapter.setQuery(string.Concat(new object[] { "INSERT INTO bans (bantype,value,reason,expire,added_by,added_date) VALUES (@rawvar,@var,@reason,'", expire, "',@mod,'", DateTime.Now.ToLongDateString(), "')" }));
adapter.addParameter("rawvar", query);
adapter.addParameter("var", username);
adapter.addParameter("reason", Reason);
adapter.addParameter("mod", Moderator);
adapter.runQuery();
}
Use the housekeeping, SwiftEmulator has the least organized commandHandler of every branch of the Butterfly "spectrum".
Take a look at Firewind, use some of its commands.
If you hadn't renamed BCStorm to Swift there would be no confusion, Just because you didn't touch it doesn't mean it isn't messy, it is. Mainly because BcStorm has a messy CommandHandler. And I am stupid for stating that it is messy? I'm really hurtYou're stupid, I barely touched the commandHandler.
If you hadn't renamed BCStorm to Swift there would be no confusion, Just because you didn't touch it doesn't mean it isn't messy, it is. Mainly because BcStorm has a messy CommandHandler. And I am stupid for stating that it is messy? I'm really hurt
Should still be called "UberEmulator".
I don't want to release anything, and you really took the time to check, I'm touchedAnd what have you released? Do you even code bro? You're in no position to judge with your lone release holoCMS edit.
Also, you specifically said swiftemu had the messiest commandHandler of the whole BCStorm branch so you're suggesting that I made it messy myself. Witch I didn't, and if you actually looked at the code before making stupid assumptions you would know what you're talking about.
On-Topic:
The get IP function doesn't select it from the database, it takes it from the users incoming connection on the client. Check the IP that you are banning and make sure its not the IP that you use in your configuration. And FYI, proxies don't do poop for retros.
If you post the banned table for me I can give you a specific answer.
I don't want to release anything, and you really took the time to check, I'm touched. And I tend to use what I learnt here on other things, developing useful things isn't really what I do here, I just mess around to improve my skills, which isn't even worth releasing.
And if you hadn't even touched commandHandler why are you even arguing about this? BcStorm > Swift, Swift is basically just an updated version of BcStorm. And I said it was the messiest out of the entire Butterfly branch, not just BcStorm, Anyway like I said BcStorm and Swift are very alike, Swift is just updated (off course you know that), so I was referring to both Swift and BcStorm.
BcStorm + Swift = equally messy commandhandler
And because I haven't contributed that means I do not have the ability to judge? Yeah releasing something instantly updates your skill set to be able to judge something! I will sure look into that!
Do I even code?
Well thats an easy one to answer, I do, I learnt from Holograph. (isn't the best resource to learn from)
Anyway not contributing does not mean I cannot develop, many developers are in fact good developers yet we haven't seen a single release from them. (I don't blame them)
Thank you
On-Topic:
The get IP function doesn't select it from the database, it takes it from the users incoming connection on the client. Check the IP that you are banning and make sure its not the IP that you use in your configuration. And FYI, proxies don't do poop for retros.
If you post the banned table for me I can give you a specific answer.
I figured out that too. But it always takes the incoming connection. So I need to code a mus command and take the ip_last?
I ban the hotel server IP, So everyone get banned.