• Print

Author Topic: URS BETA - A Highly Customizeable Restriction System (or will be)  (Read 850523 times)

0 Members and 1 Guest are viewing this topic.

Offline AphisNano

  • Newbie
  • *
  • Posts: 4
  • Karma: 1
  • That developer guy
Re: URS BETA - A Highly Customizeable Restriction System (or will be)
« Reply #480 on: April 04, 2015, 01:38:38 pm »
I warn you though, when I said it was a development branch, I meant it.  The versions there may not be entirely stable and/or missing features.  You could very well lose your data files as well.

I'm aware of the risks, the server itself is basically a continuous integration system for my spacebuild 3 revival.  Bugs are to be expected, and my users are repeatedly warned about such issues.

Thank you for your effort on this addon.
« Last Edit: April 04, 2015, 01:49:12 pm by AphisNano »
Professional Linux Devop

Offline randomguy

  • Newbie
  • *
  • Posts: 2
  • Karma: 0
Re: URS BETA - A Highly Customizeable Restriction System (or will be)
« Reply #481 on: April 05, 2015, 09:02:45 pm »
Looking great so far, any chance you can add like a hover hint. So if you hover over something it explains what it does? For example I have no idea what the "Invert Weld's" Tick box does.

Offline Aaron113

  • Hero Member
  • *****
  • Posts: 803
  • Karma: 102
Re: URS BETA - A Highly Customizeable Restriction System (or will be)
« Reply #482 on: April 05, 2015, 09:06:48 pm »
Looking great so far, any chance you can add like a hover hint. So if you hover over something it explains what it does? For example I have no idea what the "Invert Weld's" Tick box does.

I thought that might be a bit confusing.  What that does is change it from a blacklist to a whitelist.  So instead of adding people to restrict it, you're adding people to allow them.  The invert tools would do the same, but for ALL tools.  If both are enabled, then the specific tool becomes a blacklist again while all other tools are still a whitelist.  Hope that's understandable... I will definitely add some kind of explanation some where.

EDIT:  Since I have a hard time finding Stickly online at a good time, I'm just going to ask here and hope you see this :P.  I was curious if there is any way that you can queue up function calls in with xlib's animations?  So it would run an animation, run a function, then run an animation again?  Without spending a lot of time looking through your code, it's hard to figure this out with a glance around.
« Last Edit: April 05, 2015, 09:11:29 pm by Aaron113 »

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: URS BETA - A Highly Customizeable Restriction System (or will be)
« Reply #483 on: April 05, 2015, 09:19:04 pm »
Without spending a lot of time looking through your code, it's hard to figure this out with a glance around.
Searched our repo for queue and found this
xlib.addToAnimQueue
I didn't look long enough to tell if you could perform functions within it.
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline Aaron113

  • Hero Member
  • *****
  • Posts: 803
  • Karma: 102
Re: URS BETA - A Highly Customizeable Restriction System (or will be)
« Reply #484 on: April 05, 2015, 09:22:15 pm »
Haha, literally right in the function itself.  I guess I didn't look hard enough.

Code: [Select]
if type( obj ) == "function" then
table.insert( outTable, function() xlib.animRunning = true  obj( unpack( arg ) )  xlib.animQueue_call() end )

This is why I love xlib.

Offline Stickly Man!

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 1270
  • Karma: 164
  • What even IS software anymore?
    • XGUI
Re: URS BETA - A Highly Customizeable Restriction System (or will be)
« Reply #485 on: April 06, 2015, 10:16:51 am »
Haha, sorry- I was out of town this past weekend. :P

Yup, looks like you figured it out- I had the same issues when I was working with animations.. Trying to ensure they all ran properly, and called all the needed functions at the correct time. Glad it's working well for you! :D
Join our Team Ulysses community discord! https://discord.gg/gR4Uye6

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: URS BETA - A Highly Customizeable Restriction System (or will be)
« Reply #486 on: April 06, 2015, 08:17:45 pm »
I'm just stoked I figured out something in xlib, and was able to help someone else with it.

* JamminR ducks as Stickly Man throws bits of duct tape he's used to piece xlib together with ulib and ulx into XGUI over the years.
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline Aaron113

  • Hero Member
  • *****
  • Posts: 803
  • Karma: 102
Re: URS BETA - A Highly Customizeable Restriction System (or will be)
« Reply #487 on: April 06, 2015, 09:16:19 pm »
xlib may be covered in duct tape that is barely holding on, but it is an amazing part of XGUI :D

Anyway, I decided instead of recoding just the GUI, I am recoding the entire addon.  New everything.  I must say it is looking fantastic so far.  I like having tabs instead.  We will see when I have time to finish it.  I'm using a local repository backed up on dropbox to keep track of the changes now instead of the development branch on github.

Offline Stickly Man!

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 1270
  • Karma: 164
  • What even IS software anymore?
    • XGUI
Re: URS BETA - A Highly Customizeable Restriction System (or will be)
« Reply #488 on: April 07, 2015, 10:08:03 am »
Awesome work :D

Haha JamminR- I had to go double check my own code after reading your post, because I forgot about that whole section of xlib. :P  Standardizing, documenting, and releasing XLIB is on my list of things I want to do, but I just haven't had the time... But, I'll look into a potential XLIB2 for ULX4, perhaps. :)
Join our Team Ulysses community discord! https://discord.gg/gR4Uye6

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: URS BETA - A Highly Customizeable Restriction System (or will be)
« Reply #489 on: April 07, 2015, 05:01:00 pm »
xlib may be covered in duct tape that is barely holding on, but it is an amazing part of XGUI :D
Hey, I never said "barely"! It's solid. Good quality tape :P

I am recoding the entire addon.  New everything.
YESsssss! Telepathic/console/gui/chat commands here we come!

Awesome work :D
Indeed Aaron, awesome work.
A great addition to any Sandbox server.
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline Aaron113

  • Hero Member
  • *****
  • Posts: 803
  • Karma: 102
Re: URS BETA - A Highly Customizeable Restriction System (or will be)
« Reply #490 on: April 07, 2015, 06:59:38 pm »
YESsssss! Telepathic/console/gui/chat commands here we come!
URS v200 here we come!

Indeed Aaron, awesome work.
A great addition to any Sandbox server.
I need to actually finish it first haha, but I think it will be pretty nice when it is.

Offline FASGamer

  • Newbie
  • *
  • Posts: 9
  • Karma: -1
Re: URS BETA - A Highly Customizeable Restriction System (or will be)
« Reply #491 on: April 23, 2015, 03:36:11 pm »
Hello I am the server manager of the Dark Fusion Gaming sandbox server, I have about two suggestions.

#1. I currently have Scars, but I can't restrict any of them. So therefor I can't put any tanks in to restrict for higher ranks only. So my first request is can you make it possible to restrict Scars?
#2. I have WAC & J.I. Defense Solutions Installed. I only want users to have 2 WAC planes spawned at a time, but I want them to be able to spawn many J.I. Defense Solution Entities. As you may know WAC & J.I. Defense Solutions both are Entities. So my second request is can you like add a optional setting for WAC where it is separated from the other entities in the limits? Like maybe a WAC Helicopter limit and a WAC Plane limit?

Offline Buzzkill

  • Respected Community Member
  • Full Member
  • *****
  • Posts: 176
  • Karma: 59
    • The Hundred Acre Bloodbath
Re: URS BETA - A Highly Customizeable Restriction System (or will be)
« Reply #492 on: April 23, 2015, 09:58:26 pm »
Hey Aaron.  One suggestion for the new version -- something I've added to my copy of URS -- the ability to wildcard target sweps/ents/etc.  For example, I generally restrict most of Garry's Bombs from everyone, but let certain classes of bombs and individual bombs in to certain ranks.  So my config looks something like this...

gb5_*     (*, superadmin, admin)  = all of Garry's Bombs restricted to just superadmin and admin
gb5_light_*   (*, superadmin, admin, member5) = everything in the light bombs group is avail to sa, admin and member5 groups


I got this to work with some changes to URS.Check  (added a couple parms, some recursive logic and some wildcard mapping code below).  Wasn't sure if this would be interesting to anyone else, but it allows me to build a pretty rich permissions model without having to add an entry for every single entity.

Code: Lua
  1.  
  2. function URS.Check(ply, type, what, noecho, ... )
  3.  
  4.         -- MTZ
  5.         if ply:IsSuperAdmin() then return end
  6.        
  7.         what = string.lower(what)
  8.         local group = ply:GetUserGroup()
  9.         local restriction = false
  10.        
  11.         -- if we passed a description, use that for messages instead   MTZ
  12.         local whatdesc = what
  13.         local arg={...}
  14.         if arg[1] != nil then
  15.                 whatdesc = arg[1]
  16.         end
  17.         local passedRestrictionTest = false
  18.        
  19.  
  20.         if URS.restrictions[type] and URS.restrictions[type][what] then
  21.                 restriction = URS.restrictions[type][what]
  22.         end
  23.  
  24.         if restriction then
  25.                 if table.HasValue(restriction, "*") then
  26.                         if !(table.HasValue(restriction, group) or table.HasValue(restriction, ply:SteamID())) then
  27.                                 if !noecho then URS.PrintRestricted(ply, type, whatdesc) end
  28.                                 return false
  29.                         end
  30.                 elseif table.HasValue(restriction, group) or table.HasValue(restriction, ply:SteamID()) then
  31.                         if !noecho then URS.PrintRestricted(ply, type, whatdesc) end
  32.                         return false
  33.                 end
  34.                 passedRestrictionTest = true -- we overtly passed the restriction test.  Don't bother looking at wildcards later on  MTZ
  35.         end
  36.        
  37.         if URS.restrictions["all"] and URS.restrictions["all"][type] and table.HasValue(URS.restrictions["all"][type], group) then
  38.                 if !noecho then ULib.tsayError(ply, "Your rank is restricted from all ".. type .."s") end
  39.                 return false
  40.         end
  41.        
  42.         if table.HasValue(URS.types.limits, type) and URS.limits[type] and (URS.limits[type][ply:SteamID()] or URS.limits[type][group]) then
  43.                 if URS.limits[type][ply:SteamID()] then
  44.                         if ply:GetCount(type.."s") >= URS.limits[type][ply:SteamID()] then
  45.                                 ply:LimitHit( type .."s" )
  46.                                 return false
  47.                         end
  48.                 elseif URS.limits[type][group] then
  49.                         if ply:GetCount(type.."s") >= URS.limits[type][group] then
  50.                                 ply:LimitHit( type .."s" )
  51.                                 return false
  52.                         end
  53.                 end
  54.                 if URS.cfg.overwriteSbox:GetBool() then
  55.                         return true -- Overwrite sbox limit (ours is greater)
  56.                 end
  57.         end
  58.  
  59.  
  60.  
  61.         -- find wildcard entires and recurse against it   MTZ
  62.         if !string.ends(what,"*") and passedRestrictionTest == false then
  63.                 local whatwild = converttowildcard(what)
  64.                 if whatwild != what then
  65.                         local res = URS.Check( ply, type, whatwild, noecho, what )
  66.                         if (res == false) then
  67.                                 return false
  68.                         end
  69.                 end
  70.         end
  71.  
  72.  
  73.        
  74. end
  75.  
  76. -- MTZ
  77. function string.starts(String,Start)
  78.    return string.sub(String,1,string.len(Start))==Start
  79. end
  80. function string.ends(String,End)
  81.    return End=='' or string.sub(String,-string.len(End))==End
  82. end
  83.  
  84. function converttowildcard(what)
  85.         local what2 = ""
  86.        
  87.         if string.starts(what, "weapon_doom3_") then what2 = "weapon_doom3_*"
  88.         elseif string.starts(what, "npcg_") then what2 = "npcg_*"
  89.         elseif string.starts(what, "gb5_light_") then what2 = "gb5_light_*"
  90.         elseif string.starts(what, "gb5_") then what2 = "gb5_*"
  91.         elseif string.starts(what, "halo_swep_") then what2 = "halo_swep_*"
  92.         elseif string.starts(what, "weapon_sky_") then what2 = "weapon_sky_*"
  93.         elseif string.starts(what, "m9k_") then what2 = "m9k_*"
  94.         elseif string.starts(what, "crysis_wep_") then what2 = "crysis_wep_*"
  95.         elseif string.starts(what, "weapon_752_") then what2 = "weapon_752_*"
  96.         elseif string.starts(what, "fas2_") then what2 = "fas2_*"
  97.         end
  98.        
  99.         return what2
  100. end
  101. -- END MTZ
  102.  
  103.  


Offline Aaron113

  • Hero Member
  • *****
  • Posts: 803
  • Karma: 102
Re: URS BETA - A Highly Customizeable Restriction System (or will be)
« Reply #493 on: April 23, 2015, 10:01:29 pm »
Yeah, this us something I was already considering.  I just have to find some time to work on it.  I'm on my phone, so I will go over it better tomorrow.

Offline Hyperion

  • Newbie
  • *
  • Posts: 30
  • Karma: 0
Re: URS BETA - A Highly Customizeable Restriction System (or will be)
« Reply #494 on: May 31, 2015, 07:16:07 am »
Can you please explain this?

Code: [Select]
ServerLog: [ULX] Hiugo<STEAM_0:0:24910300> spawned/used swep m9k_nerve_gas -=RESTRICTED=-
Hiugo<STEAM_0:0:24910300> spawned/used swep m9k_nerve_gas -=RESTRICTED=-
Giving Hiugo a m9k_nerve_gas

Started happening like 3 days ago

  • Print