private void _OnLidgrenStatusChanged() { Log.Info(NetworkLogFlags.MasterServer, "MasterServer connection status is now ", _master.Status); if (_master.Status == NetConnectionStatus.Connected) { foreach (var msg in _pendingMessages) { _master.SendMessage(msg.Value.stream._buffer, NetChannel.ReliableInOrder1); } _pendingMessages.Clear(); if (_master.ServerConnection.RemoteHailData != null && _master.ServerConnection.RemoteHailData.Length != 0) { try { _masterGaveMyEndpoint = new NetworkEndPoint(new IPAddress(_master.ServerConnection.RemoteHailData), 0); } catch (Exception ex) { Log.Error(NetworkLogFlags.MasterServer, "Failed to receive valid external IP ", NetUtility.BytesToHex(_master.ServerConnection.RemoteHailData), " from MasterServer: ", ex); } } } else if (_master.Status == NetConnectionStatus.Disconnected) { _MasterDisconnect(); } }