- Joined
- Jul 12, 2008
- Messages
- 55
- Reaction score
- 0
not sure if this work for PE (i dun have PE to test)
but it ban ppl who can smega very fast(3 sec between smega)
and this give a warning if the offender spam 4 consecutive smega of any type
the 5th will trigger autoban
in CheatTracker.java
add this import if its not there
add this in the variable declare part
EDIT forgot this step
find
change it to
EDIT now it should send the warning to the spamer only
below what u just replaced, add this
in CheatingOffense.java
add to those enum
in UseCashItemHandler.java
find
EDIT:no longer need the character name
add this below that
find
EDIT no longer need the character name
add this below that
EDITS:forgot to add import
but it ban ppl who can smega very fast(3 sec between smega)
and this give a warning if the offender spam 4 consecutive smega of any type
the 5th will trigger autoban
in CheatTracker.java
add this import if its not there
PHP:
import net.sf.odinms.tools.MaplePacketCreator;
add this in the variable declare part
PHP:
private long lastSmegaTime;
private int sMegaSpamCount=0;
find
PHP:
public CheatTracker(MapleCharacter chr) {
this.chr = new WeakReference<MapleCharacter>(chr);
invalidationTask = TimerManager.getInstance().register(new InvalidationTask(), 60000);
takingDamageSince = attackingSince = regenMPSince = regenHPSince = System.currentTimeMillis();
}
change it to
PHP:
public CheatTracker(MapleCharacter chr) {
this.chr = new WeakReference<MapleCharacter>(chr);
invalidationTask = TimerManager.getInstance().register(new InvalidationTask(), 60000);
takingDamageSince = attackingSince = regenMPSince = regenHPSince = lastSmegaTime = System.currentTimeMillis();
}
EDIT now it should send the warning to the spamer only
below what u just replaced, add this
PHP:
public synchronized void checkSMega()
{
long oldLastSmegaTime = lastSmegaTime;
lastSmegaTime=System.currentTimeMillis();
if (lastSmegaTime - oldLastSmegaTime > 3000) {//if time between smega is more then 3 sec
sMegaSpamCount = 0;//reset count
}
else
{//time between smega is within 3 sec
sMegaSpamCount++;
}
if(sMegaSpamCount==3 && !(chr.get().isGM()))//4 consecutive spam
{
//chr.get().getClient().getChannelServer().broadcastPacket(MaplePacketCreator.serverNotice(1, "one more consecutive SMEGA from "+charname+", autoban will trigger"));
chr.get().getClient().getSession().write(MaplePacketCreator.serverNotice(1, "one more consecutive SMEGA from you, you will be autoban"));
}
if(sMegaSpamCount>3 && !(chr.get().isGM()))
{
this.registerOffense(CheatingOffense.DENIAL_OF_SERVICE_ATTACK);
}
}
in CheatingOffense.java
add to those enum
PHP:
DENIAL_OF_SERVICE_ATTACK(50,300000,0,true),//actually is Smega_spam
in UseCashItemHandler.java
find
PHP:
if (megaType == 2) {
EDIT:no longer need the character name
add this below that
PHP:
c.getPlayer().getCheatTracker().checkSMega();//autoban for smega
find
PHP:
for (int i = 0; i < 4; i++) {
lines.add(slea.readMapleAsciiString());
}
EDIT no longer need the character name
add this below that
PHP:
c.getPlayer().getCheatTracker().checkSMega();//autoban for smega
EDITS:forgot to add import
Last edited: