unity-relay-mirror-sample icon indicating copy to clipboard operation
unity-relay-mirror-sample copied to clipboard

OnClientDataReceived is null, How to fix this

Open nagasuki opened this issue 2 years ago • 3 comments

private void SetupDefaultCallbacks()
        {
            if (OnServerConnected == null)
            {
                OnServerConnected = (connId) => UtpLog.Warning("OnServerConnected called with no handler");
            }
            if (OnServerDisconnected == null)
            {
                OnServerDisconnected = (connId) => UtpLog.Warning("OnServerDisconnected called with no handler");
            }
            if (OnServerDataReceived == null)
            {
                OnServerDataReceived = (connId, data, channel) => UtpLog.Warning("OnServerDataReceived called with no handler");
            }
            if (OnClientConnected == null)
            {
                OnClientConnected = () => UtpLog.Warning("OnClientConnected called with no handler");
            }
            if (OnClientDisconnected == null)
            {
                OnClientDisconnected = () => UtpLog.Warning("OnClientDisconnected called with no handler");
            }
            if (OnClientDataReceived == null)
            {
                OnClientDataReceived = (data, channel) => UtpLog.Warning("OnClientDataReceived called with no handler");
            }
        }

nagasuki avatar Sep 05 '23 07:09 nagasuki

did you find a solution?

ChrisEL20 avatar Feb 06 '24 13:02 ChrisEL20

Did anyone find a cause for this?

jirimotejlek avatar Nov 01 '24 04:11 jirimotejlek

For me all the events were null, and i really don't how they are supposed not to be null since this is a first line of Awake(). I ended up just removing SetupDefaultCallbacks() call from UtpTransport.Awake(), no errors or issues appeared at first glance.

PeclitheUltra avatar Nov 10 '24 13:11 PeclitheUltra