Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing function. #399

Open
Backxtar opened this issue Sep 25, 2021 · 4 comments
Open

Missing function. #399

Backxtar opened this issue Sep 25, 2021 · 4 comments
Labels

Comments

@Backxtar
Copy link

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

@rogermb
Copy link
Collaborator

rogermb commented Sep 25, 2021

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
Copy link
Author

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

@Backxtar
Copy link
Author

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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants