Unhandled relayed message 20 from <PROXY_IP>:<PROXY_PORT>

Hi

I have found this unhandled error in Unity 4.2.1f4

SETUP:

  • Unity 4.2.1f4, problem will happen in EDITOR, iOS Player and Android player and others, too
  • Unity master server version 2.0.1f1
  • Proxy Server version 2.0.0b1

HOW TO REPRODUCE IT:

  • Server uses proxy, server writes its proxed ip and port into master-server comment field on subscription
  • Client fetches master server host list, clients connects to server using proxed ip and port
  • Connection happens, RPC calls are proxed, data flow is ok.

On Client disconnection:
IF cause (NetworkDisconnection info) as seen on client is Disconnected → server receives OnPlayerDisconnected
IF cause (NetworkDisconnection info) as seen on client is LostConnection > server receives the following unhandled exception

Unhandled relayed message 20 from <PROXY_IP>:<PROXY_PORT>

I’ve found a workaround by faking ID_CONNECTION_LOST as ID_DISCONNECTION_NOTIFICATION in ProxyServer.cpp

if (packet->data[0] == ID_CONNECTION_LOST) {
     packet->data[0] = ID_DISCONNECTION_NOTIFICATION;
}