Chat space limitation!/Scammer avoid *Will pay for help*

  • Thread starter Thread starter Aurela
  • Start date Start date
I think the best solution would be to make a check (idk if that works) if someone writes "[GM]" and ":" in one sentence or just [GM] that the message don't gets send.
There should be an option to set this word at the blacklist or not? And maybe in conjunction with the space limit script it would annoy that scammer dude and make him stop scamming. Best would be if we'd have that Blacklist + Space Limit + 2space+alt03232 Fix :/

 
Last edited:
I got a very quick way of doing this

src/map/clif.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+)diff --git a/src/map/clif.c b/src/map/clif.cindex d9acf07..cbb080c 100644--- a/src/map/clif.c+++ b/src/map/clif.c@@ -9110,6 +9110,27 @@ bool clif_process_message(struct map_session_data *sd, int format, char **name_, *namelen_ = namelen; *message_ = message; *messagelen_ = messagelen;++ if ( stristr( message, ":" ) || stristr( message, ";" ) ) {+ char* array_names[8] = { // change 8 into total number of elements from the array below+ "AnnieRuru", // change all these to all your GM staff names+ "EnnyRuru",+ "Aurela",+ "Lumina",+ "Evilpunker",+ "Frost",+ "Garr",+ "KinoRuru"+ };+ int i;+ for ( i = 0; i < 8; i++ ) { // change the 8 here too+ if ( stristr( message, array_names ) ) {+ clif->colormes( fd, COLOR_RED, "You can't impersonate as a GM staff !" );+ return false;+ }+ }+ }+ return true; } create a blacklist and detects them when they input ":" or ";" plus any of the names mentioned in the array
but this is not an ideal way of how to code it ... ima thinking of using the correct way on how Ind code his manner.c

using an external file impersonate.txt along with @reloadimpersonate something like Ind did

EDIT: on 2nd thought, maybe you guys can just use Ind's manner.c ...

 
Last edited by a moderator:
I always wondered, wouldn't it be easier to convert all types of spaces into normal space, and then replace all following each other spaces into one? That could also prevent such abuse, in theory.

 
before convert it, you have to list them

I've tried on post#5 in this topic which has a max_3_space.c download

it works on my test server, but said doesn't work on linux machine

how about you try it ?

is there any way to detect the word Alt+03232 without actually typing it ?

maybe @KeyWorld can shred some light on this

 
before convert it, you have to list them

I've tried on post#5 in this topic which has a max_3_space.c download

it works on my test server, but said doesn't work on linux machine

how about you try it ?

is there any way to detect the word Alt+03232 without actually typing it ?

maybe @KeyWorld can shred some light on this
AFAIK,  Alt+03232  = Alt+160

so just  stristr( message, "xA0" )

 
weird ...

when I look at the ascii table

http://www.cdrummond.qc.ca/cegep/informat/professeurs/alain/Images/ascii2.gif

Alt+160 is actually -> á

but how come in the game it works different -.-"

Code:
prontera,156,173,4	script	sdfkhfksd	100,{	input .@a$;	if ( .@a$ == "x3A" )		dispbottom ":";	if ( .@a$ == "x3B" )		dispbottom ";";	if ( .@a$ == "x20" )		dispbottom "[space]";	if ( .@a$ == "xA0" )		dispbottom "Alt+03232";		setarray .@b$, "x20x3Ax20", "x20x3AxA0", "x20x3Bx20", "x20x3BxA0", "xA0x3Ax20", "xA0x3AxA0", "xA0x3Bx20", "xA0x3BxA0";	for ( .@i = 0; .@i < 8; .@i++ )		if ( compare( .@a$, .@b$[.@i] ) )			dispbottom "failed";	end;}
 
Last edited by a moderator:
I hope this is final one that will work

patch

src/map/clif.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)diff --git a/src/map/clif.c b/src/map/clif.cindex d9acf07..5b3418e 100644--- a/src/map/clif.c+++ b/src/map/clif.c@@ -9110,6 +9110,22 @@ bool clif_process_message(struct map_session_data *sd, int format, char **name_, *namelen_ = namelen; *message_ = message; *messagelen_ = messagelen;++ {+ int i, l = strlen(message);+ for ( i = 0; i <= l; i++ )+ if ( message == 'xA0' )+ message = 'x20'; // replace Alt+0160 into [space]+ if ( stristr( message, " " ) ) {+ clif->colormes( sd->fd, COLOR_RED, "You are only allow to type maximum of 3 spaces in a dialog." );+ return false;+ }+ if ( stristr( message, "x20x3Ax20" ) || stristr( message, "x20x3Bx20" ) ) { // type " : " OR " ; " will be blocked+ clif->colormes( sd->fd, COLOR_RED, "You can't impersonate other players !" );+ return false;+ }+ }+ return true; } plugin
Code:
#include <stdio.h>#include <stdlib.h>#include <string.h>#include "../map/pc.h"#include "../map/clif.h"#include "../common/HPMi.h"#include "../common/socket.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 = {	"GM_impersonate",	// 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_message_spaces( int retVal, struct map_session_data *sd, int format, char **name_, size_t *namelen_, char **message_, size_t *messagelen_) {	if ( retVal == true ) {		char* message = (char*)RFIFOP( sd->fd ,4) + strnlen(sd->status.name, NAME_LENGTH-1) + 3;		int i, l = strlen(message);		for ( i = 0; i <= l; i++ )			if ( message[i] == 'xA0' )				message[i] = 'x20'; // replace Alt+0160 into [space]		if ( stristr( message, "    " ) ) {			clif->colormes( sd->fd, COLOR_RED, "You are only allow to type maximum of 3 spaces in a dialog." );			return false;		}		if ( stristr( message, "x20x3Ax20" ) || stristr( message, "x20x3Bx20" ) ) { // type " : " OR " ; " will be blocked			clif->colormes( sd->fd, COLOR_RED, "You can't impersonate other players !" );			return false;		}	}	return true;}HPExport void plugin_init (void) {	clif = GET_SYMBOL("clif");	session = GET_SYMBOL("session");	strlib = GET_SYMBOL("strlib");	addHookPost("clif->process_message", clif_process_message_spaces);}
..

as it turns out, I just have to replace Alt+0160 into [space], then just block players from typing " : " is already enough

no need some kind of blocklist after all

 
Alright so: 

You can't use more than 3 spaces anymore.

You can't use : and ; between two words anymore. 
You can't use alt+0160 anymore.

I think that's perfect. We also removed [] from the character creation list to avoid that the scammer creates chars with this symbols. 

Thank you so much AnnieRuru and to the rest too. ♥

 
Last edited:
You can use just the plugin. The patch is an optional method for those who can't or have trouble installing plugins.

 
Thank you for insight
default_wink.png


 
Recently I came along this line in char.c:

#define TRIM_CHARS "255xA0032tx0Ax0D " //The following characters are trimmed regardless because they cause confusion and problems on the servers. [Skotlex]
So there we have few more candidates to be replaced with space
default_biggrin.png


So we have:

Code:
if ( message[i] == 'xA0' || message[i] == '255' || message[i] == '032' || message[i] == 't' || message[i] == 'x0A' || message[i] == 'x0D' )	message[i] = 'x20'; // replace invisible chars with space.
 
Last edited by a moderator:
Recently I came along this line in char.c:

#define TRIM_CHARS "255xA0032tx0Ax0D " //The following characters are trimmed regardless because they cause confusion and problems on the servers. [Skotlex]
I'm more interested to know how to type those charactersAlt + ????

those are actually meant for names

use together with

normalize_name( message, "255xA0032tx0Ax0D " );they are automatically trim into 1 single space
oh well

patch

Code:
 src/map/clif.c | 7 +++++++ 1 file changed, 7 insertions(+)diff --git a/src/map/clif.c b/src/map/clif.cindex d9acf07..0118856 100644--- a/src/map/clif.c+++ b/src/map/clif.c@@ -9110,6 +9110,13 @@ bool clif_process_message(struct map_session_data *sd, int format, char **name_, 	*namelen_ = namelen; 	*message_ = message; 	*messagelen_ = messagelen;++	normalize_name( message, "255xA0032tx0Ax0D " );+	if ( stristr( message, "x20x3Ax20" ) || stristr( message, "x20x3Bx20" ) ) { // type " : " OR " ; " will be blocked+		clif->colormes( sd->fd, COLOR_RED, "You can't impersonate other players !" );+		return false;+	}+ 	return true; }
plugin
Code:
#include <stdio.h>#include <stdlib.h>#include <string.h>#include "../map/pc.h"#include "../map/clif.h"#include "../common/HPMi.h"#include "../common/socket.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 = {	"GM_impersonate",	// 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_message_spaces( int retVal, struct map_session_data *sd, int format, char **name_, size_t *namelen_, char **message_, size_t *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->colormes( sd->fd, COLOR_RED, "You can't impersonate other players !" );			return false;		}	}	return true;}HPExport void plugin_init (void) {	clif = GET_SYMBOL("clif");	session = GET_SYMBOL("session");	strlib = GET_SYMBOL("strlib");	addHookPost("clif->process_message", clif_process_message_spaces);}
 
If I understoof those right, they are typed with either alt+number if there's no x before, otherwise number is translated fro hex to dec and used that way.

Like Alt+010 (x0A) gave me new line, same with Alt+013 (x0D), I guess one os them is n, other is r? But not sure.

Alt+160 is some "Soft Hyphen", but you know that one already(xA0). (255) is unbreakable space, alt+255. 032 is actually space itself.

ETA: New version seems much cleaner *_*

 
Last edited by a moderator:
Recently I came along this line in char.c:

#define TRIM_CHARS "255xA0032tx0Ax0D " //The following characters are trimmed regardless because they cause confusion and problems on the servers. [Skotlex]
I'm more interested to know how to type those charactersAlt + ????

those are actually meant for names

use together with

normalize_name( message, "255xA0032tx0Ax0D " );they are automatically trim into 1 single space
oh well

patch

src/map/clif.c | 7 +++++++ 1 file changed, 7 insertions(+)diff --git a/src/map/clif.c b/src/map/clif.cindex d9acf07..0118856 100644--- a/src/map/clif.c+++ b/src/map/clif.c@@ -9110,6 +9110,13 @@ bool clif_process_message(struct map_session_data *sd, int format, char **name_, *namelen_ = namelen; *message_ = message; *messagelen_ = messagelen;++ normalize_name( message, "255xA0032tx0Ax0D " );+ if ( stristr( message, "x20x3Ax20" ) || stristr( message, "x20x3Bx20" ) ) { // type " : " OR " ; " will be blocked+ clif->colormes( sd->fd, COLOR_RED, "You can't impersonate other players !" );+ return false;+ }+ return true; } plugin
Code:
#include <stdio.h>#include <stdlib.h>#include <string.h>#include "../map/pc.h"#include "../map/clif.h"#include "../common/HPMi.h"#include "../common/socket.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 = {	"GM_impersonate",	// 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_message_spaces( int retVal, struct map_session_data *sd, int format, char **name_, size_t *namelen_, char **message_, size_t *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->colormes( sd->fd, COLOR_RED, "You can't impersonate other players !" );			return false;		}	}	return true;}HPExport void plugin_init (void) {	clif = GET_SYMBOL("clif");	session = GET_SYMBOL("session");	strlib = GET_SYMBOL("strlib");	addHookPost("clif->process_message", clif_process_message_spaces);}
hey annie sorry for the necrobump but mind updating your post again? I was about to search for it
default_tongue.png


 
Back
Top