Jump to content
  • 0
Sign in to follow this  
Guest Aurela

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

Question

Guest Aurela

Hello, c;

 

I need a limitation for spaces in chat.


For example:

 

Name : Hello my   name   is   l   l   l   l

 

You're only allowed to do max 3 spaces in a row. 

If anyone would be able to help me out I'd be very happy.

 

Also, I will pay for this if needed.

Edited by Aurela

Share this post


Link to post
Share on other sites

37 answers to this question

Recommended Posts

  • 0

willingly to pay ? omg, I can send this as a birthday gift

 

patch

 src/map/clif.c | 5 +++++ 1 file changed, 5 insertions(+)diff --git a/src/map/clif.c b/src/map/clif.cindex d9acf07..ede1a52 100644--- a/src/map/clif.c+++ b/src/map/clif.c@@ -9110,6 +9110,11 @@ bool clif_process_message(struct map_session_data *sd, int format, char **name_, 	*namelen_ = namelen; 	*message_ = message; 	*messagelen_ = messagelen;++	if ( stristr( message, "    " ) != NULL ) {+		clif_displaymessage( fd, "You're only allowed to do max 3 spaces in a row." );+		return false;+	} 	return true; } 
plugin
#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 = {	"max_3_space",	// 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 ) {		if ( stristr( (char*)RFIFOP( sd->fd ,4) + strnlen(sd->status.name, NAME_LENGTH-1) + 3, "    " ) != NULL ) {			clif->message( sd->fd, "You're only allowed to do max 3 spaces in a row." );			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);}

Share this post


Link to post
Share on other sites
  • 0
Guest Aurela

Awesome, thank you so much! Will try that as soon as I can and update if something does not work proper! -hugs- ♥

Share this post


Link to post
Share on other sites
  • 0

Its working and i know why you want this because of the people who are trying to scam by using spaces on pub.

They can still bypass this by using 2space+alt03232 again and again.

Edited by Lumina

Share this post


Link to post
Share on other sites
  • 0

because of the people who are trying to scam by using spaces on pub.

oh ? I thought I write this for fun without knowing what this actually does
#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 = {	"max_3_space",	// 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;		if ( stristr( message, " " ) != NULL ) {			clif->message( sd->fd, "Alt+03232 ? You must be joking, right ? Don't do that !" );			return false;		}		if ( stristr( message, "    " ) != NULL ) {			clif->message( sd->fd, "You're only allowed to do max 3 spaces in a row." );			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);}
ok this is tricky
if ( stristr( message, " " ) != NULL ) {
this is not a space

I Alt+03232 it

and Notepad++ doesn't work

has to use Windows Notepad, and manually type in Alt+03232 only works

 

hmm ... I upload the file then

max_3_space.c

 

post-4102-0-45446800-1409692542_thumb.jpg

Edited by AnnieRuru

Share this post


Link to post
Share on other sites
  • 0

@Lumina

like I said, don't use Notepad++, manually type in Microsoft Windows Notepad

classic one

 

although,

 

I got a better idea

 

since in a chatroom, to impersonate other has to type long sentence and then [space] then follow by

Name :

 

how about we restrict them by not typing like this

if ( sscanf( "%s : ", sd->name ) )

so if they type something like

"EnnyRuru : "

the script will detect it and stop it

 

 


 

just for my personal reference ...

getwaitingroomlist

pc_getwaitingroomlist

Edited by AnnieRuru

Share this post


Link to post
Share on other sites
  • 0

i did use windows notepad :D but when u transfer it to linux vps it will not work anymore hehe..

Maybe you can do that.

 

well this 3max space will help alot for sure.

Share this post


Link to post
Share on other sites
  • 0

@Lumina

like I said, don't use Notepad++, manually type in Microsoft Windows Notepad

classic one

 

although,

 

I got a better idea

 

since in a chatroom, to impersonate other has to type long sentence and then [space] then follow by

Name :

 

how about we restrict them by not typing like this

if ( sscanf( "%s : ", sd->name ) )

so if they type something like

"EnnyRuru : "

the script will detect it and stop it

 

 


 

just for my personal reference ...

getwaitingroomlist

pc_getwaitingroomlist

 

that idea is nice

Share this post


Link to post
Share on other sites
  • 0

try this

 

patch

 src/map/clif.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)diff --git a/src/map/clif.c b/src/map/clif.cindex d9acf07..42790b9 100644--- a/src/map/clif.c+++ b/src/map/clif.c@@ -9110,6 +9110,20 @@ bool clif_process_message(struct map_session_data *sd, int format, char **name_, 	*namelen_ = namelen; 	*message_ = message; 	*messagelen_ = messagelen;++	if ( sd->chatID ) {+		if ( stristr( message, ":" ) ) {+			struct chat_data *cd = (struct chat_data *)map->id2bl(sd->chatID);+			int i;+			for ( i = 0; i < cd->users; i++ ) {+				if ( stristr( message, cd->usersd[i]->status.name ) ) {+					clif->colormes( fd, COLOR_RED, "You can't impersonate others in a chatroom !" );+					return false; +				}+			}+		}+	}+ 	return true; } 
