Esempio n. 1
0
        public static void Setup()
        {
            IsServer       = MyAPIGateway.Multiplayer.IsServer;
            IsDedicated    = MyAPIGateway.Utilities.IsDedicated;
            ConfigInstance = MyAPIGateway.Utilities.GamePaths.ModScopeName;
            SyncManager.Setup();

            //Add ShieldBlocks To TargetHelper
            TargetHelper.ShieldBlockIDs.Add(new MyDefinitionId(typeof(MyObjectBuilder_UpgradeModule), "EmitterSA"));
            TargetHelper.ShieldBlockIDs.Add(new MyDefinitionId(typeof(MyObjectBuilder_UpgradeModule), "EmitterLA"));
            TargetHelper.ShieldBlockIDs.Add(new MyDefinitionId(typeof(MyObjectBuilder_UpgradeModule), "EmitterST"));
            TargetHelper.ShieldBlockIDs.Add(new MyDefinitionId(typeof(MyObjectBuilder_UpgradeModule), "EmitterS"));
            TargetHelper.ShieldBlockIDs.Add(new MyDefinitionId(typeof(MyObjectBuilder_UpgradeModule), "EmitterL"));
            TargetHelper.ShieldBlockIDs.Add(new MyDefinitionId(typeof(MyObjectBuilder_UpgradeModule), "DS_Supergen"));
            TargetHelper.ShieldBlockIDs.Add(new MyDefinitionId(typeof(MyObjectBuilder_Refinery), "LargeShipSmallShieldGeneratorBase"));
            TargetHelper.ShieldBlockIDs.Add(new MyDefinitionId(typeof(MyObjectBuilder_Refinery), "LargeShipLargeShieldGeneratorBase"));
            TargetHelper.ShieldBlockIDs.Add(new MyDefinitionId(typeof(MyObjectBuilder_Refinery), "SmallShipSmallShieldGeneratorBase"));
            TargetHelper.ShieldBlockIDs.Add(new MyDefinitionId(typeof(MyObjectBuilder_Refinery), "SmallShipMicroShieldGeneratorBase"));

            //LogicManager.Setup();

            if (!IsServer)
            {
                return;
            }

            EntityWatcher.RegisterWatcher();
            Logger.LoadDebugFromSandbox();
            MyAPIGateway.Session.DamageSystem.RegisterAfterDamageHandler(75, DamageHelper.DamageHandler);
        }
Esempio n. 2
0
        protected override void UnloadData()
        {
            if (ShieldApiLoaded)
            {
                SApi.Unload();
            }

            if (WeaponCoreLoaded)
            {
                WeaponCore.Unload();
            }

            if (MESApi.MESApiReady)
            {
                MESApi.UnregisterListener();
            }

            if (WaterMod.Registered)
            {
                WaterMod.Unregister();
                WaterMod.OnRegisteredEvent -= WaterLogged;
                WaterMod.WaterCreatedEvent -= WaterHelper.WaterAdded;
                WaterMod.WaterRemovedEvent -= WaterHelper.WaterRemoved;
            }

            DebugTerminalControls.RegisterControls(false);

            Instance = null;

            SyncManager.Close();
            DamageHelper.UnregisterEntityWatchers();
            BehaviorManager.Behaviors.Clear();
            EntityWatcher.UnregisterWatcher();
        }
Esempio n. 3
0
        protected override void UnloadData()
        {
            if (ShieldApiLoaded)
            {
                SApi.Unload();
            }

            if (WeaponCoreLoaded)
            {
                WeaponCore.Unload();
            }

            if (MESApi.MESApiReady)
            {
                MESApi.UnregisterListener();
            }

            Instance = null;

            SyncManager.Close();
            DamageHelper.UnregisterEntityWatchers();
            BehaviorManager.Behaviors.Clear();
            EntityWatcher.UnregisterWatcher();
        }