• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP TeamSpeak3_Helper_Signal类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: __construct

 /**
  * The TeamSpeak3_Exception constructor.
  *
  * @param  string  $mesg
  * @param  integer $code
  * @return TeamSpeak3_Exception
  */
 public function __construct($mesg, $code = 0x0)
 {
     parent::__construct($mesg, $code);
     if (array_key_exists((int) $code, self::$messages)) {
         $this->message = $this->prepareCustomMessage(self::$messages[intval($code)]);
     }
     TeamSpeak3_Helper_Signal::getInstance()->emit("errorException", $this);
 }
开发者ID:st-gc,项目名称:teamspeak-php-framework,代码行数:15,代码来源:Exception.php


示例2: resolve

 /**
  * Queries the TSDNS server for a specified virtual hostname and returns the result.
  *
  * @param  string $tsdns
  * @throws TeamSpeak3_Adapter_TSDNS_Exception
  * @return TeamSpeak3_Helper_String
  */
 public function resolve($tsdns)
 {
     $this->getTransport()->sendLine($tsdns);
     $repl = $this->getTransport()->readLine();
     $this->getTransport()->disconnect();
     if ($repl->section(":", 0)->toInt() == 404) {
         throw new TeamSpeak3_Adapter_TSDNS_Exception("unable to resolve TSDNS hostname (" . $tsdns . ")");
     }
     TeamSpeak3_Helper_Signal::getInstance()->emit("tsdnsResolved", $tsdns, $repl);
     return $repl;
 }
开发者ID:b2un0,项目名称:joomla-module-teamspeak-3,代码行数:18,代码来源:TSDNS.php


示例3: syn

 /**
  * Connects the TeamSpeak3_Transport_Abstract object and performs initial actions on the remote
  * server.
  *
  * @return void
  */
 public function syn()
 {
     if (!isset($this->options["host"]) || empty($this->options["host"])) {
         $this->options["host"] = $this->default_host;
     }
     if (!isset($this->options["port"]) || empty($this->options["port"])) {
         $this->options["port"] = $this->default_port;
     }
     $this->initTransport($this->options, "TeamSpeak3_Transport_UDP");
     $this->transport->setAdapter($this);
     TeamSpeak3_Helper_Profiler::init(spl_object_hash($this));
     TeamSpeak3_Helper_Signal::getInstance()->emit("blacklistConnected", $this);
 }
开发者ID:bgame-hunter,项目名称:temars-eve-api,代码行数:19,代码来源:Blacklist.php


示例4: __construct

 /**
  * Creates a new TeamSpeak3_Adapter_ServerQuery_Event object.
  *
  * @param  TeamSpeak3_Helper_String $evt
  * @param  TeamSpeak3_Node_Host     $con
  * @throws TeamSpeak3_Adapter_Exception
  * @return TeamSpeak3_Adapter_ServerQuery_Event
  */
 public function __construct(TeamSpeak3_Helper_String $evt, TeamSpeak3_Node_Host $con = null)
 {
     if (!$evt->startsWith(TeamSpeak3::EVENT)) {
         throw new TeamSpeak3_Adapter_Exception("invalid notification event format");
     }
     list($type, $data) = $evt->split(TeamSpeak3::SEPARATOR_CELL, 2);
     if (empty($data)) {
         throw new TeamSpeak3_Adapter_Exception("invalid notification event data");
     }
     $fake = new TeamSpeak3_Helper_String(TeamSpeak3::ERROR . TeamSpeak3::SEPARATOR_CELL . "id" . TeamSpeak3::SEPARATOR_PAIR . 0 . TeamSpeak3::SEPARATOR_CELL . "msg" . TeamSpeak3::SEPARATOR_PAIR . "ok");
     $repl = new TeamSpeak3_Adapter_ServerQuery_Reply(array($data, $fake), $type);
     $this->type = $type->substr(strlen(TeamSpeak3::EVENT));
     $this->data = $repl->toList();
     $this->mesg = $data;
     TeamSpeak3_Helper_Signal::getInstance()->emit("notifyEvent", $this, $con);
     TeamSpeak3_Helper_Signal::getInstance()->emit("notify" . ucfirst($this->type), $this, $con);
 }
开发者ID:st-gc,项目名称:teamspeak-php-framework,代码行数:25,代码来源:Event.php


示例5: syn

 /**
  * Connects the TeamSpeak3_Transport_Abstract object and performs initial actions on the remote
  * server.
  *
  * @throws TeamSpeak3_Adapter_Update_Exception
  * @return void
  */
 public function syn()
 {
     if (!isset($this->options["host"]) || empty($this->options["host"])) {
         $this->options["host"] = $this->default_host;
     }
     if (!isset($this->options["port"]) || empty($this->options["port"])) {
         $this->options["port"] = $this->default_port;
     }
     $this->initTransport($this->options, "TeamSpeak3_Transport_UDP");
     $this->transport->setAdapter($this);
     TeamSpeak3_Helper_Profiler::init(spl_object_hash($this));
     $this->getTransport()->send(TeamSpeak3_Helper_String::fromHex(32));
     if (!preg_match_all("/,?(\\d+),?/", $this->getTransport()->read(32), $matches) || !isset($matches[1])) {
         throw new TeamSpeak3_Adapter_Update_Exception("invalid reply from the server");
     }
     $this->build_numbers = $matches[1];
     TeamSpeak3_Helper_Signal::getInstance()->emit("updateConnected", $this);
 }
开发者ID:bgame-hunter,项目名称:temars-eve-api,代码行数:25,代码来源:Update.php


示例6: privilegeKeyCreate

 /**
  * Creates a new privilege key (token) and returns the key.
  *
  * @param  integer $type
  * @param  integer $id1
  * @param  integer $id2
  * @param  string  $description
  * @param  string  $customset
  * @return TeamSpeak3_Helper_String
  */
 public function privilegeKeyCreate($type = TeamSpeak3::TOKEN_SERVERGROUP, $id1, $id2 = 0, $description = null, $customset = null)
 {
     $token = $this->execute("privilegekeyadd", array("tokentype" => $type, "tokenid1" => $id1, "tokenid2" => $id2, "tokendescription" => $description, "tokencustomset" => $customset))->toList();
     TeamSpeak3_Helper_Signal::getInstance()->emit("notifyTokencreated", $this, $token["token"]);
     return $token["token"];
 }
开发者ID:TS-N-net,项目名称:ranksystem_dev,代码行数:16,代码来源:Server.php


示例7: send

 /**
  * Writes data to the stream.
  *
  * @param  string $data
  * @return void
  */
 public function send($data)
 {
     $this->connect();
     @stream_socket_sendto($this->stream, $data);
     TeamSpeak3_Helper_Signal::getInstance()->emit(strtolower($this->getAdapterType()) . "DataSend", $data);
 }
开发者ID:joelsantosjunior,项目名称:wotdb,代码行数:12,代码来源:UDP.php


示例8: waitForReadyRead

 /**
  * Blocks a stream until data is available for reading if the stream is connected
  * in non-blocking mode.
  *
  * @param  integer $time
  * @return void
  */
 protected function waitForReadyRead($time = 0)
 {
     if (!$this->isConnected() || $this->config["blocking"]) {
         return;
     }
     do {
         $read = array($this->stream);
         $null = null;
         if ($time) {
             TeamSpeak3_Helper_Signal::getInstance()->emit(strtolower($this->getAdapterType()) . "WaitTimeout", $time, $this->getAdapter());
         }
         $time = $time + $this->config["timeout"];
     } while (@stream_select($read, $null, $null, $this->config["timeout"]) == 0);
 }
开发者ID:bgame-hunter,项目名称:temars-eve-api,代码行数:21,代码来源:Abstract.php


示例9: download

 /**
  * Returns the content of a downloaded file as a TeamSpeak3_Helper_String object.
  *
  * @param  string  $ftkey
  * @param  integer $size
  * @param  boolean $passthru
  * @throws TeamSpeak3_Adapter_Exception
  * @return TeamSpeak3_Helper_String
  */
 public function download($ftkey, $size, $passthru = FALSE)
 {
     $this->init($ftkey);
     if ($passthru) {
         return $this->passthru($size);
     }
     $buff = new TeamSpeak3_Helper_String("");
     $size = intval($size);
     $pack = 4096;
     TeamSpeak3_Helper_Signal::getInstance()->emit("filetransferDownloadStarted", $ftkey, count($buff), $size);
     for ($seek = 0; $seek < $size;) {
         $rest = $size - $seek;
         $pack = $rest < $pack ? $rest : $pack;
         $data = $this->getTransport()->read($rest < $pack ? $rest : $pack);
         $seek = $seek + $pack;
         $buff->append($data);
         TeamSpeak3_Helper_Signal::getInstance()->emit("filetransferDownloadProgress", $ftkey, count($buff), $size);
     }
     $this->getProfiler()->stop();
     TeamSpeak3_Helper_Signal::getInstance()->emit("filetransferDownloadFinished", $ftkey, count($buff), $size);
     if (strlen($buff) != $size) {
         throw new TeamSpeak3_Adapter_Exception("incomplete file download (" . count($buff) . " of " . $size . " bytes)");
     }
     return $buff;
 }
开发者ID:tech-nik89,项目名称:lpm4,代码行数:34,代码来源:FileTransfer.php


示例10: request

 /**
  * Sends a prepared command to the server and returns the result.
  *
  * @param  string  $cmd
  * @param  boolean $throw
  * @throws TeamSpeak3_Adapter_Exception
  * @return TeamSpeak3_Adapter_ServerQuery_Reply
  */
 public function request($cmd, $throw = TRUE)
 {
     $query = TeamSpeak3_Helper_String::factory($cmd)->section(TeamSpeak3::SEPARATOR_CELL);
     if (strstr($cmd, "\r") || strstr($cmd, "\n")) {
         throw new TeamSpeak3_Adapter_Exception("illegal characters in command '" . $query . "'");
     } elseif (in_array($query, $this->block)) {
         throw new TeamSpeak3_Adapter_ServerQuery_Exception("command not found", 0x100);
     }
     TeamSpeak3_Helper_Signal::getInstance()->emit("serverqueryCommandStarted", $cmd);
     $this->getProfiler()->start();
     $this->getTransport()->sendLine($cmd);
     $this->timer = time();
     $this->count++;
     $rpl = array();
     do {
         $str = $this->getTransport()->readLine();
         $rpl[] = $str;
     } while ($str instanceof TeamSpeak3_Helper_String && $str->section(TeamSpeak3::SEPARATOR_CELL) != TeamSpeak3::ERROR);
     $this->getProfiler()->stop();
     $reply = new TeamSpeak3_Adapter_ServerQuery_Reply($rpl, $cmd, $this->getHost(), $throw);
     TeamSpeak3_Helper_Signal::getInstance()->emit("serverqueryCommandFinished", $cmd, $reply);
     return $reply;
 }
开发者ID:joelsantosjunior,项目名称:wotdb,代码行数:31,代码来源:ServerQuery.php


示例11: fetchError

 /**
  * Parses a ServerQuery error and throws a TeamSpeak3_Adapter_ServerQuery_Exception object if
  * there's an error.
  *
  * @param  string $err
  * @throws TeamSpeak3_Adapter_ServerQuery_Exception
  * @return void
  */
 protected function fetchError($err)
 {
     $cells = $err->section(TeamSpeak3::SEPARATOR_CELL, 1, 3);
     foreach ($cells->split(TeamSpeak3::SEPARATOR_CELL) as $pair) {
         list($ident, $value) = $pair->split(TeamSpeak3::SEPARATOR_PAIR);
         $this->err[$ident->toString()] = $value->isInt() ? $value->toInt() : $value->unescape();
     }
     TeamSpeak3_Helper_Signal::getInstance()->emit("notifyError", $this);
     if ($this->getErrorProperty("id", 0x0) != 0x0 && $this->exp) {
         if ($permid = $this->getErrorProperty("failed_permid")) {
             if ($permsid = key($this->con->request("permget permid=" . $permid, FALSE)->toAssocArray("permsid"))) {
                 $suffix = " (failed on " . $permsid . ")";
             } else {
                 $suffix = " (failed on " . $this->cmd->section(TeamSpeak3::SEPARATOR_CELL) . " " . $permid . "/0x" . strtoupper(dechex($permid)) . ")";
             }
         } elseif ($details = $this->getErrorProperty("extra_msg")) {
             $suffix = " (" . trim($details) . ")";
         } else {
             $suffix = "";
         }
         throw new TeamSpeak3_Adapter_ServerQuery_Exception($this->getErrorProperty("msg") . $suffix, $this->getErrorProperty("id"));
     }
 }
开发者ID:fyfywka,项目名称:ts3phpframework,代码行数:31,代码来源:Reply.php


示例12: getInstance

 /**
  * Returns a singleton instance of TeamSpeak3_Helper_Signal.
  *
  * @return TeamSpeak3_Helper_Signal
  */
 public static function getInstance()
 {
     if (self::$instance === null) {
         self::$instance = new self();
     }
     return self::$instance;
 }
开发者ID:MistriHD,项目名称:Nameless,代码行数:12,代码来源:Signal.php


示例13: logout

 /**
  * Deselects the active virtual server and logs out from the server instance.
  *
  * @return void
  */
 public function logout()
 {
     $this->request("logout");
     $this->whoamiReset();
     $this->delStorage("_login_user");
     $this->delStorage("_login_pass");
     TeamSpeak3_Helper_Signal::getInstance()->emit("notifyLogout", $this);
 }
开发者ID:OlivierLamiraux,项目名称:mtgas,代码行数:13,代码来源:Host.php


示例14: snapshotDeploy

 /**
  * Deploys snapshot data on the selected virtual server. If no virtual server is selected (ID 0),
  * the data will be used to create a new virtual server from scratch.
  *
  * @param  string $data
  * @param  string $mode
  * @return array
  */
 public function snapshotDeploy($data, $mode = TeamSpeak3::SNAPSHOT_STRING)
 {
     switch ($mode) {
         case TeamSpeak3::SNAPSHOT_BASE64:
             $data = TeamSpeak3_Helper_String::fromBase64($data);
             break;
         case TeamSpeak3::SNAPSHOT_HEXDEC:
             $data = TeamSpeak3_Helper_String::fromHex($data);
             break;
         default:
             $data = TeamSpeak3_Helper_String::factory($data);
             break;
     }
     $detail = $this->request("serversnapshotdeploy " . $data)->toList();
     if (array_key_exists("sid", $detail)) {
         TeamSpeak3_Helper_Signal::getInstance()->emit("notifyServercreated", $this->getParent(), $detail["sid"]);
     }
     return $detail;
 }
开发者ID:thusk,项目名称:ts3-php,代码行数:27,代码来源:Server.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP TeamSpeak3_Helper_String类代码示例发布时间:2022-05-23
下一篇:
PHP TeamSpeak3类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap