planetteamspeak / ts3phpframework

Modern use-at-will framework that provides individual components to manage TeamSpeak 3 Server instances
https://www.planetteamspeak.com
GNU General Public License v3.0
211 stars 59 forks source link

Node Method not found - using TS3 SSH connection #98

Closed Newcomer1989 closed 6 years ago

Newcomer1989 commented 6 years ago

Background information

Problem:

On serveral functions I got an error, that the node method is missed.

2018-08-22 14:30:02.541778   ERROR     Error due register notifyTextmessage 0: node method 'notifyRegister()' does not exist
2018-08-22 14:30:02.541954   ERROR     Error 0: node method 'selfUpdate()' does not exist
2018-08-22 14:30:05.658899   ERROR     Error 0: node method 'clientListReset()' does not exist

My code extracts, which produces the errors above:

$ts3->notifyRegister("server");
$ts3->notifyRegister("textprivate");
$ts3->notifyRegister("textchannel");
$ts3->notifyRegister("textserver");
TeamSpeak3_Helper_Signal::getInstance()->subscribe("notifyTextmessage", "handle_messages");
TeamSpeak3_Helper_Signal::getInstance()->subscribe("notifyCliententerview", "event_userenter");
$ts3->selfUpdate(array('client_nickname' => $queryname));

If I am using the same script, same TS3 PHP Framework, only I change the connection from SSH to RAW all is working fine!

Means, this one brings the described errors above:

$ts3 = TeamSpeak3::factory("serverquery://".rawurlencode($ts['user']).":".rawurlencode($ts['pass'])."@".$ts['host'].":".$ts['query']."?ssh=1");
$ts3->serverSelectByPort($ts['voice']);

No error / problems with this connection: $ts3 = TeamSpeak3::factory("serverquery://".rawurlencode($ts['user']).":".rawurlencode($ts['pass'])."@".$ts['host'].":".$ts['query']."/?server_port=".$ts['voice']."&blocking=0");

I am not sure, did I something wrong or is the problem the library?

Newcomer1989 commented 6 years ago

I need a short break and new eyes for the problem. Then I found it.. It is sitting in front of the PC ;-)

My bad, all is working fine, if I add the server_port= paramter to the URI.

Otherwise, if the server_port option is not set to the URI and I connect to it as described above, then I need to save the connection to the correct object. Example:

$ts3_instance = TeamSpeak3::factory("serverquery://".rawurlencode($ts['user']).":".rawurlencode($ts['pass'])."@".$ts['host'].":".$ts['query']."?ssh=1");
$ts3_virtual_server = $ts3_instance ->serverGetByPort($ts['voice']);
$ts3_virtual_server->notifyRegister("server");
[...]