Moin.
Mein derzeitiges Script zeigt einige Informationen über die Instanzen an:
PHP
<?php
/**
* Server List Example
* -------------------
* There are several possibilities to get a list of virtual servers in a TeamSpeak 3 Server instance.
*
* The PHP 5 iterator interface is very useful for defining custom behaviour for looping over objects. Each
* TeamSpeak3_Node_Abstract object implements an iterator which allows you to walk through sub nodes.
*/
/* load framework library */
require_once("stats/libraries/TeamSpeak3/TeamSpeak3.php");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
--------------------------------<br><u>Live Stats</u>:<br>
<head>
<title>minimal stats</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body style="font-family: tahoma, arial, verdana, helvetica, sans-serif; font-size: 14px;">
<?php
try
{
/* connect to server and get TeamSpeak3_Node_Host object by URI */
$ts3_ServerInstance = TeamSpeak3::factory("serverquery://serveradmin:password@127.0.0.1:10011/");
/* access total number of running servers with ArrayAccess interface */
/* iterate through host and list virtual servers */
{
$ts3_info = $ts3_ServerInstance->getInfo(TRUE, TRUE);
echo "" .
"--------------------------------<br>\n" .
" Uptime: " . $ts3_info["instance_uptime"] . "<br>\n" .
" <b>" . $ts3_info["virtualservers_running_total"] . " Servers</b> currently <b>online</b>.<br>\n" .
" <b>" . $ts3_info["virtualservers_total_clients_online"] . " Clients</b> currently <b>online</b>.<br>\n" .
" <b>" . $ts3_info["connection_bytes_sent_total"] . " </b>Talkdata sent since uptime. <i>Holy cow, you guys talk much!</i><br>\n" .
" " . $ts3_info["connection_bandwidth_sent_last_second_total"] . " Bandwith sent last second.<br>\n" .
" " . $ts3_info["connection_bandwidth_received_last_second_total"] . " Bandwith received last second.<br>\n" .
"--------------------------------<br>\n" .
" " . $ts3_ServerInstance["virtualservers_total_maxclients"] . " Slots counted together.<br>\n" .
" " . $ts3_ServerInstance["virtualservers_total_channels_online"] . " Channels online.<br>\n" .
"--------------------------------<br>\n" .
"\n";
}
/* display runtime from adapter profiler */
echo "<p><b><small>";
}
catch(Exception $e)
{
echo "Error (ID " . $e->getCode() . ") <b>" . $e->getMessage() . "</b>";
}
?>
</body>
</html>
Alles anzeigen
So. Nun meine Frage: Gibts IRGEND eine Möglichkeit, die Zahl "Users online" zu speichern, immer wenn es als neuer Rekord erscheint.
Also 150 wenn online sind, sollten 150 in ne file geschrieben werden. wenn dann mal 190 sind, 190 logischerweiße.
Wsl. zu komplex oder?
Grüße