Overriding Kore's Packet Handlers/Dropping Packets

Forum closed. All further discussion to be discussed at https://github.com/OpenKore/

Moderator: Moderators

Message
Author
User avatar
itsrachelfish
Developers
Developers
Posts: 50
Joined: 27 Feb 2012, 12:50
Noob?: No

Overriding Kore's Packet Handlers/Dropping Packets

#1 Post by itsrachelfish »

Is there any way to override kore's default packet handlers or to drop a packet before it gets there?

After poking around in the source I noticed a hook which is created for all packets, packet_pre/[handler_name], which I can only assume lets a plugin handle a packet before kore does internally. Unfortunately I see no way for a plugin to send data back and interrupt kore from continuing to parse the packet.

If you're interested in a bit of back story, I'm looking to write a plugin for OpenKore which automatically blocks spammers by holding their messages in a queue.

I've already written a plugin to block spammers by giving their chat messages a score, based on message speed and bad words like "buy zeny!!" "100% safe" etc. But this still lets the first couple messages slip through and that's no fun.
Tired of waiting for answers on the forums?
Want to talk to OpenKore experts?

Hang out on the #OpenKore IRC!

User avatar
itsrachelfish
Developers
Developers
Posts: 50
Joined: 27 Feb 2012, 12:50
Noob?: No

Re: Overriding Kore's Packet Handlers/Dropping Packets

#2 Post by itsrachelfish »

Fixed in commit 7970, with help from harvest. :3
Tired of waiting for answers on the forums?
Want to talk to OpenKore experts?

Hang out on the #OpenKore IRC!

Locked