- Joined
- Aug 28, 2009
- Messages
- 80
- Reaction score
- 50
Used this before, but i removed guests recently.
GM.java
Add this within the !ban command handler:
Add this within the !permban handler:
And again, i wont be saying exactly where should you put these, but these should already be common sense
Note: I dont know if this is released, once again, but if it is, the mod may delete it.
Extras:
This was used in dutchms and directms
Suitable for use in XoticSource.
Have fun!
Credits:
Fate
Kelvin (for telling me how he managed to get on time to time after bans in the old DutchMs (at least 4months ago))
GM.java
Add this within the !ban command handler:
Code:
else if (target.getClient().isGuest()) {
String readableTargetName = MapleCharacterUtil.makeMapleReadable(target.getName());
Connection con = DatabaseConnection.getConnection();
PreparedStatement ps;
target.getClient().deleteAllCharacters();
ps = con.prepareStatement("INSERT INTO ipbans VALUES (DEFAULT, ?)");
String[] ipSplit = target.getClient().getSession().getRemoteAddress().toString().split(":");
ps.setString(1, ipSplit[0]);
ps.executeUpdate();
ps.close();
cserv.getWorldInterface().broadcastMessage(null, MaplePacketCreator.serverNotice(6, "Guest user: " + readableTargetName + " has been banned.").getBytes());
cserv.getWorldInterface().broadcastMessage(null, MaplePacketCreator.serverNotice(6, "Reason: " + originalReason).getBytes());
}
Add this within the !permban handler:
Code:
else if (victim.getClient().isGuest()) {
String readableTargetName = MapleCharacterUtil.makeMapleReadable(victim.getName());
Connection con = DatabaseConnection.getConnection();
PreparedStatement ps;
victim.getClient().banMacs();
victim.getClient().deleteAllCharacters();
ps = con.prepareStatement("INSERT INTO ipbans VALUES (DEFAULT, ?)");
String[] ipSplit = victim.getClient().getSession().getRemoteAddress().toString().split(":");
ps.setString(1, ipSplit[0]);
ps.executeUpdate();
ps.close();
cserv.getWorldInterface().broadcastMessage(null, MaplePacketCreator.serverNotice(6, "Guest user: " + readableTargetName + " has been permanently banned.").getBytes());
cserv.getWorldInterface().broadcastMessage(null, MaplePacketCreator.serverNotice(6, "Reason: " + originalReason).getBytes());
}
And again, i wont be saying exactly where should you put these, but these should already be common sense

Note: I dont know if this is released, once again, but if it is, the mod may delete it.
Extras:
This was used in dutchms and directms

Suitable for use in XoticSource.
Have fun!
Credits:
Fate
Kelvin (for telling me how he managed to get on time to time after bans in the old DutchMs (at least 4months ago))
Last edited: