[Release] Smega Time Limits, Report system tweak, AB messages tweak
I'm going to make this my 'lil' release thread, currently this thread includes:
* Smega Time Limits
* Tweaked report system
* AB messages only display to GM's
---------------- Smega Time Limit ----------------
http://i329.photobucket.com/albums/l...seTryAgain.jpg
Open MapleClient.java:
Add:
PHP Code:
public boolean smegastarted = false;
public long lastsmega;
public long lastsmegacompare;
Under:
PHP Code:
Private byte greason = 1;
Add:
PHP Code:
public boolean smegastarted(){
return smegastarted;
}
public long lastsmega(){
return lastsmega;
}
public long lastsmegacompare(){
return lastsmega;
}
Under:
PHP Code:
public ChannelServer getChannelServer() {
return ChannelServer.getInstance(getChannel());
}
---
Open CashItemHandler.java:
Add: (I'm sure this can be done easier...)
PHP Code:
if (c.smegastarted == false){
c.lastsmega = 0;
c.smegastarted = true;
}
Under:
PHP Code:
MapleInventoryManipulator.removeById(c, MapleInventoryType.CASH, itemId, 1, true, false);
Replace:
PHP Code:
if (itemType == 507){
int megaType = itemId / 1000 % 10;
if (megaType == 2) {
c.getChannelServer().getWorldInterface().broadcastMessage(null, MaplePacketCreator.serverNotice(3, c.getChannel(), c.getPlayer().getName() +
" : " + slea.readMapleAsciiString()).getBytes());
}
With:
PHP Code:
if (itemType == 507){
int megaType = itemId / 1000 % 10;
if (megaType == 2) {
//SMEGA
c.lastsmegacompare = System.currentTimeMillis() - c.lastsmega;
if (c.lastsmegacompare > 5000){
c.lastsmega = System.currentTimeMillis();
c.getChannelServer().getWorldInterface().broadcastMessage(null, MaplePacketCreator.serverNotice(3, c.getChannel(), c.getPlayer().getName() +
" : " + slea.readMapleAsciiString()).getBytes());
} else {
MapleInventoryManipulator.addById(c, itemId, (short)1, "Spam Filter");
new ServernoticeMapleClientMessageCallback(1, c).dropMessage("Smegas are disabled or time limited!");
}
}
Replace:
PHP Code:
} else if (itemType == 539) {
List<String> lines = new LinkedList<String>();
for (int i = 0; i < 4; i++) {
lines.add(slea.readMapleAsciiString());
}
c.getChannelServer().getWorldInterface().broadcastMessage(null, MaplePacketCreator.getAvatarMega(c.getPlayer(), c.getChannel(), itemId, lines).getBytes());
With:
PHP Code:
} else if (itemType == 539) {
List<String> lines = new LinkedList<String>();
for (int i = 0; i < 4; i++) {
lines.add(slea.readMapleAsciiString());
}
//AVATAR SMEGA TIMERS
c.lastsmegacompare = System.currentTimeMillis() - c.lastsmega;
if (c.lastsmegacompare > 5000){
c.lastsmega = System.currentTimeMillis();
c.getChannelServer().getWorldInterface().broadcastMessage(null, MaplePacketCreator.getAvatarMega(c.getPlayer(), c.getChannel(), itemId, lines).getBytes());
} else {
MapleInventoryManipulator.addById(c, itemId, (short)1, "Spam Filter");
new ServernoticeMapleClientMessageCallback(1, c).dropMessage("Smegas are disabled or time limited!");
}
Change the time limit in these lines (milliseconds):
PHP Code:
if (c.lastsmegacompare > 5000){ //5 seconds
------------ Tweaked Report System ------------
http://i329.photobucket.com/albums/l...ns/Reportz.jpg
Example: Player reported Haxorname(CHARID) for REASON
In ReportHandler.java
Add:
MapleCharacter victim =
PHP Code:
c.getChannelServer().getPlayerStorage().getCharacterById(reportedCharId);
Under:
PHP Code:
Logger logger = LoggerFactory.getLogger(this.getClass());
Replace:
PHP Code:
logger.info(
c.getPlayer().getName() + " reported charid " + reportedCharId
);
With:
PHP Code:
logger.info(
c.getPlayer().getName() + " reported charid " + reportedCharId + " aka " + victim.getName()
);
Replace:
PHP Code:
StringBuilder sb = new StringBuilder();
sb.append(c.getPlayer().getName());
sb.append(" reported charid ");
sb.append(reportedCharId);
sb.append(" for ");
sb.append(reasons[reason]);
With:
PHP Code:
StringBuilder sb = new StringBuilder();
sb.append(c.getPlayer().getName());
sb.append(" reported ");
sb.append(victim.getName());
sb.append(" (");
sb.append(reportedCharId);
sb.append(") for ");
sb.append(reasons[reason]);
-------- Autoban messages display to GM's only --------
Open AutobanManager.java:
Replace:
PHP Code:
try {
c.getChannelServer().getWorldInterface().broadcastMessage(null,
MaplePacketCreator.serverNotice(0, "[Autoban] " + name + " banned by the system (Last reason: " + reason + ")").getBytes());
} catch (RemoteException e) {
c.getChannelServer().reconnectWorld();
}
With:
PHP Code:
try {
c.getChannelServer().getWorldInterface().broadcastGMMessage(null,
MaplePacketCreator.serverNotice(0, "[GM Only Message] " + name + " banned by the system (Last reason: " + reason + ")").getBytes());
} catch (RemoteException e) {
c.getChannelServer().reconnectWorld();
}
log.warn("[h4x] Autobanned player {} (accountid {})", name, acc);
}
Again, this will reduce lag & gives a 'cleaner' look in the chat window
Sincerely,
Kerelmans
Re: [Release?/Odin] Smega Time Limits
first post
great release!
Thank You
Re: [Release?/Odin] Smega Time Limits
Re: [Release?/Odin] Smega Time Limits
Cool. Nice release.Thanks dude
Re: [Release?/Odin] Smega Time Limits
Btw why is there a ? in your title?
Re: [Release?/Odin] Smega Time Limits
Hmms. It can be either depends on how 1 views it.
Re: [Release?/Odin] Smega Time Limits
Quote:
Originally Posted by
xelkin
Btw why is there a ? in your title?
Bcause I was on vacation & it may be released by some1 else... I dun wanna leech other's ideas so... that's y
Greetz :D
Re: [Release?/Odin] Smega Time Limits
Nah just make it [Release]
is better
And you dont need to say its for odin in the title
Re: [Release?/Odin] Smega Time Limits
Great release but there is also similar to this :X (Smega AB)
Re: [Release?/Odin] Smega Time Limits
Well, I actually coded this because some people didn't use smega hack, but to reduce lag caused by smegas.
If you wanna make an AB you can just make an if statement :
if (lastsmegacompare < 1000){
BANHAMMER!
}
import AutobanManager.java yourself... & search for the exact AB code (ima to lazy)
Re: [Release?/Odin] Smega Time Limits
i prefer this, than auto ban
Re: [Release?/Odin] Smega Time Limits
Quote:
Originally Posted by
Kerelmans
Well, I actually coded this because some people didn't use smega hack, but to reduce lag caused by smegas.
If you wanna make an AB you can just make an if statement :
if (lastsmegacompare < 1000){
BANHAMMER!
}
import AutobanManager.java yourself... & search for the exact AB code (ima to lazy)
No, I'm just saying something similar to this has been released already except it's in auto ban form :P
Re: [Release?/Odin] Smega Time Limits
Re: [Release?/Odin] Smega Time Limits
NIce release, these will reduce Smega spam by alot :)
Re: [Release] Smega Time Limits
Awesome release. Nice work.