Jump to content

Send All Teamspeak Servers Message Script


Hogie

Recommended Posts

Im currently trying to work on a script (I hope), that will do what the "Global Message" does under a virtual server from the control panel. Only I want to do it so I can send a message to ALL virtual servers on a single server (ie, When im about to do work on that box, and going to reboot it/etc). Would I be using the TeamSpeakServer.VirtualServer.SendMessage method to do this?

 

 

 

If it is, I guess I just get to figure out how to enumerate each server from code then.

 

 

 

Thanks

Link to comment
Share on other sites

It's easier to just use Util.TeamSpeakServer directly because Objects.VirtualVoiceServer is mostly just database stuff. Try this:

 

 

 

 

 

<div class="pre"><pre><tcascript>

<language name="VB" />

<waitForUserAction value="true"/>

 

<scriptCode><![CDATA[

 

Imports System

 

Public Class BroadcastTS

Public Shared Sub Main()

'Your global message:

Dim msg As String = "Your global message"

 

'Get a list of configured master teamspeak servers:

Dim teamspeakservers() As TCAdminSDK.Objects.VoiceServer = TCAdminSDK.Objects.VoiceServer.GetVoiceServers

If Not teamspeakservers Is Nothing Then

For Each teamspeakserver As TCAdminSDK.Objects.VoiceServer In teamspeakservers

If teamspeakserver.Enabled Then 'if you want to send the message to just one teamspeak master server add: And teamspeakserver.VoiceServerID = "TCXXXXXXXXXX"

 

'Connect to the teamspeak server with the saved admin and password using telnet

Dim ts As New TCAdminSDK.Util.TeamSpeakServer

ts.SuperLogin(teamspeakserver.ServerIP, teamspeakserver.AdminPort, teamspeakserver.Admin, TCAdminBase.Encryption.DecryptString128Bit(teamspeakserver.Password))

 

'Get a list of virtual servers on that server

Dim virtualservers() As TCAdminSDK.Util.TeamSpeakServer.VirtualServer = ts.VirtualServers

If Not virtualservers Is Nothing Then

'Send the message to each virtual server

For Each virtualserver As TCAdminSDK.Util.TeamSpeakServer.VirtualServer In virtualservers

virtualserver.SendMessage(msg)

Next

End If

'Logout from teamspeak server

ts.Logout()

End If

Next

End If

End Sub

End Class

 

]]></scriptCode>

 

</tcascript></pre></div>

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Terms of Use