PDA

View Full Version : New way: Who's online


LaCosaNostra
22-04-2007, 11:39
Since

Some of us would like to keep our ports closed by default
Some of us have the members & access arranged via their forum (http://www.vbulletin.org/forum/showthread.php?t=122221) or some home made web-application, forwhich they made the TeamSpeak Server switch to a MySql database


Now for those ones, who are able to read from TeamSpeaks MySql database already, it would be simplest to also read from there, who's online..

I've checked some of the mysql-files, in the mysql_sql folder.
There's a query for checking te login and fetching the rights.
And there's a query who after that, updates teh last-logged-in date

It would be very simple to add a "1" in an "client_is_online" to mark that person online.


What I unfortunately thusfar haven't seen is a query when a user logs off.

It would be very simple to update the "1" in the "client_is_online" to a "0" to mark that person offline.
Or add a dt_client_lastoffline date column, that gets updated on logoff.


Then when you'd like to query who's online, simply check for the "1" or do some math: where dt_client_lastoffline < dt_client_lastonline



Using this method, there wouldn't be extra recourses,connections and re-calculation of who's online needed.

For this to make, only one mysql-file would have to get updated.


update ts2_clients set
dt_client_lastonline = :dtLastOnline
where
i_client_id = :iClientID;

becomes

update ts2_clients set
dt_client_lastonline = :dtLastOnline,
client_is_online = 1,
where
i_client_id = :iClientID;



But then I can't find any actions being done when someone logs off :(

Any ideas or perhaps can this get added in the next future ?
It's not a waste of space or recourses.. ;)

Reedy Boy
22-04-2007, 11:58
The Lack of the logout method has been the reason why people havent been able to complete this before

LaCosaNostra
23-04-2007, 02:34
Thanx for the reply..

it was short and painfull, lol

Reedy Boy
23-04-2007, 08:23
Thanx for the reply..

it was short and painfull, lol

Sorry i couldnt have been of more use

Hopefull TS3 may automatically have a login flag, OR a logout procedure...

LaCosaNostra
23-04-2007, 12:21
For the time being, is it possible to have a TS-viewer on the server where the TS-server is installed on ?

If so, the viewer code could be altered, so it would refresh like every 15mins or so, and update the " client_is_online" column accordingly.. :)

This way the database still would get to be updated with who's online, and no special ports need to be opened.

Reedy Boy
23-04-2007, 17:10
For the time being, is it possible to have a TS-viewer on the server where the TS-server is installed on ?

If so, the viewer code could be altered, so it would refresh like every 15mins or so, and update the " client_is_online" column accordingly.. :)

This way the database still would get to be updated with who's online, and no special ports need to be opened.

Cant see any reason why you cant run the viewer on the pc that is running the server


I dont know about altering the code of the viewer though... Depends if its source is released