Author Topic: Utime -- Show how long your players have been connected this session and total  (Read 558167 times)

0 Members and 3 Guests are viewing this topic.

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
It's based off unique ids... I'm not sure how those are generated in the first place, so there's no way to map to the new ones (that I know of), sorry.
Experiencing God's grace one day at a time.

Offline MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2728
  • Karma: 430
    • |G4P| Gman4President
I know UTime works with unique IDs.

unique IDs are generated based on a person's SteamID. I dunno how hard it would be to change all the UniqueID's to match the new UniqueID generated by the new SteamID update. Since I had a modified version which used SteamIDs.. it wasnt hard to go in and change the SteamID's to add a 1 instead of the 0.. but having it use uniqueids adds a whole new level of wtf to the situation..


tl;dr....
In short... No.. there is no easy way to get the script to grab the correct data.
In long.. if you can figure out who is who and how UniqueIDs are generated.. it may be posible to run a query on the sqlite server (What UTime uses) and convert the old ids to the new ones and then it'll work with the old data.

If all you had was time data.. as much as it may suck.. just tell your peoplle that the data needed to be reset due to an update that valve put out.. it'll save you a LOT of time and heartache in the longrun.

Offline Cornflake

  • Newbie
  • *
  • Posts: 26
  • Karma: 0
Just out of curiosity, why was the choice made to store the time information in a database file using UIDs? Why not just use SteamIDs (and even possible generated text files) like APromotion?

I ask this in light of the fact it's much easier to go and change all the SteamIDs (Nearly impossible to do this with UIDs) if Valve decides to change everyone's ID again. But for the time being it seems they've reverted the changes, and things seem to be working okay.
« Last Edit: February 19, 2009, 02:32:49 AM by Cornflake »

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
I used UIDs so UTime would work on LAN servers. Obviously VALVe changing steamids was not part of my consideration. :P
Experiencing God's grace one day at a time.

Offline MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2728
  • Karma: 430
    • |G4P| Gman4President
Seriously.. my steam ID has been the same for how many years now.. then they just decide to change it?

Its MORE likely that garry would do something to break the lua than SteamIDs changeing.. just a unforseen niche in the plan.


Also SQL even SQLite is more effecient way of storing the data.. its faster (server side) easier to read and write too.. and less clutter in teh data folder.

Offline Dv2236

  • Jr. Member
  • **
  • Posts: 89
  • Karma: 0
    • MyGamingVoid
What I find super funny is after they did this and I know 4 people that changed all steam ID from steam_0 to steam_1
they just ended up changing it back making them 4 guys re-do it all over again haha, my lazy ass just re-added myself only :P

Offline MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2728
  • Karma: 430
    • |G4P| Gman4President
What I find super funny is after they did this and I know 4 people that changed all steam ID from steam_0 to steam_1
they just ended up changing it back making them 4 guys re-do it all over again haha, my lazy ass just re-added myself only :P

Funny thing is.. I had to do that.. but not only in text files.. I changed over 7 THOUSAND steamIDs in my database... and then had to change them back the next day... Wasnt hard.. i have my ways.. but STILL!! come on...

Offline lolol

  • Newbie
  • *
  • Posts: 14
  • Karma: 0
