Ulysses

Ulysses Stuff => General Chat & Help and Support => Topic started by: ambro on April 08, 2013, 09:01:29 PM

Title: Garrysmod update, perhaps broke IsMuted?
Post by: ambro on April 08, 2013, 09:01:29 PM
[ERROR] addons/ulx/lua/ulx/cl_lib.lua:66: attempt to call method 'IsMuted' (a nil value)
  1. gagUser - addons/ulx/lua/ulx/cl_lib.lua:66
   2. Function - addons/ulx/lua/ulx/cl_lib.lua:74
    3. unknown - lua/includes/modules/usermessage.lua:87


[ERROR] addons/ulx/lua/ulx/cl_lib.lua:66: attempt to call method 'IsMuted' (a nil value)
  1. gagUser - addons/ulx/lua/ulx/cl_lib.lua:66
   2. Function - addons/ulx/lua/ulx/cl_lib.lua:74
    3. unknown - lua/includes/modules/usermessage.lua:87

Disconnect: "Too many Lua Errors! Sorry!".
Disconnect: "Too many Lua Errors! Sorry!".

Just today, new garrysmod update, I had unmuted on my server and everyone crashed with this error, we don't have any modifications done to the base ulx code, not sure what would cause this, any ideas?
Title: Re: Garrysmod update, perhaps broke IsMuted?
Post by: ambro on April 08, 2013, 09:05:02 PM
Errors i'm logging for users on the server...

Vines|12|STEAM_0:1:38689293

[ERROR] addons/ulx/lua/ulx/cl_lib.lua:66: attempt to call method 'IsMuted' (a nil value)
  1. gagUser - addons/ulx/lua/ulx/cl_lib.lua:66
   2. Function - addons/ulx/lua/ulx/cl_lib.lua:74
    3. unknown - lua/includes/modules/usermessage.lua:87



TheAwesomePeanut|10|STEAM_0:0:55698841

[ERROR] addons/ulx/lua/ulx/cl_lib.lua:66: attempt to call method 'IsMuted' (a nil value)
  1. gagUser - addons/ulx/lua/ulx/cl_lib.lua:66
   2. Function - addons/ulx/lua/ulx/cl_lib.lua:74
    3. unknown - lua/includes/modules/usermessage.lua:87
Title: Re: Garrysmod update, perhaps broke IsMuted?
Post by: Megiddo on April 09, 2013, 05:46:17 AM
Noted: https://github.com/Nayruden/Ulysses/issues/193

We'll get to it as soon as we can.
Title: Re: Garrysmod update, perhaps broke IsMuted?
Post by: ambro on April 09, 2013, 08:50:32 AM
Thanks Megiddo.
Title: Re: Garrysmod update, perhaps broke IsMuted?
Post by: ambro on April 23, 2013, 11:52:40 AM
Just out of curiosity, has this been addressed? I'm still having players occasionally crash with Lua errors when we're gagging players. I've tried a new fresh install from SVN, even tried dumping our data and starting anew yet the problem still exists.

Is "IsMuted" in fact removed from garrys latest build?
Title: Re: Garrysmod update, perhaps broke IsMuted?
Post by: Megiddo on April 23, 2013, 11:57:56 AM
I may have time to get to it tonight. We'll see! :)
Title: Re: Garrysmod update, perhaps broke IsMuted?
Post by: Megiddo on April 23, 2013, 03:40:13 PM
Just tested it on my server and it's working fine. What gamemode is this?
Title: Re: Garrysmod update, perhaps broke IsMuted?
Post by: ambro on April 23, 2013, 11:45:52 PM
This is occurring in TTT gamemode, looks like its occuring on two different lines, sometimes on line 66, others on line 60 of ULX cl_lib.lua

When or why it occurs is sort of random and beyond my understanding, I had it occur once when I had gagged a group of people, the map changed to a new map and as soon as I attempted to ungag, everyone crashed with this error.

Lucifer|12|STEAM_0:0:25960481

[ERROR] addons/ulx/lua/ulx/cl_lib.lua:66: attempt to call method 'IsMuted' (a nil value)
  1. gagUser - addons/ulx/lua/ulx/cl_lib.lua:66
   2. Function - addons/ulx/lua/ulx/cl_lib.lua:74
    3. unknown - lua/includes/modules/usermessage.lua:87

Dasher_72|21|STEAM_0:0:43228593

[ERROR] addons/ulx/lua/ulx/cl_lib.lua:60: attempt to call method 'IsMuted' (a nil value)
  1. gagUser - addons/ulx/lua/ulx/cl_lib.lua:60
   2. Function - addons/ulx/lua/ulx/cl_lib.lua:74
    3. unknown - lua/includes/modules/usermessage.lua:87

Title: Re: Garrysmod update, perhaps broke IsMuted?
Post by: ambro on April 25, 2013, 12:51:20 AM
It's worth noting that this doesn't happen immediately, it can take some time but eventually after gagging other players, switching maps, it should surface, I just don't understand what's causing IsMuted to suddenly break, makes no sense really.

It's frustrating because every day I look at the logs, I'm seeing a lot of users crashing with this lua error (we have to gag people a lot)
Title: Re: Garrysmod update, perhaps broke IsMuted?
Post by: Megiddo on April 25, 2013, 11:29:55 AM
Why are you kicking people on errors, then?
Title: Re: Garrysmod update, perhaps broke IsMuted?
Post by: ambro on April 25, 2013, 04:08:46 PM
I don't believe adding sv_kickerrornum 0 is an adequate solution to the problem as it's a bandaid to the underlying issue.

I do appreciate all of your efforts in debugging this, were you able to test this in the TTT game mode?
Title: Re: Garrysmod update, perhaps broke IsMuted?
Post by: Megiddo on April 25, 2013, 07:29:52 PM
I don't have the ability to track down a seemingly random bug happening on one person's server, no. :P

