FPtje / DarkRP

DarkRP, a non-serious roleplay gamemode for Garry's Mod.
https://darkrp.miraheze.org
MIT License
463 stars 710 forks source link

Multirun ply:SteamDI64() errors #2744

Closed yupi2 closed 6 years ago

yupi2 commented 6 years ago

Description of the bug

A -multirun account causes ply:SteamID64() to return nil which causes everything ever to break.

How to make the bug happen

Lua errors

Client "(1)asdf" connected (192.168.1.21:27008).
ServerLog: [FAdmin] (1)asdf (STEAM_0:0:0) is Authed
ServerLog: [FAdmin] (1)asdf (STEAM_0:0:0) Spawned for the first time

[ERROR] gamemodes/darkrp/gamemode/modules/base/sv_data.lua:354: attempt to concatenate a nil value
  1. createPlayerData - gamemodes/darkrp/gamemode/modules/base/sv_data.lua:354
   2. callback - gamemodes/darkrp/gamemode/modules/base/sv_data.lua:449
    3. callback - gamemodes/darkrp/gamemode/modules/base/sv_data.lua:333
     4. query - gamemodes/darkrp/gamemode/libraries/mysqlite/mysqlite.lua:305
      5. offlinePlayerData - gamemodes/darkrp/gamemode/modules/base/sv_data.lua:305
       6. retrievePlayerData - gamemodes/darkrp/gamemode/modules/base/sv_data.lua:344
        7. restorePlayerData - gamemodes/darkrp/gamemode/modules/base/sv_data.lua:431
         8. unknown - gamemodes/darkrp/gamemode/modules/base/sv_gamemode_functions.lua:593

[ERROR] gamemodes/darkrp/gamemode/modules/base/sv_gamemode_functions.lua:612: attempt to index local 'jobTable' (a nil value)
  1. unknown - gamemodes/darkrp/gamemode/modules/base/sv_gamemode_functions.lua:612

ServerLog: [FAdmin] (1)asdf (STEAM_0:0:0) Spawned

[ERROR] gamemodes/darkrp/gamemode/modules/base/sv_gamemode_functions.lua:737: attempt to index local 'jobTable' (a nil value)
  1. unknown - gamemodes/darkrp/gamemode/modules/base/sv_gamemode_functions.lua:737

Why the developer of DarkRP is responsible for this issue

The developer is not responsible, but this can be worked around / fixed with what's currently used to fix ply:SteamID64() in singleplayer https://github.com/FPtje/DarkRP/blob/11c2f3b70021600a4b5bd19db90f12e3091d7d32/gamemode/modules/workarounds/sh_workarounds.lua#L89

Kefta commented 6 years ago

Whoops, I removed the check in https://github.com/FPtje/DarkRP/pull/2723/files since sv_lan by itself didn't seem to make a difference; didn't realise it was multirun related. Maybe a comment should be added to make it clear to anyone looking over the code?