TeamSpeak-3-Java-API
TeamSpeak-3-Java-API copied to clipboard
Problem with creating temporary channels
Hello, I have a problem with creating temporary channels using your TeamSpeak Query Wrapper. When I am trying to create temporary channel, I got an error but creating for example semi permanent or permanent channels works fine. Errors:
`ERROR 14961 --- [nio-8080-exec-3] o.a.c.c.C.[.[.[/].[disp2020-03-09 00:47atcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is com.github.theholywaffle.teamspeak3.api.exception.TS3CommandFailedException: A "channelcreate" command returned with a server error.
invalid channel flags (ID 775)] with root cause
com.github.theholywaffle.teamspeak3.api.exception.TS3CommandFailedException: A "channelcreate" command returned with a server error.
invalid channel flags (ID 775) at com.github.theholywaffle.teamspeak3.api.CommandFuture.checkForFailure(CommandFuture.java:415) ~[teamspeak3-api-1.2.0.jar:na] at com.github.theholywaffle.teamspeak3.api.CommandFuture.get(CommandFuture.java:285) ~[teamspeak3-api-1.2.0.jar:na] at xyz.kaspek.websocket.minevoipsocket.utils.TsUtil.createChannel(TsUtil.java:30) ~[minevoipsocket-0.0.1-SNAPSHOT.jar:0.0.1-SNAPSHOT] at xyz.kaspek.websocket.minevoipsocket.controlers.TeamSpeakController.createChannelAndMove(TeamSpeakController.java:142) ~[minevoipsocket-0.0.1-SNAPSHOT.jar:0.0.1-SNAPSHOT] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_201] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_201]`
My code:
Map<ChannelProperty, String> map = new HashMap<>(); map.put(ChannelProperty.CHANNEL_NAME, "sth"); map.put(ChannelProperty.CHANNEL_FLAG_TEMPORARY, "1"); map.put(ChannelProperty.CHANNEL_PASSWORD, "something"); map.put(ChannelProperty.CPID, String.valueOf(Config.vcChannel.getId()));
Have you verified that the value set in map.put(ChannelProperty.CPID, String.valueOf(Config.vcChannel.getId()) is actually an integer?
I looked through your code and can't find any other lines that might be causing your problem. I'll try to replicate your problem as soon as I'm at home.
Hi @Kaspek2480! Sorry for taking so long to respond. Real life has been a bit busy 😅
You're not really giving me a lot to work with, but here's what I noticed:
ChannelProperty.CHANNEL_NAMEdoes not belong in the extra properties map. The channel's name is just the first argument toTS3Api#createChannel.CHANNEL_FLAG_TEMPORARYis sometimes a bit strange. Usually, thechannelcreatecommand accepts it, but this somehow isn't the case here. Make sure that you're not also addingCHANNEL_FLAG_PERMANENTorCHANNEL_FLAG_SEMI_PERMANENTto the map. You could also try not adding any of these 3 flags to the map: if no flag is specified, the created channel will be temporary.- And as @TAXSET has already mentioned, make sure that
Config.vcChannel.getId()actually returns a valid channel ID.