Ulysses Stuff > Releases
UtimeMOO - Utime for MySQL (Linux Compatible)
Bite That Apple:
--- Quote from: Malkeur 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.
--- End quote ---
That's a lot of work to convert mysqli to mysql in this game. I suppose someone would have to make another addon.
crotoss:
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?
Luk | twitch.tv/doctorluk:
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: ---Jünger² Gabor
--- End code ---
is being saved as
--- Code: ---Jünger² Gabor
--- End code ---
This is an excerpt of the update-query:
--- Code: ---query( "UPDATE utime SET totaltime = " .. math.floor( ply:GetUTimeTotalTime() ) .. ", steamid = '" ..
ply:SteamID() .. "', playername = '" .. db:escape( ply:Nick() ) .. "' WHERE player = " ..
ply:UniqueID() .. ";", function() end )
--- End code ---
-------------------------------------
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: ---USE <database>;
ALTER TABLE `utime` CHANGE `playername` `playername` VARCHAR( 100 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL ;
--- End code ---
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.
Bite That Apple:
--- Quote from: crotoss on September 29, 2014, 07:06:33 PM ---I still seem to have issues with peoples time being occasionally reset. Anyone else encountering this problem?
--- End quote ---
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.
Aaron113:
--- Quote from: Bite That Apple on May 03, 2015, 07:12:54 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.
--- End quote ---
Looks like it's fixed in the version posted right above you. All he did was add a simple loaded check on the player.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version