User leaving channel message

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.
        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??

Comments

Sign In or Register to comment.