Author Topic: UnoLimited Custom FPP Group Addition?  (Read 3291 times)

0 Members and 1 Guest are viewing this topic.

Offline hymsan

  • Newbie
  • *
  • Posts: 28
  • Karma: 2
UnoLimited Custom FPP Group Addition?
« on: May 29, 2011, 03:57:56 PM »
Hey,

I was trying to figure this out for a while today, I run a server with DarkRP(which means it uses FPP) and I have a custom group inside of FPP for respected users. (If I didn't already have ~100 members in the group, I would move it to a ulx group.)

I can define the group in UnoLimited, like:

Code: [Select]
FPP.Groups.respected
but I can't figure out how to make the code actually accept the group due to the fact that it isn't a usergroup like Ulib/ulx groups. If I do ulx who in console, it will not show respected, respected is like, local in FPP.

Thanks in advance for any help.
hym

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: UnoLimited Custom FPP Group Addition?
« Reply #1 on: May 29, 2011, 07:29:10 PM »
Are they game mode 'team' names instead of groups?
I'm not volunteering to do it, but if they are team names, you could modify code to look at teams instead of groups.
I've basically put off updates of UNoLimited at this time, as URS may take its place (in addition to many other features Aaron is adding)
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline hymsan

  • Newbie
  • *
  • Posts: 28
  • Karma: 2
Re: UnoLimited Custom FPP Group Addition?
« Reply #2 on: June 02, 2011, 03:11:50 PM »
Are they game mode 'team' names instead of groups?
I'm not volunteering to do it, but if they are team names, you could modify code to look at teams instead of groups.
I've basically put off updates of UNoLimited at this time, as URS may take its place (in addition to many other features Aaron is adding)

I don't believe they are Teams, otherwise they would override darkrp Jobs, possibly?

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: UnoLimited Custom FPP Group Addition?
« Reply #3 on: June 02, 2011, 07:36:24 PM »
Can you look into the FPP code, and determine how it checks for 'access'?
If you could determiine that, could add a extra line or two to the UNoLimited (or, any other 'access based' release for that matter.)

I could have sworn I saw falco here somewhere state he was going to start using standard groups though.
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline hymsan

  • Newbie
  • *
  • Posts: 28
  • Karma: 2
Re: UnoLimited Custom FPP Group Addition?
« Reply #4 on: June 03, 2011, 12:33:32 AM »
Can you look into the FPP code, and determine how it checks for 'access'?
If you could determiine that, could add a extra line or two to the UNoLimited (or, any other 'access based' release for that matter.)

I could have sworn I saw falco here somewhere state he was going to start using standard groups though.

If he did it would most likely conflict/override ulx groups though, however, I'm not sure on how FPP is setting groups.

http://darkrp.googlecode.com/svn/trunk/gamemode/FPP/server/

I'll continue to look into it and post what I find, the above link is the trunk.

Code: [Select]
local function RetrieveGroups()
local data = sql.Query("SELECT * FROM FPP_GROUPS;")
if type(data) ~= "table" then
sql.Query("INSERT INTO FPP_GROUPS VALUES('default', 1, '');")
return
end -- if there are no groups then there isn't much to load
for k,v in pairs(data) do
FPP.Groups[v.groupname] = {}
FPP.Groups[v.groupname].tools = string.Explode(";", v.tools)
FPP.Groups[v.groupname].allowdefault = util.tobool(v.allowdefault)
for num,tool in pairs(FPP.Groups[v.groupname].tools) do
if tool == "" then
table.remove(FPP.Groups[v.groupname].tools, num)
end
end
end

local members = sql.Query("SELECT * FROM FPP_GROUPMEMBERS;")
if type(members) ~= "table" then return end
for _,v in pairs(members) do
FPP.GroupMembers[v.steamid] = v.groupname
if not FPP.Groups[v.groupname] and (not FAdmin or not FAdmin.Access.Groups[group]) then -- if group does not exist then set to default
FPP.GroupMembers[v.steamid] = nil
sql.Query("DELETE FROM FPP_GROUPMEMBERS WHERE steamid = "..sql.SQLStr(v.steamid)..";")
end
end
end
RetrieveGroups()

local function SendSettings(ply)
timer.Simple(10, function(ply)
local i = 0
for k,v in pairs(FPP.Settings) do
for a,b in pairs(v) do
i = i + FrameTime()*2
timer.Simple(i, function()
RunConsoleCommand("_"..k.."_"..a, (b and b + 1) or 0)
timer.Simple(i, RunConsoleCommand, "_"..k.."_"..a, b or "")
end)
end
end
end, ply)
end
hook.Add("PlayerInitialSpawn", "FPP_SendSettings", SendSettings)

The above is how hes retrieving the groups from the table, in:

http://darkrp.googlecode.com/svn/trunk/gamemode/FPP/server/FPP_Settings.lua
« Last Edit: June 03, 2011, 12:37:49 AM by hymsan »

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: UnoLimited Custom FPP Group Addition?
« Reply #5 on: June 03, 2011, 02:34:12 PM »
Wow.
It seems silly to me, but he totally wrote his own group comparison system.
I understand wanting to use the sql(lite) capability, but not once is the standard "IsUserGroup" used.
There is no recommendation I can make that wouldn't just be a 'check function' rewrite of unolimited.
If you really want to look into your own private version, I recommend looking into the UnoLimited v2.x though.


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