But, since it's a core garrysmod function, it should either work all the time or never. There's not much we can do for you if something is causing your garrysmod library to be unstable. The only thing I could think of that would be our fault and result in the problem you describe is if someone disconnects before the muted message gets to the clients; but that should be an exceedingly rare event (although one we should still check for).
Title: Re: Garrysmod update, perhaps broke IsMuted?
Post by: ambro on April 25, 2013, 09:55:00 PM
Megiddo,

Thank you for the feedback, I will see if I can look further into this issue myself, if I do end up finding a solution, I will post it here.

Thanks again
Title: Re: Garrysmod update, perhaps broke IsMuted?
Post by: LuaTenshi on April 26, 2013, 07:33:39 AM
Megiddo,

Thank you for the feedback, I will see if I can look further into this issue myself, if I do end up finding a solution, I will post it here.

Thanks again

I have had a similar problem... and apparently some times commands like to hide them selves from clients, I am guessing its a malfunction in Garry's Anti Cheat system, but I am not sure. Moving the function over to shared and doing if(SERVER) then ... end should fix it.

I will put a copy of the code where I worked around this error later today.
Title: Re: Garrysmod update, perhaps broke IsMuted?
Post by: ambro on April 26, 2013, 10:06:25 AM
I have had a similar problem... and apparently some times commands like to hide them selves from clients, I am guessing its a malfunction in Garry's Anti Cheat system, but I am not sure. Moving the function over to shared and doing if(SERVER) then ... end should fix it.

I will put a copy of the code where I worked around this error later today.

Hellfox, great! I wouldn't have thought of that but it does make sense, I've noticed that if you try to call certain functionality too soon within an event, it will act as if the function itself doesn't exist, rather annoying!

I look forward to your work-around.

Cheers.
Title: Re: Garrysmod update, perhaps broke IsMuted?
Post by: JamminR on April 26, 2013, 02:14:44 PM
Ambro,
Have you searched all your lua files to see if perhaps the IsMuted is being overwritten in another mod/gamemode?
Besides Megiddo's suggestion that it's a client leaves while command is executing bug of some sort (which, would seem random like you say), it's possible another mod/gamemode is in someway overwriting, forcing nil when called by our code.
Title: Re: Garrysmod update, perhaps broke IsMuted?
Post by: LuaTenshi on April 26, 2013, 04:46:37 PM
Hellfox, great! I wouldn't have thought of that but it does make sense, I've noticed that if you try to call certain functionality too soon within an event, it will act as if the function itself doesn't exist, rather annoying!

I look forward to your work-around.

Cheers.
------------------------------------------
Fix 1 - This is the way you want to try first, the second method was me deciding to start thinking like Garry to fix a Garry glitch.
------------------------------------------
Just try changing Line 66...
Code: [Select]
if not user_to_gag:IsMuted() or was_gagged then return end to...
Code: [Select]
if not (v.gimp == 2) or was_gagged then return end
-----------------------------------------
Fix 2 - The insane/unstable way.
------------------------------------------
Okay here is the code, so I wanted to replicate the ULX freeze command and make one that takes an extra var where you can choose if it silently freezes the player or just says "Someone froze Jacob"

Any way here is the code for it...

Code: [Select]
function ulx.gunfreeze( calling_ply, target_plys, should_unfreeze, hide_echo, isFrozen )
if( SERVER ) then -- This part right here is what interests you! (At least it worked for me as a fix.)
local affected_plys = {}
for i=1, #target_plys do
if not should_unfreeze and ulx.getExclusive( target_plys[ i ], calling_ply ) then
ULib.tsayError( calling_ply, ulx.getExclusive( target_plys[ i ], calling_ply ), true )
else
local v = target_plys[ i ]
if v:InVehicle() then
v:ExitVehicle()
end

if not should_unfreeze then
v:Lock()
v.frozen = true
ulx.setExclusive( v, "frozen" )
else
v:UnLock() --The error was happening here where UnLock() would "not exsist".
v.frozen = nil
ulx.clearExclusive( v )
end

v:DisallowSpawning( not should_unfreeze )
ulx.setNoDie( v, not should_unfreeze )
table.insert( affected_plys, v )

if v.whipped then
v.whipcount = v.whipamt -- Will make it remove
end
end
end

if not hide_echo then
if not should_unfreeze then
ulx.fancyLogAdmin( calling_ply, "#A froze #T", affected_plys )
else
ulx.fancyLogAdmin( calling_ply, "#A unfroze #T", affected_plys )
end
else
if not should_unfreeze then
ulx.fancyLogAdmin( calling_ply, true, "#A froze #T", affected_plys )
elseif( isFrozen ) then
ulx.fancyLogAdmin( calling_ply, true, "#A unfroze #T", affected_plys )
end
end
end
end
local gunfreeze = ulx.command( CATEGORY_NAME, "ulx gunfreeze", ulx.gunfreeze, "!gunfreeze" )
gunfreeze:addParam{ type=ULib.cmds.PlayersArg }
gunfreeze:addParam{ type=ULib.cmds.BoolArg, invisible=true }
gunfreeze:defaultAccess( ULib.ACCESS_ADMIN )
gunfreeze:help( "Used for freezing players with the physgun!" )
gunfreeze:setOpposite( "ulx ungunfreeze", {_, _, true}, "!ungunfreeze" )

In short what you want to do is take that module and make it run on shared then change this line (Line 66) "if not user_to_gag:IsMuted() or was_gagged then return end" to "if SERVER and not (user_to_gag:IsMuted() or was_gagged) then return end".


Disclaimer: Both of these are just guesses based on my own experience, I hope they help you.