however I think, look at ijji's for an example.
Unpack system.mrs > Delete abuse.txt > Go ingame
Abuse.txt is stupid to use if you really want to block words, DB is better, though it can still be bypassed its harder.
Printable View
Because it can't be bypassed since it's checked by the match server not the client(abuse.txt) but it would cause slower response and might cause problems with a lot of players.
You can also use this detour to prevent channel spamming.
Although this is not the way you should do it, this is how it looks if you only used that detour
Code:std::map<unsigned int, unsigned int> LastChannelChat;
std::map<unsigned int, unsigned int>::iterator it;
CDetour MMatchServer__OnChannelChatDet;
void WINAPI MMatchServer__OnChannelChatHook( MUID* uidPlayer, MUID* uidChannel, char *szMessage )
{
MMatchObject* lpObject = MMatchServer::GetInstance()->GetObjectA( uidPlayer );
if( !lpObject )
return;
unsigned int time = GetTickCount();
unsigned int ID = uidPlayer.high;
bool bExists = false;
if(LastChannelChat[ID] + 300 > time) { // if They talked more then once within 300 milliseconds disconnect
lpObject->Disconnect();
return;
}
else { // Check if they are in the map and update last time they talked
for(it = LastChannelChat.begin(); it != LastChannelChat.end(); it++) {
if(it->first == ID) {
bExists = true;
it->second = time;
break;
}
}
}
if(bExists == false) LastChannelChat.insert(std::pair<unsigned int, unsigned int>(ID, time) // if their not in the map, add them as a new member
MMatchServer__OnChannelChatDet.Org( uidPlayer, uidChannel, szMessage );
}
Thanks for Tutorial