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

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


  private Map<String, TS3EventEmitter> map = new HashMap<>();

  private List<TS3Listener> listeners = new ArrayList<>();

  public EventManager() {
    map.put("notifytextmessage", new TextMessageEvent());
    map.put("notifycliententerview", new ClientJoinEvent());
    map.put("notifyclientleftview", new ClientLeaveEvent());
    map.put("notifyserveredited", new ServerEditedEvent());
    map.put("notifychanneledited", new ChannelEditedEvent());
    map.put("notifychanneldescriptionchanged",
View Full Code Here


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

  }
View Full Code Here

      int clientDBId) {
    CPermOverview overview = new CPermOverview(channelId, clientDBId);
    if (query.doCommand(overview)) {
      List<AdvancedPermission> permissions = new ArrayList<>();
      for (HashMap<String, String> opt : overview.getResponse()) {
        permissions.add(new AdvancedPermission(opt));
      }
      return permissions;
    }
    return null;
  }
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

TOP

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

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.