Support => TNet 3 Support => Topic started by: xandeck on May 04, 2016, 07:27:23 PM
Title: TNet 3 - Send message to one single channel
Post by: xandeck on May 04, 2016, 07:27:23 PM
Hello Aren,
Is there any way to send a message to a single channel/room? Currently, I have a TNManager player who is inside at 3 channels at the same time. How can I send a message with "tno.Send" just to a specific channel? If I send
tno.Send("SomeMessage", Target.All, "my message");
Everyone that is in at least one of the channels/rooms will receive the message. Thanks
Title: Re: TNet 3 - Send message to one single channel
Post by: xandeck on May 04, 2016, 10:20:24 PM
I was doing something wrong, nevermind. But it could be good to know if this is true or not =)
Title: Re: TNet 3 - Send message to one single channel
Post by: ArenMook on May 05, 2016, 05:01:14 PM
You can specify a channel for tno.Send. Just check the function definitions. There's more than one. You still need to be in the channel before you can send, however.
Title: Re: TNet 3 - Send message to one single channel
Post by: xandeck on May 05, 2016, 07:15:13 PM
I did, I checked if there was a channel, but it was not specified (using version 3.0.1). Or does the "byte rfcID" is the parameter? Target I think it is either the Target.something or the player...?
Title: Re: TNet 3 - Send message to one single channel
Post by: ArenMook on May 05, 2016, 07:36:31 PM
I just double-checked. The TNObject.Send's channel ID comes from the TNObject itself. All objects belong to a channel. This is the channel that gets used for communication. You can transfer objects between channels as the multi-channel example shows that comes with TNet, but all RFCs always go to the object's channel.
Title: Re: TNet 3 - Send message to one single channel
Post by: xandeck on May 05, 2016, 08:41:16 PM
Nice, thank you for letting me know. In any case, I already changed the way I did.