UTStatsDB special chars filter

General forum for discussions regarding UTStatsDB
omihaz
Posts: 65
Joined: Thu Dec 20, 2007 10:19 am

UTStatsDB special chars filter

Postby omihaz » Thu Oct 23, 2008 10:29 pm

Hi

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

omihaz
Posts: 65
Joined: Thu Dec 20, 2007 10:19 am

Re: UTStatsDB special chars filter

Postby omihaz » Fri Oct 24, 2008 8:11 am

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; }

Panther
Site Admin
Posts: 500
Joined: Sat Dec 08, 2007 12:51 am
Contact:

Re: UTStatsDB special chars filter

Postby Panther » Fri Oct 24, 2008 11:26 am

How about you just give me an example of a server name that includes these color codes in them.

omihaz
Posts: 65
Joined: Thu Dec 20, 2007 10:19 am

Re: UTStatsDB special chars filter

Postby omihaz » Fri Oct 24, 2008 12:08 pm

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@@

Panther
Site Admin
Posts: 500
Joined: Sat Dec 08, 2007 12:51 am
Contact:

Re: UTStatsDB special chars filter

Postby Panther » Fri Oct 24, 2008 12:43 pm

Do you have a table of the color codes?

omihaz
Posts: 65
Joined: Thu Dec 20, 2007 10:19 am

Re: UTStatsDB special chars filter

Postby omihaz » Fri Oct 24, 2008 12:48 pm

Information and color editor here:
http://www.proasm.com/ut/svcolor.html

Panther
Site Admin
Posts: 500
Joined: Sat Dec 08, 2007 12:51 am
Contact:

Re: UTStatsDB special chars filter

Postby Panther » Fri Oct 24, 2008 12:53 pm

That's just download and installation instructions. How are the color codes used?

omihaz
Posts: 65
Joined: Thu Dec 20, 2007 10:19 am

Re: UTStatsDB special chars filter

Postby omihaz » Fri Oct 24, 2008 12:54 pm

Archiv consist ServerColor editor program.

Panther
Site Admin
Posts: 500
Joined: Sat Dec 08, 2007 12:51 am
Contact:

Re: UTStatsDB special chars filter

Postby Panther » Fri Oct 24, 2008 7:20 pm

I don't want the editor program, I need to know how the codes work.

omihaz
Posts: 65
Joined: Thu Dec 20, 2007 10:19 am

Re: UTStatsDB special chars filter

Postby omihaz » Fri Oct 24, 2008 10:20 pm

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.

Panther
Site Admin
Posts: 500
Joined: Sat Dec 08, 2007 12:51 am
Contact:

Re: UTStatsDB special chars filter

Postby Panther » Fri Oct 24, 2008 11:31 pm

If you get the info on how the codes work I'll implement proper support for them.

Donzi
Posts: 17
Joined: Wed Oct 01, 2008 7:59 am
Location: Germany
Contact:

Re: UTStatsDB special chars filter

Postby Donzi » Sat Oct 25, 2008 12:40 am


omihaz
Posts: 65
Joined: Thu Dec 20, 2007 10:19 am

Re: UTStatsDB special chars filter

Postby omihaz » Sun Oct 26, 2008 9:53 am

Cool, Panther add new feature please :roll:

Panther
Site Admin
Posts: 500
Joined: Sat Dec 08, 2007 12:51 am
Contact:

Re: UTStatsDB special chars filter

Postby Panther » Sun Oct 26, 2008 10:56 pm

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.

omihaz
Posts: 65
Joined: Thu Dec 20, 2007 10:19 am

Re: UTStatsDB special chars filter

Postby omihaz » Mon Oct 27, 2008 2:38 am

Okay, test it. :arrow:
Attachments
Stats_7777_2008_10_26_19_05_36.log
(2.73 KiB) Downloaded 216 times

Panther
Site Admin
Posts: 500
Joined: Sat Dec 08, 2007 12:51 am
Contact:

Re: UTStatsDB special chars filter

Postby Panther » Mon Oct 27, 2008 12:13 pm

Looks fine, and it's done without stripping out all those characters that many people do use.


Return to “UTStatsDB”