Stop server from restarting map when second player joins?

User avatar
jrivett
Posts: 16
Joined: Sat Nov 26, 2011 8:03 pm
Location: Vancouver, Canada
Contact:

Re: Stop server from restarting map when second player joins

Post by jrivett »

Senshi wrote: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.
Woot! It works. You guys are awesome.

Thanks!
Waldek
Posts: 49
Joined: Thu Mar 08, 2012 12:09 pm

Re: Stop server from restarting map when second player joins

Post by Waldek »

tuia wrote: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.
Okay, I've found and edited this value, but I've got another problem. In BFSM I created a custom ingame command - !kill - by addings this line to PlayerMenu.con:

Code: Select all

Console Commands>"game.killPlayer %bfid"|cmd,[kill]


sadly this seems to work only for users that have full admin access rights. For the rest of them the BFRM says "Command failed. User XXXXX is not authorised to issue console commands." , while rest of admin commands works fine. I don't understand this :cry: At this moment the only real way of using game.killplayer command is running the slow remote console, what is not very handy.
freddy
Posts: 1247
Joined: Sun Oct 18, 2009 4:58 pm

Post by freddy »

My admins can issue console commands, most of them have rights limited to the "Players" thing in bfrm
Waldek
Posts: 49
Joined: Thu Mar 08, 2012 12:09 pm

Re: Stop server from restarting map when second player joins

Post by Waldek »

Actually I've found the reason. The "User can issue console commands" option was not enabled for every individual BFRM user :lol: Thanks Tuia and Freddy

EDIT:
BTW, are there other useful commands enabled by that hack?
reegad
Posts: 78
Joined: Mon Nov 09, 2009 3:43 pm

Re: Stop server from restarting map when second player joins

Post by reegad »

tuia wrote: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.
Did you ever find a fix for this command for linux servers?
Console Commands>"game.killPlayer %bfid"|cmd,[kill]
Image
Diamondback
Posts: 550
Joined: Mon Oct 01, 2012 3:13 pm
Location: Canada
Contact:

Re: Stop server from restarting map when second player joins

Post by Diamondback »

freddy wrote: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
Reviving a dead thread here but the aiScript class of commands doesn't work in BF1942, only in BFV and BF2.
See my Strasbourg map project here.
Post Reply