This may be a bit of a long shot, but here goes anyway.
I’m experimenting with Unity (trial, 2.5, windows) and the Project Darkstar server by way of the DarkstarSharp API.
Almost everything is working as expected (after much fiddling as I am still novice level at much of this).
Except at some (early) point the Unity client stops picking up events on both SimpleClientListener and ChannelListener.
The main class of the script implements MonoBehaviour, SimpleClientListener and ClientChannelListener. I have tested with the listeners implemented in separate classes but it doesn’t make any apparent difference.
I make the login request from the Start() method. On receipt of the LoggedIn() callback I send a message requesting to be added to a channel on the server. This works, and the JoinedChannel() callback fires as expected. The ClientChannel is saved in a variable in the main class of the script and “this” is used as the return value. A single test event sent immediately by the server triggers the
ReceivedMessage(ClientChannel cc, byte[ ] message) //The channel listener
event handler as expected, and a pair of messages to the server bring back responses through
ReceivedMessage(byte[ ] message) //The session listener
which are used to make a landscape of cubes and place a First Person Controller prefab in the scene.
The client then sends regular updates to the Channel which get to the server, and cause the server to send channel messages back. A C# application which does nothing but login and join the channel (displaying all the messages on the channel) sees everything, both client to server and server-client, but the unity client sees no further events from the server.
I attach the major files in question, with humble requests that my dire code not be laughed at too much. There’s probably some obvious error on my part causing all this.
TLDR; - Event handlers in unity client C# script stop working after a few messages, even though other listeners using the same API and broadcast channel receive the messages succesfully.
136777–5023–$expt_100.cs (9.97 KB)