TeamSpeak-3-Java-API icon indicating copy to clipboard operation
TeamSpeak-3-Java-API copied to clipboard

Missing function.

Open Backxtar opened this issue 2 years ago • 4 comments

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

Backxtar avatar Sep 25 '21 00:09 Backxtar

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 😄

rogermb avatar Sep 25 '21 09:09 rogermb

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

Backxtar avatar Sep 26 '21 12:09 Backxtar

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 👍 

Backxtar avatar Sep 26 '21 12:09 Backxtar

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

astrolamb-gaming avatar Dec 04 '21 11:12 astrolamb-gaming