#include "common/hercules.h" #include "common/memmgr.h" #include "common/mmo.h" #include "common/socket.h" #include "common/strlib.h" #include #include #include #include "../map/pc.h" #include "../map/clif.h" #include "../common/HPMi.h" #include "plugins/HPMHooking.h" #include "../common/HPMDataCheck.h" // should always be the last file included! (if you don't make it last, it'll intentionally break compile time) HPExport struct hplugin_info pinfo = { "gmimpersonate", // Plugin name SERVER_TYPE_MAP,// Which server types this plugin works with? "0.1", // Plugin version HPM_VERSION, // HPM Version (don't change, macro is automatically updated) }; bool clif_process_whisper_message_post(bool retVal___, struct map_session_data *sd, const struct packet_whisper_message *packet, char *out_name, char *out_message, int out_messagelen) { if (retVal___ == true) { char* message = (char*)RFIFOP( sd->fd ,4) + strnlen(sd->status.name, NAME_LENGTH-1) + 3; normalize_name( message, "255xA0032tx0Ax0D " ); if ( stristr( message, "x20x3Ax20" ) || stristr( message, "x20x3Bx20" ) ) { // type " : " OR " ; " will be blocked clif->messagecolor_self( sd->fd, COLOR_RED, "You can't impersonate other players !" ); return false; } } return true; } HPExport void plugin_init (void) { addHookPost(clif, process_whisper_message, clif_process_whisper_message_post); }