TheHolyWaffle / TeamSpeak-3-Java-API

A Java wrapper of TeamSpeak's 3 server query API.
MIT License
306 stars 107 forks source link

Missing function. #399

Open Backxtar opened 3 years ago

Backxtar commented 3 years ago

Missing something like: client.getConnectionDuration() to check how long hes connected to the server :) Would be nice for leecher kicking etc.

rogermb commented 3 years ago

There's Client.getLastConnectedDate(), which despite the somewhat confusing name means the date & time the current connection to the server started (so subtract that date from now), there's Client.getIdleTime(), which measures the client's inactivity in milliseconds, and there's also ClientInfo.getTimeConnected(), which allows you to skip the manual duration calculation if you already have a ClientInfo object 😄

Backxtar commented 3 years ago

How 2 create a channel with the same rights as the parent channel?

Backxtar commented 3 years ago

final Map<ChannelProperty, String> properties = new HashMap<>(); properties.put(ChannelProperty.CHANNEL_FLAG_TEMPORARY, "1"); properties.put(ChannelProperty.CPID, String.valueOf(e.getTargetChannelId())); properties.put(ChannelProperty.CHANNEL_CODEC_QUALITY, "10"); api.createChannel(channelName, properties); api.moveClient(client.getId(), api.getChannelByNameExact(channelName, true).getId()); api.moveClient(api.whoAmI().getId(), api.getServerInfo().getDefaultChannelGroup());

    i want to sync rights with parent channel 👍 
astrolamb-gaming commented 2 years ago

@Backxtar you could make a copy of the parent channel's ChannelProperty map and change the values you want to be different.