My UTime does not store any information  :-[
If a player rejoins, if there's a map/server restart... the time is reset. How can I fix this issue?

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
My UTime does not store any information  :-[
If a player rejoins, if there's a map/server restart... the time is reset. How can I fix this issue?

Is your database in the folder? Is it read-only?
Experiencing God's grace one day at a time.

Offline ACProdigy

  • Newbie
  • *
  • Posts: 21
  • Karma: 10
  • Beriddled with nonsense
I've mashed together some code to get UTime working for MySQL databases.

The code is written in terms of quickly opening and closing connections, and is best suited on a machine serving both gmod and MySQL locally. It could easily be altered to work with a persistent connection for larger tasks (such as the UpdateAll function).

I'm willing to clean this up a bit and make it more user friendly if anybody else is interested in it. (Currently it writes MySql connected/Disconnected/QueryStatus to the server console whenever there is activity, sort reusable code into functions, etc)

[edit] Also, I've written a script for migrating an existing sqlite utime table to a mysql table if it exists.
« Last Edit: July 02, 2009, 06:50:35 PM by ACProdigy »

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
I've mashed together some code to get UTime working for MySQL databases.

The code is written in terms of quickly opening and closing connections, and is best suited on a machine serving both gmod and MySQL locally. It could easily be altered to work with a persistent connection for larger tasks (such as the UpdateAll function).

I'm willing to clean this up a bit and make it more user friendly if anybody else is interested in it. (Currently it writes MySql connected/Disconnected/QueryStatus to the server console whenever there is activity, sort reusable code into functions, etc)

[edit] Also, I've written a script for migrating an existing sqlite utime table to a mysql table if it exists.

Good work! :)
Experiencing God's grace one day at a time.

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
I'm willing to clean this up a bit and make it more user friendly if anybody else is interested in it.

Prodigy, though the true ded server + SQL + other major geek point true 'admin' experienced users around the gmod community are a small niche... always feel free to improve upon something like this.
Though I personally just hang out with the cool geeks here (I don't know SQL), I know that several here do, and know even more willing to look and learn.
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline ACProdigy

  • Newbie
  • *
  • Posts: 21
  • Karma: 10
  • Beriddled with nonsense
Prodigy, though the true ded server + SQL + other major geek point true 'admin' experienced users around the gmod community are a small niche... always feel free to improve upon something like this.

I enjoy coding, and I'm working on a full gmod web interface (for rating tables / administration), so I figured this would be a good place to start. I'll clean it up and make it more user friendly. I modified UTime a long time ago to dynamically create images (think: steamCard, example: http://fredluti.ath.cx/dcc/playerInfo.php?id=6), but it was dirty code.. Always good to start fresh.

-EDIT-
New version is ready. Cleaned up code somewhat, removed mysql debug console spam. This version reliably creates a utime database if one doesn't exist. If I continue developing UTime for MySQL, should it be branched or shall I just keep posting releases in the main UTime category? Either way is fine.

UTime-SuiScoreboard works natively with the modifications to Utime due to the way the total time is read. (so anybody using sui scoreboard won't have to change anything to use the MySQL version of UTime)
« Last Edit: July 03, 2009, 09:54:59 AM by ACProdigy »

Offline Jethro

  • Newbie
  • *
  • Posts: 45
  • Karma: 1
Hi,
Im using Utime version 1.3

Keep getting this error when people leave:
Code: [Select]
Player legendoflife21 left the game (Disconnect by user.)
autorun/cl_utime.lua:236: Tried to use a NULL entity!
autorun/cl_utime.lua:236: Tried to use a NULL entity!
autorun/cl_utime.lua:236: Tried to use a NULL entity!
autorun/cl_utime.lua:236: Tried to use a NULL entity!
autorun/cl_utime.lua:236: Tried to use a NULL entity!
autorun/cl_utime.lua:236: Tried to use a NULL entity!
autorun/cl_utime.lua:236: Tried to use a NULL entity!
autorun/cl_utime.lua:236: Tried to use a NULL entity!
autorun/cl_utime.lua:236: Tried to use a NULL entity!
autorun/cl_utime.lua:236: Tried to use a NULL entity!
autorun/cl_utime.lua:236: Tried to use a NULL entity!
autorun/cl_utime.lua:236: Tried to use a NULL entity!
autorun/cl_utime.lua:236: Tried to use a NULL entity!
autorun/cl_utime.lua:236: Tried to use a NULL entity!
autorun/cl_utime.lua:236: Tried to use a NULL entity!
autorun/cl_utime.lua:236: Tried to use a NULL entity!
autorun/cl_utime.lua:236: Tried to use a NULL entity!
autorun/cl_utime.lua:236: Tried to use a NULL entity!
autorun/cl_utime.lua:236: Tried to use a NULL entity!
autorun/cl_utime.lua:236: Tried to use a NULL entity!
autorun/cl_utime.lua:236: Tried to use a NULL entity!
autorun/cl_utime.lua:236: Tried to use a NULL entity!
autorun/cl_utime.lua:236: Tried to use a NULL entity!
autorun/cl_utime.lua:236: Tried to use a NULL entity!
autorun/cl_utime.lua:236: Tried to use a NULL entity!
autorun/cl_utime.lua:236: Tried to use a NULL entity!
autorun/cl_utime.lua:236: Tried to use a NULL entity!
autorun/cl_utime.lua:236: Tried to use a NULL entity!
autorun/cl_utime.lua:236: Tried to use a NULL entity!
autorun/cl_utime.lua:236: Tried to use a NULL entity!
autorun/cl_utime.lua:236: Tried to use a NULL entity!
autorun/cl_utime.lua:236: Tried to use a NULL entity!
autorun/cl_utime.lua:236: Tried to use a NULL entity!
autorun/cl_utime.lua:236: Tried to use a NULL entity!
autorun/cl_utime.lua:236: Tried to use a NULL entity!
autorun/cl_utime.lua:236: Tried to use a NULL entity!
autorun/cl_utime.lua:236: Tried to use a NULL entity!
autorun/cl_utime.lua:236: Tried to use a NULL entity!
autorun/cl_utime.lua:236: Tried to use a NULL entity!
autorun/cl_utime.lua:236: Tried to use a NULL entity!
autorun/cl_utime.lua:236: Tried to use a NULL entity!
autorun/cl_utime.lua:236: Tried to use a NULL entity!
autorun/cl_utime.lua:236: Tried to use a NULL entity!
autorun/cl_utime.lua:236: Tried to use a NULL entity!
autorun/cl_utime.lua:236: Tried to use a NULL entity!
autorun/cl_utime.lua:236: Tried to use a NULL entity!
autorun/cl_utime.lua:236: Tried to use a NULL entity!
autorun/cl_utime.lua:236: Tried to use a NULL entity!
autorun/cl_utime.lua:236: Tried to use a NULL entity!
autorun/cl_utime.lua:236: Tried to use a NULL entity!
autorun/cl_utime.lua:236: Tried to use a NULL entity!
autorun/cl_utime.lua:236: Tried to use a NULL entity!
autorun/cl_utime.lua:236: Tried to use a NULL entity!
autorun/cl_utime.lua:236: Tried to use a NULL entity!
autorun/cl_utime.lua:236: Tried to use a NULL entity!
autorun/cl_utime.lua:236: Tried to use a NULL entity!
autorun/cl_utime.lua:236: Tried to use a NULL entity!
autorun/cl_utime.lua:236: Tried to use a NULL entity!
autorun/cl_utime.lua:236: Tried to use a NULL entity!
autorun/cl_utime.lua:236: Tried to use a NULL entity!
autorun/cl_utime.lua:236: Tried to use a NULL entity!
autorun/cl_utime.lua:236: Tried to use a NULL entity!
autorun/cl_utime.lua:236: Tried to use a NULL entity!
autorun/cl_utime.lua:236: Tried to use a NULL entity!
autorun/cl_utime.lua:236: Tried to use a NULL entity!
autorun/cl_utime.lua:236: Tried to use a NULL entity!
autorun/cl_utime.lua:236: Tried to use a NULL entity!
autorun/cl_utime.lua:236: Tried to use a NULL entity!
autorun/cl_utime.lua:236: Tried to use a NULL entity!
autorun/cl_utime.lua:236: Tried to use a NULL entity!
autorun/cl_utime.lua:236: Tried to use a NULL entity!
autorun/cl_utime.lua:236: Tried to use a NULL entity!
autorun/cl_utime.lua:236: Tried to use a NULL entity!
autorun/cl_utime.lua:236: Tried to use a NULL entity!
autorun/cl_utime.lua:236: Tried to use a NULL entity!
autorun/cl_utime.lua:236: Tried to use a NULL entity!
autorun/cl_utime.lua:236: Tried to use a NULL entity!
autorun/cl_utime.lua:236: Tried to use a NULL entity!
autorun/cl_utime.lua:236: Tried to use a NULL entity!
autorun/cl_utime.lua:236: Tried to use a NULL entity!
autorun/cl_utime.lua:236: Tried to use a NULL entity!
« Last Edit: July 07, 2009, 04:00:03 PM by Jethro »

Offline kennis942

  • Newbie
  • *
  • Posts: 22
  • Karma: 0
hello we just changed server and i lost my 200 hours of playtime and i realy need them back, the old file is lodt , is there any way of setting them back ?