Bug 4505 - STANDALONE flag not working
Status: RESOLVED FIXED
Alias: None
Product: ioquake3
Classification: Unclassified
Component: Misc
Version: GIT MASTER
Hardware: PC All
: P3 normal
Assignee: Zachary J. Slater
QA Contact: ioquake3 bugzilla mailing list
URL:
Depends on:
Blocks:
 
Reported: 2010-01-17 12:54 EST by Monk
Modified: 2011-02-04 08:51:48 EST
1 user (show)

See Also:



Description Monk 2010-01-17 12:54:53 EST
Text copied from 2 threads in the forums.  At least two people have run into this, maybe more.  Wanted to pop it into bugzilla to get some exposure and see if it's an actual problem or not.  Yes, I realize the code is not in the form of a patch or diff and I apologize.  Hopefully it will be easy enough to figure out where it goes.  One person mentioned they were getting this error on every ioq3 revision after the 1.35 release which is bad if true and vexing that no one else brought it up sooner.

------------------

http://ioquake.org/forums/viewtopic.php?f=2&t=925&p=2271

There is a problem in the stand-alone version of ioqukae3. When I compile it using BUILD_STANDALONE, the resulting client gets into an endless loop when starting. It keeps printing to the console:

Loading vm file vm/ui.qvm...
ERROR: Bad system trap 53
Unloading ui.vm
...
...

(not exactly, there is more stuff but this is the informative part).

I have used the latest source from the SVN repository (rev, 1582) and compiled it under Windows XP using the MinGW / Msys system.

The problem is in the 'cl_ui.c' module. In the huge 'switch' statement handling system calls the cases for UI_GET_CDKEY, UI_SET_CDKEY and UI_VERIFY_CDKEY are completely defined out (by #ifndef STANDALONE #endif). This is incorrect, since the system calls are used even in the stand-alone version (and cause bad system call errors because the syscall numbers are not valid).

I corrected the code as follows:

...
...
   case UI_GET_CDKEY:
#ifndef STANDALONE
      CLUI_GetCDKey( VMA(1), args[2] );
#endif
      return 0;

   case UI_SET_CDKEY:
#ifndef STANDALONE
      CLUI_SetCDKey( VMA(1) );
#endif
      return 0;
   
...
...
   case UI_VERIFY_CDKEY:
#ifndef STANDALONE
      return CL_CDKeyValidate(VMA(1), VMA(2));
#else
      return 1;
#endif
...
...

------------------

http://ioquake.org/forums/viewtopic.php?f=12&t=1542

it seems this happened after each ioq3 revision since 1.35...
Ill try Ioquake3 revision 1500 compile it without any problems but when i try quake3 i get the error...

...


I am sorry, I forgot to mention that there is a third instance of the same bug. (It was a long time ago that I found and corrected these problems in the source code I use.) Change the code in 'client/cl_ui.c' near the end of the function 'CL_UISystemCalls' like this:

case UI_VERIFY_CDKEY:
#ifndef STANDALONE
return CL_CDKeyValidate(VMA(1), VMA(2));
#else
return 1;
#endif
Comment 1 Monk 2010-01-17 12:59:17 EST
Actually, now that I look at it a bit more, I'm guessing this will be a WONTFIX as it's editing the clientside UI VM stuff?  And the assumption is that anyone doing a STANDALONE will not be using the ioq3-supplied UI VM code?
Comment 2 Monk 2010-01-17 14:44:46 EST
Yeah, I can replicate this.  The opening cinematic plays and then the screen goes blank.  I can hit my console key and then type /quit and it quits normally.  I don't see anything onscreen while doing that.

I also see where stderr.txt keeps building in size as ioq3 tries to load the UI over and over in a loop.  I made sure that the updated ui vm was used and also tried it with the dll version (and game and cgame) and got the same Error: Bad UI system trap: 53 that other blokes were seeing.

So yes I realize that someone making a standalone should probably have removed any cdkey checks themselves already but I have to think that coders unfamiliar with the Q3 codebase will try to just run their regular Q3 assets as a "standalone" and work from there, tweaking things as they go along.  That being the case, I can see why people would consider this a "bug"--they wouldn't necessarily be expecting to rip out code when they are unfamiliar with the codebase and have been told that they can remove the CD key check by using the "standalone" flag.

If this is not something that will be fixed codewise, I'll add it to the FAQ in the forums and/or on the wiki so that when someone runs into this again people can at least link them somewhere to read the manual fix.
Comment 3 Thilo Schulz 2011-02-04 08:51:48 EST
Ludwig seems to have fixed that in r1777