Page 1 of 2

bf1942_lnxded server fixes

Posted: Wed Dec 26, 2018 10:15 pm
by russ
I've been maintaining a set of Linux dedicated server fixes for a while, but I'm opening it up to a wider audience

This includes a number of patches that have been floating around as well as a number of new fixes. The important gameplay changes are:

* Weapon deviation is set to max when selecting a weapon: Weapon deviation does not change for weapons that are not selected. Some players take advantage of this by keeping their weapon stowed while moving and then selecting it right before firing.

* Player names are sanitized: No more player names with special characters, leading/trailing spaces, or names shorter than 3 letters.

* Assault maps now award victory to the defending team if they survive until end of round (Wake, Omaha, etc). This is what was originally intended, but due to a typo never took effect.

* Death bubble now gives damage to players rather than their vehicle. This prevents the death bubble zombie wreckage problem.

Code: Select all

# Team S.W.A.T Release
# VERSION=1.8
#
# Battlefield 1942 v1.61 Linux server patched
#
# Modified to include:
# - Support for up to 128 players
# - master.bf1942.sk replacement for gamespy master
# - Ignore client version and checksum (allow 1.61b and 1.612)
# - Ignore CD key checks
# - No longer sends player keyhashes to public queries
# - Allows all console commands on remote and local console
# - Fixes segfault in dice::bf::GameServer::radioMessage
# - Fixes sefgault in dice::ref2::io::NetworkManager::getNetUpdate
# - Fixes segfault in dice::ref2::world::ObjectManager::checkMessages
# - Fixes IP bans not taking effect
# - Set weapon deviation to max when putting weapon away
# - Fixup player names (nonprintables, too short, etc)
# - Fix assaultTeam typo. Defending team now wins if timer expires
# - Fix armor zombies generated by death bubble
# - Fix segfault due to death bubble fix
# - Fixes segfault in dice::ref2::world::FireArms::Fire
# - Fixes segfault in dice::ref2::io::NetworkManager::getNetUpdateDelta
# - Fixes segfault in dice::ref2::world::BFSoldier::handleUpdate
#
# Addresses the following vulnerabilities:
# - BFE-200806.01
# - BFE-201107.01
# - BFE-201111.01
# - BFE-201211.01
# - BFE-201611.01
# - BFE-201611.02
# - BFE-201710.01
# - BFE-201804.01
aa11b4f01501cc1a9f21d58dabe2277b  bf1942_lnxded.static
7a1983a4fffe6b387ed42a50197a1538  bf1942_lnxded.dynamic
https://drive.google.com/open?id=1XRxv9 ... Eay0k3TX65

Re: bf1942_lnxded server fixes

Posted: Sat Jan 05, 2019 2:24 am
by duffman
Some serious debugging you been doing!
Have a Linux server used for gaming so applied your patched binaries. (Yet to do some proper field-testing.)
Well done!

Re: bf1942_lnxded server fixes

Posted: Sat Feb 23, 2019 2:49 pm
by Grabbi
impressive work!

This topic should be moved to Battlefield server and client area

It solves so many problems for ppl/communities running a BF1942 server beeing under hacker attacks.
and threads posted here with 35000+ views like mine three years ago looking for a solution to these problems:
https://bfmods.com/viewtopic.php?f=54&t=5647
https://bfmods.com/viewtopic.php?f=54&t=1477

Thank you for this awesome work Russ!

Greetings

Grabbi

Re: bf1942_lnxded server fixes

Posted: Mon Apr 08, 2019 7:29 pm
by Diamondback
russ wrote:I've been maintaining a set of Linux dedicated server fixes for a while, but I'm opening it up to a wider audience

This includes a number of patches that have been floating around as well as a number of new fixes. The important gameplay changes are:

* Weapon deviation is set to max when selecting a weapon: Weapon deviation does not change for weapons that are not selected. Some players take advantage of this by keeping their weapon stowed while moving and then selecting it right before firing.

* Player names are sanitized: No more player names with special characters, leading/trailing spaces, or names shorter than 3 letters.

* Assault maps now award victory to the defending team if they survive until end of round (Wake, Omaha, etc). This is what was originally intended, but due to a typo never took effect.

* Death bubble now gives damage to players rather than their vehicle. This prevents the death bubble zombie wreckage problem.

Code: Select all

