Author Topic: OpenSteam: Bans and User Management System  (Read 34749 times)

0 Members and 1 Guest are viewing this topic.

Offline Neubivljiv

  • Newbie
  • *
  • Posts: 35
  • Karma: 7
    • OHSystem
OpenSteam: Bans and User Management System
« on: April 17, 2014, 05:05:53 AM »
OpenSteam: Bans and User Management System

This project includes Lua and web application (written in php). Based on ULX MySQL.

Require:
mysqloo
webserver (mysql with php/PDO enabled)

Features:
- Each player is added to the database
- It is not necessary for a player to be on a server in order to execute a command (for example, you can add/remove/update admin although he is not on the server, playing...same for bans/removing bans)
- Check user from the database (steamID, status etc)
- Temporary bans
- Login via Steam (web)
- Custom loading screen (with caching steam players and random backgrounds)
- Support multiple servers
- GeoIP support (based on GeoIP Locator
- Country Bans

Installation
- Copy SERVER /opensteam.lua to GAMEROOT/garrysmod/addons/ulx/lua/ulx/modules/sh/
- Copy WEB folder to your public html folder on the webserver
- Open config.php and modify the settings for your database
- Open opensteam.lua and change (to match your database):
local ULX_HOST = "127.0.0.1"
local ULX_PORT = 3306
local ULX_DATABASE = "prop_hunt"
local ULX_USERNAME = "root"
local ULX_PASSWORD = "password"
- Create database (use Database.sql)
- Add in your server.cfg the following:
Code: [Select]
sv_loadingurl "http://YOUR_WEBSITE/loading/?mapname=%m&steamid=%s"(note: change YOUR_WEBSITE to match yours)
- Edit loading/index.php
Change [SERVER NAME HERE] to Your server name and {YOUR SERVER #1 IP HERE} to your server IP. (I will add option to setup this via configuration later). If you know html, css you can easily create your own loading screen.

It is possible to add more images for loading screen. Just put them into /loading/bcg folder.
To add yourself as admin, join the game and type:
rcon_password YOUR_RCON_PASSWORD
rcon ulx updateuser STEAM_{your_steamID} superadmin
(if you don't know your SteamID use ulx sid YourNick)

In fact, Installation is simple. I just wrote too much detail.  :)

GeoIP Install:
Go to MaxMind website and download GeoIPCountryCSV.zip
Unpack zip archive to /garrysmod/data folder

Commands:

ulx banuser <SteamID> <ban time in minutes (default: 7200 min.)> <Ban Reason (optional)>
ulx removeban  <SteamID> Remove banned user from the database
ulx updateuser <SteamID> <group: supeadmin, admin, user> Promote/demote user
ulx sid <Player Name> Get user SteamID from the database by name
ulx showgroups Show all groups from the database
ulx checkban Check if player is banned (by Player name)
ulx showplayers Show all players with their entity index in console
ulx banindex <Index separated with comma> <Ban time> <"Reason"> Quickly ban more than one player

All these options are also available through the web application  (and more). It is possible to set default expire time for the bans, and allow/disallow permanent bans.
We might add Gaming Panel (screenshot here), which allows almost full control of the steam games via web (Linux only). Currently, this panel is integrated with our system and forums, and we may plan to do as standalone.

If user login via Steam, web application will automatically recognize him if he is superadmin or admin (or user)....

Demo: http://stats.ohsystem.net/opensteam/

Download: https://github.com/OHSystem/opensteam

Screenshots:
Loading screen 1 | Loading screen 2Edit user | Configuration | Permissions | Permissions2 | Remote control | GeoIP Ban | GeoIP ACP

Please check all before asking a question about database connection. If your installation of MySQLOO is not good, we do not provide support for it. So before posting, make sure that your MySQLOO is working (and without OpenSteam).

To do:
- server remote control via web (done)
- more options...
- import bans?
« Last Edit: September 20, 2014, 03:40:32 PM by Neubivljiv »

Offline Grief-Code

  • Newbie
  • *
  • Posts: 15
  • Karma: 6
  • C, C++, PHP, Project Management
    • OHSystem
Re: [WIP] OpenSteam and User Mangement System
« Reply #1 on: April 17, 2014, 05:19:38 AM »
 :)
<- Other side of OHSystem :-P

Offline Storm

  • Full Member
  • ***
  • Posts: 220
  • Karma: 4
Re: [WIP] OpenSteam and User Mangement System
« Reply #2 on: April 17, 2014, 05:32:09 AM »
Just some questions- I have thousands of bans across many servers. My problem is the servers lag as a result of large banned_user.cfg and huge bans.txt files.

1)will this also record permabans to banned_user.cfg?
2)will this also record information to bans.txt?
3)how will this deal with bans across multiple servers or will it?

Offline Grief-Code

  • Newbie
  • *
  • Posts: 15
  • Karma: 6
  • C, C++, PHP, Project Management
    • OHSystem
Re: [WIP] OpenSteam and User Mangement System
« Reply #3 on: April 17, 2014, 05:33:23 AM »
We do not deal with any stupid banned_users.cfg's (this is literally outdated, slow, reading require a lot of time (what is causing your laggs) and not modern)  :-)

We are writing all into MySQL, a database which can be light fast on correctly setup indexe's.
No more laggs from reading large files ;-)
Furthermore, diffrent servers also on diffrent locations can share one database which allow shared bans actually and a shared user statistics/database.

Regards
« Last Edit: April 17, 2014, 05:36:14 AM by Grief-Code »

Offline Neubivljiv

  • Newbie
  • *
  • Posts: 35
  • Karma: 7
    • OHSystem
Re: [WIP] OpenSteam and User Mangement System
« Reply #4 on: April 17, 2014, 05:51:49 AM »
Quote
1)will this also record permabans to banned_user.cfg?
No, record permabans is done only through the database.

Quote
2)will this also record information to bans.txt?
No.

Quote
3)how will this deal with bans across multiple servers or will it?
Depends on how you've set in Lua. I do not see why someone set the different databases for each server. So that the system natively supports multiple servers.

Offline Neku

  • Hero Member
  • *****
  • Posts: 549
  • Karma: 27
Re: [WIP] OpenSteam and User Mangement System
« Reply #5 on: April 17, 2014, 01:48:39 PM »
I do not see why someone set the different databases for each server.

When you host multiple servers, you wouldn't want one ban database for all of them.

It may seem convenient, but in reality, it would only cause grief to those who were banned by an abusive admin or otherwise banned for a bad reason.
Out of the Garry's Mod business.

Offline Neubivljiv

  • Newbie
  • *
  • Posts: 35
  • Karma: 7
    • OHSystem
Re: [WIP] OpenSteam and User Mangement System
« Reply #6 on: April 17, 2014, 03:53:30 PM »
I agree. After all, this option is optional and can easily be adjusted as needed (just need to change the data for database or table in which are placed bans via lua config for each server).

Offline Mclovin

  • Newbie
  • *
  • Posts: 5
  • Karma: 0
  • Hi there.
Re: [WIP] OpenSteam and User Mangement System
« Reply #7 on: April 17, 2014, 07:25:17 PM »
This looks awesome, well done!
Call me Fogell. :D

Offline Neubivljiv

  • Newbie
  • *
  • Posts: 35
  • Karma: 7
    • OHSystem
Re: [WIP] OpenSteam and User Mangement System
« Reply #8 on: April 18, 2014, 09:46:59 AM »
First version (download...read first post):
https://github.com/Neubivljiv/opensteam
(I will probably move to https://github.com/OHSystem later)

I plan to add more options and features, as well as remote control of server (rcon query)...may make and statistics.

Offline Storm

  • Full Member
  • ***
  • Posts: 220
  • Karma: 4
Re: OpenSteam and User Mangement System
« Reply #9 on: April 18, 2014, 10:35:38 AM »
This looks incredible!

Offline Bytewave

  • Respected Community Member
  • Hero Member
  • *****
  • Posts: 723
  • Karma: 116
  • :)
    • My Homepage
Re: OpenSteam and User Mangement System
« Reply #10 on: April 18, 2014, 10:40:58 AM »
It seems Bootstrap is a goto framework for a lot of global ban related utilities, these days. I applaud it, personally, as it makes customization and retheming much easier. :D
I do have a few questions, though:
  • Will admin groups be automatically loaded? (In the admins page, if a group inherits from admin, will it show up as its group name?) Or, is it configurable in any way?
  • When running commands such as sid, is the player's name searched like ULX does it where it's like a search system? (Example: !sid short would return the SteamID of Short Circuit?)

Overall, this is a cool system. I can't wait to use it!
I'd rather use this than Sourcebans as:
  • Sourcebans/ULX requires modifications to base ULX and ULib files.
  • Sourcebans still uses mysql_connect(); functions, when the MySQL library is deprecated as of PHP 5.5. (Hopefully you guys use MySQLi :P)
  • Sourcebans seems to be abandoned. Nobody seems to update it anymore.
  • Sourcebans 2 (built under Bootstrap) is still in early development.
bw81@ulysses-forums ~ % whoami
Homepage

Offline Mclovin

  • Newbie
  • *
  • Posts: 5
  • Karma: 0
  • Hi there.
Re: OpenSteam and User Mangement System
« Reply #11 on: April 18, 2014, 10:44:25 AM »
Do you think you could also add ban reasons?
Call me Fogell. :D

Offline Neubivljiv

  • Newbie
  • *
  • Posts: 35
  • Karma: 7
    • OHSystem
Re: OpenSteam and User Mangement System
« Reply #12 on: April 18, 2014, 11:11:45 AM »
Quote from: Mclovin
Do you think you could also add ban reasons?
Yes, that was planned...but somehow I forgot to add.
Quote from: Princess Twilight Sparkle
Will admin groups be automatically loaded? (In the admins page, if a group inherits from admin, will it show up as its group name?) Or, is it configurable in any way?
When running commands such as sid, is the player's name searched like ULX does it where it's like a search system? (Example: !sid short would return the SteamID of Short Circuit?)
Groups are automatically loaded. However, only superadmins can modify configurations and bans. Will add more options for this.
ulx sid command return data from the database. Currently it only returns Steam ID (not Community ID), but can be easily added.
On the web you can search users by Name, SteamID, CommunityID (it will automatically recognize).

However, this is how loading screens looks like:
screen1 screen2

Edit user: screen2

Quote from: Princess Twilight Sparkle
Sourcebans still uses mysql_connect(); functions, when the MySQL library is deprecated as of PHP 5.5. (Hopefully you guys use MySQLi :P)
Even better. We are using Data Object (PDO).

Quote
Sourcebans 2 (built under Bootstrap) is still in early development.
Bootstrap is only template. We are using it because of responsive design.  It's easy to create a template for OpenSteam. However, I never tried and tested Sourcebans...will look into it...
« Last Edit: April 18, 2014, 11:19:54 AM by Neubivljiv »

Offline Bytewave

  • Respected Community Member
  • Hero Member
  • *****
  • Posts: 723
  • Karma: 116
  • :)
    • My Homepage
Re: OpenSteam and User Mangement System
« Reply #13 on: April 18, 2014, 11:20:35 AM »
Yes, that was planned...but somehow I forgot to add.Groups are automatically loaded. However, only superadmins can modify configurations and bans. Will add more options for this.
ulx sid command return data from the database. Currently it only returns Steam ID (not Community ID), but can be easily added.
On the web you can search users by Name, SteamID, CommunityID (it will automatically recognize).

However, this is how loading screens looks like:
screen1 screen2

Edit user: screen2
Even better. We are using Data Object (PDO).
Nice! :D
Personally, I like MySQLi, but that's just my preference.
I can't wait to see this in action and see all future updates! :D

One question, though, even though it does not concern me entirely: Will this system ever be opened for translations into other languages? Say, including a language file that contains an array of language strings and allowing for that to either be translated by hand or providing the ability to load multiple language files created by others to swap between via a dropdown menu on either the index or admin panel? That would be a very useful feature. :P
bw81@ulysses-forums ~ % whoami
Homepage

Offline Neubivljiv

  • Newbie
  • *
  • Posts: 35
  • Karma: 7
    • OHSystem
Re: OpenSteam and User Mangement System
« Reply #14 on: April 18, 2014, 01:15:30 PM »
Quote
Personally, I like MySQLi, but that's just my preference
Well, maybe you can try PDO and like it. :)

Quote
Will this system ever be opened for translations into other languages?
Yes, you have languages in lang/ folder.  I will add dropdown so each user can change the language.
screenshot (config)

However, added ban reason, so command is:
ulx banuser <SteamID> <BanTime> <Reason>
Example:
ulx banuser STEAM_0:0:14754067 1337 "Map Abuse" - will ban STEAM_0:0:14754067 for 1337 min. with reason: Map abuse
ulx banuser STEAM_0:0:14754067 - will permanent ban STEAM_0:0:14754067
« Last Edit: April 18, 2014, 01:21:57 PM by Neubivljiv »