User leaving channel message
in Photon Chat
Hi Guys,
I am new to using Phtoon Chat but cannot understand why this is not working.
This will NOT show the "Player has left the channel" message because of the this.client.Unsubscribe() call but it,s called after the request to show a goodbye message in the chat frame.
As you can see in the comments when I comment out the Unsubscribe call the message outputs into the Chat frame window with "Player has left the channel" but without Unsubscribing they are of course still active in the channel.
Any ideas please??
I am new to using Phtoon Chat but cannot understand why this is not working.
This will NOT show the "Player has left the channel" message because of the this.client.Unsubscribe() call but it,s called after the request to show a goodbye message in the chat frame.
Debug.Log("OnDisconnected fired"); //Display a user leaving the channel message. this.client.PublishMessage(worldChannel, this.playerName + " has left the channel"); //Unsubcribe the user from the channel. this.client.Unsubscribe(new string[] {worldChannel});
As you can see in the comments when I comment out the Unsubscribe call the message outputs into the Chat frame window with "Player has left the channel" but without Unsubscribing they are of course still active in the channel.
Debug.Log("OnDisconnected fired"); //Display a user leaving the channel message. this.client.PublishMessage(worldChannel, this.playerName + " has left the channel"); //Unsubcribe the user from the channel. // this.client.Unsubscribe(new string[] {worldChannel});<-- NO UNSUBSCRIBE ABOVE MESSAGE WORKS> //client.Disconnect();
Any ideas please??
0
Comments
-
Hi @Shabalaka,
Thank you for choosing Photon!
Maybe you could make use of already available events: UserSubscribed and UserUnsubscribed enabled via PublishSubscribers?
Otherwise, do not unsubscribe until you receive your own "has left the channel" message since in Photon Chat client always broadcasts.0 -
Hi Thanks for the reply I will take a look ath PublishSubscrivbers.0