logo
Main

Forums

Downloads

Unreal-Netiquette

Donate for Oldunreal:
Donate

borderline

Links to our wiki:
Wiki

Walkthrough

Links

Tutorials

Unreal Reference

Usermaps

borderline

Contact us:
Submit News
Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Colored text issues (Read 949 times)
Leo T_C_K
Betatester
Offline



Posts: 1968
Joined: Aug 27th, 2005
Gender: Male
Colored text issues
Jul 4th, 2016 at 1:13am
Print Post  
First, the colored text appears mangled on all the standard browsers outside the patch (including UT's and earlier oldunreal patches)


Second, sorting servers by name will get weird results with the colored text ones even in 227....

zeurkous thinks that "ANSI escape codes would seem to be called for."

  

People who accuse others of trolling are usually the biggest trolls themselves.
Back to top
YouTube  
IP Logged
 
BobIsUnreal
God Member
*****
Offline


Guy who has too much time
invested to quit now

Posts: 735
Joined: Apr 12th, 2010
Gender: Male
Re: Colored text issues
Reply #1 - Jul 4th, 2016 at 4:57am
Print Post  
hmm , is it possible to identify the client version during  the  server query response in any way?
would be interesting to change client query reply  in a serverside custom query based on client build , respond with a clean  name vs colored name.

Would be careful "fixing" stuff like this , fe  names/chat with certain characters you choose already to restrict/ break , and the issue trikkles down to other things , like i cant use invisible space char anymore in uscripts as a delimiter since  one of the i/j build and it get converted to some other visible character.
  

[REM_img]http://i.imgur.com/V3OSsDu.gif.disable[/img]http://i.imgur.com/JOu38Gs.gif
Back to top
IP Logged
 
Leo T_C_K
Betatester
Offline



Posts: 1968
Joined: Aug 27th, 2005
Gender: Male
Re: Colored text issues
Reply #2 - Jul 4th, 2016 at 5:13am
Print Post  
BobIsUnreal wrote on Jul 4th, 2016 at 4:57am:
hmm , is it possible to identify the client version during  the  server query response in any way?
would be interesting to change client query reply  in a serverside custom query based on client build , respond with a clean  name vs colored name.

Would be careful "fixing" stuff like this , fe  names/chat with certain characters you choose already to restrict/ break , and the issue trikkles down to other things , like i cant use invisible space char anymore in uscripts as a delimiter since  one of the i/j build and it get converted to some other visible character.

It should be possible actually, I hope so at least. It's possible in other cases too ingame not having to do with login (I myself used this to have different behavior of something on 224/225 and further). Login is one thing though...the server gets already client request but I'm not so sure about the query then. Then again the client querying is also dependand on version as in the reason why you don't see ut servers normally I think....but whether that can go through the individual server. Either way this should be possible at least master-server side.
  

People who accuse others of trolling are usually the biggest trolls themselves.
Back to top
YouTube  
IP Logged
 
Masterkent
Developer Team
Offline



Posts: 890
Location: Russia
Joined: Apr 5th, 2013
Gender: Male
Re: Colored text issues
Reply #3 - Jul 4th, 2016 at 10:09am
Print Post  
Leo T_C_K wrote on Jul 4th, 2016 at 1:13am:
Second, sorting servers by name will get weird results with the colored text ones even in 227....

This one should be easy to fix:

In class UBrowser.UBrowserServerGrid

Code
Select All
function bool ByName(UBrowserServerList T, UBrowserServerList B)
{
	local bool bResult;

	if (B == None) return True;
	if (T.Ping == 9999) return False;
	if (B.Ping == 9999) return True;

	if (DiscardColorCodes(T.HostName) < DiscardColorCodes(B.HostName))
	{
		bResult = True;
	}
	else if (DiscardColorCodes(T.HostName) > DiscardColorCodes(B.HostName))
	{
		bResult = False;
	}
	else
	{
		return (T.Ping < B.Ping);
	}

	if (bSortDescending)
		bResult = !bResult;

	return bResult;
}

final function string DiscardColorCodes(string S)
{
	class'GameInfo'.static.StripColorCodes(S);
	return S;
} 


Similarly for other columns. DiscardColorCodes could be made a native core.object function.

BobIsUnreal wrote on Jul 4th, 2016 at 4:57am:
hmm , is it possible to identify the client version during  the  server query response in any way?
would be interesting to change client query reply  in a serverside custom query based on client build , respond with a clean  name vs colored name.

That would be an ideal solution. Alternatively, it's possible to send both old-style and new-style server names in the same query packets. For example, change the current format

\hostname\ServerName

to

\hostname\OldStyleServerName\+NewStyleServerName

where NewStyleServerName is a string that may include color codes and OldStyleServerName is NewStyleServerName without color codes.

Pre-227j clients would use OldStyleServerName, 227j clients would use NewStyleServerName. When \hostname\OldStyleServerName is not followed by \+<any character except backslash>, 227j clients would use OldStyleServerName.

The disadvantages are: 227i clients won't use colored strings, and query strings become longer.

Note that player names and map titles may include color codes too. Also I'd like to point out that player names may use characters that are not representable in the 8-bit encoding format that is currently used for transferring such strings from server to client. Sometimes player names look partially or completely invisible in server browser due to this issue. Converting the original UTF-16 strings to UTF-8 before sending and then back to UTF-16 when receiving could resolve this problem (ideally, old clients should still receive and use strings in the old 8-bit encoding format and new clients should not interpret strings that use old encoding as UTF-8 encoded).
« Last Edit: Jul 4th, 2016 at 12:31pm by Masterkent »  
Back to top
 
IP Logged
 
Smirftsch
Forum Administrator
*****
Offline



Posts: 7552
Location: at home
Joined: Apr 30th, 1998
Gender: Male
Re: Colored text issues
Reply #4 - Jul 5th, 2016 at 11:10am
Print Post  
Sorting by servername definitely should be working, this solution is very much appreciated. Thanks for working it out, MK.
However, I don't want to mess with query strings right now, I would want to check if the additional length and related changes could have any unwanted side effects, so I am putting it on the list, but with little priority, I have so many things to do yet and the little annoyance of a very few messy strings in serverbrowser with older versions seems to be almost not worth the work.
  

Sometimes you have to lose a fight to win the war.
Back to top
WWWICQ  
IP Logged
 
Masterkent
Developer Team
Offline



Posts: 890
Location: Russia
Joined: Apr 5th, 2013
Gender: Male
Re: Colored text issues
Reply #5 - Jul 6th, 2016 at 12:03pm
Print Post  
Maybe the string comparisons should also be case-insensitive, except using case-sensitive comparisons when two strings would be considered equal otherwise:

Code
Select All
function bool ByName(UBrowserServerList T, UBrowserServerList B)
{
	local int Result;

	if (B == None) return True;
	if (T.Ping == 9999) return False;
	if (B.Ping == 9999) return True;

	Result = CompareStrings(T.HostName, B.HostName);
	if (Result == 0)
		return T.Ping < B.Ping;

	if (bSortDescending)
		return Result > 0;
	return Result < 0;
}

final function int CompareStrings(string S1, string S2)
{
	class'GameInfo'.static.StripColorCodes(S1);
	class'GameInfo'.static.StripColorCodes(S2);
	if (Caps(S1) < Caps(S2))
		return -1;
	if (Caps(S2) < Caps(S1))
		return 1;
	if (S1 < S2)
		return -1;
	if (S2 < S1)
		return 1;
	return 0;
} 


So names ABC, abc, BCD would be ordered as ABC -> abc -> BCD rather than ABC -> BCD -> abc
  
Back to top
 
IP Logged
 
Smirftsch
Forum Administrator
*****
Offline



Posts: 7552
Location: at home
Joined: Apr 30th, 1998
Gender: Male
Re: Colored text issues
Reply #6 - Jul 8th, 2016 at 12:49pm
Print Post  
updated accordingly.
  

Sometimes you have to lose a fight to win the war.
Back to top
WWWICQ  
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint
Bookmarks: del.icio.us Digg Facebook Google Google+ Linked in reddit StumbleUpon Twitter Yahoo