• Hey Guest, we're evolving the future of TeaSpeak.
    You're invited to join the discussion here!

Native Client Error in connect() on line 4705: host isn't a ts3 instance!

BIOS

TeaSpeak Team
Staff member
TeaTeam
i get this erro by create an serverlist

and this error on webinterface:

Error in connect() on line 4705: host isn't a ts3 instance!
Error in login() on line 2683: script isn't connected to server



cant create an masterserver im using the ts3admin.class.php
 

Attachments

Last edited:

BIOS

TeaSpeak Team
Staff member
TeaTeam
i have lookt up the ts3admin.class php the line 4705 dont exists
 

websat

Well-known member
Hi,
You have an error in function connect ()
Code:
//Original
    function connect() {
        if($this->isConnected()) { 
            $this->addDebugLog('Error: you are already connected!');
            return $this->generateOutput(false, array('Error: the script is already connected!'), false);
        }
        
        $socket = @fsockopen($this->runtime['host'], $this->runtime['queryport'], $errnum, $errstr, $this->runtime['timeout']);

        if(!$socket)
        {
            $this->addDebugLog('Error: connection failed!');
            return $this->generateOutput(false, array('Error: connection failed!', 'Server returns: '.$errstr), false);
        }
        else
        {
            if(strpos(fgets($socket), 'TS3') !== false)
            {
                $tmpVar = fgets($socket);
                $this->runtime['socket'] = $socket;
                return $this->generateOutput(true, array(), true);
            }
            else
            {
                $this->addDebugLog('host isn\'t a ts3 instance!');
                return $this->generateOutput(false, array('Error: host isn\'t a ts3 instance!'), false);
            }
        }
    }
  
//my edit version
    function connect() {
        if($this->isConnected()) { 
            $this->addDebugLog('Error: you are already connected!');
            return $this->generateOutput(false, array('Error: the script is already connected!'), false);
        }
        
        $socket = @fsockopen($this->runtime['host'], $this->runtime['queryport'], $errnum, $errstr, $this->runtime['timeout']);

        if(!$socket)
        {
            $this->addDebugLog('Error: connection failed!');
            return $this->generateOutput(false, array('Error: connection failed!', 'Server returns: '.$errstr), false);
        }
        else
        {
//            if(strpos(fgets($socket), 'TS3') !== false)
        $prefix = fgets($socket);
            if(strpos($prefix, 'TS3') !== false || strpos($prefix, 'TeaSpeak') !== false)
            {
                $tmpVar = fgets($socket);
                $this->runtime['socket'] = $socket;
                return $this->generateOutput(true, array(), true);
            }
            else
            {
                $this->addDebugLog('host isn\'t a ts3 instance!');
                return $this->generateOutput(false, array('Error: host isn\'t a ts3 instance!'), false);
            }
        }
    }
 
Last edited: