diff --git a/Heart Module/Data/Scripts/HeartModule/ExceptionHandler/CriticalHandle.cs b/Heart Module/Data/Scripts/HeartModule/ExceptionHandler/CriticalHandle.cs index 5b6454b6..290e26cf 100644 --- a/Heart Module/Data/Scripts/HeartModule/ExceptionHandler/CriticalHandle.cs +++ b/Heart Module/Data/Scripts/HeartModule/ExceptionHandler/CriticalHandle.cs @@ -1,16 +1,11 @@ using Sandbox.Game; using Sandbox.ModAPI; using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using VRage.Game.Components; using VRage.Utils; namespace Heart_Module.Data.Scripts.HeartModule.ExceptionHandler { - + public class CriticalHandle { const int WarnTimeSeconds = 20; @@ -39,7 +34,7 @@ public void Update() } if (!MyAPIGateway.Utilities.IsDedicated) - MyAPIGateway.Utilities.ShowNotification($"HeartMod CRITICAL ERROR - Shutting down in {secondsRemaining}s", 1000/60); + MyAPIGateway.Utilities.ShowNotification($"HeartMod CRITICAL ERROR - Shutting down in {secondsRemaining}s", 1000 / 60); } public void UnloadData() @@ -55,6 +50,7 @@ public static void ThrowCriticalException(Exception ex, Type callingType, ulong private void m_ThrowCriticalException(Exception ex, Type callingType, ulong callerId = ulong.MaxValue) { HeartData.I.IsSuspended = true; + HeartData.I.Log.Log("Start Throw Critical Exception " + CriticalCloseTime); if (CriticalCloseTime != -1) return; diff --git a/Heart Module/Data/Scripts/HeartModule/ExceptionHandler/HeartLog.cs b/Heart Module/Data/Scripts/HeartModule/ExceptionHandler/HeartLog.cs index 9ce05494..607b4994 100644 --- a/Heart Module/Data/Scripts/HeartModule/ExceptionHandler/HeartLog.cs +++ b/Heart Module/Data/Scripts/HeartModule/ExceptionHandler/HeartLog.cs @@ -1,10 +1,6 @@ using Sandbox.ModAPI; using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace Heart_Module.Data.Scripts.HeartModule.ExceptionHandler { @@ -27,6 +23,8 @@ public void Log(string message) public void LogException(Exception ex, Type callingType, string prefix = "") { + if (ex == null) + return; Log(prefix + $"Exception in {callingType.FullName}! {ex.Message}\n{ex.StackTrace}"); } } diff --git a/Heart Module/Data/Scripts/HeartModule/ExceptionHandler/NetworkedError.cs b/Heart Module/Data/Scripts/HeartModule/ExceptionHandler/NetworkedError.cs index 079d1adc..a9c34911 100644 --- a/Heart Module/Data/Scripts/HeartModule/ExceptionHandler/NetworkedError.cs +++ b/Heart Module/Data/Scripts/HeartModule/ExceptionHandler/NetworkedError.cs @@ -2,7 +2,6 @@ using Heart_Module.Data.Scripts.HeartModule.Network; using ProtoBuf; using System; -using VRage.Utils; namespace Heart_Module.Data.Scripts.HeartModule.ExceptionHandler { diff --git a/Heart Module/Data/Scripts/HeartModule/ExceptionHandler/SoftHandle.cs b/Heart Module/Data/Scripts/HeartModule/ExceptionHandler/SoftHandle.cs index 1fe38433..83ec6d83 100644 --- a/Heart Module/Data/Scripts/HeartModule/ExceptionHandler/SoftHandle.cs +++ b/Heart Module/Data/Scripts/HeartModule/ExceptionHandler/SoftHandle.cs @@ -1,12 +1,6 @@ using Heart_Module.Data.Scripts.HeartModule.ExceptionHandler; using Sandbox.ModAPI; using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using VRage.Scripting; -using VRage.Utils; namespace Heart_Module.Data.Scripts.HeartModule.ErrorHandler { @@ -14,7 +8,7 @@ public class SoftHandle { public static void RaiseException(string message, Type callingType = null, ulong callerId = ulong.MaxValue) { - MyAPIGateway.Utilities.ShowNotification("Minor Exception: " + message); + //MyAPIGateway.Utilities.ShowNotification("Minor Exception: " + message); Exception soft = new Exception(message); HeartData.I.Log.LogException(soft, callingType ?? typeof(SoftHandle), callerId != ulong.MaxValue ? $"Shared exception from {callerId}: " : ""); if (MyAPIGateway.Session.IsServer) @@ -23,7 +17,7 @@ public static void RaiseException(string message, Type callingType = null, ulong public static void RaiseException(Exception exception, Type callingType = null, ulong callerId = ulong.MaxValue) { - MyAPIGateway.Utilities.ShowNotification("Minor Exception: " + exception.Message); + //MyAPIGateway.Utilities.ShowNotification("Minor Exception: " + exception.Message); HeartData.I.Log.LogException(exception, callingType ?? typeof(SoftHandle), callerId != ulong.MaxValue ? $"Shared exception from {callerId}: " : ""); } diff --git a/Heart Module/Data/Scripts/HeartModule/HeartLoad.cs b/Heart Module/Data/Scripts/HeartModule/HeartLoad.cs index a1130159..2ad14eba 100644 --- a/Heart Module/Data/Scripts/HeartModule/HeartLoad.cs +++ b/Heart Module/Data/Scripts/HeartModule/HeartLoad.cs @@ -1,9 +1,6 @@ using Heart_Module.Data.Scripts.HeartModule.ErrorHandler; using Heart_Module.Data.Scripts.HeartModule.ExceptionHandler; using System; -using System.Diagnostics; -using System.Text; -using System.Threading.Tasks; using VRage.Game.Components; namespace Heart_Module.Data.Scripts.HeartModule @@ -12,7 +9,7 @@ namespace Heart_Module.Data.Scripts.HeartModule internal class HeartLoad : MySessionComponentBase { CriticalHandle handle; - + public override void LoadData() { diff --git a/Heart Module/Data/Scripts/HeartModule/Network/HeartNetwork.cs b/Heart Module/Data/Scripts/HeartModule/Network/HeartNetwork.cs index 3e8f0a5b..251b3ded 100644 --- a/Heart Module/Data/Scripts/HeartModule/Network/HeartNetwork.cs +++ b/Heart Module/Data/Scripts/HeartModule/Network/HeartNetwork.cs @@ -2,12 +2,7 @@ using Sandbox.ModAPI; using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using VRage.Game.Components; using VRage.Game.ModAPI; -using VRage.Utils; namespace Heart_Module.Data.Scripts.HeartModule.Network { diff --git a/Heart Module/Data/Scripts/HeartModule/Network/PacketBase.cs b/Heart Module/Data/Scripts/HeartModule/Network/PacketBase.cs index 655a5ddd..4f965171 100644 --- a/Heart Module/Data/Scripts/HeartModule/Network/PacketBase.cs +++ b/Heart Module/Data/Scripts/HeartModule/Network/PacketBase.cs @@ -1,10 +1,5 @@ using Heart_Module.Data.Scripts.HeartModule.Projectiles.StandardClasses; using ProtoBuf; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace Heart_Module.Data.Scripts.HeartModule.Network { diff --git a/Heart Module/Data/Scripts/HeartModule/Projectiles/DamageHandler.cs b/Heart Module/Data/Scripts/HeartModule/Projectiles/DamageHandler.cs index 4fe9dae2..c73d2c2b 100644 --- a/Heart Module/Data/Scripts/HeartModule/Projectiles/DamageHandler.cs +++ b/Heart Module/Data/Scripts/HeartModule/Projectiles/DamageHandler.cs @@ -2,12 +2,8 @@ using Sandbox.ModAPI; using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using VRage.Game; using VRage.Game.ModAPI; -using VRage.Utils; using VRageMath; namespace Heart_Module.Data.Scripts.HeartModule.Projectiles @@ -45,13 +41,13 @@ private void m_Update() switch (damageEvent.Type) { case DamageEvent.DamageEntType.Grid: - m_GridDamageHandler((IMyCubeGrid) damageEvent.Entity, damageEvent); + m_GridDamageHandler((IMyCubeGrid)damageEvent.Entity, damageEvent); break; case DamageEvent.DamageEntType.Character: - m_CharacterDamageHandler((IMyCharacter) damageEvent.Entity, damageEvent); + m_CharacterDamageHandler((IMyCharacter)damageEvent.Entity, damageEvent); break; case DamageEvent.DamageEntType.Projectile: - m_ProjectileDamageHandler((Projectile) damageEvent.Entity, damageEvent); + m_ProjectileDamageHandler((Projectile)damageEvent.Entity, damageEvent); break; } } diff --git a/Heart Module/Data/Scripts/HeartModule/Projectiles/Projectile.cs b/Heart Module/Data/Scripts/HeartModule/Projectiles/Projectile.cs index a96a2548..69a3ad3b 100644 --- a/Heart Module/Data/Scripts/HeartModule/Projectiles/Projectile.cs +++ b/Heart Module/Data/Scripts/HeartModule/Projectiles/Projectile.cs @@ -1,14 +1,12 @@ using Heart_Module.Data.Scripts.HeartModule.Debug; using Heart_Module.Data.Scripts.HeartModule.ErrorHandler; using Heart_Module.Data.Scripts.HeartModule.Projectiles.StandardClasses; -using Sandbox.Game.Entities; using Sandbox.ModAPI; using System; using System.Collections.Generic; -using VRage.Game; -using VRage.Game.Entity; using VRage.Game.ModAPI; using VRage.ModAPI; +using VRage.Utils; using VRageMath; namespace Heart_Module.Data.Scripts.HeartModule.Projectiles @@ -23,12 +21,12 @@ public partial class Projectile public Vector3D InheritedVelocity; #endregion - public long Firer; - public Vector3D Position; - public Vector3D Direction; - public float Velocity; - public int RemainingImpacts; - + public long Firer = -1; + public Vector3D Position = Vector3D.Zero; + public Vector3D Direction = Vector3D.Up; + public float Velocity = 0; + public int RemainingImpacts = 0; + public Action Close = (p) => { }; public long LastUpdate { get; private set; } @@ -39,7 +37,7 @@ public partial class Projectile public Projectile() { } public Projectile(SerializableProjectile projectile) - { + { if (!ProjectileManager.I.IsIdAvailable(projectile.Id)) { SoftHandle.RaiseSyncException("Unable to spawn projectile - duplicate Id!"); @@ -47,16 +45,17 @@ public Projectile(SerializableProjectile projectile) return; } - if (!ProjectileDefinitionManager.HasDefinition(projectile.DefinitionId)) + if (!projectile.DefinitionId.HasValue || !ProjectileDefinitionManager.HasDefinition(projectile.DefinitionId.Value)) { SoftHandle.RaiseSyncException("Unable to spawn projectile - invalid DefinitionId!"); + DefinitionId = -1; return; } Id = projectile.Id; - DefinitionId = projectile.DefinitionId; - Definition = ProjectileDefinitionManager.GetDefinition(projectile.DefinitionId); - Firer = projectile.Firer; + DefinitionId = projectile.DefinitionId.Value; + Definition = ProjectileDefinitionManager.GetDefinition(projectile.DefinitionId.Value); + Firer = projectile.Firer.GetValueOrDefault(0); // TODO fill in from Definition SyncUpdate(projectile); @@ -102,7 +101,7 @@ public void DrawUpdate(float delta) { DebugDraw.AddPoint(Position + (InheritedVelocity + Direction * (Velocity + Definition.PhysicalProjectile.Acceleration * delta)) * delta, Color.Green, 0.000001f); } - + public void CheckHits(float delta) { List intersects = new List(); @@ -137,38 +136,59 @@ public void ProjectileHit(IMyEntity impact) public void SyncUpdate(SerializableProjectile projectile) { - if (DefinitionId != projectile.DefinitionId) - { - SoftHandle.RaiseSyncException("DefinitionId Mismatch!"); - return; - } - QueuedDispose = !projectile.IsActive; LastUpdate = projectile.Timestamp; - float delta = (DateTime.Now.Ticks - LastUpdate) / (float) TimeSpan.TicksPerSecond; + float delta = (DateTime.Now.Ticks - LastUpdate) / (float)TimeSpan.TicksPerSecond; + + // The following values may be null to save network load + if (projectile.Direction.HasValue) + Direction = projectile.Direction.Value; + if (projectile.Position.HasValue) + Position = projectile.Position.Value; + if (projectile.Velocity.HasValue) + Velocity = projectile.Velocity.Value; + if (projectile.InheritedVelocity.HasValue) + InheritedVelocity = projectile.InheritedVelocity.Value; + if (projectile.RemainingImpacts.HasValue) + RemainingImpacts = projectile.RemainingImpacts.Value; - Direction = projectile.Direction; - Position = projectile.Position; - Velocity = projectile.Velocity; - InheritedVelocity = projectile.InheritedVelocity; - RemainingImpacts = projectile.RemainingImpacts; TickUpdate(delta); } - public SerializableProjectile AsSerializable() + /// + /// Returns the projectile as a network-ready projectile info class. 0 = max detail, 2+ = min detail + /// + /// + /// + public SerializableProjectile AsSerializable(int DetailLevel = 1) { - return new SerializableProjectile() + SerializableProjectile projectile = new SerializableProjectile() { IsActive = !QueuedDispose, Id = Id, - DefinitionId = DefinitionId, - Position = Position, - Direction = Direction, - InheritedVelocity = InheritedVelocity, - Velocity = Velocity, Timestamp = DateTime.Now.Ticks, }; + + switch (DetailLevel) + { + case 0: + projectile.DefinitionId = DefinitionId; + projectile.Position = Position; + projectile.Direction = Direction; + projectile.InheritedVelocity = InheritedVelocity; + projectile.Velocity = Velocity; + break; + case 1: + projectile.Position = Position; + if (Definition.Guidance.Length > 0) + projectile.Direction = Direction; + if (Definition.PhysicalProjectile.Acceleration > 0) + projectile.Velocity = Velocity; + break; + } + + return projectile; } public void QueueDispose() diff --git a/Heart Module/Data/Scripts/HeartModule/Projectiles/ProjectileManager.cs b/Heart Module/Data/Scripts/HeartModule/Projectiles/ProjectileManager.cs index 9b1a2b00..651ef4dc 100644 --- a/Heart Module/Data/Scripts/HeartModule/Projectiles/ProjectileManager.cs +++ b/Heart Module/Data/Scripts/HeartModule/Projectiles/ProjectileManager.cs @@ -1,5 +1,4 @@ using Heart_Module.Data.Scripts.HeartModule.ErrorHandler; -using Heart_Module.Data.Scripts.HeartModule.Network; using Heart_Module.Data.Scripts.HeartModule.Projectiles.StandardClasses; using Sandbox.ModAPI; using System; @@ -7,7 +6,6 @@ using System.Diagnostics; using System.Linq; using VRage.Game.Components; -using VRage.Utils; using VRageMath; namespace Heart_Module.Data.Scripts.HeartModule.Projectiles @@ -16,7 +14,7 @@ namespace Heart_Module.Data.Scripts.HeartModule.Projectiles public class ProjectileManager : MySessionComponentBase { public static ProjectileManager I = new ProjectileManager(); - const int MaxProjectilesSynced = 50; // TODO: Sync within range of client & possibly current network load + const int MaxProjectilesSynced = 25; // TODO: Sync within range of client. This value should be ~100kB/s per player private Dictionary ActiveProjectiles = new Dictionary(); private List ProjectileSyncStream = new List(); @@ -59,7 +57,7 @@ public override void UpdateAfterSimulation() { if (HeartData.I.IsSuspended) return; - if (j >= 100 && MyAPIGateway.Session.IsServer) + if (j >= 1 && MyAPIGateway.Session.IsServer) { j = 0; try @@ -77,7 +75,7 @@ public override void UpdateAfterSimulation() Firer = MyAPIGateway.Session.Player?.Controller.ControlledEntity.Entity.EntityId ?? -1, }); AddProjectile(p); - MyLog.Default.WriteLineToConsole($"Projectiles: {ActiveProjectiles.Count}"); + //MyLog.Default.WriteLineToConsole($"Projectiles: {ActiveProjectiles.Count}"); } catch (Exception ex) { @@ -86,7 +84,7 @@ public override void UpdateAfterSimulation() } j++; - delta = clock.ElapsedTicks / (float) TimeSpan.TicksPerSecond; + delta = clock.ElapsedTicks / (float)TimeSpan.TicksPerSecond; // Tick projectiles foreach (var projectile in ActiveProjectiles.Values) @@ -101,7 +99,7 @@ public override void UpdateAfterSimulation() { //MyAPIGateway.Utilities.ShowMessage("Heart", $"Closing projectile {projectile.Id}. Age: {projectile.Age} "); if (MyAPIGateway.Session.IsServer) - SyncProjectile(projectile); + SyncProjectile(projectile, 2); projectile.Close.Invoke(projectile); } QueuedCloseProjectiles.Clear(); @@ -116,7 +114,7 @@ public override void UpdateAfterSimulation() if (ActiveProjectiles.ContainsKey(id)) { - SyncProjectile(ActiveProjectiles[id]); + SyncProjectile(ActiveProjectiles[id], 1); numSyncs++; } } @@ -129,8 +127,11 @@ public override void UpdateAfterSimulation() else ProjectileSyncStream.RemoveRange(0, MaxProjectilesSynced); } - MyAPIGateway.Utilities.ShowNotification("Projectiles: " + ActiveProjectiles.Count, 1000/60); - + else + { + MyAPIGateway.Utilities.ShowNotification("Projectiles: " + ActiveProjectiles.Count, 1000 / 60); + } + DamageHandler.Update(); clock.Restart(); @@ -147,7 +148,7 @@ public override void Draw() if (MyAPIGateway.Utilities.IsDedicated) return; - + delta = clock.ElapsedTicks / (float)TimeSpan.TicksPerSecond; // Triggered every frame, avoids jitter in projectiles foreach (var projectile in ActiveProjectiles.Values) @@ -156,12 +157,12 @@ public override void Draw() } } - public void ClientSyncProjectile(SerializableProjectile projectile) + public void UpdateProjectile(SerializableProjectile projectile) { if (MyAPIGateway.Session.IsServer) return; - if (IsIdAvailable(projectile.Id) && projectile.IsActive) + if (IsIdAvailable(projectile.Id) && projectile.IsActive && projectile.DefinitionId.HasValue) AddProjectile(new Projectile(projectile)); else GetProjectile(projectile.Id)?.SyncUpdate(projectile); @@ -169,7 +170,7 @@ public void ClientSyncProjectile(SerializableProjectile projectile) public void AddProjectile(Projectile projectile) { - if (projectile == null) return; // ??? + if (projectile == null || projectile.DefinitionId == -1) return; // Ensure that invalid projectiles don't get added NextId++; while (!IsIdAvailable(NextId)) @@ -177,10 +178,10 @@ public void AddProjectile(Projectile projectile) projectile.SetId(NextId); projectile.Close += (p) => ActiveProjectiles.Remove(p.Id); ActiveProjectiles.Add(projectile.Id, projectile); - SyncProjectile(projectile); + SyncProjectile(projectile, 0); } - public void SyncProjectile(Projectile projectile) => HeartData.I.Net.SendToEveryone(projectile.AsSerializable()); + public void SyncProjectile(Projectile projectile, int DetailLevel = 1) => HeartData.I.Net.SendToEveryone(projectile.AsSerializable(DetailLevel)); public Projectile GetProjectile(uint id) => ActiveProjectiles.GetValueOrDefault(id, null); public bool IsIdAvailable(uint id) => !ActiveProjectiles.ContainsKey(id); diff --git a/Heart Module/Data/Scripts/HeartModule/Projectiles/StandardClasses/SerializableProjectile.cs b/Heart Module/Data/Scripts/HeartModule/Projectiles/StandardClasses/SerializableProjectile.cs index 740cfdc6..fb38e8e3 100644 --- a/Heart Module/Data/Scripts/HeartModule/Projectiles/StandardClasses/SerializableProjectile.cs +++ b/Heart Module/Data/Scripts/HeartModule/Projectiles/StandardClasses/SerializableProjectile.cs @@ -2,9 +2,7 @@ using ProtoBuf; using Sandbox.ModAPI; using System.Collections.Generic; -using VRage.Utils; using VRageMath; -using YourName.ModName.Data.Scripts.HeartModule.Utility; namespace Heart_Module.Data.Scripts.HeartModule.Projectiles.StandardClasses { @@ -14,26 +12,28 @@ namespace Heart_Module.Data.Scripts.HeartModule.Projectiles.StandardClasses [ProtoContract] public class SerializableProjectile : PacketBase { - // TODO add close projectile bool + // ProtoMember IDs are high to avoid collisions [ProtoMember(22)] public bool IsActive = true; [ProtoMember(23)] public uint Id; - [ProtoMember(24)] public int DefinitionId; - [ProtoMember(25)] public Vector3D Position; - [ProtoMember(26)] public Vector3D Direction; - [ProtoMember(27)] public Vector3D InheritedVelocity; - [ProtoMember(28)] public float Velocity; - [ProtoMember(29)] public int RemainingImpacts; - [ProtoMember(210)] public Dictionary OverridenValues; [ProtoMember(211)] public long Timestamp; - [ProtoMember(212)] public long Firer; - + + // All non-required values are nullable + [ProtoMember(24)] public int? DefinitionId; + [ProtoMember(25)] public Vector3D? Position; + [ProtoMember(26)] public Vector3D? Direction; + [ProtoMember(27)] public Vector3D? InheritedVelocity; + [ProtoMember(28)] public float? Velocity; + [ProtoMember(29)] public int? RemainingImpacts; + [ProtoMember(210)] public Dictionary OverridenValues; + [ProtoMember(212)] public long? Firer; + public override void Received(ulong SenderSteamId) { if (MyAPIGateway.Session.IsServer) return; - ProjectileManager.I.ClientSyncProjectile(this); + ProjectileManager.I.UpdateProjectile(this); } } } diff --git a/Heart Module/Data/Scripts/HeartModule/Projectiles/StandardClasses/SerializableProjectileDefinition.cs b/Heart Module/Data/Scripts/HeartModule/Projectiles/StandardClasses/SerializableProjectileDefinition.cs index 71d20b8f..3507fb24 100644 --- a/Heart Module/Data/Scripts/HeartModule/Projectiles/StandardClasses/SerializableProjectileDefinition.cs +++ b/Heart Module/Data/Scripts/HeartModule/Projectiles/StandardClasses/SerializableProjectileDefinition.cs @@ -73,10 +73,10 @@ public struct Visual { [ProtoMember(1)] public string Model; [ProtoMember(2)] public string TrailTexture; - [ProtoMember(3)] public float TrailFadeTime; + [ProtoMember(3)] public float TrailFadeTime; [ProtoMember(4)] public string AttachedParticle; [ProtoMember(5)] public string ImpactParticle; - [ProtoMember(6)] public float VisibleChance; + [ProtoMember(6)] public float VisibleChance; } [ProtoContract] @@ -84,7 +84,7 @@ public struct Audio { [ProtoMember(1)] public string TravelSound; [ProtoMember(2)] public string ImpactSound; - [ProtoMember(3)] public float ImpactSoundChance; + [ProtoMember(3)] public float ImpactSoundChance; } [ProtoContract] diff --git a/Heart Module/Data/Scripts/HeartModule/Utility/Heart_Logger.cs b/Heart Module/Data/Scripts/HeartModule/Utility/Heart_Logger.cs.disabled similarity index 99% rename from Heart Module/Data/Scripts/HeartModule/Utility/Heart_Logger.cs rename to Heart Module/Data/Scripts/HeartModule/Utility/Heart_Logger.cs.disabled index a4751c55..732340a5 100644 --- a/Heart Module/Data/Scripts/HeartModule/Utility/Heart_Logger.cs +++ b/Heart Module/Data/Scripts/HeartModule/Utility/Heart_Logger.cs.disabled @@ -1,9 +1,9 @@ -using System; +using ParallelTasks; +using Sandbox.ModAPI; +using System; using System.Collections.Generic; using System.IO; using System.Text; -using ParallelTasks; -using Sandbox.ModAPI; using VRage.Game; using VRage.Game.Components; using VRage.Game.ModAPI; diff --git a/Heart Module/Data/Scripts/HeartModule/Weapons/Setup/Adding/SorterWeaponLogic.cs b/Heart Module/Data/Scripts/HeartModule/Weapons/Setup/Adding/SorterWeaponLogic.cs index 6ec373a8..58cbf010 100644 --- a/Heart Module/Data/Scripts/HeartModule/Weapons/Setup/Adding/SorterWeaponLogic.cs +++ b/Heart Module/Data/Scripts/HeartModule/Weapons/Setup/Adding/SorterWeaponLogic.cs @@ -1,5 +1,4 @@ using Sandbox.Common.ObjectBuilders; -using Sandbox.Game.EntityComponents; using Sandbox.ModAPI; using System; using VRage.Game.Components; @@ -7,8 +6,6 @@ using VRage.ModAPI; using VRage.ObjectBuilders; using VRage.Sync; -using VRageMath; -using YourName.ModName.Data.Scripts.HeartModule.Utility; namespace YourName.ModName.Data.Scripts.HeartModule.Weapons.Setup.Adding { @@ -50,7 +47,7 @@ public override void UpdateOnceBeforeFrame() if (SorterWep.CubeGrid?.Physics == null) return; // ignore ghost/projected grids - // LoadSettings(); // artifact from chets meme + // LoadSettings(); // artifact from chets meme } public float Terminal_ExampleFloat { get; set; } diff --git a/Heart Module/Data/Scripts/HeartModule/Weapons/Setup/Adding/SorterWeaponTerminalControls.cs b/Heart Module/Data/Scripts/HeartModule/Weapons/Setup/Adding/SorterWeaponTerminalControls.cs index 2fb8b307..efa6a861 100644 --- a/Heart Module/Data/Scripts/HeartModule/Weapons/Setup/Adding/SorterWeaponTerminalControls.cs +++ b/Heart Module/Data/Scripts/HeartModule/Weapons/Setup/Adding/SorterWeaponTerminalControls.cs @@ -1,15 +1,8 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Reflection; -using System.Text; -using Sandbox.Game.Localization; +using Sandbox.Game.Localization; using Sandbox.ModAPI; using Sandbox.ModAPI.Interfaces.Terminal; -using VRage.Game; -using VRage.Game.Components; +using System.Text; using VRage.Game.ModAPI; -using VRage.ModAPI; using VRage.Utils; using VRageMath; diff --git a/Heart Module/Data/Scripts/HeartModule/Weapons/Setup/Hiding/ConveyorSorterLogic.cs b/Heart Module/Data/Scripts/HeartModule/Weapons/Setup/Hiding/ConveyorSorterLogic.cs index 97ebd7ac..c25d36d6 100644 --- a/Heart Module/Data/Scripts/HeartModule/Weapons/Setup/Hiding/ConveyorSorterLogic.cs +++ b/Heart Module/Data/Scripts/HeartModule/Weapons/Setup/Hiding/ConveyorSorterLogic.cs @@ -1,6 +1,5 @@ using Sandbox.Common.ObjectBuilders; using Sandbox.ModAPI; -using VRage.Game; using VRage.Game.Components; using VRage.ModAPI; using VRage.ObjectBuilders; diff --git a/Heart Module/Data/Scripts/HeartModule/Weapons/Setup/Hiding/HideSorterControls.cs b/Heart Module/Data/Scripts/HeartModule/Weapons/Setup/Hiding/HideSorterControls.cs index d5d93cc5..9da25207 100644 --- a/Heart Module/Data/Scripts/HeartModule/Weapons/Setup/Hiding/HideSorterControls.cs +++ b/Heart Module/Data/Scripts/HeartModule/Weapons/Setup/Hiding/HideSorterControls.cs @@ -1,6 +1,6 @@ -using System.Collections.Generic; -using Sandbox.ModAPI; +using Sandbox.ModAPI; using Sandbox.ModAPI.Interfaces.Terminal; +using System.Collections.Generic; namespace YourName.ModName.Data.Scripts.HeartModule.Weapons.Setup.Hiding { diff --git a/Heart Module/Data/Scripts/HeartModule/Weapons/Setup/Hiding/TerminalChainedDelegate.cs b/Heart Module/Data/Scripts/HeartModule/Weapons/Setup/Hiding/TerminalChainedDelegate.cs index 89f1775b..599e9c22 100644 --- a/Heart Module/Data/Scripts/HeartModule/Weapons/Setup/Hiding/TerminalChainedDelegate.cs +++ b/Heart Module/Data/Scripts/HeartModule/Weapons/Setup/Hiding/TerminalChainedDelegate.cs @@ -1,5 +1,5 @@ -using System; -using Sandbox.ModAPI; +using Sandbox.ModAPI; +using System; namespace YourName.ModName.Data.Scripts.HeartModule.Weapons.Setup.Hiding {