ULX

Author Topic: UtimeMOO - Utime for MySQL (Linux Compatible)  (Read 39794 times)

0 Members and 2 Guests are viewing this topic.

Offline BlueGhostHD

  • Newbie
  • *
  • Posts: 10
  • Karma: 0
Re: UtimeMOO - Utime for MySQL (Linux Compatible)
« Reply #30 on: August 12, 2013, 07:01:40 PM »
I need help setting up mysqloo for linux, I've done it for pc, but I don't understand what to do for linux and which files to use.

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: UtimeMOO - Utime for MySQL (Linux Compatible)
« Reply #31 on: August 12, 2013, 07:26:14 PM »
I need help setting up mysqloo for linux, I've done it for pc, but I don't understand what to do for linux and which files to use.
See the bottom of this post, which provides different files/links and locations.
http://facepunch.com/showthread.php?t=1220537
(all i know to do to help, but figure thats a start)
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline BlueGhostHD

  • Newbie
  • *
  • Posts: 10
  • Karma: 0
Re: UtimeMOO - Utime for MySQL (Linux Compatible)
« Reply #32 on: August 12, 2013, 07:42:56 PM »
See the bottom of this post, which provides different files/links and locations.
http://facepunch.com/showthread.php?t=1220537
(all i know to do to help, but figure thats a start)

I've tried all of that, followed tutorials, etc. but it still won't work! :(

Offline TweaK

  • Jr. Member
  • **
  • Posts: 80
  • Karma: 14
    • Garry's Mod Engineers
Re: UtimeMOO - Utime for MySQL (Linux Compatible)
« Reply #33 on: August 12, 2013, 11:43:37 PM »
"Doesn't work" tells us absolutely nothing. Are you getting an error in your console? Have you installed the dll in lua/bin and libmysql alongside the srcds executable? Are you sure your database connection info is correct?


Offline BlueGhostHD

  • Newbie
  • *
  • Posts: 10
  • Karma: 0
Re: UtimeMOO - Utime for MySQL (Linux Compatible)
« Reply #34 on: August 13, 2013, 12:13:17 AM »
"Doesn't work" tells us absolutely nothing. Are you getting an error in your console? Have you installed the dll in lua/bin and libmysql alongside the srcds executable? Are you sure your database connection info is correct?

Don't worry, I decided to backup all my work, and change the OS to Windows, because I've always preferred it over Linux :P

Edit: Now with mysqloo working, this addon shows no connectivity to the database I used.
« Last Edit: August 13, 2013, 07:59:03 AM by BlueGhostHD »

Offline esfservers

  • Newbie
  • *
  • Posts: 1
  • Karma: 0
Re: UtimeMOO - Utime for MySQL (Linux Compatible)
« Reply #35 on: August 20, 2013, 04:59:05 PM »
[ERROR] addons/utimemoo/lua/autorun/cl_utime.lua:137: attempt to index global 'utilx' (a nil value)
  1. unknown - addons/utimemoo/lua/autorun/cl_utime.lua:137


Offline TweaK

  • Jr. Member
  • **
  • Posts: 80
  • Karma: 14
    • Garry's Mod Engineers
Re: UtimeMOO - Utime for MySQL (Linux Compatible)
« Reply #36 on: August 21, 2013, 06:33:57 PM »
[ERROR] addons/utimemoo/lua/autorun/cl_utime.lua:137: attempt to index global 'utilx' (a nil value)
  1. unknown - addons/utimemoo/lua/autorun/cl_utime.lua:137
I think you got an ancient version or something... try the one I posted


Offline Neoon

  • Newbie
  • *
  • Posts: 15
  • Karma: 0
Re: UtimeMOO - Utime for MySQL (Linux Compatible)
« Reply #37 on: July 11, 2014, 03:59:46 PM »
Uses sqlite instead of mysql so it dosent works, please fix it.

Offline crotoss

  • Newbie
  • *
  • Posts: 2
  • Karma: 0
Re: UtimeMOO - Utime for MySQL (Linux Compatible)
« Reply #38 on: July 21, 2014, 07:35:21 PM »
I am having an issue where random players get their times reset. They're still in the database just their time resets at 0.

Offline Malkeur

  • Newbie
  • *
  • Posts: 9
  • Karma: 0
Re: UtimeMOO - Utime for MySQL (Linux Compatible)
« Reply #39 on: August 02, 2014, 08:22:40 AM »
I'd be down to try this but I'm curious, can you convert the data from the sv.db that the original utime uses to the mysql version this uses? I'd much rather use mysql.

Offline Bite That Apple

  • Hero Member
  • *****
  • Posts: 858
  • Karma: 416
  • Apple Innovations 2010®
    • Fun 4 Everyone Gaming
Re: UtimeMOO - Utime for MySQL (Linux Compatible)
« Reply #40 on: August 02, 2014, 03:28:30 PM »
I'd be down to try this but I'm curious, can you convert the data from the sv.db that the original utime uses to the mysql version this uses? I'd much rather use mysql.

That's a lot of work to convert mysqli to mysql in this game. I suppose someone would have to make another addon.
Quote from: John F. Kennedy 1963
A man may die, nations may rise and fall, but an idea lives on.

Offline crotoss

  • Newbie
  • *
  • Posts: 2
  • Karma: 0
Re: UtimeMOO - Utime for MySQL (Linux Compatible)
« Reply #41 on: September 29, 2014, 07:06:33 PM »
Using the version provided by TweaK https://dl.dropboxusercontent.com/u/7934790/gmod/utimem.zip

I still seem to have issues with peoples time being occasionally reset. Anyone else encountering this problem?

Offline Luk | twitch.tv/doctorluk

  • Newbie
  • *
  • Posts: 40
  • Karma: 12
Re: UtimeMOO - Utime for MySQL (Linux Compatible)
« Reply #42 on: April 06, 2015, 11:40:06 AM »
I'm replying to this topic as my issue is directly related to the modified script released by TweaK.

The aim of using MySQL for Utime is to use it on a website and get some quick info about some players and stuff.

The stock UTime addon does not save the Steam-ID, nor the current name of the player. This addon does that, which is a nice feature that I need.

However, an issue with the names is that they are not being saved in UTF-8, so german umlauts are being destroyed and all other characters that many people use are destroyed, too.

I've already changed the encoding in my MySQL table to utf8_unicode_ci, but the names are still being butchered and I suspect lua to be doing that.

Is there a way to get the script to input UTF-8 encoded characters?

As an example:
Code: [Select]
Jünger² Gaboris being saved as
Code: [Select]
Jünger² Gabor
This is an excerpt of the update-query:
Code: [Select]
query( "UPDATE utime SET totaltime = " .. math.floor( ply:GetUTimeTotalTime() ) .. ", steamid = '" ..
ply:SteamID() .. "', playername = '" .. db:escape( ply:Nick() ) .. "' WHERE player = " ..
ply:UniqueID() .. ";", function() end )

-------------------------------------
I did it!

The thing that was missing was "SET NAMES 'utf8';" as the first query before any other queries. Also the playername row must be encoded in utf8_unicode_ci to allow UTF-8 encoded entries.

Here is how to install it:
I already have a UTime MySQL table with entries
1. Open your table structure via phpmyadmin
2. Edit the row "playername"
3. Change the collation to "utf8_unicode_ci"
If you do not have phpmyadmin and can only use SQL queries, use this one:
Code: [Select]
USE <database>;
ALTER TABLE  `utime` CHANGE  `playername`  `playername` VARCHAR( 100 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL ;
and replace "<database>" with the name of your database where utime is installed.

This is the first time I install UTime with MySQL
1. You do not have to change anything, the script automatically constructs the playernames table with UTF-8 encoding

You find the modified scripts in an attachment to this post which you can only see when being logged in.
« Last Edit: April 07, 2015, 05:14:54 AM by Luk | twitch.tv/doctorluk »
Host of Spielwiese der Erwachsenen, a German TTT Server for adults only.

Offline Bite That Apple

  • Hero Member
  • *****
  • Posts: 858
  • Karma: 416
  • Apple Innovations 2010®
    • Fun 4 Everyone Gaming
Re: UtimeMOO - Utime for MySQL (Linux Compatible)
« Reply #43 on: May 03, 2015, 07:12:54 PM »
I still seem to have issues with peoples time being occasionally reset. Anyone else encountering this problem?

It's not really fixable. It's supposed to be a really RARE issue though, because of utime saving the database information at 67 seconds, it's possible that before the player's time/data is loaded, the server saved when their data is at 0, small chance though.
Quote from: John F. Kennedy 1963
A man may die, nations may rise and fall, but an idea lives on.

Offline Aaron113

  • Hero Member
  • *****
  • Posts: 803
  • Karma: 102
Re: UtimeMOO - Utime for MySQL (Linux Compatible)
« Reply #44 on: May 03, 2015, 08:40:16 PM »
It's not really fixable. It's supposed to be a really RARE issue though, because of utime saving the database information at 67 seconds, it's possible that before the player's time/data is loaded, the server saved when their data is at 0, small chance though.
Looks like it's fixed in the version posted right above you.  All he did was add a simple loaded check on the player.