private void uLink_OnDisconnectedFromServer(NetworkDisconnection netDisconnect) { NetError lastKickReason = ServerManagement.GetLastKickReason(true); this.LogDisconnect(lastKickReason, new NetworkDisconnection?(netDisconnect)); DisableOnConnectedState.OnDisconnected(); ConsoleSystem.Run("gameui.show", false); this.LoadBackground(); if (lastKickReason != NetError.NoError) { this.ShowInformation("Disconnected (" + lastKickReason.NiceString() + ")"); } else { this.ShowInformation("Disconnected from server."); } LoadingScreen.Hide(); }
private void uLink_OnFailedToConnect(uLink.NetworkConnectionError ulink_error) { if (this.levelLoader) { UnityEngine.Object.Destroy(this.levelLoader); } if (!MainMenu.singleton) { NetError netError = ulink_error.ToNetError(); if (netError != NetError.NoError) { UnityEngine.Debug.LogError(netError.NiceString()); } } try { DisableOnConnectedState.OnDisconnected(); } finally { UnityEngine.Object.Destroy(base.gameObject); } }