Author Topic: UTime - tmysql4 edition!  (Read 8827 times)

0 Members and 1 Guest are viewing this topic.

Offline wafflecopta

  • Newbie
  • *
  • Posts: 2
  • Karma: 2
UTime - tmysql4 edition!
« on: March 09, 2016, 10:27:22 PM »
Hey there guys, first release on these forums, well, first time ever on these forums. Have been doing gmod lua for quite some time now, and lately I have been hunting around for a UTime MySQL addon that just worked with no fuss, and short of http://forums.ulyssesmod.net/index.php/topic,9320.0.html (I posted in that thread as to my objections with it) there has nothing that has tickled my fancy, so I just made my own.

THIS IS MEANT TO REPLACE ANY EXISTING UTIME INSTALLATION!!!
(strangely enough) THIS REQUIRES TMYSQL4 TO BE INSTALLED!!!
Here it is for you lazy people: https://facepunch.com/showthread.php?t=1442438

Installation and Configuration
Just drag and drop (or git clone) into addons folder and add your database info in lua/utime_mysql.lua and thats it. It just works.

Database Changes
I removed the ID column, and am using SteamID64's to identify players. So there are now just the 3 columns (steamid, totaltime, lastvisit).

Download
https://github.com/Wafflecopta/utime-tmysql4
Yes its on github, and although I don't really see myself updating it that much, I would recommend cloning it instead of just downloading the zip. If you don't know how to git clone something, here is a quick guide for any Ubuntu/Debian users:
  • Install git
Code: [Select]
sudo apt-get install git
  • cd into your Garry's Mod addons directory (I can't tell you how to do that...)
  • Then simply run:
Code: [Select]
git clone https://github.com/Wafflecopta/utime-tmysql4.git
    And thats it, its installed.

    To update just cd into the addon itself and run:
    Code: [Select]
    git pull
    If you don't have terminal access to your server, just press the Download Zip button button, and extract the contents into a folder within the addons folder.

    Please Note
    This is a quick and dirty implementation, and as such I have removed things from the original UTime database schema that I deemed unnecessary (such as the id column, I have no idea why that exists), and as such there is NO way (unless you get crafty with databases) to port existing UTime data into this new system.

    No, I will not port this to MySQLOO (its garbage, lets be honest).

    And yes, you can split this between multiple servers.

    Thankyou for reading, hope you guys find it useful.
    « Last Edit: March 09, 2016, 10:28:55 PM by wafflecopta »

    Offline Bite That Apple

    • Hero Member
    • *****
    • Posts: 858
    • Karma: 416
    • Apple Innovations 2010®
      • Fun 4 Everyone Gaming
    Re: UTime - tmysql4 edition!
    « Reply #1 on: March 10, 2016, 03:04:12 AM »
    Don't take my message wrong. I'm happy to see people still make stuff for this game, but.... why all of you guys hopping on the utime bandwagon. utimem has been around since the dawn of the dinosaurs. It seems like everyone has their pick for utime now, and it's such a useless addon now a days. It serves a more comedic and finishing touch to a server.

    I myself do not develop for gmod anymore. So I have not inspected your code at all, but I'm just saying what I believe.

    {Insert JamminR response here}
    Quote from: John F. Kennedy 1963
    A man may die, nations may rise and fall, but an idea lives on.

    Offline Beast

    • Newbie
    • *
    • Posts: 18
    • Karma: 8
      • My Gaming Community
    Re: UTime - tmysql4 edition!
    « Reply #2 on: March 31, 2016, 10:40:23 AM »
    Don't take my message wrong. I'm happy to see people still make stuff for this game, but.... why all of you guys hopping on the utime bandwagon. utimem has been around since the dawn of the dinosaurs. It seems like everyone has their pick for utime now, and it's such a useless addon now a days. It serves a more comedic and finishing touch to a server.

    I myself do not develop for gmod anymore. So I have not inspected your code at all, but I'm just saying what I believe.

    {Insert JamminR response here}

    I brought the bandwagon back with the up to date version that allowed for the uploading and pushing of current data.  Once I'd finished that, I realized that mysqloo isn't exactly good, so I released UTime Ultimate which uses Falco's MySQLite module.  The issue with this is that it somehow interferes with DarkRP and apparently there are other gamemodes that have issues.

    While this is nice that a person made a tmysql4 edition, I do plan on updating and writing my own version of querying from multiple sources with a few minor improvements over my last one.

    I mean, its not fun if you never improve upon your code, right?
     
    I see what this person is doing by adding tmysql and making it remove the id system, however, I do believe that my version is superior due to the extra details and table information, as well as uploading and modification of current data.

    Nice job though.

    Offline Randos

    • Newbie
    • *
    • Posts: 16
    • Karma: 0
    Re: UTime - tmysql4 edition!
    « Reply #3 on: April 01, 2016, 06:45:40 PM »
    Great! Thanks! Ive been waiting for this edition because ive got problems with the older one!
    Ure my god! This works great!

    Offline TheHeroBilly

    • Newbie
    • *
    • Posts: 7
    • Karma: 0
    Re: UTime - tmysql4 edition!
    « Reply #4 on: August 31, 2016, 08:30:57 AM »
    Is it possible to have three separate times on this, such as Session, Total, (How long they've spent onthis server) and Global (time spent on all the servers)? I've seen it done and I'm trying to find which version does this.

    Offline Bite That Apple

    • Hero Member
    • *****
    • Posts: 858
    • Karma: 416
    • Apple Innovations 2010®
      • Fun 4 Everyone Gaming
    Re: UTime - tmysql4 edition!
    « Reply #5 on: August 31, 2016, 07:19:23 PM »
    Is it possible to have three separate times on this, such as Session, Total, (How long they've spent onthis server) and Global (time spent on all the servers)? I've seen it done and I'm trying to find which version does this.

    As far as I know, all the versions on ulx forums do not do that. Maybe facepunch, but I doubt it as that place is cancer.

    That most likely was a custom utime made for that community. It would not be that difficult to make though.
    Quote from: John F. Kennedy 1963
    A man may die, nations may rise and fall, but an idea lives on.

    Offline TheHeroBilly

    • Newbie
    • *
    • Posts: 7
    • Karma: 0
    Re: UTime - tmysql4 edition!
    « Reply #6 on: August 31, 2016, 08:25:30 PM »
    Well as i would like to very much avoid facepunch and can't lua that well myself, could you make me something like that?

    Edit: I just read your signature, and retract my statement

    Offline Bite That Apple

    • Hero Member
    • *****
    • Posts: 858
    • Karma: 416
    • Apple Innovations 2010®
      • Fun 4 Everyone Gaming
    Re: UTime - tmysql4 edition!
    « Reply #7 on: August 31, 2016, 08:57:08 PM »
    Well as i would like to very much avoid facepunch and can't lua that well myself, could you make me something like that?

    Edit: I just read your signature, and retract my statement

    Actually, you're in luck. The idea inspired me to make it, so I actually just did make it myself.

    For multiple servers, you will need to change SERVER_ID variable which is located in sv_utime.lua

    If you use my addon that changes hours for a player, it may or may not cause issues. I really didn't test it, but just giving you the heads up.

    Quote from: John F. Kennedy 1963
    A man may die, nations may rise and fall, but an idea lives on.