Esempio n. 1
0
 public void Unload()
 {
     if (init && !isDedicated)
     {
         if (instance != null)
         {
             TextAPI.Close();
         }
         TextAPI.Close();
         init = false;
     }
     isServer    = false;
     isDedicated = false;
     running     = false;
 }
Esempio n. 2
0
 public override void Close()
 {
     ModLog.Info("Close Called");
     base.Close();
     MyAPIGateway.Utilities.MessageEntered -= MessageEntered;
     TextAPI.Close();
 }
Esempio n. 3
0
 /// <summary>
 ///     Closes the hud api object.
 /// </summary>
 public void Close()
 {
     if (_hudApi != null)
     {
         IsRegistered = false;
         _hudApi.Close();
         _hudApi = null;
     }
 }
Esempio n. 4
0
        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));
            };
        }
Esempio n. 5
0
        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);
        }
Esempio n. 6
0
 protected override void UnregisterComponent()
 {
     api?.Close();
     api = null;
 }