• Print

Author Topic: Voteban Question  (Read 10536 times)

0 Members and 1 Guest are viewing this topic.

Offline NaRyan

  • Newbie
  • *
  • Posts: 39
  • Karma: 1
Voteban Question
« on: November 17, 2012, 07:07:36 am »
I was thinking of enabling the !voteban command on my TTT server for donators to use.
Donators have the rank of Admin on the server, they do not have any Admin powers in ULX as I disabled all the Admin related options.
They only have the rank of Admin so that they can get unlimited microphone battery in TTT.

The thing is if I do enable !voteban I wish for it to be limited to a maximum ban time of 2 hours.
I have tried changing the voteban time in xgui, however due to that stupid slider thing Garry added to GMOD I am unable to since it just breaks mouse usage in gmod and you have to rejoin the server to fix it (bug is already reported on the git hub bug tracker).

I have also just tried hitting apply to set the minimum and maximum time it shows (0 & 100), however when I do that it just produces a Lua error.

So I was wondering can you manually edit a file to specify the maximum voteban time a user can specify?
And if so what file and what do you need to enter into it?

Thanks.

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Voteban Question
« Reply #1 on: November 17, 2012, 09:13:13 am »
Well, you can edit a file, or grant using console command.

Searching our forum for 'ban time' and 'time limit', I found the following info;
We saw some trouble entering time for bans before GM13 came out though (but not timebans?)
I don't remember if we got it working for folks.

Also, see this, shows the console command and what would be entered into your groups.txt file (/data/ulib/groups.txt I think) under the admin group.
/index.php/topic,5536.0.html#msg25288 />
Hopefully should be able to figure out both from those discussions.
"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: Voteban Question
« Reply #2 on: November 17, 2012, 12:24:08 pm »
The following command in console should do what you want:
Code: Text
  1. ulx groupallow donator "ulx voteban" "* 1:2h"

Read this as "Allow the donator group to use the voteban command. Let them target anybody they are normally allowed to target, but only let them specify ban times between 1 minute and 2 hours"
Experiencing God's grace one day at a time.

Offline NaRyan

  • Newbie
  • *
  • Posts: 39
  • Karma: 1
Re: Voteban Question
« Reply #3 on: November 18, 2012, 07:05:18 am »
Thank you for posting the command I needed to use. :)

Also sorry for not using the search function on the forums.
Kind of obvious thing to do now that I think about it.
Guess I really need to stop doing 10 things at once before I ask a question.

Offline NaRyan

  • Newbie
  • *
  • Posts: 39
  • Karma: 1
Re: Voteban Question
« Reply #4 on: November 19, 2012, 11:34:39 am »
I have enabled the !votekick and !voteban options for Donators.
However when they use it they get this message in console.

"Vote results: User will now be kicked, pending admin approval. (14/23)"
Is it possible to remove the Admin removal part, since I only added the vote options so they could use it when there was no Admin on the server.

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
Re: Voteban Question
« Reply #5 on: November 19, 2012, 12:38:29 pm »
If there is no one with access to approve, I believe it kicks automatically? If not, that's something I need to change...
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: Voteban Question
« Reply #6 on: November 19, 2012, 01:16:58 pm »
If there is no one with access to approve, I believe it kicks automatically?
Just looked over our code. Voteban doesn't.
A way exists to disable admin veto of a votemap if wanted, but no other option exists to override a voteban acceptance by an admin atm.
"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: Voteban Question
« Reply #7 on: November 19, 2012, 01:33:46 pm »
Just looked over our code. Voteban doesn't.
A way exists to disable admin veto of a votemap if wanted, but no other option exists to override a voteban acceptance by an admin atm.

Oh wait, I got confused with votemap and votekick/ban. When the votekick/ban completes it asks the user who started the votekick/ban whether or not to continue with it. This is a good thing (in my opinion), as it allows the victim to plead their case while the vote is ongoing. This does not need to be changed. Does this make sense, NaRyan?

This just goes to show how long it has been since I've worked on some parts of the ULX code base. I'm getting forgetful. :)
Experiencing God's grace one day at a time.

Offline NaRyan

  • Newbie
  • *
  • Posts: 39
  • Karma: 1
Re: Voteban Question
« Reply #8 on: November 19, 2012, 04:07:15 pm »
Yeah it makes sense.
As looking at the logs it shows that there has been successful votekick/ban.

I guess it just the usual of people who started the vote not bothering to read that it needs them to confirm the kick/ban if it passes.

Offline NaRyan

  • Newbie
  • *
  • Posts: 39
  • Karma: 1
Re: Voteban Question
« Reply #9 on: November 20, 2012, 05:46:43 am »
Seems that the player who starts the vote is not getting the prompt to proceed after it passes.
Also last night a votekick was started, it did ask one of the server Admins to confirm it after it passed.

However he had no idea how to accept\decline the vote.
And no other votes could be started due to there being a vote in progress.

The only thing I have changed settings wise is I made the voteban command be "ulx groupallow admin "ulx voteban" "* 1h:2h"
As they kept using just !voteban playername reason. And it would only ban players for 1 minute if it passed.

So I really have no idea why it has stopped working, And no-one has any idea on how to pass\decline the vote, since they get no prompt to either accept or decline it.

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
Re: Voteban Question
« Reply #10 on: December 18, 2012, 01:04:21 pm »
Problem originated from Lua -> LuaJIT swithover. LuaJIT has some interesting quirks. In this case, the following code:

Code: Lua
  1. function returnTable(...) return {...} end
  2. t = returnTable( 1, nil, 3, 4 )
  3. print(#t)

Prints "1" in LuaJIT and "4" in Lua.

Yes, I realize that simple code is not something that would ever be done in real life, but it's a simplified version of what was happening to show specifically why it failed.
Experiencing God's grace one day at a time.

Offline mikey

  • Newbie
  • *
  • Posts: 17
  • Karma: 0
Re: Voteban Question
« Reply #11 on: December 30, 2012, 10:08:04 am »
Sorry for the bump, but how do you approve a voteban even with admin?

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
Re: Voteban Question
« Reply #12 on: December 30, 2012, 01:34:34 pm »
Whoever starts the vote is the one who approves it afterward. They'll see the approval popup at the end of it all.
Experiencing God's grace one day at a time.

  • Print