halfD has had a Mod switching/vote thing for quite some time.

http://www.halfd.org/

Mufasa
[EMAIL PROTECTED]
www.firetiger.net


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of botman
Sent: Tuesday, March 11, 2003 9:56 AM
To: [EMAIL PROTECTED]
Subject: Re: [hlcoders] Am I an idiot?


> Ah. I thought that's what it was. Can anyone suggest a workaround for not
> being able to change the mod in-game?
>
> Or should I abandon the whole idea :)

It can't be done through the engine itself.  There's no mechanism to unload
one game DLL and load another one in it's place.

The only method that I can think of for Win32 is to create a batch file that
starts the dedicated server.  Write a metamod or AdminMOD plugin that can
intercept a command ("changegame valve" or whatever), overwrite the batch
file used to start the server with a new batch file that adds "-game valve"
to the command line and have the batch file go back to the top of the file,
like this...

:loop
hlds.exe -game whatever +maxplayers 16 +map startmap
goto loop

...then have your plugin execute 'SERVER_COMMAND("exit\n")' to quit the
server.  The batch file will continue with the next line which will go back
to the top and execute the dedicated server again (this time with a
different game DLL).

I doubt this techinque would work under Linux because Win32 batch file
execution has the peculiar behavior of re-reading the batch file each time a
new line is executed (i.e. it doesn't cache the open batch file in memory
anywhere).  At least it didn't do this under MS-DOS 6.x, the behavior might
not be the same under Win2K/WinNT/WinXP, you'll have to try it yourself and
see.

Jeffrey "botman" Broome

_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives,
please visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders



_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders

Reply via email to