Stop server from restarting map when second player joins?

Re: Stop server from restarting map when second player joins

Postby tuia » Thu May 24, 2012 11:03 pm

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.
tuia
 
Posts: 129
Joined: Tue Sep 06, 2011 12:36 pm
Location: Lisbon, Portugal

Re: Stop server from restarting map when second player joins

Postby jrivett » Fri May 25, 2012 12:01 am

Ok, thanks!
User avatar
jrivett
 
Posts: 15
Joined: Sat Nov 26, 2011 8:03 pm
Location: Vancouver, Canada

Re: Stop server from restarting map when second player joins

Postby freddy » Fri May 25, 2012 4:55 am

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
User avatar
freddy
 
Posts: 1230
Joined: Sun Oct 18, 2009 4:58 pm

Re: Stop server from restarting map when second player joins

Postby tuia » Sun Jun 17, 2012 12:42 pm

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.
tuia
 
Posts: 129
Joined: Tue Sep 06, 2011 12:36 pm
Location: Lisbon, Portugal

Re: Stop server from restarting map when second player joins

Postby jrivett » Sun Jun 17, 2012 2:35 pm

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!
User avatar
jrivett
 
Posts: 15
Joined: Sat Nov 26, 2011 8:03 pm
Location: Vancouver, Canada

Postby freddy » Mon Jun 18, 2012 3:48 am

sorry i couldnt confirm the file method right away, i just saw your post and remembered ivé seen some code that could solve the problem. just had time to run some quick tests.
User avatar
freddy
 
Posts: 1230
Joined: Sun Oct 18, 2009 4:58 pm

Re:

Postby jrivett » Mon Jun 18, 2012 2:01 pm

freddy wrote:sorry i couldnt confirm the file method right away

No problem! I've filed this away for future experiments. Thanks for the information.
User avatar
jrivett
 
Posts: 15
Joined: Sat Nov 26, 2011 8:03 pm
Location: Vancouver, Canada

Re: Stop server from restarting map when second player joins

Postby jrivett » Thu Mar 14, 2013 4:35 pm

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
User avatar
jrivett
 
Posts: 15
Joined: Sat Nov 26, 2011 8:03 pm
Location: Vancouver, Canada

Re: Stop server from restarting map when second player joins

Postby tuia » Wed Mar 20, 2013 11:18 pm

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.
tuia
 
Posts: 129
Joined: Tue Sep 06, 2011 12:36 pm
Location: Lisbon, Portugal

Re: Stop server from restarting map when second player joins

Postby Senshi » Wed Mar 20, 2013 11:35 pm

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.
User avatar
Senshi
 
Posts: 695
Joined: Sun Oct 18, 2009 1:14 pm
Location: Germany

PreviousNext

Return to Battlefield server and client

Who is online

Users browsing this forum: No registered users and 3 guests

cron