RevenantX / LiteNetLib

Lite reliable UDP library for Mono and .NET
https://revenantx.github.io/LiteNetLib/index.html
MIT License
3k stars 489 forks source link

How do I use the channel feature? #536

Closed busiyg closed 7 months ago

busiyg commented 7 months ago

I'm a newbie to game server. How should I use the channel feature? I couldn't find any explanation in the documentation or sample projects. Thank you."

like this: listener.NetworkReceiveEvent += (fromPeer, dataReader, channel, deliveryMethod) => { Console.WriteLine("We got: {0}", dataReader.GetString(100 / max length of string /)); dataReader.Recycle(); };

RevenantX commented 7 months ago

@busiyg it's rarely needed when you use ReliableSequenced channel or in some cases ReliableOrdered, it's just sends data over different "QoS" like channels. In most cases you don't need this and just use 0

RevenantX commented 7 months ago

also for questions better use https://discord.gg/FATFPdy