[opendemo-devel] Re: opendemo on rtcw 1.41
Status: Beta
Brought to you by:
girlich
From: Dr. U. G. <gi...@ph...> - 2003-01-23 08:10:37
|
Hello Dan! Dan Hollis <go...@an...> wrote: > At the end of ConsoleCommand() in g_svcmds.c: > if (g_dedicated.integer) { ... > return qtrue; > } > And in odr_vmMain() in odr_main.c: > case GAME_CONSOLE_COMMAND: > result = orig_vmMain(command, arg0, arg1, arg2, arg3, a$ > if (result == qfalse) > ^^^^^^^^^^^^^^^^ > result = odr_post_ConsoleCommand(); > This means on dedicated server, console commands will never reach ^^^^^^^^^ > odr_post_ConsoleCommand() ... Now I understand. You are totally right. > And I have tested it. Indeed, opendemo does not work on RTCW. On a dedicated server, you can't type in any new command. The problem exists in all OpenDemo versions (Q3A, ...). The solution would be to deactivate the dedicated server check but insert it again in odr_vmMain(). This is ugly but I have no other solution. All OpenDemo changes should touch only the absolute minimum of lines in the base code. Something like g_svcmds.c/ConsoleCommand(): if (0 && g_dedicated.integer) { ... return qtrue; } return qfalse; (1 line change) and in odr_main.c/odr_post_ConsoleCommand(): after the block if (Q_stricmp(str, "odstop") == 0) { odrRecordStop(); return qtrue; } the new part if (g_dedicated.integer) { if (Q_stricmp (cmd, "say") == 0) { trap_SendServerCommand( -1, va("print \"server: %s\"", ConcatArgs(1) ) ); return qtrue; } // everything else will also be printed as a say command trap_SendServerCommand( -1, va("print \"server: %s\"", ConcatArgs(0) ) ); return qtrue; } Here we have the problem, that this must be updated, if the corresponding code in g_svcmds.c/ConsoleCommand() will be changed. The other possibility would be to remove the additional test in odr_main.c/odr_vmMain() and always call odr_post_ConsoleCommand(). So we would not have to change anything in g_svcmds.c but we would get all odrecord and odstop commands as "server say" output too. > commands never reach opendemo code, so you can't start or stop recording. Exactly. But it works as it should on a normal player server, which I checked just yesterday evening. Bye, Uwe |