当前位置: 首页>>代码示例>>PHP>>正文


PHP TeamSpeak3::init方法代码示例

本文整理汇总了PHP中TeamSpeak3::init方法的典型用法代码示例。如果您正苦于以下问题:PHP TeamSpeak3::init方法的具体用法?PHP TeamSpeak3::init怎么用?PHP TeamSpeak3::init使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TeamSpeak3的用法示例。


在下文中一共展示了TeamSpeak3::init方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: 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

示例2: date_default_timezone_set

<?php 
date_default_timezone_set("Europe/Paris");
require_once "libraries/TeamSpeak3/TeamSpeak3.php";
TeamSpeak3::init();
header('Content-Type: text/html; charset=utf8');
$status = "offline";
$count = 0;
$max = 0;
try {
    $ts3 = TeamSpeak3::factory("serverquery://" . $ts3queryuser . ":" . $ts3querypassword . "@" . $ipteamspeak3 . ":" . $ts3queryport . "/?server_port=" . $portteamspeak3 . "&use_offline_as_virtual=1&no_query_clients=1");
    $status = $ts3->getProperty("virtualserver_status");
    $count = $ts3->getProperty("virtualserver_clientsonline") - $ts3->getProperty("virtualserver_queryclientsonline");
    $max = $ts3->getProperty("virtualserver_maxclients");
} catch (Exception $e) {
}
开发者ID:heros,项目名称:SamPRO-CMS,代码行数:15,代码来源:teamspeak_infos.php


注:本文中的TeamSpeak3::init方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。