Page 2 of 3

Re: Stop server from restarting map when second player joins

PostPosted: Thu May 24, 2012 11:03 pm
by tuia
It's not documented here in the public forum, freddy asked me to patch the server executable, so that some commands, like game.killPlayer could be run.
You need to go to 0x00558268 address or 0x00158268 offset and change the byte value 75 to EB and save the file. After that, typing those commands from the server console won't prompt the "Unauthorized method" error message and they will be executed.

Re: Stop server from restarting map when second player joins

PostPosted: Fri May 25, 2012 12:01 am
by jrivett
Ok, thanks!

Re: Stop server from restarting map when second player joins

PostPosted: Fri May 25, 2012 4:55 am
by freddy
i ran the command from file with the unpatched exe so it doesnt seems totally locked out, there seems to be some different access levels but there is not much documention to find about it. i guess reading from file is the highest "normal" access you can get.

http://bfmods.com/mdt/scripting/Console ... ccess.html
Code: Select all
c_totalAccess
 c_fullAccess
 c_endUserAccess
 c_noAccess

***************************************************************************************************************************************************************************************

what do you guys think about this, its supposed to be for bf42, i found it when i was googling around and i wonder if it have any substance to it, i dont have enough programming skills to determine if its meant just for bots or if it could be used to other things like perhaps a random event generator.

For the more advanced people i might to point out the undocumented <aiScript> class which is able to create scripts on the fly with nested expressions, even with subroutines.

aiScript.createScript 1 // start a new with id=1
aiScript.createScriptCommand ...
aiScript.createScriptVariable ...
aiScript.createScriptFlow ...
<complex statements, subroutines, expressions>
aiScript.endScript
aiScript.close
aiScript.runScript 1 // execute me

Re: Stop server from restarting map when second player joins

PostPosted: Sun Jun 17, 2012 12:42 pm
by tuia
freddy, is right. You can add game.setMinNrOfPlayers 0 to your init.con inside your map .rfa file. It's cleaner and easier than patching the server executable. You'll have to add that command to all your map files, though.

Re: Stop server from restarting map when second player joins

PostPosted: Sun Jun 17, 2012 2:35 pm
by jrivett
tuia wrote:freddy, is right. You can add game.setMinNrOfPlayers 0 to your init.con inside your map .rfa file. It's cleaner and easier than patching the server executable. You'll have to add that command to all your map files, though.

Cleaner, perhaps, but not easier - at least not for me. Presumably it's a server-side mod? Anyway, I'll keep it in mind. I would have tried that approach earlier but I couldn't get freddy to tell me where the setting was supposed to go. Meanwhile, the EXE patch seems to be working fine. Thanks!

Re: Stop server from restarting map when second player joins

PostPosted: Thu Mar 14, 2013 4:35 pm
by jrivett
Tuia: I hate to be a bother, but is there any chance you could find the code to change in the Linux server? I recently switched to Linux hardware (finally), and people are already complaining that the second player to join restarts the current map. Alternatively, if there's a particular hex string or set of instructions I should look for, I should be able to figure out which byte to change based on what you've already said.

I'm running the version 1.61 dynamic Linux server with the patches you already provided to prevent hacks.

(crossing my fingers)
Thanks in advance!
Jeff

Re: Stop server from restarting map when second player joins

PostPosted: Wed Mar 20, 2013 11:18 pm
by tuia
Hi!

I did a quick check at BF1942 Linux server code and could not find it. I can't remember now how I found that function in BF1942 Windows server. This weekend I'll try to look further.
You can use "game.setMinNrOfPlayers 0" command in each of your map files as a temporary workaround.

Re: Stop server from restarting map when second player joins

PostPosted: Wed Mar 20, 2013 11:35 pm
by Senshi
You can also add this line:
"game.setMinNrOfPlayers 0" to a basic common file that gets called for every map. Like the soldier.inc. That goes for every SSM modding/setting you want to apply for ALL maps.

Re: Stop server from restarting map when second player joins

PostPosted: Wed Apr 03, 2013 2:27 pm
by jrivett
Senshi wrote:You can also add this line:
"game.setMinNrOfPlayers 0" to a basic common file that gets called for every map. Like the soldier.inc. That goes for every SSM modding/setting you want to apply for ALL maps.

Thanks for the additional info. I looked for soldier.inc and wasn't able to find it. Were you referring to the files in "bf1942/game/common"? They are "AmericanNames.con", etc. If so, presumably I would have to add the setting to all five of those files.

Would the server executable need to be patched to allow this? I'm referring to the patch tuia found for freddy that eliminates restrictions on otherwise restricted commands like "game.killPlayer" (see above).

Re: Stop server from restarting map when second player joins

PostPosted: Wed Apr 03, 2013 11:52 pm
by Senshi
No need to edit the .exe .

Sorry, I gave you the wrong filename. Look for "objects\Soldiers\common\CommonSoldierData.inc" . That's a file that is called whenever a soldier is required (be it bot or player), so it allows to easily "hook" in commands that you want to apply universally.