Not logged inOpenClonk Forum
Up Topic General / General / Clonk Rage Game on boom.openclonk.org
- - By Andriel Date 2013-02-26 20:49 Edited 2013-02-26 20:53
Reply
Parent - - By Sven2 [de] Date 2013-02-26 20:54
Why would anyone change their CR masterserver to that of OpenClonk? It doesn't make sense.
Parent - By Nachtfalter [de] Date 2013-02-26 20:59
To get attention in this forum!
Reply
Parent - By Zapper [de] Date 2013-02-26 21:35
Blacklist their key and burn their barn, I say!
Parent - - By Newton [de] Date 2013-02-26 21:53
Parent - - By Pyrit Date 2013-03-04 20:13
And it appears that OC dies if it tries to display a list of network games, that include CR scens with Umlaute. I can't deal with that. :(
Parent - - By B_E [de] Date 2013-03-05 12:16
For reference: the masterserver delivers the unmodified CR reference with the usual \000 octed-escaped special characters. Has this behaviour maybe been modified in OC?
Parent - - By Isilkor Date 2013-03-05 12:24
My guess is that this triggers an assertion (IsValidUtf8) in the font rendering code because we forgot to reject invalid UTF-8 strings.
But this isn't a reason to forbid CR references (instead it's a reason to sanitize the received references).
Reply
Parent - - By Sven2 [de] Date 2013-03-05 12:35
Can't we just drop that assertion and let the font rendering code ignore any invalid characters?

There are so many other inputs (like chat, player/clonk names, script, almost every place that does string formatting, etc.) that would have to be checked. I think it's better if we just define any sequence of characters as valid and some are just not rendered.
Parent - - By Isilkor Date 2013-03-05 13:43
I think that assertion is fine in theory, and the actual problem is that release builds don't disable assertions. After all, this isn't technically valid input to the DrawText routine (since it expects UTF-8 and gets some other random assortment of bytes).
Reply
Parent - - By Newton [de] Date 2013-03-05 13:47
To have the assertions enabled in the release build will help us find errors in our game better though. Perhaps we could convert non-critical assertions into error logs.
Parent - By Sven2 [de] Date 2013-03-05 13:59
A log call in the drawing routine would be a bad idea though.
Parent - - By Sven2 [de] Date 2013-03-05 14:41
Some assertions might add a performance overhead, by the way. If they ever pop up in a profiler run, it might be advantageous to create two types of assertions for release and for debug builds.
Parent - By Caesar [de] Date 2013-03-05 21:39
How would assertions pop up in profiler runs? They don't generate stack entries.
Parent - By Günther [de] Date 2013-03-05 23:09
I think we'd still be better of by adding some always-fatal assertion and turn the standard assertion in release-builds off, or automatically convert them into LogSilent. This is very likely not the only assertion that was written with the assumption that assertions are turned off in release builds. After all, we had them turned off in CR.
Reply
Parent - - By Link-Mario [de] Date 2013-03-05 14:37
Until there is no way to display these invalid letters, the easiest way would be to replace them with question marks (or other signs). Then words where some letters are missing are almost readable again and it helps debuggers to guess which letters are invalid.
Reply
Parent - By Isilkor Date 2013-03-05 14:53 Edited 2013-03-05 14:57
U+FFFD REPLACEMENT CHARACTER
Incidentally, that's already what GetNextUTF8Character returns if it encounters invalid bytes.
Reply
Parent - - By Günther [de] Date 2013-03-05 23:06
We actually have a function that will make those CR references work just fine:
StdStrBuf::EnsureUnicode() // // Checks wether the contents are valid UTF-8, and if not, convert them from windows-1252 to UTF-8.
So its a one-line fix, someone just has to search the code for the right place to insert it.
Reply
Parent - - By Pyrit Date 2013-03-05 23:23
Parent - By Zapper [de] Date 2013-03-05 23:29
CStdFont::GetTextExtent? No, probably not.
Parent - - By Günther [de] Date 2013-03-07 18:54
Not revalidating everything every time we draw text might be a premature optimization, but validating things when they first enter the program feels cleaner. In other words, I meant the place where the code reads the data from the masterserver answer into the internal data structures representing that answer.
Reply
Parent - - By Sven2 [de] Date 2013-03-07 19:20
What do you mean by "it feels cleaner"? Of course we might want to validate some strings so Umlauts in the wrong charset are converted, etc. But I'd still say a clean solution would be if a text drawing routine doesn't crash the engine no matter what text you hand it.
Parent - By Günther [de] Date 2013-03-07 21:00

> What do you mean by "it feels cleaner"?


There's less invalid data in the engine. Cleaning up early feels cleaner than cleaning up late.

And of course we shouldn't crash on invalid text data. Except in debug builds, where crashing is often the most convenient way to find bugs.
Reply
Parent - By B_E [de] Date 2013-02-26 23:45
There actually is the possibility of blocking unaltered references from different engines implemented in the masterserver, but I gathered from Newtons original and latest responses that we don't really care ;-).
Parent - By Pyrit Date 2013-03-03 04:59
And who the hell plays Cauldron for 50 minutes??
Up Topic General / General / Clonk Rage Game on boom.openclonk.org

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill