PDA

View Full Version : Top user


crazyandy
07-12-2006, 22:32
Hi Does anyone know of or can create a php script that will post up on my website the top say 5 users for a Teamspeak server.

Thanks Andy

Reedy Boy
07-12-2006, 23:02
What do you mean by the Top 5 users?

There are various tools avaliable to list all the current users on your TS server

crazyandy
13-12-2006, 17:19
I mean like a top 5 uses where it will post up on my site the top 5 users of the month. like the people that use it the most kind of thing.

Thanks Andy

Reedy Boy
15-12-2006, 23:34
Oh, the most active users

I dont think time is logged... I dont know if you'd be able to write a script to get times of users online, and parse it in say PHP to display

crazyandy
18-12-2006, 15:55
yea thats the kind of thing i want would you or do you know of any one that could make it or help me make it or even just point me in the right direction. If you look on the teamspeak webinterface and go to users it shows you when they where last on could you use this to calculate the top users???

Thanks Andrew

Reedy Boy
18-12-2006, 18:34
yea thats the kind of thing i want would you or do you know of any one that could make it or help me make it or even just point me in the right direction. If you look on the teamspeak webinterface and go to users it shows you when they where last on could you use this to calculate the top users???

Thanks Andrew

It could be done, but im not sure how

You would have to be almost constantly polling the server to find current users, you could do it like 5 minute intervals, but you have the problem that it may be false if a person joins before a 5 minutes and leaves and comes back before the next...

With the data it could then store it

Or it could poll, and check the current user time, and if its greater than before, you save it, but this still misses time



Maybe, listen for a user joining, record the time of the user, and then wait for user to leave and record that when it happens...?


Hmmmm

crazyandy
20-12-2006, 12:57
emm were getting some where but i need some sode now to play about with. does anyone else have any ideas????
Andy

Reedy Boy
20-12-2006, 18:51
emm were getting some where but i need some sode now to play about with. does anyone else have any ideas????
Andy

Theres a range of aplications avaliable that people have created for polling TS servers

What languages are you fluent/familiar with?

Reedy Boy
21-12-2006, 12:27
Theres a range of aplications avaliable that people have created for polling TS servers

What languages are you fluent/familiar with?

Just FYI i am most fluent in VB .NET

So i could do something in that... Possibly, and then it create an xml file or something...

I dont know what would be most suitable

Hdmas
21-12-2006, 12:45
Just FYI i am most fluent in VB .NET

So i could do something in that... Possibly, and then it create an xml file or something...

I dont know what would be most suitable

That thing is complicated. Yeah, there is time, how long the user has been connected, and that could be used in that script. But script goes complicated, when you have to log the connection time, you probably need to compare it to last "connection time"-value, count the difference (if still connected) to last "connection time"-value, or if the user has reconnected, just add the new connection time. (And this would need to be runned every few mins.. ;))

It would be way easier to show just the current "top 5 users", but when it is has to be all time, it needs thing that i mentioned earlier in last chapter.

Personally, I would do that with php (and connection times to mysql), but that's just my taste ;)

Good luck for that brave (fool?) who decides to do this.

Reedy Boy
21-12-2006, 13:04
That thing is complicated. Yeah, there is time, how long the user has been connected, and that could be used in that script. But script goes complicated, when you have to log the connection time, you probably need to compare it to last "connection time"-value, count the difference (if still connected) to last "connection time"-value, or if the user has reconnected, just add the new connection time. (And this would need to be runned every few mins.. ;))

It would be way easier to show just the current "top 5 users", but when it is has to be all time, it needs thing that i mentioned earlier in last chapter.

Personally, I would do that with php (and connection times to mysql), but that's just my taste ;)

Good luck for that brave (fool?) who decides to do this.

Yeah, that would be a better idea (you summarised my other posts with the first bit), and a hell of a lot easier to code

PHP would probably be more suitable to the purpose also


Would that be suitable andy?



"I pitty the foo'"

Hdmas
21-12-2006, 13:13
One more thing: That wouldn't be "bugless." There would be some difference to the real connection time (the difference is related to time between running, and rerunning that script, (more runs in hour, less difference)). Maybe running that script every 2-5mins would be enough. (The word is crontab)

"I pitty the foo'"

Hahah :D

Reedy Boy
21-12-2006, 19:49
One more thing: That wouldn't be "bugless." There would be some difference to the real connection time (the difference is related to time between running, and rerunning that script, (more runs in hour, less difference)). Maybe running that script every 2-5mins would be enough. (The word is crontab)



Hahah :D

Should really be

"I pitty the foo'"

:D


That aside, im sure its a bit of a pointless use of resources... Dunno if the staff would be able to implement a global connection time per user into TS3...?

crazyandy
22-12-2006, 15:42
well if you 2 think you can help me in making this i woould be much appreicated.
I am learning php and i know a bit, not too much on the mysql database side of it because i havent got mysql working yet so havent been able to mess about with it.
If you think it is going to be very hard to do and waste all of my servers resorces then its probly not a good idea but would like to try it any way, I am sure someone will find it usefull.

P.S. whats all the,
pitty the foo
crap about.

Andy

Reedy Boy
22-12-2006, 16:31
well if you 2 think you can help me in making this i woould be much appreicated.
I am learning php and i know a bit, not too much on the mysql database side of it because i havent got mysql working yet so havent been able to mess about with it.
If you think it is going to be very hard to do and waste all of my servers resorces then its probly not a good idea but would like to try it any way, I am sure someone will find it usefull.

P.S. whats all the,

crap about.

Andy

Its from the A-Team, Mr. T says "I pitty the foo'"

Way before my time, but it was on a tv program the other night, it made me think of it

MySQL - There isnt much other than the SQL Queries...


Really, you dont need the database for storage, a file could do it, but a table in MySQL would allow easy manipulation

The actual coding of the program is different to displaying it

You would need a backend program running on a cronjob, or a scheduled task to find out whoes online, which can update the file/database

Using the database, on a page load, the php pulls the timings...


The displaying code, is simple, its a simple SQL query on the database, organisinging in ascending/descending on the time, pull a certain number of rows, and display the relvant name with it and stick it in a table


PHP would be simplest for the parsing the data from the table and displaying it


You think of the way of doing the polling of connection times. Something running like the TS2perl mod - which runs in a continous loop, something simple like that, would work..

Its working out about the times

crazyandy
22-12-2006, 16:54
well i havent a clue how tsperlmod was made so would need lots of help with that the php maybe a bit easyer as i know a little about it. Are you up for helping me???
Andy

Reedy Boy
22-12-2006, 19:56
well i havent a clue how tsperlmod was made so would need lots of help with that the php maybe a bit easyer as i know a little about it. Are you up for helping me???
Andy

The only thing about running it in PHP, is i dont know how you would do a job

I'll help out, but i dont know PHP very well....

crazyandy
25-12-2006, 00:11
Well i know some php but i dont know where to start with this project thats why i am asking on here for some help to get me started.
so any pointers or starter scripts would be much appreciated.
Andy

Reedy Boy
25-12-2006, 00:38
Well i know some php but i dont know where to start with this project thats why i am asking on here for some help to get me started.
so any pointers or starter scripts would be much appreciated.
Andy

What does your server run on?

As we have the thing we can do it client neutral (ie linux and windows) if done in say perl and such

But if windows only, .NET framework can be used...

crazyandy
27-12-2006, 00:55
I have the server running on linux so it will need to be programed in perl then.

Reedy Boy
27-12-2006, 01:15
I have the server running on linux so it will need to be programed in perl then.

Well, Perl, C, C++....