# Team S.W.A.T Release
# VERSION=1.8
#
# Battlefield 1942 v1.61 Linux server patched
#
# Modified to include:
# - Support for up to 128 players
# - master.bf1942.sk replacement for gamespy master
# - Ignore client version and checksum (allow 1.61b and 1.612)
# - Ignore CD key checks
# - No longer sends player keyhashes to public queries
# - Allows all console commands on remote and local console
# - Fixes segfault in dice::bf::GameServer::radioMessage
# - Fixes sefgault in dice::ref2::io::NetworkManager::getNetUpdate
# - Fixes segfault in dice::ref2::world::ObjectManager::checkMessages
# - Fixes IP bans not taking effect
# - Set weapon deviation to max when putting weapon away
# - Fixup player names (nonprintables, too short, etc)
# - Fix assaultTeam typo. Defending team now wins if timer expires
# - Fix armor zombies generated by death bubble
# - Fix segfault due to death bubble fix
# - Fixes segfault in dice::ref2::world::FireArms::Fire
# - Fixes segfault in dice::ref2::io::NetworkManager::getNetUpdateDelta
# - Fixes segfault in dice::ref2::world::BFSoldier::handleUpdate
#
# Addresses the following vulnerabilities:
# - BFE-200806.01
# - BFE-201107.01
# - BFE-201111.01
# - BFE-201211.01
# - BFE-201611.01
# - BFE-201611.02
# - BFE-201710.01
# - BFE-201804.01
aa11b4f01501cc1a9f21d58dabe2277b  bf1942_lnxded.static
7a1983a4fffe6b387ed42a50197a1538  bf1942_lnxded.dynamic
https://drive.google.com/open?id=1XRxv9 ... Eay0k3TX65
Thanks Russ, I think I’ll use this for my mod.

Just a quick question, when you mention the patched server files support all the console commands, does this mean all Debugger commands work as well, such as the player class of commands (player.active, player.vehicle).

Someone should sticky this.

Re: bf1942_lnxded server fixes

Posted: Tue Apr 09, 2019 9:42 am
by russ
Yup, those should be available as well.

Re: bf1942_lnxded server fixes

Posted: Tue Apr 09, 2019 12:48 pm
by Diamondback
Great, thank you. How were you able to make the Debugger commands work? And also, did you discover some previously unused commands?

Re: bf1942_lnxded server fixes

Posted: Thu Apr 11, 2019 7:08 am
by russ
There's a place in the code where it checks if a command should be allowed. The patch is just to short circuit that. There's a couple of sites out there that document all the bf commands.

Re: bf1942_lnxded server fixes

Posted: Fri Apr 12, 2019 4:42 pm
by Diamondback
russ wrote:There's a place in the code where it checks if a command should be allowed. The patch is just to short circuit that. There's a couple of sites out there that document all the bf commands.
I’ll try to test all the commands from the Debugger that have been causing trouble for me so far and I’ll report back on this thread. It would be pretty cool to have game.drawDebug working on MP servers, for cheat detection purposes.

Re: bf1942_lnxded server fixes

Posted: Sat Apr 13, 2019 5:21 am
by russ
This is just the linux dedicated binary. You still won't be able to run arbitrary console commands client side and the binary is headless, so drawDebug the command is there, but of course won't have any effect on non-existent rendering.

Re: bf1942_lnxded server fixes

Posted: Sat Apr 13, 2019 1:46 pm
by Diamondback
russ wrote:This is just the linux dedicated binary. You still won't be able to run arbitrary console commands client side and the binary is headless, so drawDebug the command is there, but of course won't have any effect on non-existent rendering.
Actually, drawDebug seems to be specific to BF1942_r.exe (the Debugger). When entering that command in a local server while using the normal BF1942.exe, the console gives the following error: "Uknown method or object". So it doesn't work unless I guess someone patches it in the BF1942.exe? If that's the case, it's no big deal.

I have noticed that a vast majority of the commands that are entered in the console which return the "Unauthorized method" error can actually be ran from a patched RFA file. That is the basis of how my Console Unlocker script works. Most of the commands that it uses cannot be entered in the game console client side, but a patched RFA enables the unauthorized console commands.

EDIT: game.drawDebug works on a local server WITHOUT using the Debugger EXE, but does not work on an Internet server. I was able to make the command work by patching my Berlin.rfa file with game.drawDebug 1, and I could see bullet tracing without any problem. This was done without using the server files you made russ. I am still waiting for the administrator of my server to install these on my server. I will see if there is any difference with your server files by patching the RFA.