1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

HTML to autoconnect to gameserver or TS3?

Discussion in 'Resource and Add-on Requests' started by Ren3gade10, Aug 5, 2013.

  1. Ren3gade10

    Ren3gade10 Member

    Can someone shoot me the code to drop into an html page that when you open the page it lets you autoconnect to a Teamspeak server or game server?

    I had the code, but i lost it. :/

    Thank you!
     
  2. Navo

    Navo Member

    For ts3 is it
    HTML:
    <a href="ts3server://TEAMSPEAKIP?port=PORTNR">Join TS</a>
    or
    HTML:
    <a href="ts3server://TEAMSPEAKIP:PORTNR">Join TS</a>
    or if you teamspeak server use the default port 9987 you can also use:
    HTML:
    <a href="ts3server://TEAMSPEAKIP">Join TS</a>
    For teamspeak your can use some parameters to add more info for your teamspeak server. The parameters I know are:
    • port=PORTNR
    • password=SERVERPASWOORD
    • nickname=NICKNAME
    • channel=CHANNELNAME
    • channelpassword=CHANNELPW
    • token=TOKENKEY
    • addbookmark=1 (add tsserver als bookmark for the user)
    Example how to use more than 1 parameter:
    HTML:
    <a href="ts3server://TEAMSPEAKIP?port=PORTNR&password=SERVERPASWOORD&channel=CHANNELNAME">Join TS</a>
    I don't know whats gameserver it is. But if it a game from steam you can try:
    HTML:
    <a href="steam://connect/IP:PORT">Join Gameserver</a>
     
  3. Ren3gade10

    Ren3gade10 Member

    So I can just drop one of those on an HTML page and it will autoconnect?

    EDIT: Yes that does it correctly but that makes a button or text you can click on to make it connect automatically. I want it so when you load the mydomain.com/ts3connect.html it auto loads it. No button clicking or anything. It just pops up automatically to connect.
     
  4. Navo

    Navo Member

    Yes. If the user click on the link the internet browser wil popup an window that ask if the user allow to run a extern program. If the user click on oké it wil start the program and connect the user to the server.

    But if the user don't have teamspeak installed the link for teamspeak wil not work. Same is for the gameserver link if steam not installed.

    Edit:
    For teamspeak link I have 1 tip for you. Start your ts en join your server. Then go to Tools -->Invite Buddy. Choose there Inviration Type: html code en play with some options and you see the output in HTML in the textbox below.
     
    Last edited: Aug 8, 2013
  5. Ren3gade10

    Ren3gade10 Member

    There is some HTML code to where it will auto-execute the command to connect to teamspeak. So they don't even have to click "Join TS"
    They just open the link and the box to connect automatically pops up.
     
  6. Navo

    Navo Member

    Sorry I don't know what you mean. Do you have a example?
     
  7. Akinak

    Akinak Well-Known Member

    What this thread do in addon request?
     
  8. Ren3gade10

    Ren3gade10 Member

  9. Navo

    Navo Member

    That is PHP. The page you link looks like:
    PHP:
    <?php
    /* Check if run is in the link so your link is like filename.php?run=ts3 */
    if(isset($_GET['run']))
    {
        
    /* Check the value from run is the same as ts3 */
        
    if($_GET['run'] == 'ts3')
        {
            
    /* Conntect user with ts server. This server is also use on your example */
            
    header('Location: ts3server://66.150.214.9:7300');
        }
        
    /* if you have more servers */
        
    elseif($_GET['run'] == 'server2')
        {
            
    /* Run your code */
        
    }
        
    /* if you have more servers */
        
    elseif($_GET['run'] == 'server3')
        {
            
    /* Run your code */
        
    }
        
    /* Value from run is not the same as ts3, server2 or server3 */
        
    else
        {
            
    /* Give error */
            
    echo 'Server not found';
        }
    }
    /* There is no run in the link found */
    else
    {
        
    /* Give a error */
        
    echo 'Server not found';
    }
    ?>
    This is just a basic PHP script. Is work the same as you example so far I know.

    But this method is also not automatic and can't never be automatic. Users must load the page so there must click on a link or must know the link to get on the page. So the HTML version is better if you ask me.

    Don't know but just try to help :)

    Edit:
    If you have only 1 server this is than better and don't need ?run=ts3 in the link:
    PHP:
    <?php
    /* Conntect user with ts server. This server is also use on your example */
    header('Location: ts3server://66.150.214.9:7300');
    ?>
     
    Last edited: Aug 9, 2013
  10. Ren3gade10

    Ren3gade10 Member

    <?php/* Conntect user with ts server. This server is also use on your example */header('Location: ts3server://66.150.214.9:7300');?>

    that is perfect! Thank you! solved. :)
     

Share This Page