Author Topic: Problem with Pointshop hooks while using ULib  (Read 6889 times)

0 Members and 1 Guest are viewing this topic.

Offline TomatoSoup

  • Newbie
  • *
  • Posts: 40
  • Karma: 3
Problem with Pointshop hooks while using ULib
« on: April 10, 2015, 07:49:20 PM »
Currently, PointShop can fail to function due to how ULib overrides the default Hook functions. If an option or ability was added to override them then that would be excellent.

Edit by Megiddo: Changed title to reflect the discussion
« Last Edit: April 15, 2015, 03:33:44 PM by Megiddo »

Offline MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2728
  • Karma: 430
    • |G4P| Gman4President
Re: Ability to bypass ULib's special hook management
« Reply #1 on: April 10, 2015, 09:28:32 PM »
What makes you think that Pointshop failing has anything to do with ULib's custom hook system?
Just because ULib is in the stack trace for the error doesn't mean it is the cause.

More likely you have something else causing an issue.

Offline TomatoSoup

  • Newbie
  • *
  • Posts: 40
  • Karma: 3
Re: Ability to bypass ULib's special hook management
« Reply #2 on: April 10, 2015, 10:23:11 PM »
Because I have made a clean server install with ULX, ULib, and PointShop, where it fails to operate correctly. Upon deleting ULX and ULib (or even just the hooks.lua file!) PointShop begins to operate correctly again.

Offline Caustic Soda-Senpai

  • Sr. Member
  • ****
  • Posts: 469
  • Karma: 54
  • <Insert something clever here>
    • Steam Page
Re: Ability to bypass ULib's special hook management
« Reply #3 on: April 10, 2015, 11:20:58 PM »
You either have something coded wrong in your pointshop (custom group settings maybe?) Or a broken version of it altogether, otherwise, ulx and ulib shouldnt be interacting with pointshop.
You mentioned you did a clean server install with ulx, ulib, and pointshop, are these clean versions of each or customized?
Once you get to know me, you'll find you'll have never met me at all.

Offline TomatoSoup

  • Newbie
  • *
  • Posts: 40
  • Karma: 3
Re: Ability to bypass ULib's special hook management
« Reply #4 on: April 11, 2015, 08:06:10 AM »
Clean except for the MySQL settings configured for Pointshop and myself added as admin in ULX.
« Last Edit: April 11, 2015, 08:09:50 AM by TomatoSoup »

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Ability to bypass ULib's special hook management
« Reply #5 on: April 11, 2015, 06:09:02 PM »
TomatoSoup,
Please provide some code and/or errors and links to what you're using in Pointshop that you believe to be 'broken' by ULib's hooks.
Though it is possible our latest changes to the hook library could be causing some oddity, too many times we've seen people use code that was already unstable to begin with break when prioritized.
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2728
  • Karma: 430
    • |G4P| Gman4President
Re: Ability to bypass ULib's special hook management
« Reply #6 on: April 11, 2015, 10:53:41 PM »
There are plenty of people who use Pointshop and ULX together with no issues at all.
Though, like JamminR said, if you'd provide us the errors we could help determine what's going on.

Offline TomatoSoup

  • Newbie
  • *
  • Posts: 40
  • Karma: 3
Re: Ability to bypass ULib's special hook management
« Reply #7 on: April 12, 2015, 10:26:44 AM »
The stack trace is

Code: [Select]
[ERROR] addons/pointshop/lua/pointshop/sv_player_extension.lua:283: attempt to index field 'PS_Items' (a nil value)
1. PS_HasItem - addons/pointshop/lua/pointshop/sv_player_extension.lua:283
2. PS_hasItemEquipped - addons/pointshop/lua/pointshop/sv_player_extension.lua:287
3. fn - addons/pointshop/lua/pointshop/sh_init.lua:145
4. unknown - addons/ulib/lua/ulib/shared/hook.lua:108

Adding prints in order to debug what gets called when, the PlayerInitialSpawn hook in Pointshop never gets called. That is, I put
Code: [Select]
print("POINTSHOP INITIAL SPAWN") into the function that hook calls and it never prints that.
« Last Edit: April 12, 2015, 10:29:15 AM by TomatoSoup »

Offline Stickly Man!

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 1270
  • Karma: 164
  • What even IS software anymore?
    • XGUI
Re: Ability to bypass ULib's special hook management
« Reply #8 on: April 13, 2015, 11:08:36 AM »
FYI, TomatoSoup has posted more info on these GitHub issues, which Megiddo closed:
https://github.com/Nayruden/Ulysses/issues/449
https://github.com/Nayruden/Ulysses/issues/450

I'd like to look into this when I get a chance, but I have been busy as of late. Is there anyone here that can CONFIRM that pointshop works with the latest GitHub versions of ULX and ULib?

