Ulysses

Ulysses Stuff => Releases => Topic started by: Megiddo on December 22, 2007, 05:11:53 PM

Title: Utime -- Show how long your players have been connected this session and total
Post by: Megiddo on December 22, 2007, 05:11:53 PM
Utime simply keeps track of session and total time for players and puts an info box in the top right hand side of the screen. Clients can enable/disable the HUD element as well as set their own colors and positions.

Screenshot when not looking a player:
(http://ulyssesmod.net/archive/Utime/utime_collapsed.png)

Screenshot when looking at another player (there's a nice sliding animation when it opens/closes too):
(http://ulyssesmod.net/archive/Utime/utime_expanded.png)

(http://ulyssesmod.net/archive/Utime/utime_animated.gif)

Download: http://ulyssesmod.net/archive/Utime/Utime-v1_44.zip (http://ulyssesmod.net/archive/Utime/Utime-v1_44.zip)
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: MrPresident on December 22, 2007, 07:04:45 PM
Looks nice.. now integrate it into your scoreboard too! =)

Good work.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: JamminR on December 22, 2007, 07:36:36 PM
Nice Megiddo!

Re: Scoreboard integration
Well, we don't really have a scoreboard. Just a fixed-because-a-gmod-update-broke-it re-release of a scoreboard SuicideBananna released.
He was active here for a while and gave Megiddo permission to re-release the fixed board since it works well with UTeam.
:P
There are still items that I believe SuicideBananna had planned for the board that haven't been completed.
Perhaps one day he'll pick it back up.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: MrPresident on December 22, 2007, 10:26:04 PM
I know Jam.. I use sui_scoreboard too.. but as long as he doesn't release it, it would be okay to hack it for your server. I hacked my scoreboard to show the players time where it used to show their XFire account.

(http://gman4president.com/Images/newSB.png)
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Megiddo on December 25, 2007, 01:48:57 AM
New version, no longer shows with the camera equipped.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: blacksythe on December 25, 2007, 12:22:27 PM
IM currentrly using big_timespent and i modified it to remove the points and display on the left hand side, you code your differently what co-ordinates (for lack of a better word) would i need to enter to make it appear on the left hand side.

My reasons being my admins use it as a guide to catch death matchers and it looks better left alligned.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Megiddo on December 25, 2007, 03:52:31 PM
Where it creates the panel in cl_utime.lua, simply specify the location you want.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: blacksythe on December 26, 2007, 07:02:10 AM
i plan to switch to uteam shortly however is there anyway i can transfer old times over, In other words where do you store your times?
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Megiddo on December 26, 2007, 04:32:05 PM
The process of moving times over would be too complex for anyone but developers or developers who can hand-hold you through the process. Best way would be just to let the time to start over.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Megiddo on January 03, 2008, 09:12:03 PM
New version!

v1.20 - *(01/03/08)*
   * [ADD] Client config to change colors and position of Utime HUD element, as well as the ability to disable it.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: MrPresident on January 04, 2008, 05:41:18 AM
New version!

v1.20 - *(01/03/08)*
   * [ADD] Client config to change colors and position of Utime HUD element, as well as the ability to disable it.


lol, you would =)
Oh... Megiddo...
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Lt.Smith on January 05, 2008, 05:03:12 AM
Very nice, I was looking for something like this and then this showed up :) Thanks Megiddo. I have a question though:

I was looking through the code, because what I want to do is have one database with times for all our servers. The idea is that we then add a little bit of script into our forums that retrieves a player's total time spent to sex it up a bit. In any case, I looked through the code and I'm confused.

Code: [Select]
sql.QueryRow( "SELECT totaltime, lastvisit FROM utime WHERE player = " .. uid .. ";" ) I understand that this fetches the total time spent for the player, but nowhere do I see a require( "mysql" ) statement. Nor do I see an sql setup anywhere. As such, I suppose I have 2 questions:

1) What is the function of the SQL queries?
2) How can I edit this to work off a central database? I imagine the queries can be used as-is, but I still haven't figured out what database they're transmitting to.

Thanks in advance,
Smith
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Megiddo on January 05, 2008, 08:59:31 AM
It's using litesql right now, so you just have to change the function calls and require mysql. :)
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Lt.Smith on January 05, 2008, 11:53:51 AM
I love you :) Thanks!
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: TehBigA on January 05, 2008, 02:21:36 PM
Lol I love the way after I make the super customization that u make it too XD <3
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Megiddo on January 05, 2008, 03:06:59 PM
As far as I see it TehBigA, I released mine two days ago where you released yours an hour ago. ;)
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: TehBigA on January 05, 2008, 04:30:12 PM
Sorry that I had the bug checks run for 3 days prior to release, ask president he said i should wait and guess what i found a bunch of bugs esp a rare one that cause a reinstall of the script, and now look what i get because you just had to "use mine as a template" http://forums.facepunchstudios.com/showthread.php?t=473802 thanks a bunch
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: MrPresident on January 05, 2008, 06:18:52 PM
guys. Please..

Here is the bottom line..

We released the origonal script.
Megiddo made one from scratch when it was suggested for him to have one on his server.

We decided to improve ours, and I told Megiddo what we were doing. (which was probably a bad Idea, but I didn't think that it would lead to this.)
We did a private release on my server to test the script for bugs. JamminR can confirm this, because I invited him to my server to see teh script in action a few days after we installed it. (this was I believe before Megiddo released his version).
Megiddo Decided what we were doing was a good idea.. and decided to add it to his script as well. (though I dont believe he'd ever even seen our script in action.. let alone have access to the code. (if they are similar.. it's probably just a coincidence))
Megiddo released his script.. which prompted us to release ours.

Now people think it was us who stole ideas and code from Megiddo which is complete BS.
No one stole anything from anyone. They are two completely seperate scripts which were released at the same time. END OF STORY..

Now.. lets just drop the accusations.. and move on.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: JamminR on January 05, 2008, 06:35:37 PM
And, just for assurance sake, I did _not_ mention to Megiddo that Big had added color adjustment.
I actually thought it funny when I saw that he'd added them.
Geez. It's a time script. It's not the nobel prize.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Lt.Smith on January 05, 2008, 06:44:22 PM
Moving on works for me, because I need a little help, please. I hate asking for other people to do stuff for me, but I can't figure out what I've done wrong...

Here's the edited code:

Code: [Select]
-- Written by Team Ulysses, http://ulyssesmod.net/


module( "Utime", package.seeall )
if not SERVER then return end

require( "mysql" )
 
host = "hostname"
username = "username"
password = "password"
database = "database"
port = "1234"
 
local db, error = mysql.connect(host, username, password, database, port)
if !db then print(tostring(error) .. " in connection \n") return end

function onJoin( ply )
local uid = ply:UniqueID()

totaltime, isok, error = mysql.query(db, "SELECT totaltime FROM utime WHERE player = " .. uid .. ";")
if !isok then
print(tostring(error) .. " in selecting totaltime \n");
end

lastvisit, isok, error = mysql.query(db, "SELECT lastvisit FROM utime WHERE player = " .. uid .. ";")
if !isok then
print(tostring(error) .. " in selecting lastvisit \n");
end

local time = 0

if (lastvisit) AND (totaltime) then
ULib.tsay( ply, "[UTime]Welcome back " .. ply:Nick() .. ", you last played on this server " .. os.date( "%c", lastvisit ) )
var, isok, error =  mysql.query(db, "UPDATE utime SET lastvisit = " .. os.time() .. " WHERE player = " .. uid .. ";")
if !isok then
print(tostring(error) .. " in updating lastvisit! \n")
end
time = totaltime
else
ULib.tsay( ply, "[UTime]Welcome to our server " .. ply:Nick() .. "!" )
var, isok, error = mysql.query(db, "INSERT into utime ( player, totaltime, lastvisit ) VALUES ( " .. uid .. ", 0, " .. os.time() .. " );")
if !isok then
print(tostring(error) .. "in creating profile! \n")
end
end
ply:SetUTime( time )
ply:SetUTimeStart( CurTime() )
end
hook.Add( "PlayerInitialSpawn", "UTimeInitialSpawn", onJoin )

function updatePlayer( ply )
var, isok, error = mysql.query(db, "UPDATE utime SET totaltime = " .. math.floor( ply:GetUTime() + CurTime() - ply:GetUTimeStart() ) .. " WHERE player = " .. ply:UniqueID() .. ";" )
if !isok then
print(tostring(error) .. " in updating player! \n")
end
end
hook.Add( "PlayerDisconnected", "UTimeDisconnect", updatePlayer )

function updateAll()
local players = player.GetAll()

for _, ply in ipairs( players ) do
if ply and ply:IsConnected() then
updatePlayer( ply )
end
end
end
timer.Create( "UTimeTimer", 67, 0, updateAll )

I realise this is huge... but ok. I'd very much appreciate someone looking over it and pointing out my mistakes. :)

Previously the problem was that on initial spawn it always went for this part of the if statement:
Code: [Select]
if row then
ULib.tsay( ply, "[UTime]Welcome back " .. ply:Nick() .. ", you last played on this server " .. os.date( "%c", lastvisit ) )
var, isok, error =  mysql.query(db, "UPDATE utime SET lastvisit = " .. os.time() .. " WHERE player = " .. uid .. ";")
if !isok then
print(tostring(error) .. " in updating lastvisit! \n")
end
time = totaltime

but I changed the query into two seperate ones (lastvisit and totaltime) and now the script does, well, nothing. The counter appears clientside and all that jazz but all the gnarly bits seem to be laughing at me.

Thanks for any help,

Smith
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: MrPresident on January 05, 2008, 06:51:45 PM
what errors are you getting?
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Megiddo on January 05, 2008, 09:52:19 PM
I apologize for any misunderstandings as well. I honestly had no intention of making any further enhancements to Utime until I wanted something to practice context menus on (never worked with them before and I want to make sure I can do them perfectly for a possible upcoming script). I didn't really have any other script to choose for practice besides Utime, and Utime was ideal because it used complex context menus tied into variables but was still something you could code in a few hours (time is something I never seem to have enough of these days).

Anyways, I did take a look at Time Spent's code, and they're so completely different you'd have to be brain-dead to think they were based off each other. Utime is written in the same style as ULib and ULX, where TS is broken up into more chunks with heavier, more dense coding in a completely different style.

So, what I'm getting at is that I make it a professional objective to never say anything bad about other related scripts if I can help it, and that is certainly the case here as well. I hope you will offer the same courteously Big A.

Thanks! :)
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Lt.Smith on January 06, 2008, 03:59:07 AM
what errors are you getting?
That's the mystery, I'm not getting any. Are there any obvious syntax errors I made?

That's interesting, I don't have a lua_log on the server.  ??? Looks like I have more to fix.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: MrPresident on January 06, 2008, 05:01:48 AM
if you are running this on a dedicated server that you dont have the console directly in front of you, than it can be hard to see the loading lua errors sometimes. Try running this script on a listen server or even single player and see if you get any errors at startup.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Lt.Smith on January 06, 2008, 05:16:21 AM
I checked the Lua logs, fixed one bug where Lua doesn't know what if (blah) AND (lol) then means. For the rest the script is not throwing any errors and I think I've figured out why. If the db doesn't connect the script returns. Nothing shows up when I join, so it has to be that the db isn't connecting properly and the hooks aren't being, well, hooked.

Amazing, I asked for help and came to the right conclusion myself. ;D
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: MrPresident on January 06, 2008, 05:35:06 AM
I checked the Lua logs, fixed one bug where Lua doesn't know what if (blah) AND (lol) then means. For the rest the script is not throwing any errors and I think I've figured out why. If the db doesn't connect the script returns. Nothing shows up when I join, so it has to be that the db isn't connecting properly and the hooks aren't being, well, hooked.

Amazing, I asked for help and came to the right conclusion myself. ;D

That's not a bad thing =)
We need more people around here who are willing to do a little research and work on their own rather than just ask and demand that all of their issues be dealt with by other people.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Avien on January 20, 2008, 02:19:43 PM
Tried this with the new gmod and i get the following errors:

autorun/cl_utime.lua:136: attempt to call method 'GetCursorAimVector' (a nil value)
ReadUsermessageString: String Not Pooled!
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Megiddo on January 20, 2008, 03:16:11 PM
You'll get errors on startup but they're completely harmless, it runs flawlessly regardless. :)
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: MrPresident on January 20, 2008, 03:59:59 PM
correct me if I'm wrong, but it's because its checking the aim vectors (who you might be looking at) before the client is actually loaded because of the way the New Garrys mod loads the code and runs it before the client is loaded.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Avien on January 20, 2008, 04:18:07 PM
You'll get errors on startup but they're completely harmless, it runs flawlessly regardless. :)

That is not true.  When looking at people the utimer at the top left is completely black and blank.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Megiddo on January 20, 2008, 04:29:24 PM
Reset your colors and position by hitting the 'reset' button in the context menu.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Avien on January 20, 2008, 09:55:34 PM
So everyone that joins has to do that?  Cause everyone on the server said it was messed up for them as well.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Megiddo on January 20, 2008, 10:18:05 PM
If they've never played before it shouldn't... but perhaps it's a bug the new engine introduced. I'll look into it.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Avien on January 21, 2008, 09:46:34 AM
Well i added it yesterday for the first time ever.  Everyone got like 50 errors once they joined the server and the UI for the timer was blank and black.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: JamminR on January 21, 2008, 04:02:49 PM
Attached is my condump of the error Avien is getting, even when I join our server.
A screenshot is also attached that shows an error at the location where the time of day is normally displayed.

[Edit] Oh. Nice. It thumbnails it for me
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Avien on January 21, 2008, 04:14:28 PM
Your condump is weird.  Some of your lines are missing letters, while others are fine.  Strange
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: blacksythe on January 22, 2008, 04:01:56 AM
Im looking to have it dump the times into a txt file so i can retrieve it on a website, or just have them retrieve it on a website using mysql, Im currently learning the lua syntax and would like some help in doing this.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: p1cwh0r3 on January 22, 2008, 01:10:46 PM
Only error on client so for for me is "autorun/cl_utime.lua:136: attempt to call method 'GetCursorAimVector' (a nil value)"
This is just on first entering the server. Once reset  (as mentioned) is presse things run fine.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: nofear1999 on February 07, 2008, 08:11:20 AM
Utime simply keeps track of session and total time for players and puts an info box in the top right hand side of the screen. Clients can enable/disable the HUD element as well as set their own colors and positions.

Screenshot when not looking a player:
(http://img96.imageshack.us/img96/6513/gmtropicsv30000ri2.jpg)

Screenshot when looking at another player (there's a nice sliding animation when it opens/closes too):
(http://img100.imageshack.us/img100/2743/gmtropicsv30001sj3.jpg)

Download: http://ulyssesmod.net/archive/Utime/Utime-v1_2.zip

Nice you took it from Mr.P edited changed skin and made it compatable am i right??? anyways i use to use this all the time its awesome you guys should download it
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: MrPresident on February 07, 2008, 08:20:50 AM
for the last time...

This script and our script are completely different. They are not compatable in any way with each other.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Killers2 on April 05, 2008, 02:01:26 PM
Can you make a way to hook into a players total time and session time please?
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Megiddo on April 05, 2008, 05:08:24 PM
Can you make a way to hook into a players total time and session time please?

You already can.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Killers2 on April 06, 2008, 04:09:59 AM
You already can.
Oh how?
Sorry I am still fairly new to Lua.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Sc00by22 on April 15, 2008, 05:38:26 PM
On my Stranded server I join the game and get flooded with this lua error


autorun/cl_utime.lua:136: attempt to call method 'GetCursorAimVector' (a nil value)
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Megiddo on April 15, 2008, 05:46:53 PM
Only when you're joining and it doesn't affect anything.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Sc00by22 on April 15, 2008, 06:10:23 PM
Is there a way to hide this lua error, I don't want people thinking my server is broken
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: blacksythe on April 17, 2008, 04:43:51 PM
im getting Timer Error: attempt to index a nil value spammed in my server console
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Sc00by22 on May 08, 2008, 12:52:02 PM
Where abouts is the data stored for each person? I'm moving to a new server and want to take the time online with me
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Megiddo on May 08, 2008, 02:47:29 PM
It's stored in the SQL DB. Just copy the database over and you'll be golden.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Sc00by22 on May 09, 2008, 12:05:21 PM
The problem is I never new my server had an SQL DB where can i download it
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Megiddo on May 09, 2008, 02:25:15 PM
It's in the garrysmod root directory.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: spbogie on May 09, 2008, 08:38:35 PM
sv.db
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Megiddo on May 16, 2008, 07:48:03 PM
Update! We finally fixed that bug you've all been annoyed with.

Quote from: changelog
v1.30 - *(05/16/08)*
   * [ADD] Some utility functions to make getting session and total times easier.
   * [FIX] A bug introduced by one of garry's updates.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Sc00by22 on May 17, 2008, 12:20:35 AM
Thanks for the new update!
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: factice on August 01, 2008, 09:34:50 PM
I'v a problem  :-\

The time isn't saved, when a player join, leave, and rejoin, the time is reseted  :-\

My server :

77.111.203.16:27015
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Megiddo on August 02, 2008, 04:20:49 PM
Sounds like you have a problem with your sqlite DB.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Jaybuz on August 03, 2008, 08:31:20 AM
I get this error a few times when I start my server:

Code: [Select]
autorun/cl_utime.lua:152: attempt to perform arithmetic on field 'TargetSize' (a nil value)
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Jaybuz on August 03, 2008, 08:44:40 AM
Hmm nvm it's gone now, I think it might of been because I had one of UTime files open in notepad?
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Megiddo on August 03, 2008, 01:47:21 PM
Don't think so.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: factice on August 06, 2008, 05:20:40 AM
I'v deleted the sv.db file and now it's ok  ;D
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Samusaaron3 on September 18, 2008, 07:44:18 AM
I want to manually change the times in my sv.db file (I have the new APromotion script, and I want people to see how many minutes they have logged.)

What program can I use to open it?
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Megiddo on September 18, 2008, 08:03:41 AM
Google "sqlite db viewer".
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: tas on September 18, 2008, 08:25:25 AM
Let me get you the link to the browser I use for gmod, as well as my other websites.

http://sourceforge.net/project/showfiles.php?group_id=87946

You want to download the sqlitebrowser-1.3-win.zip version. I took the liberty of also adding it to the post as well.


@Megiddo: Good idea to Google it, but even I had a hard time getting a good one to work for me.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Samusaaron3 on September 18, 2008, 08:26:55 AM
Ok, I can view the contents of the database now. The problem is that I cant tell who is who.

The values for player and lastvisit just seem like random numbers to me. How can I determine who is who?
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Megiddo on September 18, 2008, 09:20:11 AM
Ok, I can view the contents of the database now. The problem is that I cant tell who is who.

The values for player and lastvisit just seem like random numbers to me. How can I determine who is who?

You can't, players are identified by uniqueids. Those aren't even tied to steam ids, and you can't access it in console without Lua. Sorry, didn't think about that part. :P

You could just start building a separate database of names and unique ids.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Samusaaron3 on September 18, 2008, 09:42:05 AM
How hard would it be to modify UTime to have it also store the player's steamid?
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Megiddo on September 18, 2008, 05:29:48 PM
You would need a basic understanding of Lua and SQL.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: XwawawaX on October 23, 2008, 12:36:46 PM
I checked the Lua logs, fixed one bug where Lua doesn't know what if (blah) AND (lol) then means. For the rest the script is not throwing any errors and I think I've figured out why. If the db doesn't connect the script returns. Nothing shows up when I join, so it has to be that the db isn't connecting properly and the hooks aren't being, well, hooked.

Amazing, I asked for help and came to the right conclusion myself. ;D
So can you type the full working script?
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: ahref on January 21, 2009, 08:14:03 AM
im having a problem with this. If a player is looking at another player who is kicked or disconnects then the player still on the server gets a whole bunch of lua errors:

Code: [Select]
autorun/cl_utime.lua:236: Tried to use a NULL entity!

Looking at this line it displays the nick of the person on the server which of course does not exist if they have just been kicked :(


Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Megiddo on January 21, 2009, 08:19:52 AM
Oops... need to fix that.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: ahref on January 21, 2009, 03:27:45 PM
thanks ill just comment out the line in question for the moment. :D.

I tried to fix it myself but im a lua newbie :)
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Megiddo on January 21, 2009, 10:58:35 PM
Fixed in svn rev 2. Let me know if there are any issues, otherwise I'll push it as a release soon.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: ahref on January 22, 2009, 02:54:19 AM
im unsure how to acess the rev 2 ive been poking around at every svn link and download link and cant seem to find utime anywhere except up to 1.3 in the link on the first page here.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Megiddo on January 22, 2009, 09:06:37 AM
It's in our main repository along with all our other works.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: ahref on February 17, 2009, 07:12:32 AM
is there a way to update this so the times remain. The steam id change seems to have messed up the saved times or something
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Megiddo on February 17, 2009, 07:45:30 AM
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.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: MrPresident on February 17, 2009, 11:13:57 AM
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.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Cornflake on February 19, 2009, 02:30:54 AM
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.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Megiddo on February 19, 2009, 09:09:37 AM
I used UIDs so UTime would work on LAN servers. Obviously VALVe changing steamids was not part of my consideration. :P
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: MrPresident on February 19, 2009, 10:57:15 AM
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.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Dv2236 on February 19, 2009, 10:54:45 PM
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
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: MrPresident on February 20, 2009, 04:57:10 PM
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...
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: lolol on April 07, 2009, 05:51:47 AM
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?
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Megiddo on April 25, 2009, 10:04:00 AM
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?
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: ACProdigy on July 02, 2009, 06:29:11 PM
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.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Megiddo on July 02, 2009, 07:09:42 PM
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! :)
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: JamminR on July 02, 2009, 09:43:31 PM
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.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: ACProdigy on July 02, 2009, 09:49:18 PM
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)
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Jethro on July 07, 2009, 02:14:11 PM
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!
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: kennis942 on July 18, 2009, 05:33:32 PM
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 ?
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: JamminR on July 18, 2009, 09:25:58 PM
I'm not sure what lodt means.
However, to get the old ones back, you'd need to take the old sv.db file from your original server gmod path and place it in your new gmod root.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: ACProdigy on July 19, 2009, 01:04:49 AM
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 ?

Unfortunately, unless you have sv.db from the old server backed up, there is no way to recover the time table. Unless you have a good working knowledge of SQL, the likelihood of manually re-adding them is relatively slim.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: kennis942 on July 20, 2009, 05:10:27 AM
isnt it possible that i for example delete the current database file and only i join the server , it would be the only record so i can change it ?
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: ACProdigy on July 20, 2009, 08:13:06 AM
This is possible to do, however you should know that if you delete your sv.db, some of your other settings may also be lost.

If you're very intent on this ( and understand the risks ), then you can do the following:
1. Delete your sv.db
2. Restart your server and join it. This will ensure your record exists.
3. Stop the server (This is important. SV.DB is sometimes readonly to other programs while a server is running)
4. Using a program called SQLite Database Browser, edit your time record in the UTime table -- the totaltime column is measured in seconds. You will have to do some math here if you wish to make it accurate.
5. Save and close the database.
6. Restart server and join. Your time should show up.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: kennis942 on July 20, 2009, 08:47:15 AM
sounds greAt i have the browser but it will not let me edit.. it says theres no table selected, anyway what are the risks ?
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: jay209015 on July 20, 2009, 08:59:23 AM
Quote
...what are the risks ?
     -Ruining the database
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: ACProdigy on July 20, 2009, 08:59:59 AM
The main risk being that when you delete your sv.db, other addon information may go away. Things like prop protect, titles, user ratings, etc are stored in sv.db. If you delete it, all these values will reset to zero.

To edit a record:
1. Open sv.db using SQLite Database Browser
2. Go to the Browse tab.
3. Select UTime from the drop list (next to the magnifying glass)
4. Find your record (It won't have a name or steamid, only a uniqueid)
5. Double click the totaltime field. A box will pop up. Change the value therein to the number of seconds you want UTime to reflect. Then press the Apply / Close button.
6. Save the Database
7. Close SQLite Database Browser.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: comradeboris on September 04, 2009, 07:45:15 PM
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!

I get exactly the same thing when people leave my server.

Anything that can be done?
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: JamminR on September 04, 2009, 08:27:18 PM
Comradeboris, if you read a few posts after the message you quote... Megiddo states he believes he fixed that in revision 2.
Megiddo is often known to be of few words, so I'll explain a little more.
If you use the SVN of UTime, it should be working.
The SVN of UTime is available from http://ulyssesmod.net/UTime/trunk/
If you don't know how to use SVN, there's a quick tutorial in our SVN forum area.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: comradeboris on September 05, 2009, 07:26:34 PM
Comradeboris, if you read a few posts after the message you quote... Megiddo states he believes he fixed that in revision 2.
Megiddo is often known to be of few words, so I'll explain a little more.
If you use the SVN of UTime, it should be working.
The SVN of UTime is available from http://ulyssesmod.net/UTime/trunk/
If you don't know how to use SVN, there's a quick tutorial in our SVN forum area.

Thanks mate, i'll install Utime with SVN now, tbh I didnt even realize there was an SVN, a mate gave me the addon when i got my server.

- Tom
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Rob1991 on April 23, 2010, 06:10:26 PM
Couldnt find another thread to reply in, bit of an old topic, but I need to know if I can set this UTime plugin to default ON for new players on the server, at the moment they have to go to utilities to enable it!

Please help, thanks

Rob
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Megiddo on April 23, 2010, 07:38:38 PM
Couldnt find another thread to reply in, bit of an old topic, but I need to know if I can set this UTime plugin to default ON for new players on the server, at the moment they have to go to utilities to enable it!

Please help, thanks

Rob

I think it broke because of garry's changes to the initialization system, I'll see if I can't get a quick fix out this weekend.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: JamminR on April 23, 2010, 08:19:49 PM
Couldnt find another thread to reply in, bit of an old topic<clip>

Actually, we'd prefer this over asking a brand new topic post in help and support.
The only time we don't like a bump is if it's totally off topic (brings no new information to the thread by answer or question), or if the question is answered in the thread already.
Thanks for asking a valid question...I'm not sure any of us knew it had broken.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Rob1991 on April 24, 2010, 02:14:00 AM
I think it broke because of garry's changes to the initialization system, I'll see if I can't get a quick fix out this weekend.

Awesome stuff, I love the efficiency of these forums, looking forward to hopefully seeing a fix. Its suprising how a Gmod update can cause the utime box to default off..

Actually, we'd prefer this over asking a brand new topic post in help and support.
The only time we don't like a bump is if it's totally off topic (brings no new information to the thread by answer or question), or if the question is answered in the thread already.
Thanks for asking a valid question...I'm not sure any of us knew it had broken.

Thanks for confirming ;D


Just to add, since iv changed to ASSMod the times keep getting reset when i restart the server :( Im not sure if this would have caused it or not
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Megiddo on May 14, 2010, 01:30:33 PM
Version 1.40 released!

Quote from: changelog
v1.40 - *(05/14/10)*
   * [FIX] A disconnect bug.
   * [FIX] Some bugs introduced by garry's updates.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: someone920 on June 09, 2010, 05:53:12 PM
I'm getting a problem with this utime. It doesn't save total time and shows the session time for both. We are using the ULX SVN if that makes any difference.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Megiddo on June 09, 2010, 06:15:15 PM
Did you delete sv.db or set it to read only?
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: someone920 on June 09, 2010, 06:21:18 PM
I did now, it's working for now, but what's weird is it was working fine up to a couple days ago.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Buggzie on June 15, 2010, 04:22:51 AM
When your looking at a player and you have that dropdown menu out, when they disconnect you get a bunch of lua errors and the same for when your looking in scoreboard and someone leaves.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Megiddo on June 15, 2010, 04:49:23 AM
When your looking at a player and you have that dropdown menu out, when they disconnect you get a bunch of lua errors and the same for when your looking in scoreboard and someone leaves.

That was fixed in v1.4, make sure you're up to date.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Megiddo on July 01, 2010, 07:17:05 PM
Has anyone been having issues with this since the latest gmod update?
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Aaron113 on July 02, 2010, 12:48:44 PM
If your talking about the scoreboard errors, yes.  If your talking about UTime's little on screen menu, one person did complain they couldn't see it.  Everyone but him seems to be able to though.


EDIT:  Then again, maybe I never updated.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Megiddo on July 02, 2010, 01:02:11 PM
Scoreboard errors? That wouldn't relate to UTime. I asked because people on the UTimeM thread were having issues but I didn't see any problems with this one.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Frrz on July 06, 2010, 10:07:48 AM
One of my friends joined my server and he keeps geting this error

Code: [Select]
Timer Error: autorun\cl_utime.lua:43: attempt to index upvalue 'gpanel' (a nil value)Timer Error: autorun\cl_utime.lua:43: a

I have utime on the server, and I have no problem.. just wondering if it's my server or if it's him.. and what to do.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Buggzie on July 09, 2010, 08:30:10 AM
One of my friends joined my server and he keeps geting this error

Code: [Select]
Timer Error: autorun\cl_utime.lua:43: attempt to index upvalue 'gpanel' (a nil value)Timer Error: autorun\cl_utime.lua:43: a

I have utime on the server, and I have no problem.. just wondering if it's my server or if it's him.. and what to do.

OK I've attached a slightly modified file that fixes the error that someone920 mentioned,
and also I've found a place where I fixed another error I was getting a long time ago.

And to Megiddo, the part I changed to fix the error that someone920 mentioned is this:

(Starting at line 31 and ending at line 38)
Code: [Select]
function initialize( ent )
if ent == LocalPlayer() then -- Player has been initialized
gpanel = vgui.Create( "UTimeMain" )
gpanel:SetSize( gpanel.Wide, gpanel.Small )
hook.Remove( "OnEntityCreated", "UtimeInitialize" )
end
end
hook.Add( "OnEntityCreated", "UtimeInitialize", initialize )

I changed it to this:

(Starting at line 31 and ending at line 36)
Code: [Select]
function initialize()
gpanel = vgui.Create( "UTimeMain" )
gpanel:SetSize( gpanel.Wide, gpanel.Small )
hook.Remove( "InitPostEntity", "UtimeInitialize" )
end
hook.Add( "InitPostEntity", "UtimeInitialize", initialize )

Let me know if this is flawed in some way.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Megiddo on July 09, 2010, 08:44:09 AM
It's strange though, because I haven't been able to reproduce that error. And if you are getting that error I'm worried it's an indication of a deeper underlying problem which should be fixed rather than the symptoms in UTime. Do you personally have this problem, Buggzie?
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Buggzie on July 10, 2010, 01:57:34 AM
It's strange though, because I haven't been able to reproduce that error. And if you are getting that error I'm worried it's an indication of a deeper underlying problem which should be fixed rather than the symptoms in UTime. Do you personally have this problem, Buggzie?

Well, Due to the Garry's Mod updates, It seems to be removed, I'm guessing.

Anyways its a problem with Sui Scoreboard which kept spamming errors on the right side of the screen as well as console.

I got line 45 instead of 43, Might be due to an edited version but.

Once you have the old version of UTime and you press tab with sui scoreboard, It started spamming that error for me. So I did what that guy said to do, In my post above and it worked perfectly.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Megiddo on August 06, 2010, 10:13:00 AM
Update, v1.41

Quote from: changelog
v1.41 - *(08/06/10)*
   * [FIX] A a few bugs some people were getting preventing the GUI from showing correctly.

I implemented Ryno's change... even though I was unable to reproduce the problem or able to see what might cause the problem, the change can't harm anything.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: tsmelinda on August 07, 2010, 03:29:28 PM
where is the player time info stored for this addon?
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Megiddo on August 07, 2010, 03:39:38 PM
where is the player time info stored for this addon?

In SQLite, which manifests itself as sv.db in the garrysmod root.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: tsmelinda on August 07, 2010, 03:50:55 PM
ok i found it.
is there a way to make it point to a sql server or is that a separate version?
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Megiddo on August 07, 2010, 07:15:02 PM
Use UTimeM for MySQL
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: tinyanimations on August 21, 2010, 05:57:51 AM
I'm getting a problem with this utime. It doesn't save total time and shows the session time for both. We are using the ULX SVN if that makes any difference.

i have the same problem on my server how do i resolve this??
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Megiddo on August 22, 2010, 04:29:27 PM
i have the same problem on my server how do i resolve this??

Do you have the sv.db file set to read-only?
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: tinyanimations on August 23, 2010, 11:56:44 AM
where do i find the sv.db file? and is there aparticular way to check if its read only?
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Megiddo on August 23, 2010, 12:28:11 PM
where do i find the sv.db file? and is there aparticular way to check if its read only?


It's in the garrysmod root, check the properties of the file.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: tinyanimations on August 24, 2010, 05:27:24 AM
ive checked the file and it isnt read only, im using admin mod exsto if that makes a difference?
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Botman on January 10, 2011, 04:38:31 AM
I have a question. After messing around with some glitchy mods my playing time on my server has been reset to 0. I removed said mods yet it seems to have saved. Is there any way of setting my play time manually?
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Megiddo on January 10, 2011, 06:44:12 AM
I have a question. After messing around with some glitchy mods my playing time on my server has been reset to 0. I removed said mods yet it seems to have saved. Is there any way of setting my play time manually?

Not without a good understanding of SQL...
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Botman on January 10, 2011, 08:47:35 AM
Ugh, wouldn't it at least be possible to run some Lua command that orders an edit in the SQL file?
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Megiddo on January 10, 2011, 09:29:07 AM
Ugh, wouldn't it at least be possible to run some Lua command that orders an edit in the SQL file?

Yes, but you'd still need to know SQL. :P
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Aaron113 on January 10, 2011, 09:54:33 AM
I have a simple setting command that I'd be willing to give you.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Botman on January 11, 2011, 06:30:25 AM
I have a simple setting command that I'd be willing to give you.

I would greatly appreciate it.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Megiddo on January 11, 2011, 06:36:58 AM
I have a simple setting command that I'd be willing to give you.

If you don't mind Aaron113, would you post it here for the future benefit of everyone? :)
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Aaron113 on January 11, 2011, 09:53:06 AM
Code: [Select]
local CATEGORY_NAME = "Custom"

function ulx.setutime( ply, targ, time )
if not targ:IsValid() then return end
targ:SetUTimeStart( CurTime() )
targ:SetUTime( time*3600 )
sql.Query( "INSET into utime( player, totaltime, lastvisit ) VALUES( ".. targ:UniqueID() ..",".. time*3600 ..",".. os.time() .." );" )
ulx.fancyLogAdmin( ply, "#A set the hour's for #T to #i", targ, time )
//return true
end
local setutime = ulx.command( CATEGORY_NAME, "ulx setutime", ulx.setutime, "!setutime" )
setutime:addParam{ type=ULib.cmds.PlayerArg, hint="player" }
setutime:addParam{ type=ULib.cmds.NumArg, default = 0, min = 0, max = 9999, hint="hours" }
setutime:defaultAccess( ULib.ACCESS_SUPERADMIN )
setutime:help( "Sets a player's hours." )
//setutime:logString( "#1s set the hour's for #2s to #3i" )
Goes in your ULX/lua/ulx/modules/sh/

The commented out lines are for a few revisions back before the logging changed.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Botman on February 08, 2011, 01:58:07 PM
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.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Megiddo on February 08, 2011, 09:18:55 PM
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.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Botman on February 09, 2011, 10:04:17 AM
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...
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Megiddo on February 09, 2011, 10:31:20 AM
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...
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: saintwubbles on February 10, 2011, 08:52:11 AM
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)
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Stickly Man! on February 10, 2011, 11:55:00 AM
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.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: krooks on January 20, 2012, 07:14:14 PM
-snip-
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: krooks on January 23, 2012, 12:48:24 PM
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.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Megiddo on January 25, 2012, 04:06:30 PM
Looking at the documentation (http://www.sqlite.org/autoinc.html) 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...
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: krooks on January 27, 2012, 02:15:36 PM
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
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: ThatBum on March 25, 2012, 06:25:30 PM
Can we has UtimeM version of setutime? I tried converting it myself using UtimeM's MySQL syntax but I'm failing at it.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Aaron113 on March 25, 2012, 06:33:38 PM
http://forums.ulyssesmod.net/index.php/topic,4445.0.html ?
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: ThatBum on March 25, 2012, 11:20:52 PM
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.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: thegtz on April 09, 2012, 04:29:50 PM
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.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: JamminR on April 09, 2012, 08:01:33 PM
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)
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: TeoTown on July 25, 2012, 02:46:55 AM
I'm very nooby with Lua. :c

I'm trying to add this to give the players experience points by how long they have played. I made a DarkRP chat command to check the total time but it appears as zero.

Code: [Select]
local function CheckTime(ply)
ply:PrintMessage(HUD_PRINTTALK,"[UTime] You have played on the server for: " .. ply:GetNWInt("TotalUTime") .. ".")
return ""
end
AddChatCommand("/time", CheckTime)

Is ply:GetNWInt("TotalUTime") wrong?
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: TweaK on July 25, 2012, 07:28:19 PM
I think ply:GetUTimeTotalTime() is what you're looking for.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: JackYack13 on October 07, 2012, 05:59:01 AM
Will there be a working release of this for GMod 13?
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Megiddo on October 07, 2012, 04:09:07 PM
Will there be a working release of this for GMod 13?

Is it not already working?
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: JackYack13 on October 08, 2012, 07:30:27 AM
Is it not already working?

It spams my console and the blue box in the corner is white and doesn't show any text. Serverside stuff is probably working though.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Milk_ on November 12, 2012, 01:56:39 AM
I don't even get a box, no errors in rcon or console.. nothing.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Glider on November 13, 2012, 07:52:43 AM
Spams the server with

[ERROR] addons/utime/lua/autorun/cl_utime.lua:138: attempt to index global 'utilx' (a nil value)
  1. unknown - addons/utime/lua/autorun/cl_utime.lua:138
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Stickly Man! on November 13, 2012, 09:12:34 AM
This is on our radar-- we'll get around to it as soon as we have the time.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: TweaK on November 13, 2012, 11:05:58 AM
Serverside part already works, here's a fixed cl_utime.lua for now until an official update.
https://dl.dropbox.com/u/7934790/cl_utime.lua
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Megiddo on November 13, 2012, 11:34:49 AM
Serverside part already works, here's a fixed cl_utime.lua for now until an official update.
https://dl.dropbox.com/u/7934790/cl_utime.lua

Thanks you kindly, we'll put these changes up on GitHub in the near future...
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: pa1n on November 15, 2012, 07:54:47 PM
I get this in console but it works.

Code: [Select]
[ERROR] lua/includes/extensions/debug.lua:41: bad argument #4 to 'format' (string expected, got nil)
1. format - [C]:-1
2. Trace - lua/includes/extensions/debug.lua:41
3. Get - lua/includes/modules/controlpanel.lua:13
4. resetCvars - addons/utime/lua/autorun/cl_utime.lua:305
5. fn - addons/utime/lua/autorun/cl_utime.lua:334
6. unknown - addons/ulib/lua/ulib/shared/hook.lua:168
7. GetAll - [C]:-1
8. fn - addons/ulx/lua/ulx/modules/sh/chat.lua:245
9. Call - addons/ulib/lua/ulib/shared/hook.lua:168
10. fn - addons/ulib/lua/ulib/cl_init.lua:40
11. unknown - addons/ulib/lua/ulib/shared/hook.lua:168
12. LocalPlayer - [C]:-1
13. fn - addons/ulib/lua/ulib/cl_init.lua:39
14. unknown - addons/ulib/lua/ulib/shared/hook.lua:168
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Milk_ on November 21, 2012, 02:12:51 AM
I don't understand what I'm doing wrong, when I add this to my addons, and apply the cl_utime fix mentioned above, it doesn't even recognize the addon.

Code: [Select]
Adding Legacy Addon 'd:\userfiles\singularityservers\864\orangebox\garrysmod\addons\newliferule'
Adding Legacy Addon 'd:\userfiles\singularityservers\864\orangebox\garrysmod\addons\rpname'
Adding Legacy Addon 'd:\userfiles\singularityservers\864\orangebox\garrysmod\addons\ulib'
Adding Legacy Addon 'd:\userfiles\singularityservers\864\orangebox\garrysmod\addons\ulx'
Adding Legacy Addon 'd:\userfiles\singularityservers\864\orangebox\garrysmod\addons\UWSVN'
Adding Legacy Addon 'd:\userfiles\singularityservers\864\orangebox\garrysmod\addons\wire'
Adding Legacy Addon 'd:\userfiles\singularityservers\864\orangebox\garrysmod\addons\wiremod-AdvDuplicator-56811b2'
Server logging enabled.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Megiddo on November 21, 2012, 05:21:18 AM
Don't forget to rename info.txt to addon.txt
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Milk_ on November 23, 2012, 10:37:01 PM
Silly me, I got it working by just adding the .lua files to the modules folder of ULX anywho. Thanks.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Megiddo on December 18, 2012, 01:28:32 PM
Official fix is now on GitHub. It's mostly unmodified from what TweaK had, though. Thanks, TweaK!
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: krooks on December 29, 2012, 11:07:12 AM
Thanks for porting this over to 13, I may have found a bug while changing the position values in resetCvars, then entering utime_reset in game, I get:

Code: [Select]
] utime_reset
Warning: vgui.Create failed to create the VGUI component (ControlPanel)

Trace:
1: Line 32 "Trace" lua/includes/extensions/debug.lua
2: Line 13 "Get" lua/includes/modules/controlpanel.lua
3: Line 305 "nil" addons/utime/lua/autorun/cl_utime.lua
4: Line 69 "nil" lua/includes/modules/concommand.lua


controlpanel.Get() - Error creating a ControlPanel!
You're calling this function too early! Call it in a hook!

[ERROR] addons/utime/lua/autorun/cl_utime.lua:310: attempt to index local 'cpanel' (a nil value)
  1. buildCP - addons/utime/lua/autorun/cl_utime.lua:310
   2. unknown - addons/utime/lua/autorun/cl_utime.lua:305
    3. unknown - lua/includes/modules/concommand.lua:69


Note, this is a TTT server.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: krooks on December 31, 2012, 10:17:33 AM
It seems to be happening to people who join for the first time, here's what I get in clientside_errors.txt

Code: [Select]
[ERROR] addons/utime/lua/autorun/cl_utime.lua:310: attempt to index local 'cpanel' (a nil value)
  1. buildCP - addons/utime/lua/autorun/cl_utime.lua:310
   2. resetCvars - addons/utime/lua/autorun/cl_utime.lua:305
    3. fn - addons/utime/lua/autorun/cl_utime.lua:334
     4. unknown - addons/ulib/lua/ulib/shared/hook.lua:168
      5. GetAll - [C]:-1
       6. fn - addons/ulx/lua/ulx/modules/sh/chat.lua:245
        7. Call - addons/ulib/lua/ulib/shared/hook.lua:168
         8. fn - addons/ulib/lua/ulib/cl_init.lua:40
          9. unknown - addons/ulib/lua/ulib/shared/hook.lua:168
           10. LocalPlayer - [C]:-1
            11. fn - addons/ulib/lua/ulib/cl_init.lua:39
             12. unknown - addons/ulib/lua/ulib/shared/hook.lua:168


controlpanel.Get() - Error creating a ControlPanel!
You're calling this function too early! Call it in a hook!

And this is the block I changed, starting on line 286 of cl_utime.lua
Code: [Select]
function resetCvars()
RunConsoleCommand( "utime_outsidecolor_r", "40" )
RunConsoleCommand( "utime_outsidecolor_g", "40" )
RunConsoleCommand( "utime_outsidecolor_b", "40" )
   
RunConsoleCommand( "utime_outsidetext_r", "255" )
RunConsoleCommand( "utime_outsidetext_g", "255" )
RunConsoleCommand( "utime_outsidetext_b", "255" )
   
RunConsoleCommand( "utime_insidecolor_r", "250" )
RunConsoleCommand( "utime_insidecolor_g", "250" )
RunConsoleCommand( "utime_insidecolor_b", "245" )
   
RunConsoleCommand( "utime_insidetext_r", "0" )
RunConsoleCommand( "utime_insidetext_g", "0" )
RunConsoleCommand( "utime_insidetext_b", "0" )
   
RunConsoleCommand( "utime_pos_x", "1" )
RunConsoleCommand( "utime_pos_y", "90" )
buildCP( controlpanel.Get( "Utime" ) )
end
concommand.Add( "utime_reset", resetCvars )
Just the default color and position. Is this the wrong place to change such things?
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: delagious on January 25, 2013, 07:22:10 PM
I am getting an issue when people reach 96 hours(4 days) of playtime with this addon.
Whenever someone on my server reaches that time they get 1 week added to their time.
So instead of displaying
Code: [Select]
00w 04d 0h 00m 00s it displays
Code: [Select]
01w 04d 0h 00m 00sThe same error occurs when they reach 264 hours(11 days).
So instead of displaying
Code: [Select]
01w 04d 0h 00m 00sit adds a week and displays
Code: [Select]
02w 04d 0h 00m 00sWhy does it add this extra week when they reach the 4th, 11th, 18th, etc... day of total playtime?
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Megiddo on January 27, 2013, 05:08:10 PM
I am getting an issue when people reach 96 hours(4 days) of playtime with this addon.
Whenever someone on my server reaches that time they get 1 week added to their time.
So instead of displaying
Code: [Select]
00w 04d 0h 00m 00s it displays
Code: [Select]
01w 04d 0h 00m 00sThe same error occurs when they reach 264 hours(11 days).
So instead of displaying
Code: [Select]
01w 04d 0h 00m 00sit adds a week and displays
Code: [Select]
02w 04d 0h 00m 00sWhy does it add this extra week when they reach the 4th, 11th, 18th, etc... day of total playtime?

Wow, not sure how that happened. It will be fixed shortly.

@Krooks, I'm not getting that error using GitHub version of UTime. I deleted my garrysmod folder to simulate a first join, but got no error. I also see no difference (except values) in the code you posted.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Megiddo on January 27, 2013, 07:33:32 PM
Updated:

Quote from: Changelog
v1.42 - *(01/27/13)*
   * [ADD] utime_welcome cvar to disable welcome message.
   * [FIX] Regular slew of bugs introduced by Garry (MAJOR thanks TweaK!).
   * [FIX] Time string calculations being incorrect (Thanks delagious).
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: smithy285 on January 28, 2013, 12:14:48 AM
The download link is dead.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Megiddo on January 28, 2013, 04:38:44 AM
Fixed, thanks.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Handmade.Mercury on January 28, 2013, 08:39:49 AM
I'm experiencing the exact same things that Krooks is experiencing. This is also on a TTT server, after freshly installing the latest ULib and ULX, restarting the server, then installing UTime and restarting the server again. I get the exact same errors on a first join, but after that it's fine.

Also, excuse me if I'm being dense, but how does a client access the UTime menu?

EDIT: I notice in clutime.lua that the menu is supposedly hooked into the GMod spawn menu, but the TTT gamemode doesn't use the spawn menu. Is there another way for me to access the menu? Maybe I'll try looking for a way to hook it into TTT's F1 menu.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: smithy285 on January 28, 2013, 11:51:36 PM
I'm experiencing the exact same things that Krooks is experiencing. This is also on a TTT server, after freshly installing the latest ULib and ULX, restarting the server, then installing UTime and restarting the server again. I get the exact same errors on a first join, but after that it's fine.

Also, excuse me if I'm being dense, but how does a client access the UTime menu?

EDIT: I notice in clutime.lua that the menu is supposedly hooked into the GMod spawn menu, but the TTT gamemode doesn't use the spawn menu. Is there another way for me to access the menu? Maybe I'll try looking for a way to hook it into TTT's F1 menu.

Yeah I have installed it but I have no idea how to use it xD

EDIT: It has now decided to work, it looks awesome exactly what I was looking for, good job, but there is one thing I would love you to add in it and that is the ability to close and open the box, so for example, !timeclose !timeopen, something like that would make this amazing.

EDIT: Works fine for me, I am using TTT ;)
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: seven50six6 on February 06, 2013, 10:16:39 PM
Hello,

