Author Topic: CreateChannel  (Read 2110 times)

devomage

  • Sr. Member
  • ****
  • Thank You
  • -Given: 7
  • -Receive: 67
  • Posts: 250
    • View Profile
CreateChannel
« on: July 29, 2016, 08:26:03 PM »
I would really like to specify the channel id when creating a channel.  I can deal with this via channel data -- but would rather use the actual channel id.  Promise, I'll check the channel id is valid first  :P

Also, I do not want to automagically join the channel I just created.  What is the use of CreateChannel if you are forced to join anyways (and the params are the same).  I do not see a way to avoid this.  Previously I did this via a custom packet.  I'm diligently trying to stay away from custom packets...

It would also be great if when creating a channel you can specify the channel data!  ...rather than hunting down the channel later and dealing with static channel data.


ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: CreateChannel
« Reply #1 on: July 29, 2016, 09:38:04 PM »
When you specify a JoinChannel and the channel doesn't exist, you effectively create it.

There is no way to create a channel without joining it, and it would be pointless anyway as TNet 3's packets always go to a channel. You can't send them via a broadcast anymore like in TNet 2. I suggest you reconsider what you're doing. You're trying to fit a square into a shape of a circle.

P.S. Note that you can JoinChannel without leaving your current one as TNet 3 supports multiple channels. You also don't need to specify a scene to load, so you can join a channel without anything visible happening.

devomage

  • Sr. Member
  • ****
  • Thank You
  • -Given: 7
  • -Receive: 67
  • Posts: 250
    • View Profile
Re: CreateChannel
« Reply #2 on: July 30, 2016, 01:30:58 AM »
My concept is sound.  I don't want to join a "match" channel until I'm ready.  A persistent channel with nobody in it.  Perhaps it's a public "chat room".  It's there, but nobody is in the channel.  Maybe this new "zone" channel is created, but I dont want anyone to enter for 2 minutes!  I could probly think of a few more scenarios...  I should have the choice of joining the channel when it's created.

I'll try the null/empty scene.

I still like the idea of being able to deal with channel data when creating a channel.

devomage

  • Sr. Member
  • ****
  • Thank You
  • -Given: 7
  • -Receive: 67
  • Posts: 250
    • View Profile
Re: CreateChannel
« Reply #3 on: July 30, 2016, 01:53:32 AM »
  1. TNManager.JoinChannel(request_id, null, true, maxplayers, null, false);

Set a ton of channel data when JoinChannel fires - then leave the channel.  Get's the job done.

Thanks!