Results 421 to 435 of 632
Thread: [API] TS3 PHP Framework
-
11-03-2012, 20:34 #421
-= TeamSpeak User =-
- Join Date
- Feb 2010
- Location
- Bordeaux
- Posts
- 4
Hi,
First, thank you for this work!
So, i have a php error when i'm trying the examples code :
Anyone have an idea where the problem may come from?Code:Error 0: php_network_getaddresses: getaddrinfo failed: Name or service not known
Thanks!
-
11-03-2012, 22:42 #422
-= TeamSpeak Servant =-
- Join Date
- Oct 2003
- Location
- Germany
- Posts
- 2,299
Sounds like there might be an issue with the DNS configuration on your server.
-
12-03-2012, 19:58 #423
-= TeamSpeak User =-
- Join Date
- Feb 2010
- Location
- Bordeaux
- Posts
- 4
It's what i have found during my search but i have used the ip as hostname so there is no need to use DNS to resolve whatever ...
Moreover, my server is properly configured and can resolves names & ping teamspeak's server address.
Even if i use the dns name or the ip address, i get the same error.
-
19-03-2012, 19:24 #424
-= TeamSpeak User =-
- Join Date
- Oct 2010
- Location
- Texas
- Posts
- 10
Is there somewhere we can get a list of all exception codes and their meaning for better error handling etc.?
Thanks!Last edited by echoDreamz; 19-03-2012 at 19:42.
-
20-03-2012, 19:28 #425
-= TeamSpeak Servant =-
- Join Date
- Oct 2003
- Location
- Germany
- Posts
- 2,299
The SDK includes a header file containing most TS3 error codes available.
-
30-03-2012, 10:36 #426
-= TeamSpeak Lover =-
- Join Date
- Dec 2009
- Location
- Poland
- Posts
- 43
Framework version: newest
Problem: "Server is not running" - with attr. /?use_offline_as_virtual=1 or "Server got an invalid status for this operation" without this attr during using function Delete()
Class
My crontab fileCode:... public function CheckVirtualServer($attr = '', $remove = FALSE) { try { if($remove) { $ts3_VirtualServer = TeamSpeak3::factory("serverquery://".self::QUERY_USERNAME.":".self::QUERY_PASSWORD."@".$this -> machine['machine_ip'].":".$this -> query_port."/?server_id=".$this -> data['server_vserver_id'].$attr); } else { $addid = rand(1024, 262144); $ts3_VirtualServer = TeamSpeak3::factory("serverquery://".self::QUERY_USERNAME.":".self::QUERY_PASSWORD."@".$this -> machine['machine_ip'].":".$this -> query_port."/?use_offline_as_virtual=1&server_id=".$this -> data['server_vserver_id']."&nickname=ServerAdmin:{$addid}".$attr); //"&nickname=QueryAdmin:{$addid}". } } catch(Exception $e) { if($e->getMessage() == 'Connection refused') { $this -> error = "Połączenie zostało odrzucone.";; $this -> StartInstance(); } else $this -> error = "Wystąpił nieoczekiwany błąd (".$e->getMessage().")"; return false; } return $ts3_VirtualServer; } public function RemoveServer() { global $cms; //echo $this -> data['server_vserver_id']; if($this -> data['server_vserver_id'] < 1) { $this -> error = "Ten serwer nie jest zainstalowany."; return false; } if(!($ts3_VirtualServer = $this -> CheckVirtualServer())) return false; //if(!($ts3_VirtualServer = $this -> CheckVirtualServer(null, TRUE))) return false; //if(!($ts3_VirtualServer = $this -> CheckInstance()->serverGetByPort($this -> data['server_port'])->getId())) return false; if($ts3_VirtualServer -> isOnline()) $ts3_VirtualServer -> Stop(); //if(!$ts3_VirtualServer -> isOffline()) $ts3_VirtualServer -> Stop(); usleep(1000); $ts3_VirtualServer -> Delete(); $cms -> db -> delete('server_backups', 'sb_server_id', $this -> id); $cms -> db -> delete('banners', 'banner_server_id', $this -> id); $cms -> db -> update('servers', array('server_vserver_id' => 0), 'server_id', $this -> id); $this -> data['server_vserver_id'] = 0; return true; } ...
Code:... $srv = new teamspeak($server); try { if($srv -> RemoveServer()) { $cms -> db -> delete('servers', 'server_id', $server['server_id']); echo "\n[DEL] [{$server['server_type']}] {$server['server_port']}: Serwer {$server['server_type']} o ID: #{$server['server_id']} (VID: {$server['server_vserver_id']}) zostal usuniety (stary)."; } else echo "\n[ERROR] {$server['server_id']}(VID: {$server['server_vserver_id']}): {$srv -> error}"; } catch (Exception $e) { echo "\n[ERR] {$server['server_port']}: Serwer {$server['server_type']} ID: #{$server['server_id']}: {$e->getMessage()} || {$srv -> error}"; } ...Last edited by Dream; 30-03-2012 at 12:35.
-
03-04-2012, 16:19 #427
-= TeamSpeak User =-
- Join Date
- Apr 2012
- Posts
- 4
Framework version: newest
I use the Framework with Standart Example Viewer. My Problem ist that the Words of Clientnames / Channelnames are to long for my HP "Box".
I edit the Html.php to get the Clientnames shorter with substr, but that doesnt work with the Channelname.
How can i do the same for the Channelnames ? i try a lot but nothing work./**
* Returns a string for the current corpus element which contains the display name
* for the current TeamSpeak_Node_Abstract object.
*
* @return string
*/
protected function getCorpusName()
{
if($this->currObj instanceof TeamSpeak3_Node_Channel && $this->currObj->isSpacer())
{
if($this->currObj->spacerGetType() != TeamSpeak3::SPACER_CUSTOM) return;
$string = $this->currObj["channel_name"]->section("]", 1, 99)->substr(10);
if($this->currObj->spacerGetAlign() == TeamSpeak3::SPACER_ALIGN_REPEAT)
{
$string->resize(30, $string);
}
return htmlspecialchars($string);
}
if($this->currObj instanceof TeamSpeak3_Node_Client)
{
$before = array();
$behind = array();
foreach($this->currObj->memberOf() as $group)
{
if($group->getProperty("namemode") == TeamSpeak3::GROUP_NAMEMODE_BEFORE)
{
$before[] = "[" . htmlspecialchars($group["name"]) . "]";
}
elseif($group->getProperty("namemode") == TeamSpeak3::GROUP_NAMEMODE_BEHIND)
{
$behind[] = "[" . htmlspecialchars($group["name"]) . "]";
}
}
return implode("", $before) . " " . htmlspecialchars($this->currObj) . " " . implode("", $behind);
}
return htmlspecialchars($this->currObj);
}
Im a PHP beginner so please be carfule with me
Greetz Bernhard
-
08-04-2012, 10:47 #428
I would try the following:
Code:if($group->getProperty("namemode") == TeamSpeak3::GROUP_NAMEMODE_BEFORE) { $before[] = "[" . htmlspecialchars($group["name"]->substr(10)) . "]"; } elseif($group->getProperty("namemode") == TeamSpeak3::GROUP_NAMEMODE_BEHIND) { $behind[] = "[" . htmlspecialchars($group["name"]]->substr(10)) . "]"; }
-
09-04-2012, 09:57 #429
-= TeamSpeak User =-
- Join Date
- Feb 2012
- Posts
- 5
Thank you for help, ScP. But I got yet another question.
Sometimes when I reload page multiple times I get flood ban message (~120 seconds). Whats causing the issue?
Also in viewer there is always a "Unknown from x.x.x.x
ort" user in lobby. Whats causing the issue?
-
10-04-2012, 16:40 #430
Hey ScP,
I think I've found a bug.
If i call TeamSpeak3_Node_Server::clientListDb() without any parameters i got only 25 entries from the database.
Expected Result: all entries from the database.
Btw. Is there any method available to filter the result of clientListDb() (I need only database id, unique identifier, last nickname)?
-
13-04-2012, 10:11 #431
-= TeamSpeak User =-
- Join Date
- Apr 2012
- Location
- Italy
- Posts
- 3
anyway there's no documentation about the first steps we should do to install and i hope you will report this gap.
i have the same problem,
ip web server added to the whitelist
query port forwarded
i don't know what is guest query group
my page /examples/config.php is set up with ts3 server ip, query-port, voice-port, serveradmin+querypsw
xampp php 5.3.8
when i try to access via web, the answer is:
Error 520: invalid loginname or passwordLast edited by fr33soul; 13-04-2012 at 10:31.
-
14-04-2012, 11:32 #432
-= TeamSpeak Servant =-
- Join Date
- Oct 2003
- Location
- Germany
- Posts
- 2,299
-
16-04-2012, 22:57 #433
-= TeamSpeak User =-
- Join Date
- Apr 2012
- Location
- Italy
- Posts
- 3
i'm trying to add the avatar to the /libraries/ts3/html/viewer.php in the function getCorpusTitle so when i will be onmouseover on a client, it will show me little <div> like a <title> with a small thumb of the avatar.. too hard for me to explore all the framework..Code:/** * Returns the HTML img tags which can be used to display the various icons for a * TeamSpeak_Node_Abstract object. * * @return string */ protected function getCorpusTitle() { if($this->currObj instanceof TeamSpeak3_Node_Server) { return "ID: " . $this->currObj->getId() . " | Clients: " . $this->currObj->clientCount() . "/" . $this->currObj["virtualserver_maxclients"] . " | Uptime: " . TeamSpeak3_Helper_Convert::seconds($this->currObj["virtualserver_uptime"]); } elseif($this->currObj instanceof TeamSpeak3_Node_Channel && !$this->currObj->isSpacer()) { return "ID: " . $this->currObj->getId() . " | Codec: " . TeamSpeak3_Helper_Convert::codec($this->currObj["channel_codec"]) . " | Quality: " . $this->currObj["channel_codec_quality"]; } elseif($this->currObj instanceof TeamSpeak3_Node_Client) { return "ID: " . $this->currObj->getId() . " | Version: " . TeamSpeak3_Helper_Convert::version($this->currObj["client_version"]) . " | Platform: " . $this->currObj["client_platform"]; } elseif($this->currObj instanceof TeamSpeak3_Node_Servergroup || $this->currObj instanceof TeamSpeak3_Node_Channelgroup) { return "ID: " . $this->currObj->getId() . " | Type: " . TeamSpeak3_Helper_Convert::groupType($this->currObj["type"]) . " (" . ($this->currObj["savedb"] ? "Permanent" : "Temporary") . ")"; } }
however, i suggest to add an "offline" output if the serverquery is down instead of php socket connection failed as usual.Last edited by fr33soul; 17-04-2012 at 08:40.
-
18-04-2012, 03:08 #434
-= TeamSpeak User =-
- Join Date
- Aug 2011
- Posts
- 14
Hi, im a framework noob and i have a question, which, in turn will probably help me answer a lot of other questions i have.
im trying to change a single server instance autostart property to '0' but cant seem to get it to work.
this is what i have so far:
the above i tried by server port, not ID, but doesnt work either, how can i do it via port and fix my autostart change as its not changing?Code:$ts3_ServerInstance = TeamSpeak3::factory("serverquery://" . $cfg["user"] . ":" . $cfg["pass"] . "@" . $cfg["host"] . ":" . $cfg["query"] . "?server_port=9987"); $ts3_VirtualServer["virtualserver_autostart"] = "0";Last edited by ukrai; 20-04-2012 at 01:17.
-
20-04-2012, 01:16 #435
-= TeamSpeak User =-
- Join Date
- Aug 2011
- Posts
- 14
Another quick question, how do i ignore serverid's that dont exist or are offline.
Im trying to run through an array of server id's from a customer database and ensure inactive customer servers are offline.
here is what i have:
this works fine as long as all id's in question are online and exist, as soon as it hits one that is offline or doesnt exist, the script stops, giving an error about server not being online but wont continue.Code:$ts3_ServerInstance = TeamSpeak3::factory("serverquery://" . $cfg["user"] . ":" . $cfg["pass"] . "@" . $cfg["host"] . ":" . $cfg["query"] . "/"); foreach ($serverIDs as $key => $value) { $ts3_ServerInstance->serverStop($value); }
How do i put in something like 'if server exists or online, then...'
help would be much appreciated.
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
TS3 PHP Framework Connection problems
By stheam in forum General QuestionsReplies: 1Last Post: 01-01-2013, 21:03 -
Extraction using the Framework
By HarryMW in forum ToolsReplies: 1Last Post: 03-08-2012, 19:04 -
TeamSpeak 3 PHP Framework
By danger89 in forum General QuestionsReplies: 3Last Post: 11-06-2012, 16:40 -
Teamspeak, PHP Framework?
By mario2027 in forum General QuestionsReplies: 1Last Post: 21-12-2010, 09:30 -
[solved] Problem with Ts3 und Ts3 Php Framework
By m3ntry in forum Bug ReportsReplies: 1Last Post: 14-10-2010, 05:55


Reply With Quote