TomatoSoup, also let us know what gamemode, pointshop version, and maybe any other addons you're running to help us test. Thanks!
Join our Team Ulysses community discord! https://discord.gg/gR4Uye6

Offline Aaron113

  • Hero Member
  • *****
  • Posts: 803
  • Karma: 102
Re: Ability to bypass ULib's special hook management
« Reply #9 on: April 13, 2015, 12:47:11 PM »
I have no problems with fresh installs of both.

Offline TomatoSoup

  • Newbie
  • *
  • Posts: 40
  • Karma: 3
Re: Ability to bypass ULib's special hook management
« Reply #10 on: April 13, 2015, 05:56:53 PM »
I tested it initially on my addon-heavy sandbox server, where it first failed, so I then made a clone of my clean testing server and threw it in there, where it errored. I'll try it on my TTT server in a little and report back.

Also, again, I really want to apologize for opening two identical issues back-to-back on the bug tracker. I was just really frustrated.

EDIT:

Well, the TTT server doesn't have any errors. I thought maybe that was because I haven't used my sandbox server in quite some time, so perhaps ULib and ULX got out of date. And they were! But updating them didn't fix the problem. So the problem is persisting even on my clean (and now fully up-to-date) sandbox server.
« Last Edit: April 13, 2015, 06:49:07 PM by TomatoSoup »

Offline Stickly Man!

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 1270
  • Karma: 164
  • What even IS software anymore?
    • XGUI
Re: Ability to bypass ULib's special hook management
« Reply #11 on: April 13, 2015, 09:11:20 PM »
It's all good- When you can narrow a problem down that far, it makes it seem likely that the hook.lua file would be causing the problem- but there are always some unseen factors at play that can be very hard to find. :P Plus, if there was an issue with the core functionality of the hook library, we'd likely be dealing with a LOT more issues.

One other thing to note- be sure your Garry's Mod servers are up-to-date (scrds if you have control over it). It's been a couple weeks since they updated, but they made some changes to NWVars that may be causing some issues.

EDIT: I just tried throwing Pointshop on my development server (dev version of Garry's Mod) and did not have any issues (sandbox, ULX/ULib only). Hopefully you can figure out what's causing this!
« Last Edit: April 13, 2015, 10:18:35 PM by Stickly Man! »
Join our Team Ulysses community discord! https://discord.gg/gR4Uye6

Offline Aaron113

  • Hero Member
  • *****
  • Posts: 803
  • Karma: 102
Re: Ability to bypass ULib's special hook management
« Reply #12 on: April 14, 2015, 05:45:30 AM »
Well, the TTT server doesn't have any errors. I thought maybe that was because I haven't used my sandbox server in quite some time, so perhaps ULib and ULX got out of date. And they were! But updating them didn't fix the problem. So the problem is persisting even on my clean (and now fully up-to-date) sandbox server.

Would it be possible for us to get your item files?  Perhaps it is something with a custom item you have, although that seems unlikely, worth a try I suppose.

Offline TomatoSoup

  • Newbie
  • *
  • Posts: 40
  • Karma: 3
Re: Ability to bypass ULib's special hook management
« Reply #13 on: April 14, 2015, 07:37:03 AM »
I don't have any custom items yet and, when hooks.lua is missing, all the stock items appear, so I don't think that's related.

My modded sandbox isn't as up-to-date as I'd like, but the clean one is only a few days old. It's a bit of a bummer because a lot of my legacy stuff uses NWVars and I'm not looking forward to updating all that!

I'm gonna start seeing what's different between TTT and Sandbox. I put debug into hooks.lua and it stops trying to run hooks after one of them returns true.

I know that default behavior for GarrysMod is that, when you return true on a hook, it stops the Gamemode's hook from executing. It looks like the way hooks.lua works, once any hook returns true, it stops executing all the lower priority hooks of the same event from executing. Which is definitely a feature of the priority system so that a higher priority hook can stop a lower priority one from executing.

So that's hooks.lua's departure from default behavior. Now I just need to figure out what I have that's returning true and hooked to PlayerInitialSpawn that shouldn't be.

Offline Stickly Man!

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 1270
  • Karma: 164
  • What even IS software anymore?
    • XGUI
Re: Ability to bypass ULib's special hook management
« Reply #14 on: April 15, 2015, 08:33:06 AM »
Do let us know if you find anything, as there are a few others having this same issue. Good luck! :)

Also, BuzzKill made a neat debug tool that can help you find the names of hooks that are calling "PlayerInitialSpawn":
http://forums.ulyssesmod.net/index.php/topic,8428.0.html

Edit: TomatoSoup, is your server running on Linux? We would like to rule out the possibility of this being a platform-specific bug, as well. (We've only tested on Windows)
« Last Edit: April 15, 2015, 08:40:49 AM by Stickly Man! »
Join our Team Ulysses community discord! https://discord.gg/gR4Uye6