Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

How to block Names and Abusive Words.

Joined
Jun 17, 2009
Messages
2,726
Reaction score
340
I know it is easy for most of us but from what I saw today with a certain user , looks like I gotta post these simple tutorials to help you all.

Requirements

Notepad/Notepad ++(recommended)
A brain
GunZ Client
System.mrs decompiled

Difficulity - 0/10

Purpose - to make users better understand abuse.txt

When you open your Abuse.txt you see a series of 1 or 2's and some names

Code:
 1,hello
Code:
2,Maiet

Now into the contents of the '1' in abuse.txt

The '1' is the number for when a specified word is probitied to be sent through the chat string

-Pic Coming Soon-

The '2' is responible for probiting any names under Maiet as seen in my example to be made

-Pic Coming Soon-

Glad I cloud help
 
(。◕‿‿◕。)
Loyal Member
Joined
Oct 15, 2008
Messages
1,451
Reaction score
152
Someones posted this already, i remember seeing it.

Its not really something a thread needs to be made on, but i guess it is usefull to some people. But i don't think most servers even use Abuse.txt
 
Joined
Feb 4, 2010
Messages
2,204
Reaction score
1,012
I've seen this posted a few times, I personally find it quite useless but I'm sure some people would want to use it, so thanks for your effort in writing this up. Just search to see if such a tutorial already exists next time.
 
Master Summoner
Joined
Jun 28, 2009
Messages
523
Reaction score
15
in my abuse.txt i dont see a 1. or a 2.

i only see this

"END"
 
(。◕‿‿◕。)
Loyal Member
Joined
Oct 15, 2008
Messages
1,451
Reaction score
152
in my abuse.txt i dont see a 1. or a 2.

i only see this

"END"

It means nothing is in it. End is the end of the list (obviously) so if nothings before it, its empty. Most servers don't use Abuse.txt like i said so they're usually always empty

1 means words you can't use
2 is names

as he said.

For example, ijjis would has stuff like
1,butt
2,GM

and so forth
 
Skilled Illusionist
Joined
Mar 15, 2009
Messages
331
Reaction score
15
ha ha, you must've been real bored if you decided to make this your first tutorial xD. Anyways, helpful to the new commers who want to know how to do this and can't search if their life depended on it :p.
 
Master Summoner
Joined
Jun 28, 2009
Messages
523
Reaction score
15
kk so i would do like
1,butt
1,witch
2,gm
2,admin

? or does it have to be

1,
2,
1,
2,
???
 
Experienced Elementalist
Joined
Aug 24, 2008
Messages
206
Reaction score
11
Use the DB for block words(a stored proc.)
 
Joined
Apr 18, 2010
Messages
674
Reaction score
393
How to block abusive words (in channel)
Code:
CDetour MMatchServer__OnChannelChatDet;

void WINAPI MMatchServer__OnChannelChatHook( MUID* uidPlayer, MUID* uidChannel, char *szMessage )
{
	char* szBlocked[] = { "wigger", "spick" };
	MMatchObject* lpObject = MMatchServer::GetInstance()->GetObjectA( uidPlayer );

	if( !lpObject )
		return;

	int nString = strlen( szMessage );
	char szStrCopy[1024];
	strcpy( szStrCopy, szMessage );
	_strlwr( szStrCopy );

	for( int i = 0; i != sizeof( szBlocked ) / sizeof(char*); i++ )
	{
		if( strstr( szMessage, szBlocked[i] ) )
		{
			*szMessage = NULL;
		}
	}

	MMatchServer__OnChannelChatDet.Org( uidPlayer, uidChannel, szMessage );
}
 
Joined
Jan 21, 2009
Messages
579
Reaction score
89
How to block abusive words (in channel)
Code:
CDetour MMatchServer__OnChannelChatDet;

void WINAPI MMatchServer__OnChannelChatHook( MUID* uidPlayer, MUID* uidChannel, char *szMessage )
{
	char* szBlocked[] = { "wigger", "spick" };
	MMatchObject* lpObject = MMatchServer::GetInstance()->GetObjectA( uidPlayer );

	if( !lpObject )
		return;

	int nString = strlen( szMessage );
	char szStrCopy[1024];
	strcpy( szStrCopy, szMessage );
	_strlwr( szStrCopy );

	for( int i = 0; i != sizeof( szBlocked ) / sizeof(char*); i++ )
	{
		if( strstr( szMessage, szBlocked[i] ) )
		{
			*szMessage = NULL;
		}
	}

	MMatchServer__OnChannelChatDet.Org( uidPlayer, uidChannel, szMessage );
}
Omg why to use this ?
The other way(abuse.txt) it's easier.. :/
 
(。◕‿‿◕。)
Loyal Member
Joined
Oct 15, 2008
Messages
1,451
Reaction score
152
kk so i would do like
1,butt
1,witch
2,gm
2,admin

? or does it have to be

1,
2,
1,
2,
???

however I think, look at ijji's for an example.

Omg why to use this ?
The other way(abuse.txt) it's easier.. :/

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.
 
Junior Spellweaver
Joined
Apr 16, 2009
Messages
115
Reaction score
22
Omg why to use this ?
The other way(abuse.txt) it's easier.. :/

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 );
}
 
Last edited:
Back
Top