ULX

Author Topic: MySQL server  (Read 4601 times)

0 Members and 2 Guests are viewing this topic.

Killers

  • Guest
MySQL server
« on: October 29, 2007, 05:19:26 PM »
I would like ULX to support MySQL servers for the ban list and users and other files...
I just have a thing for MySQL  :P

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
Re: MySQL server
« Reply #1 on: October 29, 2007, 07:29:32 PM »
Have you seen our script UBan? It's a MySQL ban list that can be shared across multiple servers. As far as users list, I understand why you would want something like that (we have our servers hooked up to this forum to grab the user list based off the forum user group, it's pretty neat). Still, I don't think there's a high enough interest in something like this to make it worth-while.
Experiencing God's grace one day at a time.

Offline spbogie

  • Ulysses Team Member
  • Sr. Member
  • *****
  • Posts: 456
  • Karma: 41
Re: MySQL server
« Reply #2 on: October 29, 2007, 07:33:04 PM »
MySQL support for users is not likely to be a feature added to the official build, however it would not be overly difficult to create a ULib module to query users from an SQL database. As for bans, there is UBan which uses an SQL database to store ban info for use accross multiple servers, but it would work just as well for a single server if that's all you wanted it for. Using UBan you would have to use the different commands to ban people, but if you didn't want anyone to use the default ones for files you could simply deny access to all admins to that, and if want could even rename the commands int he Lua scripts.

I'll not have any time to create such a module for who knows how long, but I would gladly help point you in the right direction.

Edit: Bah, Meg got here first *shakesfist*
I have not failed. I've just found 10,000 ways that won't work. - Thomas A. Edison
I reject your reality and substitute my own. - Adam Savage

Killers

  • Guest
Re: MySQL server
« Reply #3 on: October 30, 2007, 01:57:36 PM »
So Uban would not load the ulx bans file into the database automatic and automatic add entries to the database?

Offline spbogie

  • Ulysses Team Member
  • Sr. Member
  • *****
  • Posts: 456
  • Karma: 41
Re: MySQL server
« Reply #4 on: October 30, 2007, 02:20:55 PM »
UBan uses different ban commands, so you would essentially have two seperate ban datablases, the default flatfile one which Source uses, and "ulx ban" works off of, and the MySQL database for those done with UBan. Your existing bans would not be transfered over, and any new bans made with the default commands would still end up only in the flatfile, but you could force your admins to use the UBan commands so that all new bans would go to the SQL server, and would just have to manually enter any bans in the default file.
I have not failed. I've just found 10,000 ways that won't work. - Thomas A. Edison
I reject your reality and substitute my own. - Adam Savage

Offline MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2728
  • Karma: 430
    • |G4P| Gman4President
Re: MySQL server
« Reply #5 on: October 30, 2007, 02:39:02 PM »
wouldn't it be possible to create a module (new command) that essentially combined the 2 commands together.. or modified the ulx ban command to perform the default function of kicking and banning the user from the server and adding it to the local flat file, and also performing the function of the UBan command and adding that command to the SQL database?

This would be useful in keeping local bans up to date in case of a SQL malfunction as well as allowing for a SQL list for multiple servers or for use in tables on websites and such.


I don't know enough about LUA to know if this is possible or to attempt to do this myself.. but in theory it doesn't seem like it would be too difficult? right?

Offline spbogie

  • Ulysses Team Member
  • Sr. Member
  • *****
  • Posts: 456
  • Karma: 41
Re: MySQL server
« Reply #6 on: October 30, 2007, 02:52:42 PM »
Yes, that would be possible, though in that situation I'd probably go with a simple timer which checked every few minutes and synchronized the lists. The problem being you need to decide which list gets priority. One main reason for using an SQL server for tracking bans, besides sharing accross servers, would be to display, and modify the bans from a web page.
I have not failed. I've just found 10,000 ways that won't work. - Thomas A. Edison
I reject your reality and substitute my own. - Adam Savage

Killers

  • Guest
Re: MySQL server
« Reply #7 on: October 31, 2007, 09:10:07 AM »
wouldn't it be possible to create a module (new command) that essentially combined the 2 commands together..
Thats exactly what i am looking for...
It would be better if ULX supported this officially.
( Server.ini preferences to choose between the flat file and my sql the default should be the flat file )

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: MySQL server
« Reply #8 on: October 31, 2007, 09:55:59 AM »
Killers, Our motto is "striving for simplicity".
From the questions we get daily, I (Guestimate) 80+% of the Gmod admin community doesn't even know where the ban list is stored normally, let alone if we were to complicate matters with an SQL module option as standard.
As soon as someone would see it, we'd start getting "I enabled SQL in the options...how come my bans aren't being stored...blah blah"
We have enough frustration as it is with "How do I add myself as admin?"

I'm not saying your idea is bad...however, I disagree with you wanting us to add it as a standard part of ULX.
Many of the compliments we get about ULX are due to its low resource requirements.

We wrote ULib and ULX to be modular. If you, or someone you know, know Lua..its not hard to add on.

"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2728
  • Karma: 430
    • |G4P| Gman4President
Re: MySQL server
« Reply #9 on: October 31, 2007, 12:49:32 PM »
I agree with JAM... ULX is already too complicated for *most* people who want to run servers.. unfortunately. I agree that the SQL Database is a great idea it is best served as a side dish.. if you know what I mean  ;D ;D ;)

Just get UBan.. and then do this.. but PLEASE back up your origional files... please...

Open up the UBan lua file.. and change the command for ulx gban to ulx ban
Change the command for ulx gbanid to ulx banid
(just remove the g's) ;)


Then go into Addons/ULX/ and find the file that houses the Ban and banid commands for ULX.. I think it's util.lua.. NOT SURE on that.. I'd have to look.. and comment out the commands for ulx ban and ulx banid..

This will effectively keep the same commands and same functionality.. but instead of saving your bans to your local flatfile.. they will now be saved to your database (assuming you set up UBan correctly)

Like I said.. make a backup of all the files you changed.. in case you need to revert them for some reason.

Also.. since you are modifying your default file for ULX you will have to do this modification to the ULX files every time you update ULX as it will be reverted to it's previous state.

If you arent sure how to edit those files.. I might be able to post the modified versions up here for you. but look at them yourself first..