本文整理汇总了PHP中TeamSpeak3类的典型用法代码示例。如果您正苦于以下问题:PHP TeamSpeak3类的具体用法?PHP TeamSpeak3怎么用?PHP TeamSpeak3使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TeamSpeak3类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: ts3_co
function ts3_co()
{
global $ts3_selected, $ts3_host;
$ts3_host = TeamSpeak3::factory("serverquery://213.246.55.19:10011/?nickname=MOGG");
$ts3_host->serverSelect(1);
return $ts3_selected = $ts3_host->serverGetSelected();
//$ts3_myid = $ts3_host->whoamiGet('client_id') ;
//$ts3_defaultchan = $ts3_host->whoamiGet('client_channel_id') ;
}
开发者ID:OlivierLamiraux,项目名称:mtgas,代码行数:9,代码来源:ts3.php
示例2: get_avatars
function get_avatars($ts3, $mysqlcon, $lang, $dbname, $slowmode, $jobid, $timezone)
{
$starttime = microtime(true);
$sqlmsg = '';
$sqlerr = 0;
$count = 0;
try {
usleep($slowmode);
$tsfilelist = $ts3->channelFileList($cid = "0", $cpw = "", $path = "/");
} catch (Exception $e) {
if ($e->getCode() != 1281) {
echo DateTime::createFromFormat('U.u', number_format(microtime(true), 6, '.', ''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "), "get_avatars 1:", $e->getCode(), ': ', "Error by getting Avatarlist: ", $e->getMessage(), "\n";
$sqlmsg .= $e->getCode() . ': ' . "Error by getting Avatarlist: " . $e->getMessage();
$sqlerr++;
}
}
$fsfilelist = opendir(substr(__DIR__, 0, -4) . 'avatars/');
while (false !== ($fsfile = readdir($fsfilelist))) {
if ($fsfile != '.' && $fsfile != '..') {
$fsfilelistarray[$fsfile] = filemtime(substr(__DIR__, 0, -4) . 'avatars/' . $fsfile);
}
}
if (isset($tsfilelist)) {
foreach ($tsfilelist as $tsfile) {
$fullfilename = '/' . $tsfile['name'];
$uuidasbase16 = substr($tsfile['name'], 7);
if (!isset($fsfilelistarray[$uuidasbase16 . '.png']) || $tsfile['datetime'] > $fsfilelistarray[$uuidasbase16 . '.png']) {
if (substr($tsfile['name'], 0, 7) == 'avatar_') {
try {
usleep($slowmode);
$avatar = $ts3->transferInitDownload($clientftfid = "5", $cid = "0", $name = $fullfilename, $cpw = "", $seekpos = 0);
$transfer = TeamSpeak3::factory("filetransfer://" . $avatar["host"] . ":" . $avatar["port"]);
$tsfile = $transfer->download($avatar["ftkey"], $avatar["size"]);
$avatarfilepath = substr(__DIR__, 0, -4) . 'avatars/' . $uuidasbase16 . '.png';
echo DateTime::createFromFormat('U.u', number_format(microtime(true), 6, '.', ''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "), "Download avatar: ", $fullfilename, "\n";
file_put_contents($avatarfilepath, $tsfile);
$count++;
} catch (Exception $e) {
echo DateTime::createFromFormat('U.u', number_format(microtime(true), 6, '.', ''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "), "get_avatars 2:", $e->getCode(), ': ', "Error by download Avatar: ", $e->getMessage(), "\n";
$sqlmsg .= $e->getCode() . ': ' . "Error by download Avatar: " . $e->getMessage();
$sqlerr++;
}
}
}
}
}
$buildtime = microtime(true) - $starttime;
if ($sqlerr == 0) {
if ($mysqlcon->exec("UPDATE {$dbname}.job_log SET status='0', runtime='{$buildtime}' WHERE id='{$jobid}'") === false) {
echo DateTime::createFromFormat('U.u', number_format(microtime(true), 6, '.', ''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "), "get_avatars 3:", print_r($mysqlcon->errorInfo()), "\n";
}
} else {
if ($mysqlcon->exec("UPDATE {$dbname}.job_log SET status='1', err_msg='{$sqlmsg}', runtime='{$buildtime}' WHERE id='{$jobid}'") === false) {
echo DateTime::createFromFormat('U.u', number_format(microtime(true), 6, '.', ''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "), "get_avatars 4:", print_r($mysqlcon->errorInfo()), "\n";
}
}
}
开发者ID:TS-N-net,项目名称:ranksystem_dev,代码行数:57,代码来源:get_avatars.php
示例3: __construct
function __construct()
{
try {
// $this->cfg = Tools::getConfig('tsconfig_dev');
$this->cfg = Tools::getConfig('tsconfig');
$this->ts3 = TeamSpeak3::factory("serverquery://{$this->cfg['user']}:{$this->cfg['pass']}@{$this->cfg['host']}:{$this->cfg['qPort']}/?server_port={$this->cfg['sPort']}&nickname={$this->cfg['nick']}");
} catch (Exception $e) {
Tools::Log('error', 'Error', array($e));
}
}
开发者ID:creativewild,项目名称:ts3Chan,代码行数:10,代码来源:TsAPI.php
示例4: __construct
/**
* @param integer $port
* @param string $user
* @param string $pass
*/
public function __construct($host, $port, $user, $pass, $timeout = 1)
{
$this->user = $user;
$this->pass = $pass;
try {
$uri = 'serverquery://' . $host . ':' . $port;
$uri .= '?timeout=' . $timeout . '&use_offline_as_virtual=1#no_query_clients';
$this->query = \TeamSpeak3::factory($uri);
$this->online = true;
} catch (\TeamSpeak3_Transport_Exception $e) {
$this->online = false;
}
}
开发者ID:Onneil,项目名称:dedipanel,代码行数:18,代码来源:QueryGateway.php
示例5: ts3connect
function ts3connect()
{
require_once 'libraries/TeamSpeak3/TeamSpeak3.php';
if (strlen(QUERYDISPLAYNAME) < 3) {
$extension = "";
} else {
$extension = '&nickname=' . urlencode(QUERYDISPLAYNAME);
}
try {
$ts3 = TeamSpeak3::factory('serverquery://' . QUERYUSER . ':' . QUERYPASS . '@' . IP . ':' . QUERYPORT . '?server_port=' . SERVERPORT . $extension);
} catch (TeamSpeak3_Exception $e) {
return $e;
}
return $ts3;
}
开发者ID:Multivit4min,项目名称:GroupAssigner,代码行数:15,代码来源:index.php
示例6: connect
function connect($ip, $qport, $port, $name, $pass, $display = "CPTBot")
{
$e = false;
$server = null;
try {
$server = TeamSpeak3::factory("serverquery://{$name}:{$pass}@{$ip}:{$qport}/?nickname={$display}&server_port={$port}");
} catch (Exception $exc) {
$e = true;
}
if ($e) {
say("Couldn't reach Server {$ip}.");
return null;
} else {
return new Server($server);
}
}
开发者ID:twyK,项目名称:CPTBot,代码行数:16,代码来源:exec.php
示例7: getData
public static function getData(JRegistry $params, stdClass $module)
{
if (!$params->get('server_host') || !$params->get('server_port') || !$params->get('query_port') || !$params->get('query_login') || !$params->get('query_password')) {
return JText::_('MOD_TEAMSPEAK3_BASIC_CONFIGURATION_MISSING');
}
$cache = JFactory::getCache('teamspeak3', 'output');
$cache->setCaching(1);
$cache->setLifeTime($params->get('cache_time', 5));
$query = array();
$query['server_port'] = $params->get('server_port');
$query['timeout'] = $params->get('connection_timeout', 10);
if ($params->get('no_query_clients', 1)) {
$query['no_query_clients'] = 1;
}
$query = http_build_query($query);
$url = 'serverquery://' . $params->get('query_login') . ':' . $params->get('query_password') . '@' . $params->get('server_host') . ':' . $params->get('query_port') . '/?' . $query;
$key = md5($url);
if (!($data = $cache->get($key))) {
try {
$ts3 = TeamSpeak3::factory($url);
$html = new TeamSpeak3_Viewer_Html_Joomla($params);
$html->loadCacheIcons();
$data = new stdClass();
$data->infos = $ts3->getInfo(true, true);
$data->infos['caching_timestamp'] = JFactory::getDate('now', 'UTC')->toSql();
if ($params->get('channel_id')) {
try {
$channel = $ts3->channelGetById($params->get('channel_id'));
} catch (TeamSpeak3_Exception $e) {
return $e->getMessage() . ' (' . $e->getCode() . ')';
}
$data->viewer = $channel->getViewer($html);
} else {
$data->viewer = $ts3->getViewer($html);
}
$html->storeCacheIcons();
$data->title = $html->getModuleTitle();
$cache->store($data, $key);
} catch (TeamSpeak3_Exception $e) {
return $e->getMessage() . ' (' . $e->getCode() . ')';
}
}
if ($params->get('module_title')) {
$module->title = $data->title;
}
return $data;
}
开发者ID:b2un0,项目名称:joomla-module-teamspeak-3,代码行数:47,代码来源:helper.php
示例8: checkConnection
function checkConnection($ip, $qport, $sport, $user, $pass, $nick)
{
require_once 'libraries/TeamSpeak3/TeamSpeak3.php';
if (strlen($nick) < 3) {
$extension = '';
} else {
$extension = '&nickname=' . urlencode($nick);
}
try {
$ts3 = TeamSpeak3::factory('serverquery://' . $user . ':' . $pass . '@' . $ip . ':' . $qport . '?server_port=' . $sport . $extension);
$ts3->clientList();
$ts3->getInfo();
} catch (TeamSpeak3_Exception $e) {
return '<b>TS3 Error:</b> ' . $e->getMessage();
}
return true;
}
开发者ID:Multivit4min,项目名称:GroupAssigner,代码行数:17,代码来源:admin.php
示例9: online_users
function online_users()
{
if ($this->modSettings["tea_ts_warnm"] == 0 && $this->modSettings["tea_ts_kickm"] == 0) {
return;
}
require_once $this->sourcedir . '/TS3_Class/TeamSpeak3.php';
$tslv = TeamSpeak3::LIB_VERSION;
TeamSpeak3::init();
try {
$ts3 = TeamSpeak3::factory("serverquery://" . $this->modSettings["tea_ts_username"] . ":" . $this->modSettings["tea_ts_password"] . "@" . $this->modSettings["tea_ts_host"] . ":" . $this->modSettings["tea_ts_qport"] . "/?server_port=" . $this->modSettings["tea_ts_port"] . "&blocking=0");
$clist = $ts3->clientList();
foreach ($clist as $c) {
if ($c->client_type == 0) {
$clid = (string) $c->client_unique_identifier;
$cnick = (string) $c->client_nickname;
$smf = $this->smcFunc['db_query']('', "SELECT id, tsid, dbid, name, warnstart, lastwarn FROM {db_prefix}tea_ts_users WHERE tsid = '" . $clid . "'");
$smf = $this->tea->select($smf);
if (!empty($smf)) {
$warned = FALSE;
$kick = FALSE;
$time = time() - $this->modSettings["tea_ts_warnm"] * 60;
if ($smf[0][5] < $time) {
$char = $smf[0][3];
// $chars = $this -> tea -> get_all_chars($smf[0][0]);
$name = $this->format_ts_name($smf[0][0], $char);
// $aid = NULL;
if (!empty($name)) {
// foreach($chars as $i => $ch)
// {
// if($ch[0] == $char)
// $aid = $i;
// }
if ($name != $cnick) {
if ($this->modSettings["tea_ts_kickm"] != 0 && $smf[0][4] != 0 && $smf[0][4] < time() - $this->modSettings["tea_ts_kickm"] * 60) {
$c->kick(TeamSpeak3::KICK_SERVER, 'Incorrect Nickname, Expecting: ' . $name);
$this->smcFunc['db_query']('', "UPDATE {db_prefix}tea_ts_users SET lastwarn = 0, warnstart = 0 WHERE tsid = '" . $clid . "'");
} elseif ($this->modSettings["tea_ts_warnm"] != 0) {
$c->poke('Incorrect Nickname, Expecting: ' . $name);
$warned = TRUE;
}
} else {
$this->smcFunc['db_query']('', "UPDATE {db_prefix}tea_ts_users SET lastwarn = 0, warnstart = 0 WHERE tsid = '" . $clid . "'");
}
} else {
$c->message('Error Unable to Find Character');
$warned = TRUE;
}
}
if ($warned) {
$sql = '';
if ($smf[0][4] == 0) {
$sql = ', warnstart = ' . time();
}
$this->smcFunc['db_query']('', "UPDATE {db_prefix}tea_ts_users SET lastwarn = " . time() . $sql . " WHERE tsid = '" . $clid . "'");
}
} else {
$c->message('Error: SMF Account not Found, Please Register on Forum and use Temars EVE API mod to link Teamspeak to forum');
}
}
}
} catch (Exception $e) {
die($e->getMessage());
$_SESSION['tea_ts_error'][] = $e->getMessage();
}
}
开发者ID:bgame-hunter,项目名称:temars-eve-api,代码行数:65,代码来源:TEA_TS.php
示例10: iconUpload
/**
* Uploads a given icon file content to the server and returns the ID of the icon.
*
* @param string $data
* @return integer
*/
public function iconUpload($data)
{
$crc = crc32($data);
$size = strlen($data);
$upload = $this->transferInitUpload(rand(0x0, 0xffff), 0, "/icon_" . $crc, $size);
$transfer = TeamSpeak3::factory("filetransfer://" . $upload["host"] . ":" . $upload["port"]);
$transfer->upload($upload["ftkey"], $upload["seekpos"], $data);
return $crc;
}
开发者ID:TS-N-net,项目名称:ranksystem_dev,代码行数:15,代码来源:Server.php
示例11: function_exists
$extension_openssl_text = $extension_openssl ? "Yes" : "No";
$extension_simplexml = function_exists('simplexml_load_string');
$extension_simplexml_color = $extension_simplexml ? "green" : "red";
$extension_simplexml_text = $extension_simplexml ? "Yes" : "No";
$mod_automod = version_compare($config['automod_version'], '1.0.2', '>=') ? true : false;
$mod_automod_color = $mod_automod ? "green" : "red";
$mod_automod_text = $mod_automod ? "Yes" : "No";
// TeamSpeak stuff
try {
$nickname = "TeamSpeakDebugGuy";
$testMessage = "Awesome, TeamSpeak integration is working!";
$errorCode = 0;
$errorMsg = "No errors found!";
$teamspeak_UID_color = !empty($user->data['eveapi_ts']) ? "green" : "red";
$teamspeak_UID_text = !empty($user->data['eveapi_ts']) ? $user->data['eveapi_ts'] : "Unknown";
$ts3_VirtualServer = TeamSpeak3::factory("serverquery://" . $config["eveapi_ts_username"] . ":" . $config["eveapi_ts_password"] . "@" . $config["eveapi_ts_ip"] . ":" . $config["eveapi_ts_port_query"] . "/?server_port=" . $config["eveapi_ts_port_server"] . "&nickname=" . $nickname);
$ts3_VirtualServer->clientGetByUid($user->data['eveapi_ts'])->poke($testMessage);
} catch (Exception $e) {
$errorCode = $e->getCode();
$errorMsg = $e->getMessage();
}
$error_color = $errorCode == 0 ? "green" : "red";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" xml:lang="en-gb" lang="en-gb">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="Content-Style-Type" content="text/css">
<meta http-equiv="Content-Language" content="en-gb">
开发者ID:shibdib,项目名称:API-Registration-Mod-Revisited,代码行数:30,代码来源:eveapi_check.php
示例12: TeamSpeak3_Viewer_Html
<?php
// load framework files
require_once "libraries/TeamSpeak3/TeamSpeak3.php";
// connect to local server, authenticate and spawn an object for the virtual server on port 9987
$ts3_VirtualServer = TeamSpeak3::factory("serverquery://serveradmin:[email protected]:10011/?server_port=9987");
// build and display HTML treeview using custom image paths (remote icons will be embedded using data URI sheme)
#echo $ts3_VirtualServer->getViewer(new TeamSpeak3_Viewer_Html("images/icons/", "images/flags/", "data:image"));
echo $ts3_VirtualServer->getViewer(new TeamSpeak3_Viewer_Html());
开发者ID:ArcaneChaos,项目名称:boss-member-manager,代码行数:9,代码来源:ts3viewer.php
示例13: header
* along with this program. If not, see <http://www.gnu.org/licenses/>
*/
header("Content-type: text/xml; charset=utf-8");
// Errors destroy the xmlvalidity
//error_reporting(0);
require_once "include/app.config.php";
require_once "../include/calladmin_helpers.php";
require_once "include/TeamSpeak3/TeamSpeak3.php";
$helpers = new CallAdmin_Helpers();
// Key set and no key given or key is wrong
if (!isset($_GET['key']) || !$helpers->keyToServerKeys($access_keys, $_GET['key'])) {
$helpers->printXmlError("APP_AUTH_FAILURE", "CallAdmin_Ts3");
}
$ts3 = new TeamSpeak3();
try {
$ts3_VirtualServer = TeamSpeak3::factory("serverquery://" . $user . ":" . $password . "@" . $host . ":" . $queryport . "/?server_port=" . $port);
$count = 0;
$uid = "";
//$name = "";
foreach ($ts3_VirtualServer->clientList() as $ts3_Client) {
$uid = (string) $ts3_Client['client_unique_identifier'];
//$name = (string)$ts3_Client['client_nickname'];
// Is listed as admin, add him to the count
if (in_array($uid, $access_keys[$_GET['key']])) {
$count++;
}
}
} catch (TeamSpeak3_Adapter_ServerQuery_Exception $e) {
// Nope
$helpers->printXmlError($e->getMessage(), "CallAdmin_Ts3");
}
开发者ID:GentSynthax,项目名称:CallAdmin,代码行数:31,代码来源:onlinecount.php
示例14: array
<?php
try {
require_once "../libraries/TeamSpeak3/TeamSpeak3.php";
include '../data/config.php';
echo "Conectando al servidor TeamSpeak</br>";
$connect = "serverquery://" . $USER_QUERY . ":" . $PASS_QUERY . "@" . $HOST_QUERY . ":" . $PORT_QUERY . "/?server_port=" . $SERVER_PORT . "";
$ts3_VirtualServer = TeamSpeak3::factory($connect);
// Conseguimos array con los grupos
$server_groups = $ts3_VirtualServer->serverGroupList();
$servergroups = array();
foreach ($server_groups as $group) {
if ($group->type != 1) {
continue;
}
if (in_array($group["sortid"], $SID_GROUP)) {
$servergroups[] = array('name' => (string) $group, 'id' => $group->sgid, 'type' => $group->type, 'icon' => $group->iconDownload());
}
}
echo "Iniciando Descarga de iconos...</br>";
// Iteramos por grupo para guardar a archivo
foreach ($servergroups as $group) {
// ya estaba descargada la wea xD
file_put_contents("./icons/" . $group['id'] . ".png", $group['icon']);
echo "Archivo iconos/icons/" . $group['id'] . ".png" . " Creado para el grupo " . $group['name'] . "<br>";
}
} catch (Exception $e) {
if ($DEBUG == True) {
//print_r($e);
echo "[DEBUG] Ha ocurrido un error inesperado <br>";
echo "[DEBUG] Mensaje de error DEBUG: " . $e->getMessage() . "<br>";
开发者ID:qeekus,项目名称:TS3IconManager,代码行数:31,代码来源:geticonos.php
示例15: avatarDownload
/**
* Downloads and returns the clients avatar file content.
*
* @return TeamSpeak3_Helper_String
*/
public function avatarDownload()
{
if ($this["client_flag_avatar"] == 0) {
return;
}
$download = $this->getParent()->transferInitDownload($this->getId(), 0, $this->avatarGetName());
$transfer = TeamSpeak3::factory("filetransfer://" . $this->getParent()->getAdapterHost() . ":" . $download["port"]);
return $transfer->download($download["ftkey"], $download["size"]);
}
开发者ID:ECP-Black,项目名称:ECP,代码行数:14,代码来源:Client.php
示例16: header
require 'app/Infos.php';
require 'app/Keys.php';
require 'inc/db.php';
if (!isset($_SESSION['auth'])) {
header('Location: login.php');
exit;
}
$verify = new \App\Verify($cnx);
$verify->checkIndex($_SESSION['auth']['pseudo']);
$infos = new \App\Infos($cnx);
$port = $infos->getPort($_SESSION['auth']['pseudo']);
try {
/*
CHANGE THIS LINE WITH YOUR TS3 QUERY INFOS
*/
$ts3_VirtualServer = TeamSpeak3::factory("serverquery://serveradmin:[email protected]:10011/?server_port=" . $port);
} catch (Exception $e) {
$_SESSION['flash']['danger'] = "Error your TS3 server is offline please contact admin to solve this error";
$offline = true;
header('Location: offline.php');
exit;
}
$keys = new \App\Keys($ts3_VirtualServer);
$map = $ts3_VirtualServer->getViewer(new TeamSpeak3_Viewer_Html("images/viewer/", "images/countryflags/", "data:image"));
if (isset($_GET) && !empty($_GET['key'])) {
$keys->generate($_GET['key']);
}
?>
<body class="hold-transition skin-red layout-boxed">
<div class="wrapper">
开发者ID:jimmy57000,项目名称:0TS3-CMS,代码行数:31,代码来源:index.php
示例17: main
function main($id, $mode)
{
global $config, $db, $user, $auth, $template, $phpbb_root_path, $phpEx;
$submit = !empty($_POST['submit']) ? true : false;
$error = $data = array();
$s_hidden_fields = '';
$user->add_lang('mods/info_acp_eveapi');
switch ($mode) {
case 'register_account':
$this->tpl_name = 'ucp_eveapi_account';
$this->page_title = 'UCP_EVEAPI_ACCOUNT';
$data = array('username' => utf8_normalize_nfc(request_var('username', $user->data['username'], true)), 'eveapi_keyid' => request_var('eveapi_keyid', $user->data['eveapi_keyid'], true), 'eveapi_vcode' => request_var('eveapi_vcode', $user->data['eveapi_vcode'], true));
if ($submit) {
$check_ary = array('eveapi_keyid' => array(array('string', false, 1, 15)), 'eveapi_vcode' => array(array('string', false, 64, 64)));
if ($auth->acl_get('u_chgname') && $config['allow_namechange']) {
$check_ary['username'] = array(array('string', false, $config['min_name_chars'], $config['max_name_chars']), array('username'));
}
$error = validate_data($data, $check_ary);
if (!sizeof($error) && $config['eveapi_validation']) {
if (!$auth->acl_get('u_chgname') || !$config['allow_namechange']) {
$data['username'] = $user->data['username'];
}
$eveapi_teamSpeakGroups = array();
$characterInfo = eveapi_checkThisCharacter($data['eveapi_keyid'], $data['eveapi_vcode'], $data['username']);
if (empty($characterInfo["error"])) {
if (!empty($characterInfo["forumGroups"]) || empty($characterInfo["forumGroups"]) && $config['eveapi_nonmember']) {
$eveapi_forumGroups = $characterInfo["forumGroups"];
$eveapi_teamSpeakGroups = $characterInfo["TSGroups"];
$extraGroups = eveapi_setForumGroups($user->data['user_id'], $eveapi_forumGroups, $data['username']);
if ($config['eveapi_jabber_masterswitch']) {
if ($config['eveapi_ejabber_switch']) {
eveapi_setJabberAccess($user->data['user_id'], $characterInfo['jabber'], $extraGroups['jabber'], $data['username']);
}
if ($config['eveapi_openfire_switch']) {
eveapi_setOpenFireAccess($user->data['user_id'], $characterInfo['openfire'], $extraGroups['openfire'], $data['username']);
}
}
} else {
$error[] = 'This character is not permitted to have an account on this forum.';
}
} else {
$error = array_merge($error, $characterInfo["error"]);
}
}
$sql_ary = array('user_character_id' => isset($characterInfo["info"]["characterId"]) ? (int) $characterInfo["info"]["characterId"] : 0, 'username' => $auth->acl_get('u_chgname') && $config['allow_namechange'] ? $data['username'] : $user->data['username'], 'username_clean' => $auth->acl_get('u_chgname') && $config['allow_namechange'] ? utf8_clean_string($data['username']) : $user->data['username_clean'], 'eveapi_keyid' => $data['eveapi_keyid'], 'eveapi_vcode' => $data['eveapi_vcode']);
if ($auth->acl_get('u_chgname') && $config['allow_namechange'] && $data['username'] != $user->data['username']) {
add_log('user', $user->data['user_id'], 'LOG_USER_UPDATE_NAME', $user->data['username'], $data['username']);
}
if ($data['eveapi_keyid'] != $user->data['eveapi_keyid'] || $data['eveapi_vcode'] != $user->data['eveapi_vcode']) {
add_log('user', $user->data['user_id'], 'User has updated his/her EVE API information.', $user->data['username'], $data['eveapi_keyid'] . " -> " . $data['eveapi_vcode']);
}
$message = 'EVEAPI_UPDATED';
if (sizeof($sql_ary)) {
$sql = 'UPDATE ' . USERS_TABLE . '
SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
WHERE user_id = ' . $user->data['user_id'];
$db->sql_query($sql);
}
}
$template->assign_vars(array('ERROR' => sizeof($error) ? implode('<br />', $error) : '', 'USERNAME' => $data['username'], 'EVEAPI_KEYID' => $data['eveapi_keyid'], 'EVEAPI_VCODE' => $data['eveapi_vcode'], 'EVEAPI_ACCESSMASK' => eveapi_getAccessMask(), 'L_USERNAME_EXPLAIN' => sprintf($user->lang[$config['allow_name_chars'] . '_EXPLAIN'], $config['min_name_chars'], $config['max_name_chars']), 'L_TITLE' => $user->lang['UCP_EVEAPI_ACCOUNT'], 'S_EVEAPI_VALIDATE' => $config['eveapi_validation'] ? true : false, 'S_CHANGE_USERNAME' => $config['allow_namechange'] && $auth->acl_get('u_chgname') ? true : false));
break;
case 'register_jabber':
$this->tpl_name = 'ucp_eveapi_jabber';
$this->page_title = 'UCP_EVEAPI_JABBER';
if (!$config['eveapi_openfire_switch'] && !$config['eveapi_jabber_masterswitch'] || empty($user->data["eveapi_keyid"]) || empty($user->data["eveapi_vcode"])) {
$template->assign_vars(array('L_TITLE' => $user->lang['UCP_EVEAPI_JABBER'], 'L_DISABLED' => $user->lang['EVEAPI_JABBER_DISABLED']));
break;
}
if ($submit) {
$characterInfo = eveapi_checkThisCharacter($user->data['eveapi_keyid'], $user->data['eveapi_vcode'], $user->data['username']);
if (empty($characterInfo["error"]) && (!empty($characterInfo["forumGroups"]) || empty($characterInfo["forumGroups"]) && $config['eveapi_nonmember'])) {
$eveapi_forumGroups = $characterInfo["forumGroups"];
$extraGroups = eveapi_setForumGroups($user->data['user_id'], $eveapi_forumGroups, $user->data['username']);
$password = eveapi_randomString(8);
$result = eveapi_setOpenFireAccess($user->data['user_id'], $characterInfo['openfire'], $extraGroups['openfire'], $user->data['username'], $password);
if ($result) {
$user->data['user_jabber_password'] = $password;
} else {
$error[] = $user->lang['JABBER_REGISTRATION_FAILED'];
}
}
}
$clean_username = str_replace(array(" ", "'"), array("_", "_"), $user->data['username']);
$template->assign_vars(array('ERROR' => sizeof($error) ? implode('<br />', $error) : '', 'JABBER_USERNAME' => $clean_username, 'JABBER_PASSWORD' => $user->data['user_jabber_password'], 'JABBER_HOST' => 'almostawesome.org', 'L_TITLE' => $user->lang['UCP_EVEAPI_JABBER'], 'L_JABBER' => $user->lang['EVEAPI_JABBER_REGISTER'], 'L_JABBER_EXPLAIN' => $user->lang['EVEAPI_JABBER_EXPLAIN'], 'L_JABBER_USERNAME' => $user->lang['EVEAPI_JABBER_USERNAME'], 'L_JABBER_PASSWORD' => $user->lang['EVEAPI_JABBER_PASSWORD'], 'L_JABBER_HOST' => $user->lang['EVEAPI_JABBER_HOST'], 'L_CHANGE_REGISTER' => empty($user->data['user_jabber_password']) ? $user->lang['REGISTER'] : $user->lang['EVEAPI_JABBER_CHANGE_PASSWORD']));
break;
case 'register_ts':
$this->tpl_name = 'ucp_eveapi_ts';
$this->page_title = 'UCP_EVEAPI_TS';
if (!$config['eveapi_ts_masterswitch']) {
$template->assign_vars(array('L_TITLE' => $user->lang['UCP_EVEAPI_TS'], 'L_DISABLED' => $user->lang['EVEAPI_TEAMSPEAK_DISABLED']));
break;
}
if ($submit) {
try {
$nickname = $config['eveapi_ts_nickname'];
if (eveapi_validateMixedalphanumeric($nickname) != 1) {
$nickname = "Cyerus";
}
$ts3_VirtualServer = TeamSpeak3::factory("serverquery://" . $config["eveapi_ts_username"] . ":" . $config["eveapi_ts_password"] . "@" . $config["eveapi_ts_ip"] . ":" . $config["eveapi_ts_port_query"] . "/?server_port=" . $config["eveapi_ts_port_server"] . "&nickname=" . $nickname);
} catch (Exception $e) {
//.........这里部分代码省略.........
开发者ID:Covert-Inferno,项目名称:eve_api_phpbb,代码行数:101,代码来源:eveapi.php
示例18: error_reporting
<?php
require_once "TeamSpeak3.php";
include 'config.php';
error_reporting(0);
$ChannelName = $_POST['name'];
$idUnica = $_POST['idts'];
if (!$ChannelName || !$idUnica) {
echo "El nombre del channel y la ID unica tienen que estar";
exit;
}
$ts3_VirtualServer = TeamSpeak3::factory("serverquery://" . $UserAdmin . ":" . $PWQuery . "@" . $IP_TS . ":" . $PuertoQuery . "/?server_port=" . $PuertoTS . "");
$ListaDeChannels = $ts3_VirtualServer->request("channellist")->toString();
if (strpos($ListaDeChannels, $ChannelName)) {
echo "El nombre del channel esta en uso, utiliza otro";
exit;
}
$clID = $ts3_VirtualServer->clientGetByUid($idUnica);
$top_cid = $ts3_VirtualServer->channelCreate(array("channel_name" => $ChannelName, "channel_codec" => TeamSpeak3::CODEC_SPEEX_WIDEBAND, "channel_flag_permanent" => TRUE));
$clID = $ts3_VirtualServer->clientGetByUid($idUnica);
$infoCliente = $ts3_VirtualServer->execute("clientgetnamefromuid", array("cluid" => $idUnica))->toList();
$cldbid = strval($infoCliente['cldbid']);
$ts3_VirtualServer->execute("clientmove", array("clid" => $clID, "cid" => $top_cid));
$ts3_VirtualServer->execute("setclientchannelgroup", array("cldbid" => $cldbid, "cid" => $top_cid, "cgid" => '5'));
echo "El channel se creo correctamente.";
开发者ID:brai4u,项目名称:teamspeak-3-channels-create-web,代码行数:25,代码来源:crear.php
示例19: microtime
<?php
$starttime = microtime(true);
require_once 'config.php';
require_once 'lang.php';
require_once 'ts3_lib/TeamSpeak3.php';
try {
$ts3_ServerInstance = TeamSpeak3::factory("serverquery://" . $cfg["user"] . ":" . $cfg["pass"] . "@" . $cfg["host"] . ":" . $cfg["query"] . "/");
$ts3_VirtualServer = TeamSpeak3::factory("serverquery://" . $cfg["user"] . ":" . $cfg["pass"] . "@" . $cfg["host"] . ":" . $cfg["query"] . "/?server_port=" . $cfg["voice"]);
require_once 'mysql_connect.php';
try {
$ts3_VirtualServer->selfUpdate(array('client_nickname' => $queryname));
} catch (Exception $e) {
try {
$ts3_VirtualServer->selfUpdate(array('client_nickname' => $queryname2));
} catch (Exception $e) {
echo $lang['error'] . $e->getCode() . ': ' . $e->getMessage();
}
}
$todaydate = time();
$icontime = $todaydate - $warntime;
$tschanarr = $ts3_VirtualServer->channelList();
foreach ($tschanarr as $channel) {
$tscid[] = $channel['cid'];
}
if ($deleteicons == 1) {
echo $lang['hldelicon'] . PHP_EOL;
$count = 0;
foreach ($tschanarr as $channel) {
$channelid = $channel['cid'];
$checkicon = $ts3_VirtualServer->channelPermList($channelid, $permsid = FALSE);
开发者ID:externo6,项目名称:ChannelDeleter,代码行数:31,代码来源:crawl_cli.php
示例20: array
\==========================================/
*/
require_once "libraries/TeamSpeak3/TeamSpeak3.php";
try {
// هنا الاتصال بالسيرفر وكذا عرفت
$config = array();
$config['teamspeakip'] = 'localhost';
$config['QueryName'] = 'serveradmin';
$config['QueryPass'] = '';
$config['QueryPort'] = '';
$config['PortServer'] = '';
$config['GroupIDAdmin'] = '';
$config['GroupIDactivated'] = '';
$config['GroupIDnotactivated'] = '';
$ts3_VirtualServer = TeamSpeak3::factory("serverquery://" . $config['QueryName'] . ":" . $config['QueryPass'] . "@" . $config['teamspeakip'] . ":" . $config['QueryPort'] . "/?server_port=" . $config['PortServer'] . "");
// التعرف التلقائي
foreach ($ts3_VirtualServer->clientList() as $cl) {
if ($cl->getProperty('connection_client_ip') == $_SERVER['REMOTE_ADDR']) {
header('Content-Type: image/png');
// هذه نستعملها للتجارب في المتصفح نصيحة شيلها :)
header('refresh: 3; url=');
// نهاية الي تشيلة
$_SESSION['ggids'] = explode(",", $cl["client_servergroups"]);
if (in_array($config['GroupIDnotactivated'], $_SESSION['ggids'])) {
$image_file = 'banner_notactivated.png';
} else {
if (in_array($config['GroupIDactivated'], $_SESSION['ggids'])) {
$image_file = 'banner_activated.png';
} else {
if (in_array($config['GroupIDAdmin'], $_SESSION['ggids'])) {
开发者ID:warningman,项目名称:TS-ISLAM,代码行数:30,代码来源:banner.php
注:本文中的TeamSpeak3类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论