ttleser
16-05-2004, 15: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
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