• Print

Author Topic: Read players steamid from the ban list  (Read 5684 times)

0 Members and 1 Guest are viewing this topic.

Offline warhammer

  • Newbie
  • *
  • Posts: 1
  • Karma: -1
Read players steamid from the ban list
« on: August 12, 2016, 11:30:22 am »
I want to create/put it in a lua file that reads the ban list and if it has a spercific steamid on the list it will unban it and perhaps run it on a timer to check every 5 seconds
i know i will need to read it by something like

Code: [Select]
local input = ULib.fileRead( "data/ulib/bans.txt" )

but im not sure where to go.
any help appreciated.
« Last Edit: August 12, 2016, 11:31:56 am by warhammer »

Offline iViscosity

  • Respected Community Member
  • Hero Member
  • *****
  • Posts: 803
  • Karma: 58
Re: Read players steamid from the ban list
« Reply #1 on: August 12, 2016, 11:33:14 am »
http://wiki.garrysmod.com/page/file/Read Check this out. I can't help too much at the moment but probably later.
I'm iViscosity. I like gaming and programming. Need some help? Shoot me PM.

Offline Bytewave

  • Respected Community Member
  • Hero Member
  • *****
  • Posts: 718
  • Karma: 116
  • :)
    • My Homepage
Re: Read players steamid from the ban list
« Reply #2 on: August 12, 2016, 12:10:38 pm »
That seems a bit malicious, but...

I pulled this snipped straight from ulib/server/player.lua. It's only a snippet, and would have to be used in the context of a function, but it checks if a SteamID is banned and, if it is, does nothing, otherwise it will continue with any lines following it.
Code: Lua
  1. local banData = ULib.bans[ steamid ]
  2. if not banData then return end -- Not banned
bw81@ulysses-forums ~ % whoami
Homepage

Offline roastchicken

  • Respected Community Member
  • Sr. Member
  • *****
  • Posts: 476
  • Karma: 84
  • I write code
Re: Read players steamid from the ban list
« Reply #3 on: August 12, 2016, 06:05:21 pm »
I cannot think of any use case for this that isn't malicious or at least misguided.
Give a man some code and you help him for a day; teach a man to code and you help him for a lifetime.

Offline Bytewave

  • Respected Community Member
  • Hero Member
  • *****
  • Posts: 718
  • Karma: 116
  • :)
    • My Homepage
Re: Read players steamid from the ban list
« Reply #4 on: August 12, 2016, 06:56:13 pm »
I cannot think of any use case for this that isn't malicious or at least misguided.
Keeping the owner of the server unbanned, maybe?
bw81@ulysses-forums ~ % whoami
Homepage

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Read players steamid from the ban list
« Reply #5 on: August 12, 2016, 07:00:20 pm »
Actually, I was fine with the question, right up until the point 'run on a timer every 5 seconds'.
It then seems like a malicious injection attempt, like many exploits that fill a console with constant unban requests of the script kiddie.
Otherwise, I could see it becoming some custom integration with ULib (or ULX), but not using ULib/ulx (un)ban functions.
SQL mods perhaps.
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline roastchicken

  • Respected Community Member
  • Sr. Member
  • *****
  • Posts: 476
  • Karma: 84
  • I write code
Re: Read players steamid from the ban list
« Reply #6 on: August 13, 2016, 04:46:50 am »
Keeping the owner of the server unbanned, maybe?

I would consider that misguided. You shouldn't rely on yourself being unbanned due to a Lua script. I also wonder why they couldn't just unban themselves via console.
Give a man some code and you help him for a day; teach a man to code and you help him for a lifetime.

Offline Caustic Soda-Senpai

  • Sr. Member
  • ****
  • Posts: 469
  • Karma: 54
  • <Insert something clever here>
    • Steam Page
Re: Read players steamid from the ban list
« Reply #7 on: August 17, 2016, 07:05:36 pm »
I also wonder why they couldn't just unban themselves via console.

My thoughts exactly.
Once you get to know me, you'll find you'll have never met me at all.

  • Print