• Print

Author Topic: Private Dev corner  (Read 41 times)

0 Members and 1 Guest are viewing this topic.

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Private Dev corner
« on: August 24, 2013, 08:40:18 pm »
Since I'm not ready to even MENTION this beast in public, for fear that if it doesn't fully wake up, the villagers will form posse and hunt it down and kill it, I ask some advice here in our private area;
I'm considering waking the long hibernating lua beast in me and reviving my bounce back/immunity project.

In it's current state, it only allows modifying single users with the flags I'm using.
Though I may leave it per player only, and have people complain to me they want to add to groups, if I decide to add group access functions, I don't remember the following;

1) If player X is in group Y, and group Y has <my_flag>, would X:query(my_flag) return true?
2) If I return target(s) from ULibPlayerTarget or ULibPlayerTargets, are normal 'can_target' checks done after. My fear is not wanting to override normal checks if the hooks decide nothing needs to be done to one of a group of players and returns them.
"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: 2727
  • Karma: 430
    • |G4P| Gman4President
Re: Private Dev corner
« Reply #1 on: August 24, 2013, 09:19:32 pm »
Not sure about #2, but #1 is yes.

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
Re: Private Dev corner
« Reply #2 on: August 26, 2013, 05:07:18 am »
Normal access checks are performed if you return a player, yes. :)
Experiencing God's grace one day at a time.

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Private Dev corner
« Reply #3 on: August 31, 2013, 08:10:08 pm »
So I find that in the past 3-4 years, we no longer have ULib.ACCESS_NONE.
What are we using now to register access but not give it to a default group?

Here's what I want to do;
Give ULX (well, ULib actually) knowledge of 3 additional permission flags.
I don't want to grant them to any group/person by default though.

Here's what I'm trying;
Code: [Select]
ULib.ucl.registerAccess( "osi_overcome", _, "Old School Immunity - Allows override of rubber and immune, still follows can_target", "JamminR" )
ULib.ucl.registerAccess( "osi_immune", _, "Old School Immunity - Be immune to most punishments, overrides can_target", "JamminR" )
ULib.ucl.registerAccess( "osi_rubber", _, "Old School Immunity - Bounces ULX punishment back to attacking player", "JamminR" )

I was originally trying ULib.ACCESS_NONE in place of _.
Using grep, I find that it no longer exists, so I switched to _.
Here's the error;
Code: [Select]
[ERROR] addons/ulib/lua/ulib/server/ucl.lua:820: bad argument #1 to 'ipairs' (table expected, got nil)
  1. ipairs - [C]:-1
   2. registerAccess - addons/ulib/lua/ulib/server/ucl.lua:820
    3. unknown - addons/ulx_rubber/lua/ulx/modules/ulx_rubber.lua:42
     4. include - [C]:-1
      5. unknown - addons/ulx/lua/ulx/init.lua:28
       6. include - [C]:-1
        7. unknown - addons/ulx/lua/ulib/modules/ulx_init.lua:2
         8. include - [C]:-1
          9. unknown - addons/ulib/lua/ulib/init.lua:68
           10. include - [C]:-1
            11. unknown - addons/ulib/lua/autorun/ulib_init.lua:3
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Private Dev corner
« Reply #4 on: August 31, 2013, 08:13:11 pm »
Nevermind, use a blank table () and, though empty, it didn't return error.
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
Re: Private Dev corner
« Reply #5 on: August 31, 2013, 08:22:00 pm »
Hmm, the documentation says you should be able to pass in nil... I'll have to fix that.
Experiencing God's grace one day at a time.

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
Re: Private Dev corner
« Reply #6 on: August 31, 2013, 08:25:45 pm »
Fixed. :)
Experiencing God's grace one day at a time.

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Private Dev corner
« Reply #7 on: September 02, 2013, 08:03:19 am »
After several years, and seemingly many forum questions during that time, why don't we use a standard ULib hook system, such as ULibPlayerTarget, in our Physgun code?
Even if it were a fake 'no real action' command such as 'ulx wasphysgunned', it would help me with my current project, and perhaps other ULib developers looking for a standard instead of having to write weapon/what weapon was used hooks. (I don't remember how ULX does the check currently)
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
Re: Private Dev corner
« Reply #8 on: September 02, 2013, 03:17:19 pm »
It's something that I didn't consider during the initial write of the current UCL. I actually comment on this in the physgun code already. :)
Experiencing God's grace one day at a time.

Offline MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2727
  • Karma: 430
    • |G4P| Gman4President
Re: Private Dev corner
« Reply #9 on: September 06, 2013, 12:54:46 am »
/Hijacks Thread

I'm posting this here for similar reasons to why Jam posted here (in the TeamU forum)
I'm working on a UCL overhaul that will convert UCL into MySQL without any need to run parallel authentication systems. I'm trying to do it as a module and have certain functions such as ucl.addUser override the base. It seems that this isn't quite working though.

In some cases the functions are pulling from the default functions. If I force a reload of my module lua file it will then run my function.

Is there a way that I can ensure that my module is loaded completely after all of the base modules are loaded? Also, maybe you could make that a function by default. I feel like modules by nature should have the ability to override default functionality.

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
Re: Private Dev corner
« Reply #10 on: September 06, 2013, 02:33:56 pm »
Modules are (or used to be) loaded alphabetically. There's no other way at the present to control the order of loading. Having a 'pre' and 'post' folder for order seems a little overkill, but I'm open to suggestions.
Experiencing God's grace one day at a time.

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Private Dev corner
« Reply #11 on: September 06, 2013, 04:44:48 pm »
MrP, don't forget ULib has some hooks that are capable of overriding and or executing post commands.
Could reasonably easily be used to override most stuff if needed.
My code project discussion above (that your terrorist hijacking!) mentions two that use the player target hooks to watch for certain "ulx blah" commands, and prevents them from executing if certain target player conditions are met.

Prevent any ULib command:(runs pre)
ULibCommandCalled

Prevent player targeting if needed; (runs pre)
ULibPlayerTarget
ULibPlayerTargets


Execute Post commands (runs post)
ULibPostTranslatedCommand

In all honesty, If I ran a multi server database, I'd probably still want functions executed/stored locally, 'just in case' as a local/single server 'back up'.
Sure, if something went wrong, reconciling might take some time, but, figure easier if at least one server had it's sanity in tact.


"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

  • Print