Tasharen Entertainment Forum

Support => TNet 3 Support => Topic started by: Shifty Geezer on November 28, 2016, 09:29:47 AM

Title: How to use DeleteChannel
Post by: Shifty Geezer on November 28, 2016, 09:29:47 AM
My game has drop in/drop out coop into a host's game. When the host leaves (level complete), the game closes and clients are returned to the menu with no host migration. I have Channel 1 open for sending game details for joining players, and Channel 2 is the game itself. When a level is complete, I want to close Channel 2 and the game and return everyone to the preparation phase using Channel 1.

I'm thinking I should delete Channel 2 so I can recreate it again in the way I do initially, but I get a "not authorized" error. I can't find any documentation on authorisation for Channel 2 removal - doesn't matter whether I'm in the channel or not, it seems.

So how do I go about deleting the channel and starting again from scratch as if Channel 2 was never created? Or should I go about this some other way?
Title: Re: How to use DeleteChannel
Post by: ArenMook on November 28, 2016, 11:19:49 AM
Assuming the channel isn't persistent, simply having all players leave the channel is enough to discard it.

If you want to explicitly close a channel, you need to set a server flag: TNManager.SetServerData("canCloseChannels", true); -- whoever creates the server can do this.