Website Tags and Server Group Sync

Hello all,

Forgive me if this is the wrong place to post this and direct me to the right place but I am wondering if anyone can help me. Effectively I have seen a large number of groups who have their Website Tags synced with their TeamSpeak server groups and vice versa.

Say I had just made someone an Admin on my website and assigned them the tag, how would I go about syncing this to my TeamSpeak so they are given the Admin tag on there automatically without myself or another having to do it manually? I want all tags and server groups synced with eachother

I know there is a way and some people say you need to write your own code or make your own plugins but you see I’m not at all good at this stuff. I have a friend who is so if there is some coding related to this he would understand. We just need a point in the right direction. What are the principles to getting this to work. We know there’s some Database work that needs to be done but how di we get them to sync together and talk? If anyone could help me I would appreciate it.

Thanks in advance.

This is rather easy.

First you need a way of syncing website accounts with TeamSpeak identities.

The easiest would probably be to prompt the users on the website to enter their id while connected.
Then send a message to them via the serverquery with a unique code to enter again on the website to verify it is actually them.

Then you just need to assign the correct server groups via the serverquery.

Assuming the website is running on php you can simply use the TeamSpeak 3 PHP Framework for that.
The documentation should be pretty clear.

Just make sure you can reach the serverquery port.

1 Like

Hi Gamer 92000,Thanks for your reply.

Could you explain which part of the PHP Framework Wiki we would need to look at to help us achieve this? How would I go about linking the Server Query to the area where they enter their TS ID? Is there a specific line of code?

Also, how do I get the tags to speak to the Server Query ?

Thank you

Basically everywhere.
I will try to summarize the important parts.

Initialization

First you need to initialize the library and create a connection to the serverquery.
This can be done like so (as found in the examples)

// load framework files
require_once("libraries/TeamSpeak3/TeamSpeak3.php");
// connect to local server, authenticate and spawn an object for the virtual server on port 9987
$ts3_VirtualServer = TeamSpeak3::factory("serverquery://username:[email protected]:10011/?server_port=9987");
Get UUID

A simple input field should be sufficient with maybe an explanation on how to get one own’s uuid.
The easiest I found is to drag yourself into you own contacts list and rightclick Copy unique ID to clipboard

Verify ID

Before using the uuid you should ensure it is not malicious. The easiest way would be a pattern check (regex match) and/or a urlencoding.
Generate a random number / string on the webserver and send that as a message to the given uuid.

$ts3_VirtualServer->clientGetByUid($uuid)->message($msg);

docs

Save UUID

Just save the uuid to you database linked to the useraccount. Again make sure it is sane and not malicious.

Assign server groups

Find the code in the website that handles changes tags and add the correct server group.
If needed you could also remove other server groups.
To add a group use this:

$ts3_VirtualServer->clientGetByUid($uuid)->addServerGroup($sgid)

To remove a group use this:

$ts3_VirtualServer->clientGetByUid($uuid)->remServerGroup($sgid)

docs
You can find the server group ids via yaTQa or the serverquery directly.

3 Likes

Hi Gamer,

Thanks for this. My friend has given it a go but it’s causing the page to crash and go to a blank white screen. He said this:

“When I tell the script to connect to my teamspeak it is causing the page to crash and show a blank white screen.”

$ts3_VirtualServer = TeamSpeak3::factory("serverquery://ThameshireRPC:[email protected]:9138/?server_port=9987");

EDIT

He has changed out port to 9138 and is now getting an error.

Error 111: Connection Refused

Will it matter if we have our TS hosted by a provider rather than off our own Domain?

Hi Gamer,

We have been fiddling about with this and it seems that the connection will not go through.We believe the port is correct and get the issue below.


Error 111: Connection Refused.

Does this have anything to do with the TS being hosted by a provider? Or is there something we are doing wrong? What reasons would call for the connection to be refused?

Thanks Again in advance!

I guess so, most providers will not give you access to the server query. You will have to ask them whether you can get access but tbh I doubt it.
In that case you could only resort to develop your own client based bot.

twitch instagram twitter facebook