PDA

View Full Version : Extracting if someone is on the server or not


ttleser
16-05-2004, 16:58
I'd like to know if anyone out there can write a small VB script, whatever that could look in whatever database teamspeak uses and determine if any user is on the server or not.

Here's my idea. I'm still working with administering 2 servers. One server, "the master" is the only server in our clan that I want people to register with. The "slave" server currently downloads the server.dbs file from the master on a nightly basis. Ultimately after the download is complete, the slave restarts TS2 server and it's now using new server.dbs

I've been using a program called Beyond Compare, that I downloaded for something else, but started to realize I could use it here. Beyond Compare can be setup to analyze any files or directories and give you the option of "syncing" up the different files. The program has a small scripting interface that will allow you to do it automaticallly. Here's what I thought I'd do:

Rem Using windows scheduler, launch beyond compare script every hour (or whatever period I tell it to)

Run comparision master\server.dbs against slave\server.dbs
if master is newer, goto sync
if files match, goto evaluate

:sync
Download master\server.dbs to slave server
rem continue to evaluate

:evaluate
**Detect if any user is on slave server.
if user is on, copy slave\server.dbs to slave\server.old then goto end
if user is not on the server, continue
if exist server.old goto recycle
if not exist server.old goto end

:recycle
delete server.old
shutdown TS2 server program
wait 10 seconds
start TS2 server program
goto end

:end



The idea of making a .old copy is so that there's a reference to let the script know that the download did happen, but the server can't be brought down since someone is on it. But when the comparsion runs again, it'll see if the copies are the same, if they are, it'll then check to see if the .old file exists and if a user isn't on the server, if no user, then it'll restart the server.

I'll figure out my spagetti logic myself, no worries there. What I need is a way to have a small program automatically determine if just one user is on the TS2 server or not and return that as a value I can use in this script. Any takers??? :D

ttleser
19-05-2004, 02:36
Sometimes it's like posting into the Black Hole.

guldi
19-05-2004, 08:40
Originally posted by ttleser
Sometimes it's like posting into the Black Hole.
I'd like to know if anyone out there can write a small VB script, whatever that could look in whatever database teamspeak uses and determine if any user is on the server or not.

Do you really expect that after 3 days the whole world will scrambe for programming your wish. I guess most people have better things to do then just wainting for programming requests from others (for which they get noting).
So don't expect too much and have patience.


PS: amazon sells good books about "how to programm in VB"

Brain
19-05-2004, 08:45
I'd like to know if anyone out there can write a small VB script
Alright, alright, if you want an answer here it is:
I could, but I won't.

Besides, if you used MySQL and replication you wouldn't need any "VB script" at all ;)
You could even have people register on both servers without problems.

ttleser
22-05-2004, 04:04
Guidi:

Do you really expect that after 3 days the whole world will scrambe for programming your wish. I guess most people have better things to do then just wainting for programming requests from others (for which they get noting).
Perhaps a week or a month of waiting for a reply would have been better? Perhaps also that my choice of words "Program for me" wasn't the best, I did mean if anyone had any suggestions. Didn't ask everyone to drop what they're doing and do my bidding. If you HAD read my whole sentence, you'll notice that I implied that there are probably other methods out there and if anyone knew of it, some that would perhaps require a little explaination or sample code (Though I didn't say that). Sorry.


PS: amazon sells good books about "how to programm in VB"
By the time I learn it, TS3 will be out. Kinda thought that the purpose of these forums were to SHARE answers and help.

Sorry if anyone took offence to my "black hole" comment, but you've got to admit that help is sometimes very selective here.

guldi
22-05-2004, 12:53
didn't want to affront you, SRY !
But your request didn't looked like a question but more like a request that someone do a work for you.
You wouldn't have been the first one haveing the idea that someone else would programm code for him as he is the most important guy on earth.
I REALLY hate such posts !!!!!!!!!!


but you've got to admit that help is sometimes very selective here
When I check this forum daily it oftens takes me an hour to go through all questions and to do researches,... As everyone else, I do this in my spare time and I have some other hobbies as well. Do you really want to keep up your Statement ?

ttleser
22-05-2004, 21:22
Actually I'm done. This conversation has turned pointless.

I'm sorry for having offended you guidi. I spend many hours myself on other forums, helping people with expertise I have in those areas. With Teamspeak using MySQL, PHP, and whatever other programs it uses, I figured I ask for help since I don't have the knowledge. My original statement was not phrased correctly, sorry.

I have seen your name throughout the forums and you do appear to help people out. Again, very sorry you took offense to my "black hole" comment, and now my "selective" comment. I apologize.