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

0 Members and 3 Guests are viewing this topic.

Offline Samusaaron3

  • Newbie
  • *
  • Posts: 20
  • Karma: 0
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?

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6213
  • Karma: 394
  • Project Lead
Google "sqlite db viewer".
Experiencing God's grace one day at a time.

Offline tas

  • Newbie
  • *
  • Posts: 20
  • Karma: 3
  • NG Clan Administrator
    • Nocturnal Gaming
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.
Malum consilium quod mutari non potest.

Someone once said "Don't try to be a great man. Just be a man, and let history make its own judgment."
That's rhetorical nonsense. Who said that?
You did, ten years from now
--Star Trek, First Contact


Offline Samusaaron3

  • Newbie
  • *
  • Posts: 20
  • Karma: 0
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?

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6213
  • Karma: 394
  • Project Lead
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.
Experiencing God's grace one day at a time.

Offline Samusaaron3

  • Newbie
  • *
  • Posts: 20
  • Karma: 0
How hard would it be to modify UTime to have it also store the player's steamid?

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6213
  • Karma: 394
  • Project Lead
You would need a basic understanding of Lua and SQL.
Experiencing God's grace one day at a time.

Offline XwawawaX

  • Newbie
  • *
  • Posts: 1
  • Karma: 0
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?

Offline ahref

  • Jr. Member
  • **
  • Posts: 62
  • Karma: 4
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 :(



Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6213
  • Karma: 394
  • Project Lead
Oops... need to fix that.
Experiencing God's grace one day at a time.

Offline ahref

  • Jr. Member
  • **
  • Posts: 62
  • Karma: 4
thanks ill just comment out the line in question for the moment. :D.

I tried to fix it myself but im a lua newbie :)

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6213
  • Karma: 394
  • Project Lead
Fixed in svn rev 2. Let me know if there are any issues, otherwise I'll push it as a release soon.
Experiencing God's grace one day at a time.

Offline ahref

  • Jr. Member
  • **
  • Posts: 62
  • Karma: 4
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.

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6213
  • Karma: 394
  • Project Lead
It's in our main repository along with all our other works.
Experiencing God's grace one day at a time.

Offline ahref

  • Jr. Member
  • **
  • Posts: 62
  • Karma: 4
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