plugin
#include <stdio.h>#include <stdlib.h>#include <string.h>#include "../map/pc.h"#include "../map/clif.h"#include "../map/chat.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 = {	"chatroom_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 && sd->chatID ) {		char* message = (char*)RFIFOP( sd->fd ,4) + strnlen(sd->status.name, NAME_LENGTH-1) + 3;		if ( stristr( message, ":" ) ) {			struct chat_data *cd = (struct chat_data *)map->id2bl(sd->chatID);			int i;			for ( i = 0; i < cd->users; i++ ) {				if ( stristr( message, cd->usersd[i]->status.name ) ) {					clif->colormes( sd->fd, COLOR_RED, "You can't impersonate others in a chatroom !" );					return false; 				}			}		}	}	return true;}HPExport void plugin_init (void) {	map = GET_SYMBOL("map");	clif = GET_SYMBOL("clif");	session = GET_SYMBOL("session");	strlib = GET_SYMBOL("strlib");	addHookPost("clif->process_message", clif_process_message_spaces);}
Edited by AnnieRuru

Share this post


Link to post
Share on other sites
  • 0

 

try this

 

patch

 src/map/clif.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)diff --git a/src/map/clif.c b/src/map/clif.cindex d9acf07..42790b9 100644--- a/src/map/clif.c+++ b/src/map/clif.c@@ -9110,6 +9110,20 @@ bool clif_process_message(struct map_session_data *sd, int format, char **name_, 	*namelen_ = namelen; 	*message_ = message; 	*messagelen_ = messagelen;++	if ( sd->chatID ) {+		if ( stristr( message, ":" ) ) {+			struct chat_data *cd = (struct chat_data *)map->id2bl(sd->chatID);+			int i;+			for ( i = 0; i < cd->users; i++ ) {+				if ( stristr( message, cd->usersd[i]->status.name ) ) {+					clif->colormes( fd, COLOR_RED, "You can't impersonate others in a chatroom !" );+					return false; +				}+			}+		}+	}+ 	return true; } 
plugin
#include <stdio.h>#include <stdlib.h>#include <string.h>#include "../map/pc.h"#include "../map/clif.h"#include "../map/chat.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 = {	"chatroom_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 && sd->chatID ) {		char* message = (char*)RFIFOP( sd->fd ,4) + strnlen(sd->status.name, NAME_LENGTH-1) + 3;		if ( stristr( message, ":" ) ) {			struct chat_data *cd = (struct chat_data *)map->id2bl(sd->chatID);			int i;			for ( i = 0; i < cd->users; i++ ) {				if ( stristr( message, cd->usersd[i]->status.name ) ) {					clif->colormes( sd->fd, COLOR_RED, "You can't impersonate others in a chatroom !" );					return false; 				}			}		}	}	return true;}HPExport void plugin_init (void) {	map = GET_SYMBOL("map");	clif = GET_SYMBOL("clif");	session = GET_SYMBOL("session");	strlib = GET_SYMBOL("strlib");	addHookPost("clif->process_message", clif_process_message_spaces);}

 

Not working AnnieRuru.

Share this post


Link to post
Share on other sites
  • 0
Guest Aurela

Woah, didn't knew about the '2space+alt03232' bypass. 

Hope that AnnieRuru's idea will work and that we'll have a fix soon for this (if AnnieRuru's is really "not working"), since that guy does not stop scamming players and also blackmails them. :l 

Edited by Aurela

Share this post


Link to post
Share on other sites
  • 0

*ahem* ...

please test it and tell if it works =/

because I tested it working fine in my test server ....

 

unless you guys found some other way to bypass this

Share this post


Link to post
Share on other sites
  • 0
Guest Aurela

Apparantly it does not work if no one else is in the chatroom and also for example: 

If me and Frost are in the chat room and I try impersonate Frost, it won't work. But if AnnieRuru was online but not in the chat room, I could impersonate AnnieRuru.

If that makes sense.

Share this post


Link to post
Share on other sites
  • 0

But if AnnieRuru was online but not in the chat room, I could impersonate AnnieRuru.

wait, I thought its common sense that players only try to impersonate other players that are currently in the chat room

if AnnieRuru is not in the chatroom, of course can impersonate, but players should know that she is not in the chatroom so its busted, isn't it ?

because at the right hand side of the chatroom, it list the players currently inside

 

are you saying so I should run a loop for all online players instead of just players joined the chat room ?

Share this post


Link to post
Share on other sites
  • 0
Guest Aurela

For example:

qprkrxb3.jpg

 

The scammer creates a novice or already scammed another existing char and PM's someone with that char, saying that he's one of the admins and on his legit char.

He tells him that the GM team wants to talk to him cause the team thinks that he/she would be a good GM too. 

The scammer lures them into another town and opens a chatroom with his scammed char. If the person he talked to entered the room he starts doing this on the picture.

As you see "a gm is talking" even tho that GM is not in the chatroom. But 90% of the people don't get this trick. I had to look at it a few times too. 

He does that with serveral names and keeps confusing the player, then he gets the information he wants (account and such) and wants them to add them on skype to pay for their account, if the player wants his account back. 


Video Example

To your question: Most people dun take care of the player on the right side in that situation, it's unbelieveable but true. Edited by Aurela

Share this post


Link to post
Share on other sites
  • 0

Hmm, I remember that one. That's indeed a nice idea. But I'm at loss how to implement such a check for every char name used, unless going through all the chars for each message, and it'll kill the messaging. Btw, such trick also works for normal chat window if you leave it at default size, aka pretend you're getting PMs from GM.

Share this post


Link to post
Share on other sites
  • 0
Guest Aurela

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 :/

Edited by Aurela

Share this post


Link to post
Share on other sites
  • 0

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[i] ) ) {+				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 ...

Edited by AnnieRuru

Share this post


Link to post
Share on other sites
  • 0

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.

Share this post


Link to post
Share on other sites
  • 0

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

Share this post


Link to post
Share on other sites
  • 0

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" )

Share this post


Link to post
Share on other sites
  • 0

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 -.-"

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;}
Edited by AnnieRuru

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.