Raised This Month: $51 Target: $400
 12% 

Get playing time from server


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
GuskiS
Veteran Member
Join Date: Aug 2007
Location: Latvia
Old 07-18-2014 , 15:45   Get playing time from server
Reply With Quote #1

How can I get played time from server itself? Look at picture.
Server somehow/somewhere saves that, so it don't change after mapchange. How to retrieve it?
Attached Images
File Type: jpg time.jpg (6.2 KB, 178 views)
__________________
Finished mods:
Trouble in Terrorist Town
MurderMod
The Hidden
Cowboys vs Indians
JailBreak Supreme
Survival Madness
GuskiS is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 07-18-2014 , 15:47   Re: Get playing time from server
Reply With Quote #2

Have you tried get_user_time()? I can't remember if that is limited to the time playing the map or the time playing on the server.
__________________

Last edited by fysiks; 07-18-2014 at 15:47.
fysiks is offline
GuskiS
Veteran Member
Join Date: Aug 2007
Location: Latvia
Old 07-18-2014 , 15:59   Re: Get playing time from server
Reply With Quote #3

I read in a thread that said it was only getting time from connect to disconnect. So, reseting after map change.
__________________
Finished mods:
Trouble in Terrorist Town
MurderMod
The Hidden
Cowboys vs Indians
JailBreak Supreme
Survival Madness
GuskiS is offline
Backstabnoob
Veteran Member
Join Date: Feb 2009
Location: Iwotadai Dorm
Old 07-19-2014 , 06:29   Re: Get playing time from server
Reply With Quote #4

Disconnect doesn't necessarily happen on mapchange, FM_ClientDisconnect doesn't catch it. At least try it please
__________________
Currently busy working on a very large scale anime database project.
Backstabnoob is offline
vlad_slick
Member
Join Date: Jul 2009
Old 07-19-2014 , 17:29   Re: Get playing time from server
Reply With Quote #5

get_user_time doesn't return the full time (it's reset by reconnects or on mapchange).

The time in your screenshot is calculated (and stored) by the steam libraries (steamclient.so/steamclient.dll) in servers without dproto.
You shouldn't try to get it from the server because it's much harder than just calculating it yourself with a plugin.


But .... if you really want to get it from the server you could do it with orpheu. The way I came up with is by getting the address of the client_t structure and substracting the connect_time member from the last_received member from the netchan_t struct of each client. But as you can see it's overkill and I don't recommend it, unless you have specific reasons to do so.

Last edited by vlad_slick; 07-19-2014 at 18:25. Reason: clarification
vlad_slick is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 11:37.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode