Jump to content

[TUT]Character creation with special characters


Recommended Posts

  • VIP
Posted (edited)

Hello. I found it, how can you do it from source.

 

Quote




game/src/localeservice.cpp

 search:
int check_name_alphabet(const char * str)


make like this:

int check_name_alphabet(const char * str)
{
	const char*	tmp;

	if (!str || !*str)
		return 0;

	if (strlen(str) < 2)
		return 0;

	for (tmp = str; *tmp; ++tmp)
	{
		// ¾ËÆĺª°ú ¼öÀÚ¸¸ Çã¿ë
		if (isdigit(*tmp) || isalpha(*tmp))
			continue;
#ifdef USE_SPECIAL_CHARACTERS
		switch (*tmp)
		{
		case ' ':
		case '.':
		case '-':
		case '_':
		case '@':
		case '!':
		case '^':
		case '#':
		case '$':
		case '%':
		case '&':
		case '*':
		case '(':
		case ')':
			continue;
		}
#endif
			return 0;
	}

	return check_name_independent(str);
}

 

 

Quote

server/common/service.h

add this at end of file (ATTENTION! if you have #endif in the last line, add it BEFORE!)

#define USE_SPECIAL_CHARACTERS

 

 

you can add more "case".

example: case '€':

 

Im sorry, if somewhere is already posted, but i didnt found it.

 

spacer.png

 

Have a naise day ^^

Edited by Ulthar
added image
  • Lmao 3
Link to post
  • VIP
Posted (edited)

sql injection inc

Edited by TAUMP
  • Love 1
If code.isTurkisch:
    self.suicide();
elif code.isPoland:
   self.giveHate()

 

Link to post
9 hours ago, TAUMP said:

sql injection inc

That comment is dumb af. You can't secure your self against sql injections by just disallowing people from using special characters. That's not the point of cyber defence.

Link to post
  • VIP
15 minutes ago, Denizeri24 said:

where is 

 

15 minutes ago, Denizeri24 said:

case ';'

I dont understand your question :D

Link to post
Posted (edited)
11 minutes ago, Ulthar said:

I dont understand your question :D

I think he "thought in reverse" thinking you forbid the chars at the switch while you actually allows them there. Char ';' is because it seperates sql commands to try sql injection that's why he wanted to block it while it's blocked by default.

Edited by TMP4
Link to post
3 hours ago, TMP4 said:

I think he "thought in reverse" thinking you forbid the chars at the switch while you actually allows them there. Char ';' is because it seperates sql commands to try sql injection that's why he wanted to block it while it's blocked by default.

dsmGaKWMeHXe9QuJtq_ys30PNfTGnMsRuHuo_MUz

  • Lmao 1
Link to post

Nah otherwise you could tell. You just didn't read OP's code before you wrote that comment.

Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

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



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.