FakeFishGames / Barotrauma

A 2D online multiplayer game taking place in a submarine travelling through the icy depths of Jupiter's moon Europa.
http://www.barotraumagame.com/
1.74k stars 405 forks source link

It is possible to join servers with job preferences that are otherwise hidden in selection (but not spawn as) #9604

Closed NilanthAnimosus closed 2 years ago

NilanthAnimosus commented 2 years ago

Disclaimers

What happened?

It is possible to edit your player config file to set preferences to NPC only jobs such as vipsecurityofficer or prisoner which will show (for the player and other clients) as their preferred job in a lobby.

This does not cause the job to actually be picked when a round starts with vanilla NPC jobs (going for the 2nd/3rd preference or a random job if their all NPC jobs) but still probably doesn't make sense to be doable, especially if it works with ones that have positive/no limits set or something in modded jobs (As I don't know what'd happen there).

Essentially this allows you to pick hiddenjobs, which I also believe the server doesn't strictly prevent you from spawning as (I think?)

Reproduction steps

Edit the player config file to have job preferences that otherwise cannot be selected, such as prisoner or vip, IE:

<player
    name="Bob"
    tags=""
    HairIndex="6"
    BeardIndex="13"
    MoustacheIndex="0"
    FaceAttachmentIndex="0"
    HairColor="#000000"
    FacialHairColor="#000000"
    SkinColor="#000000">
    <job
      identifier="vipsecurityofficer"
      variant="-1" />
    <job
      identifier="prisoner"
      variant="0" />
    <job
      identifier="medicaldoctor"
      variant="0" />
  </player>

The above will show these as preferences in lobby, but still spawn you as a medical doctor.

Bug prevalence

Happens every now and then

Version

0.18.15.0

-

No response

Which operating system did you encounter this bug on?

Windows

Relevant error messages and crash reports

No response

Regalis11 commented 2 years ago

Fixed in https://github.com/Regalis11/Barotrauma-development/commit/2e0931e37fca9333f724cfb6f8cbbbdc492ba101

NilanthAnimosus commented 2 years ago

Tested on 0.19.0.0, does not appear to be working correctly.

I joined with in configs my first job selected as "vip" and when I joined I saw that was my selected job, so I took a second client (Who also had vip as the first job selection) and both clients saw each other as preferred job VIP when hovering over the names, indicating the server still allows for this behavior.

curiously, vip in vanilla has hiddenjob="true and I am using no mods, so I would have expected it to have my second preference (Captain) be at least showed to other clients. I guess this is strictly round start and not lobby join that is fixed (As to prevent spawning as them, though vanilla hidden jobs couldn't be spawned in before any fixes so I'd have to make a mod and test both versions against it thats hidden but has a max higher than 0 if you want that tested)

Regalis11 commented 2 years ago

Addressed in https://github.com/Regalis11/Barotrauma-development/commit/b285014e5e3d9de0af55014c9711566d6dd92662 and https://github.com/Regalis11/Barotrauma-development/commit/0d815db99a2214ee658bdd53a6a66b33800e4c19

NilanthAnimosus commented 2 years ago

Tested against dev commit https://github.com/Regalis11/Barotrauma-development/commit/f82a333e436d97a8051448f960194e41892e9be5, no issues found, closing.