Page 1 of 1

UTStatsDB special chars filter

Posted: Thu Oct 23, 2008 10:29 pm
by omihaz
Hi

If use mutator ServerColor, server name use scecial chars for color codes. Add filter non ASCII codes please for server names.

Re: UTStatsDB special chars filter

Posted: Fri Oct 24, 2008 8:11 am
by omihaz
Use this function for filter server name:

Code: Select all

function getASCII ( $text ) { $newtext = ""; for ($i=0; $i<strlen($text); $i++) { $char = substr($text, $i, 1); $ascii = ord($char); if ($ascii > 47 && $ascii < 58) $newtext .= $char; if ($ascii > 64 && $ascii < 91) $newtext .= $char; if ($ascii > 96 && $ascii < 123) $newtext .= $char; if ($char == "-") $newtext .= $char; if ($char == "_") $newtext .= $char; if ($char == ".") $newtext .= $char; if ($char == "<") $newtext .= $char; if ($char == ">") $newtext .= $char; if ($char == " ") $newtext .= $char; if ($char == "|") $newtext .= $char; if ($char == "/") $newtext .= $char; if ($char == ":") $newtext .= $char; if ($char == "%") $newtext .= $char; } return $newtext; }

Re: UTStatsDB special chars filter

Posted: Fri Oct 24, 2008 11:26 am
by Panther
How about you just give me an example of a server name that includes these color codes in them.

Re: UTStatsDB special chars filter

Posted: Fri Oct 24, 2008 12:08 pm
by omihaz
All my UT2004 server. See:
http://stats.unreal-club.com/

Current Status for ш@@U.Zшш@one @°°
Current Status for шш@Duel ш@@U.Zшш@one @ии
Current Status for шш@Battle ш@@U.Zшш@one @шш

Color have admin name too:
http://stats.unreal-club.com/serverstats.php?server=2
|ufo|Ami@@

Re: UTStatsDB special chars filter

Posted: Fri Oct 24, 2008 12:43 pm
by Panther
Do you have a table of the color codes?

Re: UTStatsDB special chars filter

Posted: Fri Oct 24, 2008 12:48 pm
by omihaz
Information and color editor here:
http://www.proasm.com/ut/svcolor.html

Re: UTStatsDB special chars filter

Posted: Fri Oct 24, 2008 12:53 pm
by Panther
That's just download and installation instructions. How are the color codes used?

Re: UTStatsDB special chars filter

Posted: Fri Oct 24, 2008 12:54 pm
by omihaz
Archiv consist ServerColor editor program.

Re: UTStatsDB special chars filter

Posted: Fri Oct 24, 2008 7:20 pm
by Panther
I don't want the editor program, I need to know how the codes work.

Re: UTStatsDB special chars filter

Posted: Fri Oct 24, 2008 10:20 pm
by omihaz
I don't want the editor program, I need to know how the codes work.
I don't know that. But color codes this not ANCII chars, this special unicod character and it can filter my function.

Re: UTStatsDB special chars filter

Posted: Fri Oct 24, 2008 11:31 pm
by Panther
If you get the info on how the codes work I'll implement proper support for them.

Re: UTStatsDB special chars filter

Posted: Sat Oct 25, 2008 12:40 am
by Donzi

Re: UTStatsDB special chars filter

Posted: Sun Oct 26, 2008 9:53 am
by omihaz
Cool, Panther add new feature please :roll:

Re: UTStatsDB special chars filter

Posted: Sun Oct 26, 2008 10:56 pm
by Panther
No, it didn't help out at all, but I found info elsewhere. It's simply the escape character followed by three characters of value 1-255 (0 isn't allowed). I'm simply stripping out the color codes (properly). Send a log so I can test.

Re: UTStatsDB special chars filter

Posted: Mon Oct 27, 2008 2:38 am
by omihaz
Okay, test it. :arrow:

Re: UTStatsDB special chars filter

Posted: Mon Oct 27, 2008 12:13 pm
by Panther
Looks fine, and it's done without stripping out all those characters that many people do use.