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

0 Members and 1 Guest are viewing this topic.

Offline Botman

  • Newbie
  • *
  • Posts: 14
  • Karma: 0
The most recent gmod update seems to have caused the play time of all players in my server to be reset to 0. Is there anything to do..?

edit: this has actually become really, really severe in my server. I'm running a quite active sandbox server and I'd have no chance of manually resetting every player's play time -- there are just way too many and there must be another solution for me. I'm also using the promotion script which relies on UTime; and it doesn't even respond to UTime anymore despite displaying no lua errors. (I'm able to set UTime manually thanks to Aaron113's code above.) I have a feeling there's something mysterious to it judging by the way UTime is behaving. I'm also afraid that the script is now overwriting the old player time saves so that no matter if the problem is resolved, my every players' time will be reset to 0 and forced to start over again. This in turn would cause longstanding consequences for the established player environment in the server.
« Last Edit: February 08, 2011, 02:26:36 PM by Botman »

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6213
  • Karma: 394
  • Project Lead
Perhaps there's something wrong with the database? You could try deleting the "sv.db" file in the garrysmod root and set everyone's time manually again to see if that fixes your problem.
Experiencing God's grace one day at a time.

Offline Botman

  • Newbie
  • *
  • Posts: 14
  • Karma: 0
Just tried that, Megiddo. Yes, it does stabilise the database and fixes all other problems scriptwise. This still feels very hopeless though as I've absolutely not got enough time to reset everyone's time manually, the task would be too immense (this is a 16-slots, and active). What can I do? Please, please tell me there are any options...

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6213
  • Karma: 394
  • Project Lead
Just tried that, Megiddo. Yes, it does stabilise the database and fixes all other problems scriptwise. This still feels very hopeless though as I've absolutely not got enough time to reset everyone's time manually, the task would be too immense (this is a 16-slots, and active). What can I do? Please, please tell me there are any options...

If I were in your shoes, I'd probably look into using an sqlite tool to export the UTime table, then import it into the new database. My experience with SQL is limited, so your mileage may vary. I'm not sure what caused your issues in the first place, so this might just bring the problems to the new database...
Experiencing God's grace one day at a time.

Offline saintwubbles

  • Newbie
  • *
  • Posts: 15
  • Karma: 3
Having trouble with UtimeM as well since this update.

Timer Error: [@addons\ulx\lua\ulx\lib.lua:70] bad arguement #2 to 'format' (number expected, got nil)
« Last Edit: February 10, 2011, 08:57:22 AM by saintwubbles »

Offline Stickly Man!

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 1270
  • Karma: 164
  • What even IS software anymore?
    • XGUI
That was the same error I got when I was fixing the error in this thread here: http://forums.ulyssesmod.net/index.php/topic,5173.0.html

Make sure your ULX SVN is up-to-date then post in that thread if you have further issues.
Join our Team Ulysses community discord! https://discord.gg/gR4Uye6

Offline krooks

  • Sr. Member
  • ****
  • Posts: 382
  • Karma: 32
  • I don't like video games.
    • Diamond Krooks
-snip-
« Last Edit: January 23, 2012, 12:49:01 PM by krooks »
My TTT server. Join the fun!

Offline krooks

  • Sr. Member
  • ****
  • Posts: 382
  • Karma: 32
  • I don't like video games.
    • Diamond Krooks
Sorry for so many edits,
I first posted and said I had a database error related to utime, causing the server to go into restart loops.
I then snipped the post, because I was able to look at the database and found that it was used by many other services within gmod, and couldn't be sure utime was at fault.

I have since looked at it and after changing something that I thought to be an error, my server is now working again, it was in fact related to utime.

On the utime table I have 1000 entries.
There is another table called "sqlite_sequence" and it lists utime among other things like sui_ratings, then there is a "seq" column, this column seems to contain the number of entries for each table it lists. utime's entry was 1644.

Changing this to match the actual table 1000, seemed to fix things.

I still don't know if utime is to blame or if something else is. Or if this is a permanent fix. I thought I'd report it none the less.
My TTT server. Join the fun!

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6213
  • Karma: 394
  • Project Lead
Looking at the documentation for that table, I'm inclined to believe that either a rogue addon modified the table or Garry can't even implement simple C libraries correctly...
Experiencing God's grace one day at a time.

Offline krooks

  • Sr. Member
  • ****
  • Posts: 382
  • Karma: 32
  • I don't like video games.
    • Diamond Krooks
Hmm, ok, thanks for the reply. Sorry if I've brought this thread off topic  :P
It's back to it's restart loops again, and those tables all match up this time, so I'm stumped as to what the issue is now. Wont post back here about it though if I have questions  ;D
My TTT server. Join the fun!

Offline ThatBum

  • Newbie
  • *
  • Posts: 14
  • Karma: 2
Can we has UtimeM version of setutime? I tried converting it myself using UtimeM's MySQL syntax but I'm failing at it.


Offline ThatBum

  • Newbie
  • *
  • Posts: 14
  • Karma: 2
Yessir. It was from when I imported the data from the SQLite3 DB from standard UTime, and it got wiped from a Source engine update a long time ago. So, I need to manually add time to people, even though it's on MySQL now.

Offline thegtz

  • Newbie
  • *
  • Posts: 25
  • Karma: 0
How would I make this addon run off of Utime?

http://www.garrysmod.org/downloads/?a=view&id=103559

Trying to make it use data from Utime instead of a PlayerTimes file.

Example when a player plays a certain amount of time(ex. 6hrs according to Utime) then he will get promoted to the next rank according to settings in TimeSpent.

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
You mean this? AutoPromote - http://forums.ulyssesmod.net/index.php/topic,3826.msg13322.html#msg13322 (OLD code)
And this code from Aaron in Jan 2011 would probably have much more chance of working due to original's age.
http://forums.ulyssesmod.net/index.php/topic,3826.msg22128.html#msg22128
(Though, even the 2011 code may not work)
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming