Forum


Notice to all users

We are migrating towards a new forum system located at community.teamspeak.com, as such this forum will become read-only on January 29, 2020

Page 69 of 100 FirstFirst ... 1959676869707179 ... LastLast
Results 1,021 to 1,035 of 1498
  1. #1021
    Join Date
    January 2010
    Location
    Germany
    Posts
    252
    Quote Originally Posted by barricas View Post
    What you mean with register aggregate classes?
    e.g.:

    PHP Code:
    use Zend\EventManager\EventManager;
    use 
    Zend\EventManager\EventManagerAwareInterface;
    use 
    Zend\EventManager\EventManagerInterface;

    class 
    Baz  implements EventManagerAwareInterface
    {
         protected 
    $events;
        
        public function 
    setEventManager(EventManagerInterface $events) {
            
    $this->events $events;
            return 
    $this;
        }
        
        public function 
    getEventManager() {
            if (!
    $this->events) { $this->setEventManager(new EventManager(__CLASS__)); }
            return 
    $this->events;
        }
       
        public function 
    get($id)
        {
            
    $params compact('id');
            
    $results $this->getEventManager()->trigger('Bar.pre'$this$params);

            
    // If an event stopped propagation, return the value
            
    if ($results->stopped()) {
                return 
    $results->last();
            }

            
    // do some work...

            
    $this->getEventManager()->trigger('Bar.post'$this$params);
        }

    PHP Code:
    use Zend\EventManager\ListenerAggregateInterface;
    use 
    Zend\EventManager\EventInterface;

    class 
    Bar implements ListenerAggregateInterface
    {
        protected 
    $listeners = array();
        
        public function 
    attach(EventManagerInterface $e)
        {  
            
    $this->listeners[] = $e->attach('Bar.pre', array($this'load'));
            
    $this->listeners[] = $e->attach('Bar.post', array($this'save'));
        }
        
        public function 
    detach(EventManagerInterface $e
        {
            foreach (
    $this->listeners as $index => $listener) {
                if (
    $e->detach($listener)) {
                    unset(
    $this->listeners[$index]);
                }
            }
        }
        
        public function 
    load(EventInterface $e) { echo 'load...'; }
        public function 
    save(EventInterface $e) { echo 'save...'; }

    PHP Code:
    $baz = new Baz;
    $barListeners = new Bar;
    $baz->getEventManager()->attachAggregate($barListeners); 

  2. #1022
    Join Date
    June 2012
    Location
    Portugal
    Posts
    317
    Oh I see.... I look at the framework code and it looks like you can only subscribe one at a time.. however if registing aggregate isn't supported maybe you can register a class along with some dispatcher method. In that method you dispatch the events to whatever you registered.

    Tl;dr: Custom event dispatcher class that listens to generic events. In this class you then do your logic to implement aggregate register.

    I never really used the ts3 framework events, I use another framework events logic since I only use events that I emit hehe

  3. #1023
    Join Date
    January 2014
    Posts
    13
    HI, Im trying to make a script to ban clients when there special characters in there name.
    so far I have.

    PHP Code:
    <?php

    // load framework files
    require_once("../libraries/TeamSpeak_3/TeamSpeak3.php");
    require_once(
    "ts3_connect.php");

    // connect to local server, authenticate and spawn an object for the virtual server on port 9987
    $ts3_VirtualServer TeamSpeak3::factory("serverquery://$username:$password@$host:$queryport/?server_port=$serverport");
    $arr_ClientList $ts3_VirtualServer->clientlist();  
        foreach(
    $arr_ClientList as $ts3_Client)
        { 
        if(
    preg_match('/serveradmin/',$ts3_Client))
            {
            
            }
        else if(
    preg_match('/[^A-Za-z0-9]/',$ts3_Client))
            {
            
    $ts3_VirtualServer->clientban($ts3_Client["client_database_id"], 60'Name may only contain a-z and 0-9.' );
            }
        }
        
    ?>
    But when I run the script I get this.

    Uncaught exception 'TeamSpeak3_Adapter_ServerQuery_Exception' with message 'convert error'
    and the other one.
    Uncaught exception 'TeamSpeak3_Adapter_ServerQuery_Exception' with message 'invalid clientID'

    ive updated to the latest ts3 php framework and still the same, any help would be helpful.

    thanks in advance.
    Last edited by Soulkeeper5; November 16th, 2014 at 12:41 AM.

  4. #1024
    Join Date
    May 2010
    Location
    Verona - Italy
    Posts
    122
    Hello guys,
    how can I list all icons of a server plus their icon id?
    Thank you.

  5. #1025
    Join Date
    October 2003
    Location
    Germany
    Posts
    2,527
    Quote Originally Posted by faralsimbor View Post
    Hi ScP,

    is ist possible to implement priorities into TeamSpeak3_Helper_Signal::subscribe() and can you implement a function to register aggregate classes ?
    Not yet. But I like the idea and will work on it soon.

  6. #1026
    Join Date
    August 2014
    Posts
    22
    Hello,
    I am looking for information about a script or a script that works like this, it tells you when the character dies in the game, and she built this trailer and served in ts3, works as follows and the tibia game.

    By example: You have a list of characters that you enter as this: http://www.tibiawars.com/ShowWar.php?id_war=2940

    I saw in a TS3 plugin, probably a script on a VPS tied to ts3, and created one that CHANNEL with all the characters and when he dies and sent one POKE to everyone who gets in TS, warning about death.

    I have no idea how it's done, so I was in the same curiosity and am researching.

    Simply put: It's a list where you insert characters and when he dies in the game, poke ts blow a warning when he dies.They put in the Channel with the characters in it.

    My doubt is i don't know i take the game plugin and only know how to connect into my client

    //Load Framework
    require_once("libraries/TeamSpeak3/TeamSpeak3.php");

    try {
    //Connect
    $ts3 = TeamSpeak3::factory("serverquery://username[email protected]:10011/?server_port=9987"); //your ts3 server here
    //Server Status
    echo "Server Status: online";
    }

    catch(Exception $e) {
    //Errors (No connection)
    echo "Server Status: offline";
    }

    Check if is connect and if someone die send a POKE.

  7. #1027
    Join Date
    December 2013
    Location
    Poland
    Posts
    17
    Quote Originally Posted by asskiller View Post
    Hello,
    I am looking for information about a script or a script that works like this, it tells you when the character dies in the game, and she built this trailer and served in ts3, works as follows and the tibia game.
    With this library you can get data from game.: https://github.com/madsaune/TibiaWebsiteAPI

    Now you can write something like that:

    PHP Code:

    include_once dirname(__file__) . "/../Tibia/TibiaWebAPI.class.php";
    require_once 
    dirname(__file__) . "/../Tibia/ts3php/libraries/TeamSpeak3/TeamSpeak3.php";
    $TSmessageSG "70";

    try
    {
        
    $ts3_VirtualServer TeamSpeak3::factory("serverquery://$TSadminNickname:$TSpassword@$TSaddress:$TSqueryport/?server_port=$TSport&nickname=$botname");
    }

    catch (
    TeamSpeak3_Exception $e)
    {
        
    // print the error message returned by the server
        
    echo "Error " $e->getCode() . ": " $e->getMessage();
    }

    $vip = array(
        
    "Kamerat",
        
    "Pyruvat",         
        
    "Julegave",
        
    "CM Mirade",
        
    "Sir Sippo");

    $deadplayers = array();

    foreach (
    $vip as $playerName)
    {
        
    $player = new Tibia\Player($playerName);

        if (
    $player->getDeaths() == false)
        {
         
        } else
        {
            
    $deadplayers[] = array(
            
    "DEATHTIME" => $player->getDeaths()[0],
            
    "PLAYERNAME" => $playerName);
        }
    }

    foreach (
    $deadplayers as $dp)

    {
        
    $a $dp["PLAYERNAME"];
        
    $b $dp["DEATHTIME"];
        
    $ts3_VirtualServer->serverGroupGetById($TSmessageSG)->message("Player: $a $b");

    This is only exampe.

  8. #1028
    Join Date
    November 2014
    Posts
    4
    Hello, good evening I'm trying to make a

    ADMINISTRATOR OF ICONS by Unique ID.

    but I can not get the icons of the selected person and do not understand the getinfo function.

    leave my code and good thing I did so far is from the Unique ID. grip the DB ID
    but since there do not know what else

    appreciate your help

    <?php
    require_once("TeamSpeak3.php");
    session_start();

    if(!isset($_SESSION['ts3_last_query']))
    $_SESSION['ts3_last_query'] = microtime(true);

    if($_SESSION['ts3_last_query'] >= microtime(true))
    die('Tenes que esperar 10 segundos para volver a crear un channel.');

    $_SESSION['ts3_last_query'] = microtime(true)+10.0;
    ?>
    <!DOCTYPE html>
    <html>
    <head>
    <title>Crear canal TeamSpeak3</title>
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <meta name="description" content="" />
    <meta name="keywords" content="" />
    <!--[if lte IE 8]><script src="css/ie/html5shiv.js"></script><![endif]-->
    <script src="js/jquery.min.js"></script>
    <script src="js/skel.min.js"></script>
    <script src="js/init.js"></script>
    <noscript>
    <link rel="stylesheet" href="css/skel.css" />
    <link rel="stylesheet" href="css/style.css" />
    <link rel="stylesheet" href="css/style-desktop.css" />
    <link rel="stylesheet" href="css/style-noscript.css" />
    </noscript>
    <!--[if lte IE 8]><link rel="stylesheet" href="css/ie/v8.css" /><![endif]-->
    </head>
    <?php

    $uid = $_POST['id'];


    try
    {
    /* connect to server, login and get TeamSpeak3_Node_Server object by URI */
    $ts3_VirtualServer = TeamSpeak3::factory("serverquery://pass[email protected]:10011/?server_port=9987");

    $cid1 = $ts3_VirtualServer->clientGetByUid($uid);
    $cid3 = $ts3_VirtualServer->clientFindDb($uid, true);
    ?>

    <?php

    }
    catch(Exception $e)
    {
    echo "Error (ID " . $e->getCode() . ") <b>" . $e->getMessage() . "</b>";
    }

    ?>
    <body>
    <!-- Wrapper-->
    <div id="wrapper">
    <!-- Nav -->
    <nav id="nav">
    <a href="xxxxxxxxxx"><img src="crear.png"><span style="width: 113px;margin-left: -81px;">CREAR CANAL</span></a>
    <a href="#iconos"><img src="iconos.png"><span style="width: 125px; margin-left: -36px;">DARME ICONOS</span></a>
    </nav>
    <div id="main">
    <article id="iconos" class="panel">
    <header>
    <h2>Administrar Mis Iconos</h2>
    </header>
    <div class="row">
    <div class="12u">
    <label><?php
    echo $cid1 ;?>
    </label>
    </div>
    </div>
    <div class="row">
    <div class="12u">
    <label><?php
    echo $cid3 ;?>
    </label>
    </div>
    </div>


    <form action="#" method="get">
    <div>
    <div class="row">
    <div class="12u">
    <input type="text" name="name" placeholder="ID CLIENTE" />
    </div>
    </div>
    <div class="row">
    <div class="12u">
    <center>
    <input type="submit" value="Traer Iconos" />
    </center>
    </div>
    </div>
    </div>
    </form>
    </article>


    </div>


    </div>

    </body>

    </html>

  9. #1029
    Join Date
    August 2014
    Posts
    22
    Yanek, Thanks for the awnser, do you have another contact skype or something like that, to i contact you when i have doubt's....

  10. #1030
    Join Date
    November 2014
    Posts
    4

    Post [API] TS3 PHP Framework Icon MANAGER HELP

    Hello, good evening I'm trying to make a

    ADMINISTRATOR OF ICONS by Unique ID.

    but I can not get the icons of the selected person and do not understand the getinfo function.

    leave my code and good thing I did so far is from the Unique ID. grip the DB ID
    but since there do not know what else

    appreciate your help

    PHP Code:
    <?php
    require_once("TeamSpeak3.php");
    session_start();

    if(!isset(
    $_SESSION['ts3_last_query']))
        
    $_SESSION['ts3_last_query'] = microtime(true);

    if(
    $_SESSION['ts3_last_query'] >= microtime(true))
        die(
    'Tenes que esperar 10 segundos para volver a crear un channel.');

    $_SESSION['ts3_last_query'] = microtime(true)+10.0;
    ?>
    <!DOCTYPE html>
    <html>
        <head>
            <title>Crear canal TeamSpeak3</title>
            <meta http-equiv="content-type" content="text/html; charset=utf-8" />
            <meta name="description" content="" />
            <meta name="keywords" content="" />
            <!--[if lte IE 8]><script src="css/ie/html5shiv.js"></script><![endif]-->
            <script src="js/jquery.min.js"></script>
            <script src="js/skel.min.js"></script>
            <script src="js/init.js"></script>
            <noscript>
                <link rel="stylesheet" href="css/skel.css" />
                <link rel="stylesheet" href="css/style.css" />
                <link rel="stylesheet" href="css/style-desktop.css" />
                <link rel="stylesheet" href="css/style-noscript.css" />
            </noscript>
            <!--[if lte IE 8]><link rel="stylesheet" href="css/ie/v8.css" /><![endif]-->
        </head>
    <?php

    $uid 
    $_POST['id'];


    try
    {
      
    /* connect to server, login and get TeamSpeak3_Node_Server object by URI */
      
    $ts3_VirtualServer TeamSpeak3::factory("serverquery://pass:[email protected]:10011/?server_port=9987");
      
      
    $cid1 $ts3_VirtualServer->clientGetByUid($uid);
      
    $cid3 $ts3_VirtualServer->clientFindDb($uidtrue);
     
    ?>
     
     <?php
     
    }
    catch(
    Exception $e)
    {
      echo 
    "Error (ID " $e->getCode() . ") <b>" $e->getMessage() . "</b>";
    }

    ?>
        <body>
            <!-- Wrapper-->
                <div id="wrapper">
                                <!-- Nav -->
                        <nav id="nav">
                            <a href="xxxxxxxxxx"><img src="crear.png"><span style="width: 113px;margin-left: -81px;">CREAR CANAL</span></a>
                            <a href="#iconos"><img src="iconos.png"><span style="width: 125px; margin-left: -36px;">DARME ICONOS</span></a>
                                            </nav>
                        <div id="main">
                                <article id="iconos" class="panel">
                                    <header>
                                        <h2>Administrar Mis Iconos</h2>
                                    </header>
                                            <div class="row">
                                                <div class="12u">
                                                    <label><?php 
                                                    
    echo $cid1 ;?>
                                                    </label>
                                                </div>
                                            </div>
                                            <div class="row">
                                                <div class="12u">
                                                    <label><?php 
                                                    
    echo $cid3 ;?>
                                                    </label>
                                                </div>
                                            </div>
                                
                                    
                                    <form action="#" method="get">
                                        <div>
                                            <div class="row">
                                                <div class="12u">
                                                    <input type="text" name="name" placeholder="ID CLIENTE" />
                                                </div>
                                            </div>
                                            <div class="row">
                                                <div class="12u">
                                                <center>
                                                    <input type="submit" value="Traer Iconos" />
                                                </center>
                                                </div>
                                            </div>
                                        </div>
                                    </form>
                                </article>
                        

                        </div>
        
            
                </div>

        </body>

    </html>

  11. #1031
    Join Date
    November 2014
    Posts
    4
    Update Post! , plz help!

  12. #1032
    Join Date
    June 2011
    Location
    Baghdad, Iraq
    Posts
    367
    by icons you mean server groups ?
    also try to explain what you want to do exactly so we can help you

  13. #1033
    Join Date
    June 2013
    Posts
    32
    Teamspeak trigger event on client connect

    Any call back or function for that?

    I know there is one to check if the client has disconnected " notifyclientleftview "

    Now I'm asking if there is anything to check if the client has connected

  14. #1034
    Join Date
    June 2011
    Location
    Baghdad, Iraq
    Posts
    367
    notifycliententerview
    notifyclientleftview

  15. #1035
    Join Date
    October 2014
    Posts
    7
    ppl can helping me for create hunted list on mi TeamSpeak3? please or send a tutorial?

Thread Information

Users Browsing this Thread

There are currently 7 users browsing this thread. (0 members and 7 guests)

Similar Threads

  1. PHP Framework
    By Multivit4min in forum Permission System
    Replies: 1
    Last Post: June 29th, 2015, 12:28 PM
  2. PHP Framework
    By phil998 in forum Server Support
    Replies: 0
    Last Post: February 25th, 2015, 07:27 PM
  3. TS3 PHP Framework Visualizations
    By Ronin Design in forum Tools / Web Based
    Replies: 2
    Last Post: February 22nd, 2015, 06:04 AM
  4. Extraction using the Framework
    By HarryMW in forum Tools / Web Based
    Replies: 1
    Last Post: August 3rd, 2012, 08:04 PM
  5. Teamspeak, PHP Framework?
    By mario2027 in forum General Questions
    Replies: 1
    Last Post: December 21st, 2010, 10:30 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •