public void Unload() { if (init && !isDedicated) { if (instance != null) { TextAPI.Close(); } TextAPI.Close(); init = false; } isServer = false; isDedicated = false; running = false; }
public override void Close() { ModLog.Info("Close Called"); base.Close(); MyAPIGateway.Utilities.MessageEntered -= MessageEntered; TextAPI.Close(); }
/// <summary> /// Closes the hud api object. /// </summary> public void Close() { if (_hudApi != null) { IsRegistered = false; _hudApi.Close(); _hudApi = null; } }
protected override void UnloadData() // will act up without the try-catches. yes it's ugly and slow. it only gets called on disconnect so we don't care { try { try { _textAPI.Close(); } catch (Exception e) { MyAPIGateway.Utilities.ShowMessage("Error", e.Message + "\n" + e.StackTrace); } ; try { _mStarted = false; } catch (Exception e) { MyAPIGateway.Utilities.ShowMessage("Error", e.Message + "\n" + e.StackTrace); } ; try { MyAPIGateway.Multiplayer.UnregisterMessageHandler(1337, FoodUpdateMsgHandler); } catch (Exception e) { MyAPIGateway.Utilities.ShowMessage("Error", e.Message + "\n" + e.StackTrace); } ; try { MyAPIGateway.Utilities.MessageEntered -= OnMessageEntered; } catch (Exception e) { MyAPIGateway.Utilities.ShowMessage("Error", e.Message + "\n" + e.StackTrace); } ; } catch (Exception e) { Logging.Instance.WriteLine(("(FoodSystem) Client Unload Data Error: " + e.Message + "\n" + e.StackTrace)); }; }
public void Close() { if (init && !isServer) { init = false; } if (HudAPI != null) { HudAPI.Close(); } running = false; isServer = false; foreach (var surface in RegisteredSurfaces) { surface.Close(false); } RegisteredSurfaces.Clear(); SetUpdateOrder(MyUpdateOrder.NoUpdate); }
protected override void UnregisterComponent() { api?.Close(); api = null; }