auto ban smega UPDATED

Newbie Spellweaver
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
PHP:
import net.sf.odinms.tools.MaplePacketCreator;

add this in the variable declare part
PHP:
        private long lastSmegaTime;
        private int sMegaSpamCount=0;
EDIT forgot this step
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:
Re: [Release]auto ban smega

Nice but i can smega twice w/o hacks in less hen 3 seconds )=
Anyway to change the 3 seconds to 2?
 
Re: [Release]auto ban smega

Code:
            if (lastSmegaTime - oldLastSmegaTime > 3000) {//if time between smega is more then 3 sec

Not hard to find out what to change huh?
 
Re: [Release]auto ban smega

Nice but i can smega twice w/o hacks in less hen 3 seconds )=
Anyway to change the 3 seconds to 2?

u can finish a proper sentence in less then 3 sec?
anyway u have 4 tries. it will give a warning as well so dun have worry abt innocent ppl getting ban

u can change the 3 sec to any time u want to, just see the comments in the code
 
Re: [Release]auto ban smega

Im kinda doing something so i didn't have time to look, haven't even put in to my server yet >.>
 
Re: [Release]auto ban smega

I didnt releaze this step :

"add this below the constructor"

which constructor do u mean and what is it ?
 
more realistic?
such as?

i dun think it will have unnecessary autobans problems since it has a warning (a popup warning in fact)

it will auto ban when a person spam 5 consecutive smega and time between each successive smega is less then 3 seconds

i have no idea how to tell u wads a constructor is. anyway just add it in that file will do.
 
Re: [Release]auto ban smega

Can you give a prepared 2 files because i don't understand some steps.

for the constructor thingy erm
this is the constructor im talking abt
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 i miss out something, check the 1st post
 
Re: [Release]auto ban smega

Edit: I done almost all only no the last file because i dont understand where to add codes u didnt say below or above
 
Re: [Release]auto ban smega

Why not just...

Add in the negative NX ban, this is predominantly how the hackers spam SMegas ;)

Nice release btw, xD
 
Re: [Release]auto ban smega

Hey Nice 0.0 Would You Mind Release Horntail Death And Summon Animation Cause Something Summon 2 Horntail O.O I Remember You Posted In OdinMS,Ahh Request You Know Nulled Zakum Body Skill Before Arms Are Down
So Body 1 Does Not Use Any Attack 0.0 >_> I Cant Do It
 
Re: [Release]auto ban smega

There are a few flaws with this. Though, megaphones were initially created in MapleStory to SELL things. :X
 
Re: [Release]auto ban smega

When you packet edit, it works just like your sending the real SMEGA, so yes, this will block us packet editors also.

Thanks for ruining my fun, jerk =(
 
Back