DemoPublishOnSubscribe
How do I use Demo Publish On Subscribe
Below are practical examples compiled from projects for learning and reference purposes
Featured Snippets
Line | Code | Ex.. |
---|---|---|
321 | if (this.DemoPublishOnSubscribe) | 1 |
File name: ChatGui.cs
Copy
317 public void OnSubscribed(string[] channels, bool[] results)
318 {
319
320 // this demo can automatically send a "hi" to subscribed channels. in a game you usually only send user's input!!
321 if (this.DemoPublishOnSubscribe)
322 {
323 foreach (string channel in channels)
324 {
325 this.chatClient.PublishMessage(channel, "says 'hi' in OnSubscribed(). "); // you don't HAVE to send a msg on join but you could.
326 }
327 }
328 }
DemoPublishOnSubscribe 139 lượt xem
Gõ tìm kiếm nhanh...