ULX

Author Topic: Permanent bans to carry over  (Read 1747 times)

0 Members and 1 Guest are viewing this topic.

Offline cyborgguy123

  • Newbie
  • *
  • Posts: 4
  • Karma: 0
Permanent bans to carry over
« on: May 13, 2017, 12:20:43 PM »
I am working in a community and we do not want bans to carry over each server because they are different gamemodes. However the one exception is permanent bans.

How would I make it so only permanent bans (aka a ban time of 0) carry over.

We already have MySQL databases to carry out this function.


Offline BlueNova

  • Full Member
  • ***
  • Posts: 113
  • Karma: 13
  • The most powerful force in the universe.
Re: Permanent bans to carry over
« Reply #1 on: May 13, 2017, 12:49:42 PM »
Perhaps you could try using source bans and just port permanent bans to source bans. Would enforce them to all servers added.

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Permanent bans to carry over
« Reply #2 on: May 13, 2017, 06:04:02 PM »
You didn't mention how far along you were in your code ideas, so here's a very high level.
You'd have to disable ULib bans.
Pseudo logic
On a ban function,
if bantime > 0 then
    write sql <gamemode> ban table = banned_player, time
else
    write sql perm ban table = banned_player, 0
end

on connect hook
On connect, check player against gamemode banlist and perm ban list.
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming