Author Topic: Group selection not working  (Read 1947 times)

0 Members and 1 Guest are viewing this topic.

Offline General Butthurt

  • Newbie
  • *
  • Posts: 4
  • Karma: 0
Group selection not working
« on: August 18, 2014, 04:43:25 PM »
Hello, I just wrote a ulx addon that allows me to set the scoreboard color for members and groups in ttt. I'm having a bit of an issue with the command to give groups a color though, it seems that at random times the command stops restricting the group limit and will let you enter any value you want. Originally it worked perfectly and you could only enter groupnames and in the dropdown menu in the gui it would give you group options. Now however the dropbox menu doesn't work in the gui, I click it an nothing happens, and it will allow me to use whatever value I want for the group when typing the command. This an issue as I was counting on ulx to provide me with safe group names in the command to add to the sqlite database, with it not working occasionally it leaves me vulnerable to sql injection attacks. Here is the code for the command I wrote. This is the one for removing the color from a group, but it uses the same code for the group parameter.

Code: [Select]
function ulx.ungroupcolor(calling_ply, group_name)
removeGroupColor(group_name)
end
local ungroupcolor =  ulx.command("Scoreboard Colors", "ulx ungroupcolor", ulx.ungroupcolor, "!ungroupcolor")
ungroupcolor:addParam{ type=ULib.cmds.StringArg, completes=ulx.group_names, hint="group", error="invalid group \"%s\" specified", ULib.cmds.restrictToCompletes }
ungroupcolor:defaultAccess( ULib.ACCESS_SUPERADMIN )
ungroupcolor:help( "Removes a groups scoreboard color." )

Offline anangrybeaver

  • Newbie
  • *
  • Posts: 1
  • Karma: 0
Re: Group selection not working
« Reply #1 on: August 19, 2014, 04:11:19 PM »
I'm having the exact same issue. Hope we both have it wrong, and its not a bug... i hope

Offline General Butthurt

  • Newbie
  • *
  • Posts: 4
  • Karma: 0
Re: Group selection not working
« Reply #2 on: August 30, 2014, 02:24:17 PM »
Sorry to bump, but I really need help with this and haven't been able to find a solution.

Offline Stickly Man!

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 1270
  • Karma: 164
  • What even IS software anymore?
    • XGUI
Re: Group selection not working
« Reply #3 on: September 02, 2014, 12:27:30 PM »
This is an interesting bug, and I'd like to investigate further, but haven't had the time. Have you tried this command on a vanilla server running sandbox? It's likely this issue is related to some bugs with how ULX initializes- essentially, it hasn't quite loaded the groups yet and thinks the ulx.group_names table is nil.
Join our Team Ulysses community discord! https://discord.gg/gR4Uye6