unity-relay-mirror-sample
unity-relay-mirror-sample copied to clipboard
OnClientDataReceived is null, How to fix this
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");
}
}
did you find a solution?
Did anyone find a cause for this?
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.