Package com.github.theholywaffle.teamspeak3.api.wrapper

Examples of com.github.theholywaffle.teamspeak3.api.wrapper.Wrapper


      for (TS3Listener l : listeners) {
        emitter.fire(l, new DefaultArrayResponse(notifyBody).getArray()
            .get(0));
      }
    } else {
      throw new TS3UnknownEventException(notifyName + " " + notifyBody);
    }

  }
View Full Code Here


        serverCon.getChannels().forEach( ( c ) -> {
            System.out.println( c.getName() );
        } );
        System.out.println( ApiUtils.getChannelByName( serverCon.getChannels(), "Games" ) );

        Channel c = ApiUtils.getSubChannel( serverCon.getChannels(), new String[]{ "League of Legends", "#1", } );
        System.out.println( c );
        System.out.println( c.getTotalClients() );
        serverCon.setChannel( c );
        serverCon.setName( "Seplunker" );

        System.out.println( "finish" );
    }
View Full Code Here

     * @param channelId
     * @throws org.tsbs.manager.exceptions.UnknownChannelException if there's no channel with the id ChannelId
     */
    public void activateChannel( int channelId ) throws UnknownChannelException
    {
        Channel c = ApiUtils.getChannelById( getAllServerChannels(), channelId );
        if( c == null )
            throw new UnknownChannelException( "Channel with the id( " + channelId + " ) not found!" );

        activateChannel( c );
    }
View Full Code Here

   public void callAction( String[] params, TS3BotChannelListener source, TextMessageEvent eventSource )
   {
      TS3Api api = source.getTS3Api();
      Random random = new Random();
      List<Channel> channelList = ApiUtils.filterPasswordProtectedChannels( api.getChannels() );
      Channel sourceChannel =  ApiUtils.getChannelById( channelList, source.getChannelId() );
      List<Client>  clientList  = ApiUtils.filterClientsFromOtherChannels( api.getClients(), sourceChannel );
      Channel channel = channelList.get( random.nextInt( channelList.size() ) );
      Client  client  = clientList.get( random.nextInt( clientList.size() ) );

      if( params.length > 1 )
         api.moveClient( eventSource.getInvokerId(), channel.getId() );
      else
         api.moveClient( client.getId(), channel.getId() );
   }
View Full Code Here

        Thread.sleep( 1500L );
    }

    public void testActivateChannel() throws Exception
    {
        Channel c = ApiUtils.getSubChannel( manager.getAllServerChannels(), new String[]{ "Games", "Diablo3", "#1" } );
        Thread.sleep( 1500L );
    }
View Full Code Here

        TS3Api api = source.getTS3Api();

        switch( params[1] )
        {
            case fMOVE_CHANNEL_CLIENTS:
                Channel channelSrc = ApiUtils.getChannelById( api.getChannels(), source.getChannelId() );
                moveChannelClients( api, channelSrc, params[2] );
                break;
            default:
                printUsage( api );
                break;
View Full Code Here

    }

    public void moveChannelClients( TS3Api api, Channel channel, String destChannel )
    {
        List<Client> clientList = ApiUtils.filterClientsFromOtherChannels( api.getClients(), channel );
        Channel dest = api.getChannelByName( destChannel );

        if( dest != null )
        {
            printUsage( api );
            return;
        }

        for( Client c : clientList )
            api.moveClient( c.getId(), dest.getId() );
    }
View Full Code Here

      Random random = new Random();
      List<Channel> channelList = ApiUtils.filterPasswordProtectedChannels( api.getChannels() );
      Channel sourceChannel =  ApiUtils.getChannelById( channelList, source.getChannelId() );
      List<Client>  clientList  = ApiUtils.filterClientsFromOtherChannels( api.getClients(), sourceChannel );
      Channel channel = channelList.get( random.nextInt( channelList.size() ) );
      Client  client  = clientList.get( random.nextInt( clientList.size() ) );

      if( params.length > 1 )
         api.moveClient( eventSource.getInvokerId(), channel.getId() );
      else
         api.moveClient( client.getId(), channel.getId() );
   }
View Full Code Here

  }

  public Wrapper getFirstResponse() {
    List<HashMap<String, String>> resp = getResponse();
    if(resp.size() > 0){
      return new Wrapper(resp.get(0));
    }
    return new Wrapper(new HashMap<String, String>());
  }
View Full Code Here

    CClientFind find = new CClientFind(pattern);
    if (query.doCommand(find)) {
      List<Client> clients = new ArrayList<>();
      for (Client c : getClients()) {
        for (HashMap<String, String> opt : find.getResponse()) {
          if (c.getId() == StringUtil.getInt(new Wrapper(opt)
              .get("clid"))) {
            clients.add(c);
          }
        }
      }
View Full Code Here

TOP

Related Classes of com.github.theholywaffle.teamspeak3.api.wrapper.Wrapper

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.