Xandaros / evolve

An advanced admin mod for Garry's Mod
49 stars 39 forks source link

Invalid Steam IDs cause lua errors #95

Open MuteTM opened 10 years ago

MuteTM commented 10 years ago
05:23:51 ev unban STEAM_0:0:48186840
05:23:51 L 05/11/2014 - 06:23:50: Lua Error: 
05:23:51 [ERROR] addons/evolve/lua/includes/modules/sourcebans.lua:525: attempt to concatenate local 'steamID' (a nil value)
           1. UnbanPlayerBySteamID - addons/evolve/lua/includes/modules/sourcebans.lua:525
            2. UnBan - addons/evolve/lua/ev_framework.lua:1117
             3. Call - addons/evolve/lua/ev_plugins/sh_unban.lua:25
              4. CCommand - addons/evolve/lua/ev_plugins/sv_consolecommands.lua:30
               5. unknown - addons/evolve/lua/ev_plugins/sv_consolecommands.lua:37
                6. unknown - lua/includes/modules/concommand.lua:69

05:23:51 [05/11/14 06:23:50] Console ran command 'unban' with arguments 'STEAM_0 : 0 : 48186840' via console.
         [EV] Cleaned up 751 players.
05:23:51 L 05/11/2014 - 06:23:50: Lua Error: 
05:23:51 [ERROR] addons/evolve/lua/includes/modules/sourcebans.lua:525: attempt to concatenate local 'steamID' (a nil value)
           1. UnbanPlayerBySteamID - addons/evolve/lua/includes/modules/sourcebans.lua:525
            2. UnBan - addons/evolve/lua/ev_framework.lua:1117
             3. Call - addons/evolve/lua/ev_plugins/sh_unban.lua:25
              4. CCommand - addons/evolve/lua/ev_plugins/sv_consolecommands.lua:30
               5. unknown - addons/evolve/lua/ev_plugins/sv_consolecommands.lua:37
                6. unknown - lua/includes/modules/concommand.lua:69

         [ERROR] addons/evolve/lua/includes/modules/sourcebans.lua:525: attempt to concatenate local 'steamID' (a nil value)
           1. UnbanPlayerBySteamID - addons/evolve/lua/includes/modules/sourcebans.lua:525
            2. UnBan - addons/evolve/lua/ev_framework.lua:1117
             3. Call - addons/evolve/lua/ev_plugins/sh_unban.lua:25
              4. CCommand - addons/evolve/lua/ev_plugins/sv_consolecommands.lua:30
               5. unknown - addons/evolve/lua/ev_plugins/sv_consolecommands.lua:37
                6. unknown - lua/includes/modules/concommand.lua:69

Versus running with the Steam ID in quotes

05:24:26 ev unban "STEAM_0:0:48186840"
05:24:26 [05/11/14 06:24:25] Console ran command 'unban' with arguments 'STEAM_0:0:48186840' via console.
         [EV] Console has unbanned muffinodeath.
         [05/11/14 06:24:25] Console has unbanned muffinodeath.

Some players seem to be plain missing from the bans database as well, though they are banned on the sourcebans.

Another error I ran into (I might as well not spam you with issues):

Hook 'PlayerDisconnected' in plugin 'Player Info' failed with error:
addons/evolve/lua/ev_plugins/sv_playerinfo.lua:76: attempt to perform arithmetic on a nil value
Bucky21659 commented 10 years ago

When does the last error occur? When someone disconnects? I fixed the playerinfo because it was sometimes logging negative playtimes on 64-bit servers, the only issue that's still there is sometimes players join for the first time with a negative time (but it'll get logged as 0 until the timer hits 1), and I think that's related.

As for the original issue, I could be wrong but skimming the code I believe the issue is it's not set up to handle invalid SteamIDs in a manner that wouldn't spew lua errors. I think it should just be a matter of having it check to make sure the argument's valid, and give a chat message if it's not.

MuteTM commented 10 years ago

Yes, it happens on disconnect.