bf1942_lnxded server fixes

Ask questions, discuss ideas, get answers
russ
Posts: 73
Joined: Sun Oct 29, 2017 8:12 am

Re: bf1942_lnxded server fixes

Post by russ »

Adding that command to the RFA on the server won't effect your client. If you want to use these commands, I think running a non-internet server and connecting with BF1942_r.exe will get you going. Anything else would be discussion of enabling blatant cheats.
Diamondback
Posts: 589
Joined: Mon Oct 01, 2012 3:13 pm
Location: Canada
Contact:

Re: bf1942_lnxded server fixes

Post by Diamondback »

russ wrote:Adding that command to the RFA on the server won't effect your client. If you want to use these commands, I think running a non-internet server and connecting with BF1942_r.exe will get you going. Anything else would be discussion of enabling blatant cheats.
Debugger doesn't need to be enabled to use the game.drawDebug command, it works on a local server (GMSingle) if the server and client use the exact same patched RFAs, with the command in a CON file somewhere. However, it does not work online as you mentionned. I think game.drawDebug is far from a cheat, it actually could have been used by server hosts to track down players whom they think might be using accuracy/auto-aim/aimbot hacks by looking at their aiming patterns, but that's a debate for a different thread.

I have been debugging various console commands listed on 4CentsShy's website to try to make them work online and in a local server. The good thing is that some previously unused commands can be used in a beneficial way by clients and server hosts. There is literally two classes of commands, the player class and the fileManager class, which can be used with conditional statements to verify certain conditions while in a local or online server, and execute code if the conditions have been met. The bad thing is some very interesting commands either do not work at all or only work on a local server. More about this later.

The player and fileManager commands could have some very interesting applications, especially for the fileManager class, as it can be used as a very rudimentary file checking system to make sure a client has the same RFAs as the server and does not run RFA patches which are illegal (ie, to run cheats). It can also be run to execute other kind of file checks, most notably a map checking script which verifies if a client has a certain map, and if they dont, the script would show a link to download the map and/or disconnect the client and (but I don't think this can be done without a BF1942.exe edit) redirect the client to the website that contains the map.

The player class is pretty cool, I've been testing the player.active command and the player.isAlive command. The second command has a lot of potential, as I was able to sucessfully check if my in game character was alive or not in an Internet server. This means you can selectively run code depending on if a player is dead or alive. Cool stuff. player.kit, player.team, player.isAi, player.vehicleHP all need to be tested online but they work in a local server.

With player.vehicle and object.absolutePosition I was able to create a script that returns the current position of my in game character as a Vector 3 (x/y/z) and prints it on my screen with debug.debugOutputMessage. This can be useful for modding or debugging a map, as you can get the coordinates of your position on the map by pressing a key which is bound to the "locator" script. However, as I mentionned above, object.absolutePosition does not work online, only in a local server. I haven't tested it for Singleplayer but I assume it should work.

One of the most important things I discovered, which might not come as a surprise for the most advanced modders on this forum, is that you can declare variables in a remote CON file and include these variables in another CON file. This is incredibly useful if you declare variables that you want to use for multiple maps, instead of declaring the variables in each map in the init.con or another CON file, you can create a file called "variables.con" in your game.rfa, and include that file for each map that needs it using the include command. You will have to wrap your include statement with console.useRelativePaths 0 and console.useRelativePaths 1. This discovery could potentially permit creating mod-specific settings using CON files. These settings could overwrite the Settings folder in the default bf1942 mod folder. So for if example in your mod, you want the mouse sensitivity to be lower than in the retail bf1942 mod, it could potentially be done. I say potentially because I haven't tested this fully yet, but was able to assign different values to the player.active command, depending on my in-game name.

I have more debugging to do to make some new commands work. Of course I am not trying out cheats, just legitimate commands. I will post my progress as I discover new things.

Oh and there are two new commands which haven't been documented yet for BF1942, but documented for BF Vietnam: profiler.reportPerTimer and profiler.runAutoReport. These two commands have been tested by me with the BF1942 Debugger and both work. The first command returns the time, in milliseconds, allocated to every element the game loaded when the map loaded and I can't remember what the second command does.

EDIT: Yup, player.team and player.kit both work on an Internet server as intended. The only problem is that once the player respawns, incorrect values can be returned for the player.kit command. Trying to fix this.
See my Strasbourg map project here.
User avatar
jrivett
Posts: 17
Joined: Sat Nov 26, 2011 8:03 pm
Location: Vancouver, Canada
Contact:

Re: bf1942_lnxded server fixes

Post by jrivett »

I only just discovered this. Thanks for making this patched server available. Great work!

However, I would like to be able to apply the changes individually, as I'm not sure I want all of them, and my current server has some other patches applied already.

I don't suppose you'd consider posting the individual patches, would you?
henk
Posts: 16
Joined: Sat Mar 07, 2020 7:10 pm

Re: bf1942_lnxded server fixes

Post by henk »

Russ isnt active anymore. I do have access to the patches. But there are indeed reasons to not make them public
Post Reply