I got this working with my TTT server but I am trying to reposition it so that it is in the same place for everyone, even for people with different resolutions. I changed the code to move it beside the "preparing" box but with people who have different resolutions, it appears covering the timer. It also seems like when people join it won't correct the positioning if changed between the time they left last time and rejoined; it shows were it was when they left last time.

Some screenshots of the positioning differences:
http://cloud.steampowered.com/ugc/1119412561814368440/F012A5E6E60F812E6F59CDC6FC821C96A72AC7C5/
http://cloud.steampowered.com/ugc/1119412561814346767/50CE8357A867D592C3C43087F60928432CEA363C/


Also, how do I force utime to reset the positioning on the box whenever a player joins instead of having to use that command? (Which currently caused lua error crashing)
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: zaph on February 13, 2013, 01:55:40 AM
Hello,

I got this working with my TTT server but I am trying to reposition it so that it is in the same place for everyone, even for people with different resolutions. I changed the code to move it beside the "preparing" box but with people who have different resolutions, it appears covering the timer. It also seems like when people join it won't correct the positioning if changed between the time they left last time and rejoined; it shows were it was when they left last time.

Some screenshots of the positioning differences:
http://cloud.steampowered.com/ugc/1119412561814368440/F012A5E6E60F812E6F59CDC6FC821C96A72AC7C5/
http://cloud.steampowered.com/ugc/1119412561814346767/50CE8357A867D592C3C43087F60928432CEA363C/


Also, how do I force utime to reset the positioning on the box whenever a player joins instead of having to use that command? (Which currently caused lua error crashing)


bumping for same issue
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: nathan736 on February 13, 2013, 09:38:38 AM
you need to pos it by %  not flat numbers i believe as i cant look at pics because im at school >: (
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: krooks on February 17, 2013, 09:48:14 AM
Updated:
I was just coming on to report the times, thanks for the fix!
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: krooks on February 19, 2013, 03:15:08 PM
Still jumping to 1 week after reaching 4 days for some reason.
Maybe it's because I edit it?
All I do is comment out:
AddCSLuaFile( "autorun/cl_utime.lua" )
on line 3 of sh_utime.lua
and remove the cl_utime.lua file.

I do this to get rid of the display, and built a custom scoreboard to show the times.
To get it to show on my scoreboard I copied this to the scoreboard file:
Code: [Select]
function timeToStr( time )
local tmp = time
local s = tmp % 60
tmp = math.floor( tmp / 60 )
local m = tmp % 60
tmp = math.floor( tmp / 60 )
local h = tmp % 24
tmp = math.floor( tmp / 24 )
local d = tmp % 7
local w = math.floor( tmp / 7 )

return string.format( "%02iw %id %02ih %02im %02is", w, d, h, m, s )
end
Because I wasn't sure how to call it from outside.

Could this be the issue in my case?
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Milk_ on February 25, 2013, 10:20:55 PM
hm.. whenever somebody on my server almost reaches 2 weeks, they reset back to 1 week.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Dazzuh on May 31, 2013, 06:11:07 AM
It seems to be happening to people who join for the first time, here's what I get in clientside_errors.txt

Code: [Select]
[ERROR] addons/utime/lua/autorun/cl_utime.lua:310: attempt to index local 'cpanel' (a nil value)
  1. buildCP - addons/utime/lua/autorun/cl_utime.lua:310
   2. resetCvars - addons/utime/lua/autorun/cl_utime.lua:305
    3. fn - addons/utime/lua/autorun/cl_utime.lua:334
     4. unknown - addons/ulib/lua/ulib/shared/hook.lua:168
      5. GetAll - [C]:-1
       6. fn - addons/ulx/lua/ulx/modules/sh/chat.lua:245
        7. Call - addons/ulib/lua/ulib/shared/hook.lua:168
         8. fn - addons/ulib/lua/ulib/cl_init.lua:40
          9. unknown - addons/ulib/lua/ulib/shared/hook.lua:168
           10. LocalPlayer - [C]:-1
            11. fn - addons/ulib/lua/ulib/cl_init.lua:39
             12. unknown - addons/ulib/lua/ulib/shared/hook.lua:168


controlpanel.Get() - Error creating a ControlPanel!
You're calling this function too early! Call it in a hook!

And this is the block I changed, starting on line 286 of cl_utime.lua
Code: [Select]
function resetCvars()
RunConsoleCommand( "utime_outsidecolor_r", "40" )
RunConsoleCommand( "utime_outsidecolor_g", "40" )
RunConsoleCommand( "utime_outsidecolor_b", "40" )
   
RunConsoleCommand( "utime_outsidetext_r", "255" )
RunConsoleCommand( "utime_outsidetext_g", "255" )
RunConsoleCommand( "utime_outsidetext_b", "255" )
   
RunConsoleCommand( "utime_insidecolor_r", "250" )
RunConsoleCommand( "utime_insidecolor_g", "250" )
RunConsoleCommand( "utime_insidecolor_b", "245" )
   
RunConsoleCommand( "utime_insidetext_r", "0" )
RunConsoleCommand( "utime_insidetext_g", "0" )
RunConsoleCommand( "utime_insidetext_b", "0" )
   
RunConsoleCommand( "utime_pos_x", "1" )
RunConsoleCommand( "utime_pos_y", "90" )
buildCP( controlpanel.Get( "Utime" ) )
end
concommand.Add( "utime_reset", resetCvars )
Just the default color and position. Is this the wrong place to change such things?
Was there ever a fix for this?
Whenever people join my server they get this error the first time, losing allot of players due to it yet it is a useful plugin.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Megiddo on May 31, 2013, 07:13:08 AM
Yes, that was fixed in January.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: SaintSin on June 15, 2013, 08:54:31 AM
Players are still getting the Too Many Lua Errors crash on their first connection. Was there any fix for this? I haven't found one yet.

Quote
[ERROR] addons/utime/lua/autorun/cl_utime.lua:310: attempt to index local 'cpanel' (a nil value)
  1. buildCP - addons/utime/lua/autorun/cl_utime.lua:310
   2. resetCvars - addons/utime/lua/autorun/cl_utime.lua:305
    3. fn - addons/utime/lua/autorun/cl_utime.lua:334
     4. unknown - addons/ulib/lua/ulib/shared/hook.lua:183
      5. LocalPlayer - [C]:-1
       6. fn - addons/ulib/lua/ulib/cl_init.lua:39
        7. unknown - addons/ulib/lua/ulib/shared/hook.lua:183


NAME ID
controlpanel.Get() - Error creating a ControlPanel!
You're calling this function too early! Call it in a hook!

Another issue is the 4 days changing to 1 week and 4 days. Any fixes?
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Megiddo on June 18, 2013, 08:56:17 AM
Both of those were fixed in January... please update.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: sabo on June 19, 2013, 07:54:13 AM
I am sorry if this has been posted already but I thought Ill just let it here:

Code: [Select]
KeyValues Error: RecursiveLoadFromBuffer:  got EOF instead of keyname in file materials/models/zombie_classic/zombie_players_sheet.vmt
VertexLitGeneric, (*proxies*), (*Clamp*),
TTT Client post-init...
Cbuf_AddText: buffer overflow
Cbuf_AddText: buffer overflow
Cbuf_AddText: buffer overflow
Cbuf_AddText: buffer overflow
Cbuf_AddText: buffer overflow
Cbuf_AddText: buffer overflow
Cbuf_AddText: buffer overflow
Cbuf_AddText: buffer overflow
Cbuf_AddText: buffer overflow
Cbuf_AddText: buffer overflow
Cbuf_AddText: buffer overflow
Cbuf_AddText: buffer overflow
Cbuf_AddText: buffer overflow
Cbuf_AddText: buffer overflow
Cbuf_AddText: buffer overflow
Cbuf_AddText: buffer overflow
Cbuf_AddText: buffer overflow
Warning: vgui.Create failed to create the VGUI component (ControlPanel)

Trace:
1: Line 32 "Trace" lua/includes/extensions/debug.lua
2: Line 13 "Get" lua/includes/modules/controlpanel.lua
3: Line 305 "resetCvars" addons/utime/lua/autorun/cl_utime.lua
4: Line 334 "fn" addons/utime/lua/autorun/cl_utime.lua
5: Line 183 "nil" addons/ulib/lua/ulib/shared/hook.lua
6 C function
7: Line 143 "nil" addons/utime/lua/autorun/cl_utime.lua


controlpanel.Get() - Error creating a ControlPanel!
You're calling this function too early! Call it in a hook!

[ERROR] addons/utime/lua/autorun/cl_utime.lua:310: attempt to index local 'cpanel' (a nil value)
  1. buildCP - addons/utime/lua/autorun/cl_utime.lua:310
   2. resetCvars - addons/utime/lua/autorun/cl_utime.lua:305
    3. fn - addons/utime/lua/autorun/cl_utime.lua:334
     4. unknown - addons/ulib/lua/ulib/shared/hook.lua:183
      5. TraceLine - [C]:-1
       6. unknown - addons/utime/lua/autorun/cl_utime.lua:143


This is what I got after restarting the server and joining for the first time, on the 2nd join I did not get any errors.




Another thing: Can I view the player time from someone without having to look at him? and how can I disable the hud part clientside?

Also, is it possible to make the time sync over multiple servers?
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: drake90001 on June 21, 2013, 09:30:56 AM
Yes, I too would like to know how to check my members time without having them in game.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Mors Quaedam on June 22, 2013, 08:48:55 AM
You could always code a PHP interface and use the MySQL addon for this ;)
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Freedom on June 22, 2013, 10:00:01 PM
Is it possible to disable the ability for players to view another player's time by placing their cursor on them. I currently run a TTT server and being able to see through the disguiser with Utime is undesirable.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Megiddo on June 23, 2013, 08:00:24 AM
Yes, I too would like to know how to check my members time without having them in game.

Not possible in current UTime. You'd need to read from the database yourself (it's a fairly simple format).

Is it possible to disable the ability for players to view another player's time by placing their cursor on them. I currently run a TTT server and being able to see through the disguiser with Utime is undesirable.

No, and I can't think of any way I could support that, either.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: smitester on July 02, 2013, 10:55:04 PM
Hey I'm loving this addon. I'm using it for a TTT server but I have one issue with it and I was wondering if anyone could help me fix it. Whenever you hover over someone it shows their time played but the problem is when a traitor is disguised if you hover over them it still shows their name and time played so it kind a ruins the whole purpose of the disguise. I was just wondering if anyone out there could help me with this. I know it may be something hard to fix but I would love it if someone could find a way to fix this.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Megiddo on July 03, 2013, 09:29:22 AM
Hey I'm loving this addon. I'm using it for a TTT server but I have one issue with it and I was wondering if anyone could help me fix it. Whenever you hover over someone it shows their time played but the problem is when a traitor is disguised if you hover over them it still shows their name and time played so it kind a ruins the whole purpose of the disguise. I was just wondering if anyone out there could help me with this. I know it may be something hard to fix but I would love it if someone could find a way to fix this.

I'm actually not familiar with the rules of TTT, and the quick introduction to TTT I found here (http://ttt.badking.net/) doesn't seem to explain why traitors would need to keep their name secret. Could you explain why their name needs to stay secret? (I'm assuming traitors look just like innocents?)
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Decicus on July 03, 2013, 10:52:59 AM
A disguiser hides their name so when someone aims at them, nothing shows up at all (normally it would show name, how healthy you are and such).

So when they're disguised, letting people see their name makes the Disguiser useless.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: JamminR on July 03, 2013, 02:44:52 PM
So, let me get this straight.
NOT using UTime...
If I'm playing TTT, and I aim at someone, who isn't disguised, I get name/health.
But if they're in disguise, I don't get name/health?
Is that right?
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Megiddo on July 03, 2013, 02:48:08 PM
A disguiser hides their name so when someone aims at them, nothing shows up at all (normally it would show name, how healthy you are and such).

So when they're disguised, letting people see their name makes the Disguiser useless.

Hmm, since TTT is included with gmod by default, I'll look into it (https://github.com/Nayruden/Ulysses/issues/225), but it may be too specific for me to address in UTime.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: smitester on July 04, 2013, 02:37:48 PM
I'm actually not familiar with the rules of TTT, and the quick introduction to TTT I found here (http://ttt.badking.net/) doesn't seem to explain why traitors would need to keep their name secret. Could you explain why their name needs to stay secret? (I'm assuming traitors look just like innocents?)
Yes a traitor looks exactly like an innocent and whenever they use a disguiser it hides their name so when they are shooting no one knows who it is but with Utime it shows their name so it ruins the disguiser and everyone can still see their name. Thank you for trying to help :)
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Rupert Cow on July 18, 2013, 11:52:49 PM
Nice very nice!  ;D
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: TheAndroid1 on July 21, 2013, 06:36:26 PM
Hmm, since TTT is included with gmod by default, I'll look into it (https://github.com/Nayruden/Ulysses/issues/225), but it may be too specific for me to address in UTime.

Line 145 in cl_utime.lua change it to:
Code: [Select]
if !trace.Entity:GetNWBool("disguised", false) then
self.TargetSize = self.Large
self.playerInfo:SetPlayer( trace.Entity )
locktime = CurTime()
end
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: SaintSin on July 21, 2013, 08:13:42 PM
My work around the disguiser glitch was to simply just remove the name bar and instead we added an advertisement to our site were the names would appear. Although it is a pain when you want to get someones name it does prevent the glitch. So it has its pros and cons, you decide if it is worth it.
Also I moved the Utime down to the bottom left of the HUD because the utime window would cover the notifications when people discovered bodies.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Megiddo on July 24, 2013, 05:29:24 PM
Line 145 in cl_utime.lua change it to:
Code: [Select]
if !trace.Entity:GetNWBool("disguised", false) then
self.TargetSize = self.Large
self.playerInfo:SetPlayer( trace.Entity )
locktime = CurTime()
end

Thanks for sharing your patch!
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: TheAndroid1 on July 31, 2013, 10:10:50 AM
Thanks for sharing your patch!
No problem!  :)
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Megiddo on August 02, 2013, 10:37:45 AM
Your patch was integrated into Utime, by the way.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: TheAndroid1 on August 07, 2013, 11:00:45 AM
Your patch was integrated into Utime, by the way.
Nice ;D
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Ledhead900 on August 11, 2013, 09:34:02 PM
Two things.


One would think that Utime would integrate with ULX XGUI  but nope that was too much to wish for. Also why would you show the time on players at all it just looks messy it should be disabled by default because I bet a lot of non Sandbox servers will want to get rid of that pronto.


Edit
Killed it I think  8)
Line8
Code: Lua
  1. local utime_enable = CreateClientConVar( "utime_enable", "0.0", true, false )
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: JamminR on August 12, 2013, 02:07:22 PM
You seem a bit harsh and cynical ... did you register just so you could come here and be that way?
1) No. Not as designed. UTime was written many years before TTT was even written, and, as such, very few of the older projects have been upgraded for TTT.  We thank you for your kind constructive idea though.
2) Can't be done from server. Clients can use convar "utime_enable <0|1>" to hide the hud.

Why would UTime, written totally to be independent of ULX, and I think, perhaps even independent of our library, ULib, be integrated by default into XGUI, a menu system written that requires ULib, and is made to control ULX?

It's not too much to wish for.
Learn Lua. Adding the checks (to ensure UTime was loaded) and creating a UTime tab would be a good learning project.

Then rather than coming and seeming hostile, you could come, join a great community, and contribute to it.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: sabo on September 08, 2013, 02:44:50 PM
Line 145 in cl_utime.lua change it to:
Code: [Select]
if !trace.Entity:GetNWBool("disguised", false) then
self.TargetSize = self.Large
self.playerInfo:SetPlayer( trace.Entity )
locktime = CurTime()
end

I did this and for some reason the menu which pops down does not go up any longer :I

And Megiddo I tried to replace the files from your first post and it did not work (the disguise feature).

Is anyone else having these issues or am I the only one and doing something wrong maybe? :o
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: JamminR on September 08, 2013, 04:03:50 PM
sabo, grab svn utime and try (from our github)
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: sabo on September 09, 2013, 10:01:44 AM
Thanks Jammin :)
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: JamminR on September 09, 2013, 07:07:40 PM
No worries. I looked at the commit logs for utime and saw the last commit attempting to fix a bug in the TTT part.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: sabo on September 17, 2013, 06:23:08 AM
I got another server and was just wondering where the Utime database is saved because if I want to move or something similar then I am pretty much screwed haha :D
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: JamminR on September 17, 2013, 03:35:08 PM
http://forums.ulyssesmod.net/index.php/topic,3039.msg10509.html#msg10509
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: sabo on September 19, 2013, 05:29:06 AM
http://forums.ulyssesmod.net/index.php/topic,3039.msg10509.html#msg10509

I searched till page 3 then I gave up lol, thanks JamminR, youre golden keep on going!
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: JamminR on September 19, 2013, 02:28:06 PM
Welcome.
Question comes up every so often, not just UTime though.
Perhaps we should make a FAQ "How do I transfer <old server> to <new server>?"
I'd have to learn myself besides what /sv.db, /addons , /data, /cfg, and /settings might need to be copied though.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: sabo on September 20, 2013, 12:17:13 PM
Welcome.
Question comes up every so often, not just UTime though.
Perhaps we should make a FAQ "How do I transfer <old server> to <new server>?"
I'd have to learn myself besides what /sv.db, /addons , /data, /cfg, and /settings might need to be copied though.


I know my old pointshop used sv.db as database, but I really never looked into it.

never thought what else does it store... what it is for real...

So yea, a FAQ on what the sv.db does/stores would be awesome + what stuff you need to copy over to the new server :P
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Megiddo on September 20, 2013, 12:38:42 PM

I know my old pointshop used sv.db as database, but I really never looked into it.

never thought what else does it store... what it is for real...

So yea, a FAQ on what the sv.db does/stores would be awesome + what stuff you need to copy over to the new server :P

sv.db and cl.db are created by Gmod, not individual mods.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: rainbowdash on October 16, 2013, 04:24:40 PM
How would one use UTime to broadcast (and log) when a player was last seen?

I ask this because a search for "Last Seen" came up with more Utime related content than anything, but a quick skim through the code tells me that it is not included by default.

Off topic btw, been getting a lot of internal server errors trying to browse the forums from my phone and pc just now...
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Megiddo on October 16, 2013, 04:53:05 PM
It shows the player who joins when they're last join time was, it would be a simple modification to make this show to everyone.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: equallyhero on November 01, 2013, 06:58:57 PM
So i have been trying to back up my servers Utime data for EVER!!!!

I tried copying my servers sv.db and it doesnt save the data on my dev server.

Any way to backup my servers utime data?
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: JamminR on November 01, 2013, 08:25:40 PM
Any way to backup my servers utime data?
See same question (but for transfer) here.
http://forums.ulyssesmod.net/index.php/topic,3039.msg32341.html#msg32341 (http://forums.ulyssesmod.net/index.php/topic,3039.msg32341.html#msg32341)
Answered few posts later, before this page actually.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: xLiaMz on November 03, 2013, 01:32:58 PM
Is there anyway to disable the box when looking at people? It never shows the details but instead stays black, I'd rather remove it - More so is it possible to move the box further up on the screen?
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Megiddo on November 04, 2013, 05:33:55 PM
Yes, it's in the configuration menu to move it up the screen. To disable the expansion, you'd need to modify the client side code.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: n00bl3t on November 06, 2013, 02:24:06 PM
I've seen some questions on transferring but how would I go about resetting everyone's time played?

Thanks.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: JamminR on November 06, 2013, 02:50:25 PM
go about resetting everyone's time played?
Well, you 'could' go and delete the sv.db, but there's probably tons of other important server and player data stored there.
But our releases section also contains an hour changer.
I didn't re-read the release post, but perhaps it could do what you're asking.
http://forums.ulyssesmod.net/index.php/topic,6182.0.html (http://forums.ulyssesmod.net/index.php/topic,6182.0.html)
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Bite That Apple on November 11, 2013, 02:42:10 AM
I've seen some questions on transferring but how would I go about resetting everyone's time played?

Thanks.

I'm curious why you would want to reset everyone's time anyways?
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: LewisUK on November 21, 2013, 01:28:13 PM
Hey, i have been using UTime on my server for a while, but for me and a couple others the UTime has moved to the bottem right of our screen, instead of top right.. as shown here:

(http://i.imgur.com/DdjaCOF.png)

And due to it being there, it is obstructing the HUD. Any fix?

It gives off no errors in console either.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: JamminR on November 21, 2013, 02:45:38 PM
LewisUK, UTime has it's own client side settings menu in Gmod options menu while in game.
One of those is 'reset' I think, and one allows position/color adjustment.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: LewisUK on November 22, 2013, 07:55:40 AM
LewisUK, UTime has it's own client side settings menu in Gmod options menu while in game.
One of those is 'reset' I think, and one allows position/color adjustment.

Could i have a little more help with that, i checked the actual gmod settings and the ULX settings tab, can't see anything.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: LewisUK on November 22, 2013, 08:21:09 AM
Fixed by typing utime_reset into console!
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Megiddo on November 22, 2013, 11:00:26 AM
It's in the spawn menu settings, LewisUK. Say, where does your avatar come from?
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: HazCP on November 28, 2013, 12:51:48 PM
I'm really confused about how you customize this. I would like to move it to top left of screen. And be able to know how you disable it.

Haz
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Megiddo on November 28, 2013, 01:20:23 PM
It's in the spawn menu settings.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: shawnmd on December 02, 2013, 08:00:54 AM
I keep getting a lua error on my dedicated server,
I've tried starting with a fresh sv.db and data folder, but to no avail.

[ERROR] addons/utime/lua/autorun/cl_time.lua:46: attempt to index upvalue 'gpanel' (a nil value)
1. unknown - addons/utime/lua/autorun/cl_utime.lua:46

The utime options appear in the ulx menu, and i'm running the latest svn of ulx and ulib.
Using "Utime-v1_42"

Any suggestions?
I love this module and hope to have it working!
btw i am running auto promote and some other ulx modules.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Bite That Apple on December 02, 2013, 09:58:31 AM
Above is a Client Side error. So you don't need to clear your sv.db and you would never need to clear your data folder because utime doesn't use the data folder..
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: JamminR on December 02, 2013, 10:06:59 AM
Any suggestions?

Use the latest/greatest utime from our Github repository.
https://github.com/Nayruden/Ulysses
The last fix was 4 months ago, and code change added a check for nil gpanel (https://github.com/Nayruden/Ulysses/commit/7c556b6dc094af437da44ad1ffc1508c969cc96c).
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Bite That Apple on December 02, 2013, 03:28:41 PM
Use the latest/greatest utime from our Github repository.
https://github.com/Nayruden/Ulysses
The last fix was 4 months ago, and code change added a check for nil gpanel (https://github.com/Nayruden/Ulysses/commit/7c556b6dc094af437da44ad1ffc1508c969cc96c).

Then the original post should be updated with the new download link.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: JamminR on December 02, 2013, 04:10:29 PM
Chaos, we have 'release' and 'non-release' cycles here in Team Ulysses.
Our repository is considered beta code, non-release.
Just like all of our projects hosted there, if enough people use the non-release code and find no other bugs, Megiddo may update the first post to count it as a release.
If you look at the readme for UTime repository (https://github.com/Nayruden/Ulysses/blob/master/utime/readme.txt), it's version is 1.43, it's release date, 0/0/00 because, well, it's not been officially released as stable yet.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Bite That Apple on December 02, 2013, 04:16:49 PM
Well I personally would say that if the current version of utime appears to not have any issues, then it should be considered 'released'. That's just my opinion though, I'm not really sure how such a simple addon such as utime could really have too much of an issues..
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: JamminR on December 02, 2013, 04:35:04 PM
Well, we thought that about 1.42, and we apparently didn't have it tested long enough before releasing it. :)
Tons of addons in the Gmod world, always possible a popular one might break something or conflict in a way we didn't consider.
Good coding projects will almost always have this type of cycle, release, and beta.
Anything on our repository is considered beta, anything on our ulyssesmod.com/downloads page is 'release'.

Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: HazCP on December 08, 2013, 05:21:59 PM
It's in the spawn menu settings.

My server is Trouble in Terrorist Town.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: SaintSin on December 09, 2013, 01:26:27 PM
I am running 1.42 and when I check the client side errors I often see this on players joining the server for the first time.

Quote
[ERROR] addons/utime/lua/autorun/cl_utime.lua:310: attempt to index local 'cpanel' (a nil value)
  1. buildCP - addons/utime/lua/autorun/cl_utime.lua:310
   2. resetCvars - addons/utime/lua/autorun/cl_utime.lua:305
    3. fn - addons/utime/lua/autorun/cl_utime.lua:334
     4. unknown - addons/ulib/lua/ulib/shared/hook.lua:183
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: DendeSon on December 15, 2013, 07:19:12 PM
Is there a command to check someones playtime if they are not online? Is there a way to check the play time in the server files?
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: JamminR on December 15, 2013, 08:12:42 PM
I am running 1.42 and when I check the client side errors I often see this on players joining the server for the first time.
Saint, see the post a few back.
Use the latest/greatest utime from our Github repository.
https://github.com/Nayruden/Ulysses
The last fix was 4 months ago, and code change added a check for nil cpanel (https://github.com/Nayruden/Ulysses/commit/7c556b6dc094af437da44ad1ffc1508c969cc96c).

DendeSon, Not sure by default, no.
However, you might look into the release named "UTime Hour Changer". I'm not sure if it has viewing/editing of offline players or not, but figure it would.

Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: SaintSin on December 16, 2013, 01:38:55 PM
I've managed to recreate another issue that has had the time reset after any server issues.

I changed a line of code on my server that created an error (compared a string to a number, idiot) in a pointshop file. This caused the player models to bug out along with all the other gamemode files. I noticed that in this broken server state it also over writes the players time. So any players that were online while I messed up had their time reset.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: benjanmin112 on December 19, 2013, 08:17:11 PM
I got a bug with that me and some other players on my server are not able to see the utime up in our left cornor is they are way to fix this?!
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: JamminR on December 19, 2013, 08:33:36 PM
I got a bug with that me and some other players on my server are not able to see the utime up in our left cornor is they are way to fix this?!
http://forums.ulyssesmod.net/index.php/topic,3039.msg33186.html#msg33186 (http://forums.ulyssesmod.net/index.php/topic,3039.msg33186.html#msg33186) or using the settings - Utime tab in your spawn menu.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Megiddo on December 20, 2013, 10:17:44 PM
I've managed to recreate another issue that has had the time reset after any server issues.

I changed a line of code on my server that created an error (compared a string to a number, idiot) in a pointshop file. This caused the player models to bug out along with all the other gamemode files. I noticed that in this broken server state it also over writes the players time. So any players that were online while I messed up had their time reset.

We can't really control errors in other people's scripts...
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Nick_515 on December 31, 2013, 11:35:16 PM
Sorry. I'm not great with this, but I'm getting these errors in console when people join for the first time. I have the newest version from GitHub and it includes the fix on line 40 of the cl_utime.lua.

Code: [Select]
[------------|33|STEAM_0:1:---------] Lua Error:
controlpanel.Get() - Error creating a ControlPanel!
You're calling this function too early! Call it in a hook!

[---------------|33|STEAM_0:1:---------] Lua Error:

[ERROR] addons/utime/lua/autorun/cl_utime.lua:310: attempt to index local 'cpanel' (a nil value)
1. buildCP - addons/utime/lua/autorun/cl_utime.lua:310
2. resetCvars - addons/utime/lua/autorun/cl_utime.lua:305
3. fn - addons/utime/lua/autorun/cl_utime.lua:334
4. unknown - addons/ulib/lua/ulib/shared/hook.lua:183


[--------------|33|STEAM_0:1:--------] Lua Error:
controlpanel.Get() - Error creating a ControlPanel!
You're calling this function too early! Call it in a hook!

[-------------|33|STEAM_0:1:---------] Lua Error:

[ERROR] addons/utime/lua/autorun/cl_utime.lua:310: attempt to index local 'cpanel' (a nil value)
1. buildCP - addons/utime/lua/autorun/cl_utime.lua:310
2. resetCvars - addons/utime/lua/autorun/cl_utime.lua:305
3. fn - addons/utime/lua/autorun/cl_utime.lua:334
4. unknown - addons/ulib/lua/ulib/shared/hook.lua:183


[-------------|33|STEAM_0:1:---------] Lua Error:
controlpanel.Get() - Error creating a ControlPanel!
You're calling this function too early! Call it in a hook!

Dropped ------------ from server ("Too many Lua Errors! Sorry!")

This is on TTT. Not sure what other information is needed, but it's stopping new people from joining. :/
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: lopio1234 on January 03, 2014, 09:31:30 PM
I have a question, wehre are the playerdata or rather is it possibel to modifiy the time of the player?

Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: JamminR on January 03, 2014, 10:04:12 PM
Code: [Select]
[------------|33|STEAM_0:1:---------] Lua Error:
controlpanel.Get() - Error creating a ControlPanel!
You're calling this function too early! Call it in a hook!
<clip>
Dropped ------------ from server ("Too many Lua Errors! Sorry!")
1) Could have sworn we fixed the 'call it in a hook' error years ago.
Make sure you didn't mix old with new code on the server, and that your clients are getting latest?
Also, you can either set your "sv_kickerrornum 0" variable, or better yet, when experiencing an issue that bad with a addon, simply remove it after getting the details like you did.

I have a question, wehre are the playerdata or rather is it possibel to modifiy the time of the player?
In SQLite, which manifests itself as sv.db in the garrysmod root.
See release UTime Hour Changer (http://forums.ulyssesmod.net/index.php/topic,6182.0.html)
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Nick_515 on January 07, 2014, 12:00:18 PM
Yeah, I can't figure it out. I haven't mixed any code. I just downloaded the newest version and added it. :/
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: HazCP on January 25, 2014, 06:22:46 AM
(http://imgur.com/UcPJ4Kb.png)

How do I move the utime over a couple of centimetres?
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: zacciev on January 26, 2014, 02:09:08 AM
I run TTT, how do I edit utime?
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: syn. on January 26, 2014, 08:35:46 AM
I run TTT, how do I edit utime?

great addon by chaos http://forums.ulyssesmod.net/index.php/topic,6182.0.html (http://forums.ulyssesmod.net/index.php/topic,6182.0.html) let's you set a player's Utime Hours
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Megiddo on January 26, 2014, 02:46:22 PM
(http://imgur.com/UcPJ4Kb.png)

How do I move the utime over a couple of centimetres?

Go to the config.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: nogger on January 27, 2014, 09:18:07 AM
Can i ahve the patch for no errors to new players?
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Megiddo on January 28, 2014, 05:14:54 AM
All current code is kept on GitHub, just like all our other projects. https://github.com/Nayruden/Ulysses
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: HazCP on February 02, 2014, 05:34:55 AM
My users are getting this error, definitely using the latest version of uTime aswell.
Code: [Select]
[angeguiochet|68|STEAM_0:0:59170242] Lua Error:

[ERROR] addons/utime/lua/autorun/cl_utime.lua:310: attempt to index local 'cpanel' (a nil value)
1. buildCP - addons/utime/lua/autorun/cl_utime.lua:310
2. resetCvars - addons/utime/lua/autorun/cl_utime.lua:305
3. fn - addons/utime/lua/autorun/cl_utime.lua:334
4. unknown - addons/ulib/lua/ulib/shared/hook.lua:183


[angeguiochet|68|STEAM_0:0:59170242] Lua Error:
controlpanel.Get() - Error creating a ControlPanel!
You're calling this function too early! Call it in a hook!

Dropped angeguiochet from server ("Too many Lua Errors! Sorry!")
Client "angeguiochet" connected (84.5.181.242:27005).
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: JamminR on February 02, 2014, 07:32:49 AM
Haz, are you sure you don't have an old version of Utime somewhere?
Those error line numbers don't match up with current code in the latest from github.
Latest would be;
line 309 = cpanel
line 309 = buildCP
line 307 = resetCvars
And, we DO call building it in a hook, and have for many years now.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: caydpoe on March 06, 2014, 06:11:52 AM
Ha, I can't code... Great addon, I love how simple and simplistic it looks. Using it on my server now.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: deinemudda32 on March 07, 2014, 08:58:57 AM
Sometimes Utime creates an error, I dont know why it appears but its still in my console:

[ERROR] lua/autorun/cl_utime.lua:310: attempt to index local 'cpanel' (a nil value)
  1. buildCP - lua/autorun/cl_utime.lua:310
   2. resetCvars - lua/autorun/cl_utime.lua:305
    3. fn - lua/autorun/cl_utime.lua:334
     4. unknown - lua/ulib/shared/hook.lua:183
      5. LocalPlayer - [C]:-1
       6. fn - lua/ulib/cl_init.lua:39
        7. unknown - lua/ulib/shared/hook.lua:183


[wwwwwaaaazzzzaaaaa!|27|STEAM_0:0:55186726] Lua Error:
controlpanel.Get() - Error creating a ControlPanel!
You're calling this function too early! Call it in a hook!
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Sgt.Blue on March 10, 2014, 12:58:45 PM
How do I configure it?
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Megiddo on March 10, 2014, 03:49:25 PM
You configure it from the spawn menu.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: infamousmango on March 14, 2014, 12:00:20 AM
Hey man. I know people have commented about this, but I just can't get this to work.
The module does not show up on the top right corner of my screen. I have re-installed it and it does not appear to be on the server. I tried, "utime_reset " in the client console but it just gives me lua errors and kicks me for "too many lua errors."

Code: [Select]
[ERROR] addons/utime/lua/autorun/cl_utime.lua:310: attempt to index local 'cpanel' (a nil value)
1. buildCP - addons/utime/lua/autorun/cl_utime.lua:310
2. unknown - addons/utime/lua/autorun/cl_utime.lua:305
3. unknown - lua/includes/modules/concommand.lua:69


Dropped InfamousMango from server ("Too many Lua Errors! Sorry!")

That is the error I get. Any suggestions? :/
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: frustratedgamers on March 20, 2014, 11:58:29 PM
i get the cpanel issue as well and way too often
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: JamminR on March 21, 2014, 04:04:48 PM
All you folks reporting cpanel errors.
here did you download Utime from?
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Bytewave on March 21, 2014, 04:15:28 PM
All you folks reporting cpanel errors.
here did you download Utime from?

Git.
Most likely these people are running off a non-Sandbox derivative gamemode- which could be causing some errors such as this; however I would not know as I don't know that much xD.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: deinemudda32 on April 05, 2014, 04:45:38 PM
I get that cpanl error too and i downloaded it from this page.
I am running TTT with some modifications!
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: JamminR on April 06, 2014, 01:31:01 AM
g36224#msg36224 date=1396741538]
downloaded it from this page.
[/quote]
All current code is kept on GitHub, just like all our other projects. https://github.com/Nayruden/Ulysses

Make sure you have latest version, from github.
Make sure you have ALL Ulysses latest code from there.
As for TTT, we make no guarantee of compatibility.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: MisterCoolBeans on June 18, 2014, 07:37:13 PM
I seem to be getting errors... Can someone help me I have no idea what I'm doing incorrect. I typed in everything correctly.
http://4st.me/HJ8Ki.png (http://4st.me/HJ8Ki.png)
http://4st.me/smVCg.png (http://4st.me/smVCg.png)
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: JamminR on June 19, 2014, 07:25:58 AM
MrCoolBeans, you're trying to ask about UTimeMoo in the Utime release. They are different releases.
Please go ask in http://forums.ulyssesmod.net/index.php/topic,5737.0.html (http://forums.ulyssesmod.net/index.php/topic,5737.0.html)
Though, before asking, you may wish to review that thread first...others seem to have posted similar errors and been told they're using old versions.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: KayKayy on July 13, 2014, 06:01:35 AM
Hi people, do any of you know where the time data is stored?

I'm moving server hosts and I dont want my players to lose their time on my server.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Avoid on July 13, 2014, 06:27:29 AM
Indeed, utime uses the inbuilt SQLite database, just copy your sv.db in server/garrysmod/.

Avoid
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: JamminR on July 13, 2014, 10:28:12 PM
Hi people, do any of you know where the time data is stored?

I'm moving server hosts and I dont want my players to lose their time on my server.
Blast from the past!
where is the player time info stored for this addon?
In SQLite, which manifests itself as sv.db in the garrysmod root.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Malkeur on August 02, 2014, 08:10:42 AM
I don't quite follow how to load sv.db into your mysql database.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: PatPeter on August 02, 2014, 10:20:42 AM
I have NO Lua errors, but every time I switch maps on my server, utime starts at 0! Has anyone else has this problem/know how to fix it?

A player on my server had Lua problems, but he hasn't given them to me yet.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Bite That Apple on August 02, 2014, 03:31:30 PM
I don't quite follow how to load sv.db into your mysql database.

sv.db is the mysql database. What are you even trying to do?

I have NO Lua errors, but every time I switch maps on my server, utime starts at 0! Has anyone else has this problem/know how to fix it?

A player on my server had Lua problems, but he hasn't given them to me yet.

Sounds like a compatibility issue with another addon. Are you using sui_scoreboard by any chance?
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: JamminR on August 02, 2014, 08:55:33 PM
sv.db is the mysql database.
FYI, it's my understanding its a SQLite database, not mysql.
Similar, but different enough to be a pain in conversion
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Bite That Apple on August 03, 2014, 12:41:13 AM
FYI, it's my understanding its a SQLite database, not mysql.
Similar, but different enough to be a pain in conversion

... -.- :p

I forgot the "i" in mysql.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Ticket on August 04, 2014, 04:56:22 PM
Can anyone let me know how? I can't see the settings.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: PatPeter on August 04, 2014, 05:59:31 PM
@chaos13125 I'm running Trouble in Terrorist Town, with custom editions to its scoreboard. Would that matter?

I'm looking in my sv.db file and it has a utime table with the fields:

id | player | totaltime | lastvisit

But there are no rows.

EDIT: I fixed the corruption and now it's saving again.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: JamminR on August 04, 2014, 09:39:18 PM
Can anyone let me know how? I can't see the settings.
Colors are controlled on client.
Start a single player listen server in Sandbox mode, you'll then be able to change stuff in settings.
I don't remember if UTime has color change settings though.
Also, why did you not ask this in the UTime thread???
EDIT - MERGED
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: frustratedgamers on August 06, 2014, 01:01:17 AM
Is this being developed still at all? Seems even like on a vanilla server it always will throw an error here and there.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Neku on August 06, 2014, 01:03:17 AM
Is this being developed still at all? Seems even like on a vanilla server it always will throw an error here and there.

Works fine for me.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: JamminR on August 06, 2014, 05:41:46 PM
FrustratedGamers, there's a much newer code base at our Github, rather than using the link in first post.
Make sure you grab it (it's part of the Zip at github that comes with all our projects)
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: nar308 on August 08, 2014, 02:36:36 PM
Is there a reason why some players dont see the Total Session box at the top right corner?
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Avoid on August 09, 2014, 08:52:09 AM
Is there a reason why some players dont see the Total Session box at the top right corner?
utime_enable 1
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Bite That Apple on August 13, 2014, 11:30:25 PM
utime_enable 1

Also could be that they're getting client side errors.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: PatPeter on August 15, 2014, 10:57:49 PM
All of the clients in my server occasionally get these messages, but when they do they're infinitely spammed in console:

Code: [Select]
[ERROR] addons/utime/lua/autorun/cl_utime.lua:77: attempt to call method 'GetWide' (a nil value)
  1. unknown - addons/utime/lua/autorun/cl_utime.lua:77


[ERROR] addons/utime/lua/autorun/cl_utime.lua:137: attempt to index field 'playerInfo' (a nil value)
  1. unknown - addons/utime/lua/autorun/cl_utime.lua:137


[ERROR] gamemodes/base/entities/weapons/weapon_base/cl_init.lua:160: attempt to index field 'Weapon' (a nil value)
  1. unknown - gamemodes/base/entities/weapons/weapon_base/cl_init.lua:160
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: notownz on October 13, 2014, 08:40:22 PM
Here is my console error message, any help would be appreciated.

Code: [Select]
[ERROR] addons/utime/lua/autorun/cl_utime.lua:310: attempt to index local 'cpane
l' (a nil value)
  1. buildCP - addons/utime/lua/autorun/cl_utime.lua:310
   2. resetCvars - addons/utime/lua/autorun/cl_utime.lua:305
    3. fn - addons/utime/lua/autorun/cl_utime.lua:334
     4. unknown - addons/ulib/lua/ulib/shared/hook.lua:183
      5. LocalPlayer - [C]:-1
       6. fn - addons/ulib/lua/ulib/cl_init.lua:39
        7. unknown - addons/ulib/lua/ulib/shared/hook.lua:183

Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: petravic on October 15, 2014, 11:07:09 AM
On my server we have pointshop 2 and we had render lag on hats and accessories that is caused by utime wenn we removed utime all works fine.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Wrath on December 06, 2014, 12:04:04 PM
How can I move the position of the box on my screen? o:
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: JamminR on December 06, 2014, 03:13:36 PM
There's a configuration menu added to the same Gmod client side menus that Admin and "clean up" are on.
If you're not playing in Sandbox mode, I believe many gamemodes prevent that menu from opening.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Bite That Apple on December 06, 2014, 08:39:23 PM
There's a configuration menu added to the same Gmod client side menus that Admin and "clean up" are on.
If you're not playing in Sandbox mode, I believe many gamemodes prevent that menu from opening.

The only one I knew that did it was dog fight (which is no longer an available gamemode with garry's mod.)
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: PatPeter on December 28, 2014, 07:29:09 PM
So does anyone know how to fix this?

Code: [Select]
[Bean|188|STEAM_0:0:62527870] Lua Error:
controlpanel.Get() - Error creating a ControlPanel!
You're calling this function too early! Call it in a hook!

[Bean|188|STEAM_0:0:62527870] Lua Error:

[ERROR] addons/utime/lua/autorun/cl_utime.lua:311: attempt to index global 'cpanel' (a nil value)
  1. buildCP - addons/utime/lua/autorun/cl_utime.lua:311
   2. resetCvars - addons/utime/lua/autorun/cl_utime.lua:305
    3. fn - addons/utime/lua/autorun/cl_utime.lua:335
     4. unknown - addons/ulib/lua/ulib/shared/hook.lua:183
      5. LocalPlayer - [C]:-1
       6. fn - addons/ulib/lua/ulib/cl_init.lua:39
        7. unknown - addons/ulib/lua/ulib/shared/hook.lua:183



It's just a minor annoyance.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: JamminR on December 28, 2014, 07:51:24 PM
PatPeter, don't use the download from first post. At least, I think that's what you're doing.
Go get latest from our github.
It's included as part of the master zip file that contains all our github releases (you don't have to use all of them, only upload the addon folder from UTime (and ULib and ULX too)
https://github.com/Nayruden/Ulysses
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Toxic_Terrorists on January 19, 2015, 07:48:39 PM
Is there a way to view other players "last played on".

I mean this: [UTime]Welcome back Toxic_Terrorists, you last played on this server 01/19/15 21:42:24


But for admins to be able to see when a certain SteamID or player last played.
Title: Viewing other player's time
Post by: Naunuk2424 on February 18, 2015, 08:25:16 AM
As the servers coder i was hoping to use this to keep track of time for promotions. How do we view others time spent?
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Bytewave on February 18, 2015, 06:36:08 PM
As the servers coder i was hoping to use this to keep track of time for promotions. How do we view others time spent?
You'll have to search through the SQLite database for player entries, then work off the data there.
Alternatively, if you were seeking automated promotions, you could check out one of the many Autopromote addons (http://forums.ulyssesmod.net/index.php?topic=6791.0).
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: allofmywutsteam on March 14, 2015, 01:03:14 PM
Where does the addon store the hours? Is it hidden because I can't see any data logs that logs player x to hours x.

The reason i ask is because I had to wipe server after a year's worth of logged hours. So i'd like to see if I can recover that time.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Bytewave on March 14, 2015, 01:52:41 PM
Where does the addon store the hours? Is it hidden because I can't see any data logs that logs player x to hours x.

The reason i ask is because I had to wipe server after a year's worth of logged hours. So i'd like to see if I can recover that time.
All times are stored in sv.db, the SQLite database on the root of the server's files.
If you lost that, there is no recovery.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Bite That Apple on March 25, 2015, 09:28:24 AM
Anyone having issues with utime, if you are and understand why, I'd like to know why:
http://forums.ulyssesmod.net/index.php?topic=8327 (http://forums.ulyssesmod.net/index.php?topic=8327)
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Canne on March 25, 2015, 05:53:26 PM
i got issues with it the time resets all the time how we fix it?
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Aaron113 on March 25, 2015, 06:57:18 PM
Make sure your server and garry's mod are up-to-date.  There was an update today that possibly fixed the issue.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Belly136 on March 26, 2015, 08:34:25 AM
Can i somehow remove box displaying time from top right corner completely so that it does not show to anyone? I only need Utime for Apromote.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Canne on March 26, 2015, 08:44:26 AM
Ill check it today if it works.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Aaron113 on March 26, 2015, 09:45:24 AM
Can i somehow remove box displaying time from top right corner completely so that it does not show to anyone? I only need Utime for Apromote.

Easiest way would be to just delete utime/lua/autorun/cl_utime.lua.

Then also delete line 3 of sh_utime.lua.


EDIT:  You could also probably just delete the line 3 and it would function the same as deleting both.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: allofmywutsteam on March 26, 2015, 12:31:39 PM
Easiest way would be to just delete utime/lua/autorun/cl_utime.lua.

Then also delete line 3 of sh_utime.lua.


EDIT:  You could also probably just delete the line 3 and it would function the same as deleting both.

Or type "utime_enable 0" in console and it won't show the on-screen window.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Aaron113 on March 26, 2015, 12:47:58 PM
Or type "utime_enable 0" in console and it won't show the on-screen window.
That's only for whoever types it in.  To my understanding, he wanted to just get rid of it entirely.  I guess if he wants to just have it disabled by default, he can change the default convar for it.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Belly136 on March 26, 2015, 08:39:27 PM
Or type "utime_enable 0" in console and it won't show the on-screen window.

That only disables clientside... I want it to be server side so that no one sees it when they join no matter if they have utime_enable set to 1 or 0. I only need the timer so i can continue using apromote and utime hour changer.

Edit: Well deleting line 3 and cl_utime just gave me errors on server console and disabled both apromote and utime hour changer.
Code: [Select]
[Belly|2|STEAM_0:0:85396729] Lua Error:

[ERROR] lua/includes/extensions/table.lua:51: bad argument #1 to 'pairs' (table expected, got nil)
  1. pairs - [C]:-1
   2. Empty - lua/includes/extensions/table.lua:51
    3. fn - addons/ulx/lua/ulx/modules/cl/xgui_client.lua:429
     4. func - addons/ulib/lua/ulib/client/cl_util.lua:22
      5. unknown - lua/includes/modules/net.lua:32
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Canne on March 27, 2015, 06:58:47 AM
utime keeps restting for me it's not even working... can someone help and yes i got the latest version of gmod.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: allofmywutsteam on March 27, 2015, 09:26:30 PM
Pasting from another thread.

Due to some unfortunate circumstances, I had to completely wipe my computer of anything GMod related, and reinstall it, plus validate tf2 and hl2 etc.

Now that I'm up and running, I first download the 10-13 addons I keep up to date from the WS, and then join my main server. Immediately when I join, I am greeted by 2 big concerns:

1. (related to this addon) script errors that spammed my console for nearly a minute. Screenshots of the errors included.
(http://puu.sh/gR2N7/414ed69ccd.png)

(http://puu.sh/gR2Oa/2b3318c41b.png)

Any ideas?

2. (unrelated I think) I get the below XGUI warning which I have never seen in the 3+ years I've played the game
(http://puu.sh/gR2Tr/f93bca30f2.png)

I'll be posting in the ULX thread with the second problem once the first is resolved. Unless someone can chime in here.

Oh, and my utime hours are fine, by the box itself has been re-positioned and colors defaulted.

Keep in mind this has only happened this one time. Maybe it's happened in the beginning and never again after, but if my users are experiencing this the first time they join for the very first time, then I'm a bit concerned.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: JamminR on March 27, 2015, 09:53:59 PM
If you open your server /addons/utime/addon.txt, there's a table in it, one of the table entries is "version"; what version does it say?
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: allofmywutsteam on March 28, 2015, 05:11:06 AM
If you open your server /addons/utime/addon.txt, there's a table in it, one of the table entries is "version"; what version does it say?

I don't have an addon.txt file. My readme.txt says I'm running v1.42 though

(http://puu.sh/gSWcv/bef0e7c509.png)
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: JamminR on March 28, 2015, 07:34:12 AM
I'm totally lost as to how utime is even running on your server then, as I thought the legacy addon system (non-workshop) required "addon.txt".
However it's working for you, you're running an old version that was known to cause some errors.
As I asked previously, please use the version from Github in our master zip file.

https://github.com/Nayruden/Ulysses/archive/master.zip

Remove/delete your current utime folder from your server addons folder, and upload the utime folder from within that zip to your server addons folder.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: allofmywutsteam on March 28, 2015, 10:30:54 AM
I'm totally lost as to how utime is even running on your server then, as I thought the legacy addon system (non-workshop) required "addon.txt".
However it's working for you, you're running an old version that was known to cause some errors.
As I asked previously, please use the version from Github in our master zip file.

https://github.com/Nayruden/Ulysses/archive/master.zip

Remove/delete your current utime folder from your server addons folder, and upload the utime folder from within that zip to your server addons folder.

Two questions.

1. If I uninstall and reinstall then I lose all the data logged for users right?
2. Isn't this the master archive https://github.com/Nayruden/Ulysses? I'm confused because I downloaded my utime from there, but I don't see it saying it's been updated there aside from two years ago.

What's different from 1.42 and 1.43?
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: JamminR on March 28, 2015, 11:27:59 AM
1) Utime data is stored in sv.db of server gmod directory. Changing anything in /addons will not affect the data for utime unless you changed something we've never recommended. Same for ULib/ULX, it's stored in /data/
2) Yes, that's our master repo, and whether you originally downloaded from there or not, the path you showed, and the readme file you showed in your last post are not the same/newer data in our repo.

I can't quickly tell the full differences between 1.42 and 1.43, however, the current code on github shows Megiddo added an extra check to make sure cpanel wasn't nil (https://github.com/Nayruden/Ulysses/commit/7c556b6dc094af437da44ad1ffc1508c969cc96c), which, your error indicates it is.


I'm not guaranteeing with 100% absolute surety your error will stop. I'm just saying the latest code from github was to fix an issue like that.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: allofmywutsteam on March 28, 2015, 11:09:39 PM
1) Utime data is stored in sv.db of server gmod directory. Changing anything in /addons will not affect the data for utime unless you changed something we've never recommended. Same for ULib/ULX, it's stored in /data/
2) Yes, that's our master repo, and whether you originally downloaded from there or not, the path you showed, and the readme file you showed in your last post are not the same/newer data in our repo.

I can't quickly tell the full differences between 1.42 and 1.43, however, the current code on github shows Megiddo added an extra check to make sure cpanel wasn't nil (https://github.com/Nayruden/Ulysses/commit/7c556b6dc094af437da44ad1ffc1508c969cc96c), which, your error indicates it is.


I'm not guaranteeing with 100% absolute surety your error will stop. I'm just saying the latest code from github was to fix an issue like that.

I'll install the latest. Hopefully the hours logged aren't affected which I doubt they would from what you said. And as for the error, I've only seen it when I first joined after a fresh install of everything, so I doubt I'll see it again, and the only way I'll know if it continues or not is if I re-wipe my stuff. I'll just have to trust that this solves.

Thanks
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: [GL]Mesud18 on March 29, 2015, 10:50:05 AM
I need some help. my Utime isn't saving anyone time. It shows how long they played and then when its a new day it resets to 0. Can Anyone help me?
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Moka on March 29, 2015, 10:55:03 AM
I need some help. my Utime isn't saving anyone time. It shows how long they played and then when its a new day it resets to 0. Can Anyone help me?

Having the same problem on my dev server.

I had a problem where everyones time was the same until I updated ran my SteamCMD to update and ran my server again and it was fixed but no lua errors popped up for that particular problem.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Belly136 on March 31, 2015, 11:37:54 AM
-snip-
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: allofmywutsteam on April 04, 2015, 11:14:53 AM
1) Utime data is stored in sv.db of server gmod directory. Changing anything in /addons will not affect the data for utime unless you changed something we've never recommended. Same for ULib/ULX, it's stored in /data/
2) Yes, that's our master repo, and whether you originally downloaded from there or not, the path you showed, and the readme file you showed in your last post are not the same/newer data in our repo.

I can't quickly tell the full differences between 1.42 and 1.43, however, the current code on github shows Megiddo added an extra check to make sure cpanel wasn't nil (https://github.com/Nayruden/Ulysses/commit/7c556b6dc094af437da44ad1ffc1508c969cc96c), which, your error indicates it is.


I'm not guaranteeing with 100% absolute surety your error will stop. I'm just saying the latest code from github was to fix an issue like that.

Installing the latest (removing the old addon and installing this one) won't effect the hours stored so far right? I'm guessing my previous time was reset due to me wiping my entire server, but wiping the addons/utime portion shouldnt effect it correct?
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: JamminR on April 04, 2015, 01:22:23 PM

1) Utime data is stored in sv.db of server gmod directory. Changing anything in /addons will not affect the data for utime
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: allofmywutsteam on April 04, 2015, 02:05:10 PM


thanks
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Belly136 on April 12, 2015, 06:18:39 AM
Ok so i have added

Code: [Select]
if not LocalPlayer():IsValid() or gpanel == nil or cpanel == nil then return end
Under think function in cl_utime to fix client error when client joins and i got no error 310 yet.
But i'm not sure if this is the best thing to do... Any suggestions?

Edit: Nope, still here. 2 errors for each new client.

Code: [Select]
[??????? ?? ??????|347|STEAM_0:0:49744753] Lua Error:
controlpanel.Get() - Error creating a ControlPanel!
You're calling this function too early! Call it in a hook!

[??????? ?? ??????|347|STEAM_0:0:49744753] Lua Error:

[ERROR] addons/utime/lua/autorun/cl_utime.lua:310: attempt to index local 'cpanel' (a nil value)
1. buildCP - addons/utime/lua/autorun/cl_utime.lua:310
2. resetCvars - addons/utime/lua/autorun/cl_utime.lua:305
3. fn - addons/utime/lua/autorun/cl_utime.lua:334
4. unknown - addons/ulib/lua/ulib/shared/hook.lua:179
5. LocalPlayer - [C]:-1
6. fn - addons/utime/lua/autorun/cl_utime.lua:333
7. unknown - addons/ulib/lua/ulib/shared/hook.lua:179


[??????? ?? ??????|347|STEAM_0:0:49744753] Lua Error:
controlpanel.Get() - Error creating a ControlPanel!
You're calling this function too early! Call it in a hook!

[??????? ?? ??????|347|STEAM_0:0:49744753] Lua Error:

[ERROR] addons/utime/lua/autorun/cl_utime.lua:310: attempt to index local 'cpanel' (a nil value)
1. buildCP - addons/utime/lua/autorun/cl_utime.lua:310
2. resetCvars - addons/utime/lua/autorun/cl_utime.lua:305
3. fn - addons/utime/lua/autorun/cl_utime.lua:334
4. unknown - addons/ulib/lua/ulib/shared/hook.lua:179


[??????? ?? ??????|347|STEAM_0:0:49744753] Lua Error:
controlpanel.Get() - Error creating a ControlPanel!
You're calling this function too early! Call it in a hook!

2nd edit: Fixed the error but i still have
Code: [Select]
Lua Error:
controlpanel.Get() - Error creating a ControlPanel!
You're calling this function too early! Call it in a hook!
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: JamminR on April 12, 2015, 01:23:38 PM
Belly, are you using version from Github, and not from the first post of this thread?
The version at our Github site should have fixed that control panel error 2 years ago. 1.43 is the version I think.
Also, you mentioned over several various posts you've tried editing on your own to prevent client side from showing.
If you DO NOT edit the code, and use the Github UTime version, do you still get errors?
Try this BEFORE deleting anything.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Belly136 on April 12, 2015, 02:29:25 PM
No, i downloaded from here. But i think i found a fix. I deleted
Code: [Select]
buildCP( controlpanel.Get( "Utime" ) ) and that seems to have fixed the problem. I don't need control panel anyway because i'm using prop hunt. I never downloaded utime from github.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: JamminR on April 12, 2015, 06:49:33 PM
Utime from github fixes that error. It has for 2 years. Megiddo fixed it in Github Jul 27, 2013 ( https://github.com/Nayruden/Ulysses/commit/7c556b6dc094af437da44ad1ffc1508c969cc96c )
What you did will likely cause errors on client-side, even when running in a gamemode you state won't use it.

I've nothing against learning/editing one's own code to enhance/fit for own purpose.
I find it irritating to make changes that aren't necessary when a developer has already fixed them, and the same fix has been discussed several times in a thread including where to get that fix.
Especially when the choice made will likely cause error for others.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Belly136 on April 13, 2015, 04:55:46 AM
I did that. And that only fixed gpanel but not cpanel. I was still getting

Code: [Select]
[ERROR] addons/utime/lua/autorun/cl_utime.lua:310: attempt to index local 'cpanel' (a nil value)
But i fixed that too and the only thing left was

Code: [Select]
Lua Error:
controlpanel.Get() - Error creating a ControlPanel!
You're calling this function too early! Call it in a hook!

And since i deleted 
Code: [Select]
buildCP( controlpanel.Get( "Utime" ) )

there were no more errors.

Edit: I've also completely reinstalled gmod. I used to get errors when i first joined the server after clean install but not now. And utime is working perfectly fine.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: CaptinCCat?? -VG - on April 24, 2015, 08:45:37 PM
I like using this ALOT, however I am wondering how would I add it so WITH a UNIQUE ID. it also adds the players STEAM ID indo the sv.db Folder
I was also wondering if there is a way to sinc the Times between multiple Servers?
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Belly136 on April 26, 2015, 05:32:39 PM
There's utime MySQL.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Bite That Apple on May 03, 2015, 03:46:45 PM
There's utime MySQL.

Also knwon as utimeM, but speaking of the devil, anyone having problems with that, I also can't seem to find the forum thread for utimeM here on these forums, anyone able to assist me?
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Aaron113 on May 03, 2015, 05:25:20 PM
Looks like this is the latest version:  http://forums.ulyssesmod.net/index.php/topic,5737.0.html (http://forums.ulyssesmod.net/index.php/topic,5737.0.html)
You can also view the old version here:  http://forums.ulyssesmod.net/index.php/topic,4445.0.html (http://forums.ulyssesmod.net/index.php/topic,4445.0.html)


Google is amazing :P

(https://dl.dropboxusercontent.com/u/50945661/ShareX/2015/05/2015-05-03_19-26-15.png)
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Whitesoul on May 04, 2015, 12:15:30 PM
Reply how to move it to the right side of the screen its on the left
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Belly136 on May 04, 2015, 01:33:37 PM
If only utimeM used same tables as utime does... I have converted over 5k users from sv.db to .sql
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Megiddo on May 06, 2015, 07:07:31 PM
Released current GitHub version, updated link on first post. Anyone still having cpanel issues with that one?
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Belly136 on May 07, 2015, 12:54:52 PM
I fixed cpanel with
Code: [Select]
if not LocalPlayer():IsValid() or cpanel == nil then return end under
Code: [Select]
function buildCP( cpanel )But i was still getting error when creating panel for new players (Using prop hunt). I tried removing
Code: [Select]
buildCP( controlpanel.Get( "Utime" ) ) and it works fine but i'm not sure if this is the best way to prevent error from showing again. Any suggestions?
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: allofmywutsteam on May 09, 2015, 10:52:04 AM
Is it possible to this concept http://puu.sh/hHdZu/7bcb796ef9.png (http://puu.sh/hHdZu/7bcb796ef9.png) and add the option to monitor when the last time someone joined? So right now it's client-side, but can I find out when someone last joined? As in "ulx ujoined "steamId" or something. And running this command will let me know when the last tinme that player joined.

Alternatively, could we set a group check after a certain amount of days that adds that ulx group to the list stating "This group hasn't joined in over 31 days." With this, we decide which groups we'd like to apply this watch to.

Somewhat like combining the !warn menu, while using the ulx who <steam_id> and the utim function all in one.

My goal is to monitor the activity of someone who has purchase content on the server, but doesn't join after X days, and they would be added to a list. With that list I'd remove whatever extra content they have on the server since they're not utilizing it anymore to help prevent the clutter. I already have this policy implemented, but monitoring it isn't that easy. Right now I'm guessing (server wise), but I'm checking last active date on the website as well.

Hope that wasn't confusing
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Megiddo on May 09, 2015, 01:57:01 PM
Doing what you're asking directly from an sqlite query would be pretty simple, though you'd have to correlate the uid back to their steam id/name.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Tomzen on May 10, 2015, 07:04:19 PM
Is there some code that allows me to use lua and check their time on the server and auto promote them to regular if (example) they have 8 hours
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: JamminR on May 10, 2015, 08:23:44 PM
Is there some code that allows me to use lua and check their time on the server and auto promote them to regular if (example) they have 8 hours
Maybe (https://www.google.com/?gws_rd=ssl#q=%2Bsite:forums.ulyssesmod.net+autopromote)

In all honesty though, I'd recommend not doing that.
Though 8 hours is still better than some I've seen, it tends to clutter and grow the user files.
I've seen 2-3 come here and ask why groups are acting strange to find out they have autopromote of some type and have hundreds of "regulars".

If you do decide to use any one of those found in our releases section, just make sure to also clean up users who haven't been seen in (weeks/months)
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: lRoberth on May 15, 2015, 02:47:01 AM
I have a problem, every time i disconnect from my server, the time of utime resets, what i can do? i reiinstalled this like 8 times
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: JamminR on May 15, 2015, 07:54:06 PM
Look for errors in server console from UTime.
And make sure your server gmod can read and write to sv.db
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: lRoberth on May 23, 2015, 10:55:30 PM
How i can know that? i have a hosted darkrp server, and every time i disconnect the time resets, and is not writiing errors on the console
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Tomzen on May 23, 2015, 10:56:56 PM
Have you ran it as administrator? right click > run as admin
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: MetallicGloss on May 24, 2015, 12:23:11 PM
Is there a way to reset the data?
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: JamminR on May 24, 2015, 10:10:54 PM
Is there a way to reset the data?
You can erase your server gmod\sv.db, but that would delete all other data any other addon/or Gmod stores there.
You could also grab "UTime hour changer" from the releases section of the forum.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: lRoberth on May 24, 2015, 11:16:13 PM
You can erase your server gmod\sv.db, but that would delete all other data any other addon/or Gmod stores there.
You could also grab "UTime hour changer" from the releases section of the forum.

Man, how i can fix my problem, all addons are saving his info, but utime is not saving the time, what i can do
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: MetallicGloss on May 25, 2015, 12:56:40 AM
You can erase your server gmod\sv.db, but that would delete all other data any other addon/or Gmod stores there.
You could also grab "UTime hour changer" from the releases section of the forum.


How can I erase the UTime data... If I delete the .db file it will remove all of the info saved by all of my addons.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: MetallicGloss on May 25, 2015, 01:01:45 AM
Also is there a way to get UTime to save to a MySQL server rather than the .db file within the server?
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Aaron113 on May 25, 2015, 06:53:09 PM
Also is there a way to get UTime to save to a MySQL server rather than the .db file within the server?
There are mysql versions of UTime, yes.  Just search the releases.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Caustic Soda-Senpai on May 26, 2015, 12:58:59 AM
You can erase your server gmod\sv.db, but that would delete all other data any other addon/or Gmod stores there.
You could also grab "UTime hour changer" from the releases section of the forum.

Or you can edit the sv.db with SQLite Browser and delete the utime tables.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: MetallicGloss on May 26, 2015, 10:28:21 AM
Thank you both very much!!
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: JasonMan on July 31, 2015, 11:54:49 AM
Is there any way I can edit the utime values?
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: JamminR on July 31, 2015, 12:43:27 PM
but I don't want people to be able to see other players times
Then why track it at all? I'm not sure we provide a mass way to hide or see the time unless you're using another addon (which, is possible, as others have released addons that use UTime functions)
Anyway, to answer your question, it's been asked before previously, and Aaron, another great community member, answered here.
http://forums.ulyssesmod.net/index.php/topic,3039.msg42373.html#msg42373 (http://forums.ulyssesmod.net/index.php/topic,3039.msg42373.html#msg42373)


Is there any way I can edit the utime values?
See the rest of our communities Releases (http://forums.ulyssesmod.net/index.php/board,15.0.html).
This one might work for you (there's also discussion farther back in this post about editing your sv.db file with an sqllite manager.)
Utime Hour Changer Addon (http://forums.ulyssesmod.net/index.php/topic,6182.0.html)

Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Aaron113 on August 01, 2015, 03:25:06 PM
Then why track it at all? I'm not sure we provide a mass way to hide or see the time unless you're using another addon (which, is possible, as others have released addons that use UTime functions)
Anyway, to answer your question, it's been asked before previously, and Aaron, another great community member, answered here.
http://forums.ulyssesmod.net/index.php/topic,3039.msg42373.html#msg42373 (http://forums.ulyssesmod.net/index.php/topic,3039.msg42373.html#msg42373)
Someone actually said that it caused an error shortly after.  Not sure if I ever tested it.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: kinkadethegreat on August 07, 2015, 02:29:08 PM
Ok so this has been up for a long time and i was woundering if there was a way to see all of my players total times
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Ryan Hemmet on August 07, 2015, 02:34:15 PM
Ok so this has been up for a long time and i was woundering if there was a way to see all of my players total times

With this version you will need to download the sv.db (if hosting on a sever host) and open it with a SQLite Browser such as SqliteBrowser (http://sqlitebrowser.org/), I personally use the MySQLOO version of this so I can display the times on my forums.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Muffin2 on September 18, 2015, 04:47:54 PM
Is the link still a working version? I extracted it to addons, updated fast DL and restarted the server and nothing shows up.  :-\
Nvm it's working now just had to remove the macosx folder i don't see why it was included though
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Limpmulerider on October 28, 2015, 04:29:08 PM
Hi.
I'd like to ask if there's a possibility to make it so players in spectator mode will not get their timer updated. Basically make it so it counts the actual time you've played.
Thanks. :).
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: M21z on November 24, 2015, 05:11:44 PM
Hi, I use this for my murder server... Is there a permission or setting that I can set that it removes it from certain players being able to view it? I know utime_enable 0 but I want the players not able to use that command.

Thanks

M21z
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Megiddo on November 25, 2015, 09:50:14 AM
There's no configurable way to do that at the moment. Are you trying to set it up for admins only?
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: monkeymacman on November 26, 2015, 05:15:21 AM
Hi, I use this for my murder server... Is there a permission or setting that I can set that it removes it from certain players being able to view it? I know utime_enable 0 but I want the players not able to use that command.

Thanks

M21z
I'm sure there's a better way but what you can do is: In addons/utime/lua/autorun go to cl_utime.lua in the first section of code look for this chunk of code, it is in the think() function
Code: Lua
  1. if not utime_enable:GetBool() or not IsValid( LocalPlayer() ) or
  2.          (IsValid( LocalPlayer():GetActiveWeapon() ) and LocalPlayer():GetActiveWeapon():GetClass() == "gmod_camera") then
  3.       gpanel:SetVisible( false )
  4.    else
  5.       gpanel:SetVisible( true )
  6.    end
  7.  
You should be able to simply change the part that says gpanel:SetVisible( true ) to gpanel:SetVisible( false ) . After doing so no matter if the player has utime_enable 1 or Utime_enable 0 the box should not show. This is useful if you want to make alternative methods of checking times, because in some gamemodes it just looks bad, or it ruins a part of the gamemode (like looking at somebody with a disguiser on ttt)
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: M21z on November 27, 2015, 08:21:13 PM
There's no configurable way to do that at the moment. Are you trying to set it up for admins only?

If possible, yes.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: M21z on November 27, 2015, 08:23:56 PM
I'm sure there's a better way but what you can do is: In addons/utime/lua/autorun go to cl_utime.lua in the first section of code look for this chunk of code, it is in the think() function
Code: Lua
  1. if not utime_enable:GetBool() or not IsValid( LocalPlayer() ) or
  2.          (IsValid( LocalPlayer():GetActiveWeapon() ) and LocalPlayer():GetActiveWeapon():GetClass() == "gmod_camera") then
  3.       gpanel:SetVisible( false )
  4.    else
  5.       gpanel:SetVisible( true )
  6.    end
  7.  
You should be able to simply change the part that says gpanel:SetVisible( true ) to gpanel:SetVisible( false ) . After doing so no matter if the player has utime_enable 1 or Utime_enable 0 the box should not show. This is useful if you want to make alternative methods of checking times, because in some gamemodes it just looks bad, or it ruins a part of the gamemode (like looking at somebody with a disguiser on ttt)

I'm sure there's a better way but what you can do is: In addons/utime/lua/autorun go to cl_utime.lua in the first section of code look for this chunk of code, it is in the think() function
Code: Lua
  1. if not utime_enable:GetBool() or not IsValid( LocalPlayer() ) or
  2.          (IsValid( LocalPlayer():GetActiveWeapon() ) and LocalPlayer():GetActiveWeapon():GetClass() == "gmod_camera") then
  3.       gpanel:SetVisible( false )
  4.    else
  5.       gpanel:SetVisible( true )
  6.    end
  7.  
You should be able to simply change the part that says gpanel:SetVisible( true ) to gpanel:SetVisible( false ) . After doing so no matter if the player has utime_enable 1 or Utime_enable 0 the box should not show. This is useful if you want to make alternative methods of checking times, because in some gamemodes it just looks bad, or it ruins a part of the gamemode (like looking at somebody with a disguiser on ttt)

Is there a way to only allow it in other gamemodes but not in murder and/or TTT?


I really need to learn lua coding :P
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: pieman88 on January 13, 2016, 12:22:45 PM
Apologies for such a large bump, but is there an easy way to get a player's playtime?

Edit: I suppose I should say it has to be clientside.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Megiddo on January 13, 2016, 01:53:04 PM
Yes. Look at the shared file for the function name.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Ciank33 on January 18, 2016, 11:43:40 AM
Is this incompatible with pointshop2?
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Megiddo on January 18, 2016, 12:03:53 PM
No
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: TT=open again Isabella Jazzlyn on January 20, 2016, 12:49:05 PM
how to fix this

addons/utime/lua/autorun/cl_utime.lua:310: attempt to index local 'cpanel' (a nil value)
  1. buildCP - addons/utime/lua/autorun/cl_utime.lua:310
   2. resetCvars - addons/utime/lua/autorun/cl_utime.lua:305
    3. fn - addons/utime/lua/autorun/cl_utime.lua:334


Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Megiddo on January 20, 2016, 02:13:31 PM
how to fix this

addons/utime/lua/autorun/cl_utime.lua:310: attempt to index local 'cpanel' (a nil value)
  1. buildCP - addons/utime/lua/autorun/cl_utime.lua:310
   2. resetCvars - addons/utime/lua/autorun/cl_utime.lua:305
    3. fn - addons/utime/lua/autorun/cl_utime.lua:334




We've never been able to figure out why some users get that error occasionally, but it's harmless.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Canne on January 20, 2016, 02:39:49 PM
We've never been able to figure out why some users get that error occasionally, but it's harmless.
Heey can i get some help? when i restart my server the Utime resets total time etc...... whats the point of it if resets when i restart my server?
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Megiddo on January 20, 2016, 02:41:32 PM
Sounds like you may have some permission problems with your server database. The times are saved to sv.db in the garry's mod root. Make sure that the file is writable.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Canne on January 20, 2016, 02:42:59 PM
Sounds like you may have some permission problems with your server database. The times are saved to sv.db in the garry's mod root. Make sure that the file is writable.
I put the folder of the Utim in my addons that's it anything else i need to do?
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: JamminR on January 20, 2016, 02:47:51 PM
anything else i need to do?
Canne, please read Megiddo's precise instructions. He doesn't use many words, but when he does, they are important.
permission problems with your server database. The times are saved to sv.db in the garry's mod root. Make sure that the file is writable.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Canne on January 20, 2016, 02:52:41 PM
Canne, please read Megiddo's precise instructions. He doesn't use many words, but when he does, they are important.
The reason why i ask what to do is because i have idea what you meaning by that..... what i need to do? i put the folder in the addons folder everytime i restart my server it resets the timers.... what i need to do else? what do u mean by " Make sure that the file is writable. " how to get it writable it's in my addons folder what i need to do more? please explain in details i go to my host go to addons than what i put it there aand after that wat i need to do else? screenshot: http://puu.sh/mDo1t/3c7ae7864e.png
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Bytewave on January 20, 2016, 02:59:43 PM
The reason why i ask what to do is because i have idea what you meaning by that..... what i need to do? i put the folder in the addons folder everytime i restart my server it resets the timers.... what i need to do else? what do u mean by " Make sure that the file is writable. " how to get it writable it's in my addons folder what i need to do more? please explain in details i go to my host go to addons than what i put it there aand after that wat i need to do else?
Contact your hosting provider if you're having trouble making the file sv.db in the root directory of your server writeable. It's your best bet, from what I can tell.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: JamminR on January 20, 2016, 07:23:06 PM
When someone says "root" folder, specifically in this place, Gmod, it means the first folder.
Megiddo did not mention addons.
He mentioned sv.db in root folder
So, you need to make sure the user that your server runs as has write access to <your gmod folder>/sv.db
That file stores much information about Gmod and some addons, not just UTime.
If you do not know how to do that, check with your host.
Checking write permissions of that file is beyond the support of this thread.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Canne on January 20, 2016, 11:20:20 PM
When someone says "root" folder, specifically in this place, Gmod, it means the first folder.
Megiddo did not mention addons.
He mentioned sv.db in root folder
So, you need to make sure the user that your server runs as has write access to <your gmod folder>/sv.db
That file stores much information about Gmod and some addons, not just UTime.
If you do not know how to do that, check with your host.
Checking write permissions of that file is beyond the support of this thread.

I can't see .db files on my pc wtf
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: TT=open again Isabella Jazzlyn on January 21, 2016, 03:44:14 AM
We've never been able to figure out why some users get that error occasionally, but it's harmless.


oke any idea how to implement utime into a ttt_scoreboard?
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Canne on January 21, 2016, 08:02:05 AM
I stil didn't get any help i'm sorry but my utime resets all the time... anyone that can help me? i would appreciate it it's really annoying when i restart my server everyone lose their stats of time it goes back to 0 and i have auto promote ranks....
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Canne on January 21, 2016, 10:04:17 AM
When someone says "root" folder, specifically in this place, Gmod, it means the first folder.
Megiddo did not mention addons.
He mentioned sv.db in root folder
So, you need to make sure the user that your server runs as has write access to <your gmod folder>/sv.db
That file stores much information about Gmod and some addons, not just UTime.
If you do not know how to do that, check with your host.
Checking write permissions of that file is beyond the support of this thread.
ii contacted my host they say it has the permissons my utime stil resets all the time any other thing i can do ? any other addon that has utime aswell?
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: monkeymacman on January 21, 2016, 01:36:25 PM

oke any idea how to implement utime into a ttt_scoreboard?
If you know GLua then it is pretty simple just look at the TTT hook documentation, if you don't then it's pretty easy you could learn or I'm sure somebody on here would be glad to do it for you (I can throw together a quick 5 minute or less code, but I don't have my computer so I can't test it.)
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Megiddo on January 21, 2016, 05:00:37 PM
ii contacted my host they say it has the permissons my utime stil resets all the time any other thing i can do ? any other addon that has utime aswell?

Something is removing information from the database. Try removing all addons EXCEPT UTime and see if you have a conflict somewhere.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: TT=open again Isabella Jazzlyn on January 22, 2016, 01:10:05 AM
If you know GLua then it is pretty simple just look at the TTT hook documentation, if you don't then it's pretty easy you could learn or I'm sure somebody on here would be glad to do it for you (I can throw together a quick 5 minute or less code, but I don't have my computer so I can't test it.)

Thnx found someone to do it for me  ;D
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Canne on January 24, 2016, 10:18:18 AM
Heeey utime dissapeared out of the nowhere wtf? how can i get it back it's not ingame more do i have to reinstal it or something?
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Canne on January 24, 2016, 11:12:37 AM
Can it get fixed pleasse?
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Megiddo on January 24, 2016, 03:10:10 PM
Did you disable UTime?
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Canne on January 25, 2016, 08:49:32 AM
disable where??
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Megiddo on January 25, 2016, 08:53:33 AM
In the client settings, you can disable UTime. Run the following in your client console...
Code: [Select]
utime_enable 1.0
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Canne on January 25, 2016, 11:59:25 AM
In the client settings, you can disable UTime. Run the following in your client console...
Code: [Select]
utime_enable 1.0
this is the error i get...
it stoped working out of nowhere didn't touch anything at all

[ERROR] addons/utime/lua/autorun/cl_utime.lua:310: attempt to index local 'cpanel' (a nil value)
  1. buildCP - addons/utime/lua/autorun/cl_utime.lua:310
   2. resetCvars - addons/utime/lua/autorun/cl_utime.lua:305
    3. fn - addons/utime/lua/autorun/cl_utime.lua:334
     4. unknown - addons/ulib/lua/ulib/shared/hook.lua:105
      5. LocalPlayer - [C]:-1
       6. fn - addons/utime/lua/autorun/cl_utime.lua:333
        7. unknown - addons/ulib/lua/ulib/shared/hook.lua:105
 

it's enabled...

Code: [Select]
local utime_enable = CreateClientConVar( "utime_enable", "1.0", true, false )
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Megiddo on January 25, 2016, 01:57:06 PM
You need to run "utime_enable 1.0" in your console.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Megiddo on January 25, 2016, 02:01:42 PM
Released version 1.44, changed for murder gamemode.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: ERROR404PL on January 26, 2016, 09:23:56 AM
Link dead :/
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Megiddo on January 26, 2016, 09:31:33 AM
Good catch; fixed.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Canne on January 26, 2016, 11:46:13 PM
Good catch; fixed.

I'm sorry to tell you this but you're rreally "useless" it's not working and you not helping at all with ur cmds i need to type in the console... anything else you want to say? it worked before... it just stoped working out of nowhere what can i do about it? i removed it readded it stil not showing up
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Megiddo on January 27, 2016, 04:12:24 AM
Did you follow the instructions I gave you? Tell us what the console output was when you did so. I can't help you when you just throw up your hands every time.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: josephhabib on January 27, 2016, 12:07:41 PM
You probably have addons that conflict with it. Try removing some ULX addons because they might be broken. I had a problem like this once and I believe that's how I fixed it.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Belly136 on February 28, 2016, 01:10:46 AM
Is there a way to 'pause' the current session timer? I would like to disable it while players are in spectating team.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Megiddo on February 28, 2016, 05:22:17 AM
Is there a way to 'pause' the current session timer? I would like to disable it while players are in spectating team.

You would need to modify it yourself. You'd basically want to add the time they were spectating to the join time, which would make it not count time spent spectating.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: MangaPeter on March 13, 2016, 12:41:07 PM
HI:) I have a question: Where is the data stored?
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: JamminR on March 13, 2016, 01:55:19 PM
HI:) I have a question: Where is the data stored?
Search this thread for word "stored (https://forums.ulyssesmod.net/index.php?action=search2;params=eJwtzEEKwzAMBMC_5NJrgukhrzG2tJAE1wqymlDw4yuX3nZnhRJfqRK4P_rcp25y7uQ5zGH12ja5I8nrLDA4L25Zx_HyHPM7HyCLUsvHbYioeVIU_P7-KfKuzoxGQ5CUNu_NRMFf3pQy5Q..)"
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Linkje on March 19, 2016, 05:37:10 AM
Anyone have any idea how to add the totaltime to the scoreboard? I can find some info on the web but its all for custom scoreboard addons.

Edit:

Got it working with this:

hook.Add( "TTTScoreboardColumns", "SetHourInScoreboard", function( pnl )
   pnl:AddColumn( "Hours", function(ply) return math.Round(ply:GetUTimeTotalTime()/3600) end )
end );

Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: pmag on May 02, 2016, 10:19:55 AM
I am having the same issue as Canne, It used to be there on servers now it isn't (I tested on ones I knew had it and even asked if someone else on the server could see it) . I tried utime_enable 1 and all I got was "Unknown command "utime_enable" " I removed all of my addons and tried again on the same server other people were able to have it but it still doesn't show up for me and I still get the unknown command thing. I only want to get this back because one time someone asked me how long ive been on a server and I had to tell them I didn't know and the thing that used to tell me is gone. Its actually been gone for a while now and I just figured out not too long ago what it actually was.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: zeelotelite on May 14, 2016, 12:06:33 PM
How to i setup the blue box to be disabled by default?
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Megiddo on May 21, 2016, 04:59:08 AM
I am having the same issue as Canne, It used to be there on servers now it isn't (I tested on ones I knew had it and even asked if someone else on the server could see it) . I tried utime_enable 1 and all I got was "Unknown command "utime_enable" " I removed all of my addons and tried again on the same server other people were able to have it but it still doesn't show up for me and I still get the unknown command thing. I only want to get this back because one time someone asked me how long ive been on a server and I had to tell them I didn't know and the thing that used to tell me is gone. Its actually been gone for a while now and I just figured out not too long ago what it actually was.

"utime_enable 1" needs to be run from your client. There's also a place in the settings menu where you can enable/disable it.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: pmag on May 22, 2016, 12:55:57 AM
"utime_enable 1" needs to be run from your client. There's also a place in the settings menu where you can enable/disable it.
I'm sorry did I forget to mention that I am not talking about my own server? I meant servers that I connect to from gmod that other people make. For some reason other people are able to see the utime but I can not. I do not believe there is any more info that I can give you that I didn't already say in my original comment. However since that last comment I have been to 2 servers that did let me see the utime thing but there are still servers that I KNOW have it but I just can't see it (and if I put in the command in the console it would still give me the error)

I don't need to be able to have/see utime but I am more curious as to why It doesn't show up for me but it does for other people on a lot of servers.

My original comment:
I am having the same issue as Canne, It used to be there on servers now it isn't (I tested on ones I knew had it and even asked if someone else on the server could see it) . I tried utime_enable 1 and all I got was "Unknown command "utime_enable" " I removed all of my addons and tried again on the same server other people were able to have it but it still doesn't show up for me and I still get the unknown command thing. I only want to get this back because one time someone asked me how long ive been on a server and I had to tell them I didn't know and the thing that used to tell me is gone. Its actually been gone for a while now and I just figured out not too long ago what it actually was.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Megiddo on May 22, 2016, 04:25:43 AM
If it shows as an invalid command in your client, they are NOT running UTime. Not this version of it, anyways.


Sent from my iPhone using Tapatalk
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: pmag on May 24, 2016, 07:17:24 PM
Thank you for helping me understand this as best as you could. I wonder if its just an older version of Utime or even a ULX pack which includes Utime but only shows for some people. Im still not exactly sure how ULX/Utime work but in my experience "modding" minecraft I know that the tiniest of differences can mean a whole different outcome.

Thank you
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: DrSchnell on June 12, 2016, 07:11:52 PM
Hello,

Up until about 1 hour ago uTime has been working flawlessly and I really thank you for it. I recently tried setting up a server admin panel and it required a modified lua script in the ULX files. So i disable my workshop ULX and ulib and I go and get it from the website. After some fussing around, I get it set up and working, but none of the hours show up. Almost all of the players on the server have their hours reset to 0. One person retained his hours. I chmod'd sv.db to 777 and it still doesn't work. i don't know if between the set up of the admin panel and the different versions of ULX that my database became corrupt? Is that a possibility? I was just wondering if there is a way to fix this as my users' rank progression depends on how many hours they have.

Thank you again,

Schnell
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: saya on April 25, 2017, 12:16:00 PM
how can i set permissions? users can change the colors
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Bytewave on April 25, 2017, 05:03:10 PM
how can i set permissions? users can change the colors
Colors are configured clientside. Changes on the client don't affect the server.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: jtw144 on October 26, 2017, 12:58:51 PM
What folder do you put the download in?
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: MrPresident on October 26, 2017, 01:07:48 PM
It goes in your addons folder, jtw144.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Rokilo on January 06, 2018, 10:54:06 PM
I'm getting this error :(
[ERROR] addons/utime/lua/autorun/server/sv_utime.lua:127: attempt to call global 'log' (a nil value)
  1. updatePlayer - addons/utime/lua/autorun/server/sv_utime.lua:127
   2. unknown - addons/utime/lua/autorun/server/sv_utime.lua:153
So the time doesn't save when I reset the server
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: JamminR on January 07, 2018, 12:55:12 PM
Rokilo, Not sure what you're using, but you aren't using this release of Utime.
Likely someone elses modified version. This release has no 'server' folder in autorun.
(As reviewed - https://github.com/TeamUlysses/utime/tree/master/lua/autorun )
I even looked in this releases sv_utime.lua folder, it doesn't even have 127 lines of code.

I'd recommend finding the author of the release you're using and ask for help in that release comments.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Bite That Apple on January 07, 2018, 07:01:00 PM
I'm getting this error :(
[ERROR] addons/utime/lua/autorun/server/sv_utime.lua:127: attempt to call global 'log' (a nil value)
  1. updatePlayer - addons/utime/lua/autorun/server/sv_utime.lua:127
   2. unknown - addons/utime/lua/autorun/server/sv_utime.lua:153
So the time doesn't save when I reset the server

If you have only one server, then I'd recommend to just download the original copy of uTime from the original post on this thread.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Noobless on January 09, 2018, 12:50:21 PM
I keep getting a error and i don't know why. This is what i found in my server console

Unknown Function:             InitTimer       player [1][NoobLess]


Noobless is my steam name.
I've tried reinstalling it and i even put utime and ulx as the only two addons on my server and still had the same problem. i got it straight from the git hub as well.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Gr0m3r on February 08, 2018, 06:33:18 AM
Me and my friends noticed that today a few players lost their time on utime on server. It has reset to 0, for some players time get back, but not to the same value as early. I'm useing autopromote and some players lost their ranks then they get ranks back, but time not. I created that post to ask if someone can help me or have idea what can cause that.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: JamminR on February 08, 2018, 03:34:29 PM
ULX groups are stored in gmod\data\ulib\groups.txt, users for groups are stored in gmod\data\ulib\users.txt
Utime data is stored in gmod\sv.db (the root gmod server folder)
If by 'ranks' you mean admin "groups", they have nothing to do with the same file area.
If by 'ranks' you mean something actually called 'ranks' in a gamemode, then it's possible whatever stores ranks are also in sv.db

No matter, it sounds as though your sv.db has been erased/modified/or corrupted.
If you do not have a recent backup of your gmod\sv.db file from recently, your UTime data is gone.
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: Gr0m3r on February 09, 2018, 08:44:09 AM
Well, only a few players lost their time and i've modified SV.db file, but it was almost 2 weeks ago and everything was fine. I didn't even touch utime data, what could affect that?
Title: Re: Utime -- Show how long your players have been connected this session and total
Post by: JamminR on February 09, 2018, 03:40:57 PM
- what could affect that?
- i've modified SV.db file

You've answered your question. Sounds like you corrupted the file.
Likely not noticed until certain players joined.

The only time I've ever seen player times lost is when the sv.db was damaged, erased, server reinstalled fresh (which writes new sv.db), etc.
Really, we can't know for sure, but, it's corrupt now. I'd recommend restore from backup.