Block Text Snippet[Whisper]
Well , This is my Christmas release. Before people ask why not save it until Christmas , reason being I've started to become very busy with IRL issues at this moment so I've decided to release this , I don't plan to finish the rest(Chatroom) , so here it is.
Original Thread : http://forum.ragezone.com/f245/block...nippet-710519/
Code:
CONST uint32_t MMatchServer__OnWhisperAddress = 0x004219D0;
Code:
}
void OnUserWhisper (MUID* uidComm, char* szSenderName, char* szTargetName, char* szMessage)
{
((void (__thiscall *) (LPVOID, MUID * , char *, char*, char *))MMatchServer__OnWhisperAddress) (this, uidComm , szSenderName , szTargetName, szMessage);
}
Code:
CDetour MMatchServerOnUserWhisperDet;
void WINAPI MMatchServerOnUserWhisper( MUID* uidComm, char* szSenderName, char* szTargetName, char* szMessage )
{
MMatchObject* Object = MMatchServer::GetInstance()->GetObjectA( uidPlayer );
if( !Object )
return;
char* szBlockedWords[] = { "words", "are", "sperated", "like", "so", };
char szStrCopy[1024];
strcpy( szStrCopy, szMessage );
_strlwr( szStrCopy );
for( int i = 0; i != sizeof( szBlockedWords ) / sizeof(char*); i++ )
{
if( strstr( szMessage, szBlockedWords[i] ) )
{
char szBuffer[1024];
sprintf_s( szBuffer, "[Server] : You can't say the word \'%s\'", szBlockedWords[i] );
MMatchServer::GetInstance()->Announce( uidPlayer, szBuffer );
return;
}
}
Credits
Dawson - For the original base(released)
Your Master - Helping me finish this and teaching me how to find addresses
Lambda - For Sharing code out of his emulator
Re: Block Text Snippet[Whisper]
Nice job Military, and I see that you improved you C++..
Re: Block Text Snippet[Whisper]
I didn't really code this Dylan , I wanted to finish it and got help.
Re: Block Text Snippet[Whisper]
Re: Block Text Snippet[Whisper]
Uhm. I'm kinda lost here. What does this do ?
Re: Block Text Snippet[Whisper]
Quote:
Originally Posted by
razi46
Uhm. I'm kinda lost here. What does this do ?
Like Dawson's release , it is to block out any bad words declared in 'badwords' so you don't have to use abuse.txt
Re: Block Text Snippet[Whisper]
this looks good does it also block certain character names at character creation
Re: Block Text Snippet[Whisper]
Quote:
Originally Posted by
Dude3889
this looks good does it also block certain character names at character creation
Yes , it was put in Dawson's thread but someone because Phoenix required it.