Author Topic: SuperPowers - Set run speed and jump power of players. Update! (v1.1, SVN only)  (Read 1122 times)

0 Members and 1 Guest are viewing this topic.

Offline RynO-SauruS

  • Jr. Member
  • **
  • Posts: 51
  • Karma: 10
    • View Profile
This is really strange.. Apparently there's some kind of conflict with Player:GetNetworkedString("UserGroup") and the ULX/ULib release versions.
I've tried this with ULX/ULib release versions in singleplayer and listen server, still returns a blank string. Can someone try this please?
I tried it with no ULX/ULib in singleplayer, and it worked beautifully. I also tried it with ULX/ULib SVN versions on a dedicated server, also worked.

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • ****
  • Posts: 3262
  • Karma: 106
  • Project Specialist
    • View Profile
    • Team Ulysses [ULib/ULX, other fine releases]
You're right. I didn't try a ded, but ULib 2.3 seems to break the variable.
I tested using a single player game and a listen server.
Previously tried ded and single player using SVN and it worked fine.
Odd.
I've searched, can't find any mention of network var "UserGroup" in ULib 2.3
There's a meta override in ucl_sh.lua... it's potentially an issue
Software Upgrade Paradox - If you improve a piece of software enough times, you eventually ruin it - David Pogue

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • ****
  • Posts: 3488
  • Karma: 188
  • Project Lead
    • View Profile
Hmm, I can't test this on my server due to a complicated setup... but there really shouldn't be anything in ULib 2.3 that's capable of doing that.
“Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.” -Brian W. Kernighan
"I love working on my crappy code. it is crappy, but it is mine. I guess I could love other people's code, but it's like loving other people's children -- not quite the same as your own" -- Jeff Atwood
"Their tree came and found my tree!" -- Stickly Man!

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • ****
  • Posts: 3262
  • Karma: 106
  • Project Specialist
    • View Profile
    • Team Ulysses [ULib/ULX, other fine releases]
Seems to be true Megiddo. I removed ULib/ULX release and it returned the proper usergroup I'd set in /settings/users.txt
With release version installed, it didn't.

According to Entity.SetNetworkedString , "Running a networked function will cause it to synchronize the networked data with the clients. "

Many of Garry's player group update code/checks (IsAdmin, IsSuperadmin, IsUserGroup, SetUsergroup ) uses network functions (Set and Get).
ULIb's 2.3 doesn't... we overwrote many of them.
ULib SVN, we use Get/Set several times due to the rewrite.

My theory : ULib release never syncronizes the variables. When they sync, it's due to another mod calling Get/SetNetworkedVar
I'm curious if this somehow adds onto the 'long random time menu/commands break' we occasionally see... lack of sync.

(Sorry Ryno, we've kind of hijacked your release thread... let me know if you want the 'why doesn't this code work' part, including your question, split to Developers corner.
« Last Edit: February 24, 2010, 07:55:03 PM by JamminR »
Software Upgrade Paradox - If you improve a piece of software enough times, you eventually ruin it - David Pogue

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • ****
  • Posts: 3488
  • Karma: 188
  • Project Lead
    • View Profile
Seems to be true Megiddo. I removed ULib/ULX release and it returned the proper usergroup I'd set in /settings/users.txt
With release version installed, it didn't.

According to Entity.SetNetworkedString , "Running a networked function will cause it to synchronize the networked data with the clients. "

Many of Garry's player group update code/checks (IsAdmin, IsSuperadmin, IsUserGroup, SetUsergroup ) uses network functions (Set and Get).
ULIb's 2.3 doesn't... we overwrote many of them.
ULib SVN, we use Get/Set several times due to the rewrite.

My theory : ULib release never syncronizes the variables. When they sync, it's due to another mod calling Get/SetNetworkedVar
I'm curious if this somehow adds onto the 'long random time menu/commands break' we occasionally see... lack of sync.

(Sorry Ryno, we've kind of hijacked your release thread... let me know if you want the 'why doesn't this code work' part, including your question, split to Developers corner.

Ah, yes, I believe you're right. It does hijack the original method that would set that. It didn't really matter since client still registered superadmin and admin's correctly (with the appropriate functions). Good to know we got this fixed for the future though. :)
“Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.” -Brian W. Kernighan
"I love working on my crappy code. it is crappy, but it is mine. I guess I could love other people's code, but it's like loving other people's children -- not quite the same as your own" -- Jeff Atwood
"Their tree came and found my tree!" -- Stickly Man!

Offline RynO-SauruS

  • Jr. Member
  • **
  • Posts: 51
  • Karma: 10
    • View Profile
So, can anyone think of any way I could make this work? I thought of possibly re-overriding SetUserGroup() to make it call SetNetworkedString(<group>) also.
Would this be messing with things too much for this small addon maybe?  :-\
« Last Edit: February 24, 2010, 11:29:24 PM by RynO-SauruS »