String args[] = message.split(" ");
@rogermb
This wouldn't happen if the API just set
overwrite=1
instead of 0. However, I was (probably being overly cautious) afraid of a CRC32 hash collision happening. Basically, I wanted to exclude the possibility of people uploading an icon to the TS3 server which didn't already exist on there and it removing / changing an existing icon to that uploaded icon. At least this way you know that a "collision" has happened and can take the appropriate steps to resolve it
Hmmm, I have sometime problems with the CRC32. How do you mean that with overwrite=1?
Hey there, i have another Problem.
I try to create a Subchannel, move a client, from the channel above in the subchannel, change the channel to a temporary one and give the client a specific channel group.
But it won't work, the channel is created, and modified to a temporary one, but noething more...
Here is my Code:
// ---- Channel Creation ----
System.out.println("Create Channel");
// Let's customize our channel
final HashMap<ChannelProperty, String> properties = new HashMap<ChannelProperty, String>();
// Make it a permanent channel
properties.put(ChannelProperty.CHANNEL_FLAG_PERMANENT, "1");
// Make it a subchannel of the channel, the user joint.
int mainChannel = headChannelId;
properties.put(ChannelProperty.CPID, String.valueOf(mainChannel));
// Create the (sub-)channel
String name = "";
try {
name = Core.asyncApi.getChannelInfo(headChannelId).get().getName() + " Ch1";
} catch (InterruptedException ex) {
ex.printStackTrace();
}
Core.asyncApi.createChannel(name, properties);
// ---- Move user to the created (sub-)channel ----
System.out.println("Move User");
int newChannelId = -1;
try {
newChannelId = Core.asyncApi.getChannelByNameExact(name, false).get().getId();
} catch (InterruptedException ex) {
ex.printStackTrace();
}
if (newChannelId != -1) {
Core.asyncApi.moveClient(clientId, newChannelId);
}
// ---- Make the channel temporary ----
System.out.println("Make Channel temporary");
HashMap<ChannelProperty, String> newProperties = new HashMap<ChannelProperty, String>();
newProperties.put(ChannelProperty.CHANNEL_FLAG_PERMANENT, "0");
newProperties.put(ChannelProperty.CHANNEL_FLAG_TEMPORARY, "1");
Core.asyncApi.editChannel(newChannelId, newProperties);
// ---- Set the channel-group for the user ----
System.out.println("Set the Channelgroup");
int channelGroupId = 28;
int channelId = newChannelId;
int clientDBId = clientId;
Core.asyncApi.setClientChannelGroup(channelGroupId, channelId, clientDBId);
// ---- Done ----
Maybe you can help me out?