Compare commits

...

3 Commits

Author SHA1 Message Date
ElectroJr
4f0f020f56 Version: 147.0.0 2023-08-10 00:40:01 -04:00
Leon Friedrich
5ce8369fb9 Rename a Dirty() proxy method to DirtyEntity() (#4253) 2023-08-10 14:17:57 +10:00
Pieter-Jan Briers
2446e64033 entitysystemupdateorder debug command 2023-08-08 21:36:14 +02:00
7 changed files with 58 additions and 6 deletions

View File

@@ -1,4 +1,4 @@
<Project>
<!-- This file automatically reset by Tools/version.py -->
<!-- This file automatically reset by Tools/version.py -->

View File

@@ -54,6 +54,21 @@ END TEMPLATE-->
*None yet*
## 147.0.0
### Breaking changes
* Renamed one of the EntitySystem.Dirty() methods to `DirtyEntity()` to avoid confusion with the component-dirtying methods.
### New features
* Added debug commands that return the entity system update order.
### Bugfixes
* Fixed a bug in MetaDataSystem that was causing the metadata component to not be marked as dirty.
## 146.0.0
### Breaking changes

View File

@@ -161,3 +161,9 @@ command-description-EqualCommand =
Performs an equality comparison, returning true if the inputs are equal.
command-description-NotEqualCommand =
Performs an equality comparison, returning true if the inputs are not equal.
command-description-entitysystemupdateorder-tick =
Lists the tick update order of entity systems.
command-description-entitysystemupdateorder-frame =
Lists the frame update order of entity systems.

View File

@@ -186,7 +186,7 @@ public partial class EntitySystem
/// Marks an entity as dirty.
/// </summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
protected void Dirty(EntityUid uid, MetaDataComponent? meta = null)
protected void DirtyEntity(EntityUid uid, MetaDataComponent? meta = null)
{
EntityManager.DirtyEntity(uid, meta);
}
@@ -296,7 +296,7 @@ public partial class EntitySystem
if (!Exists(uid))
return false;
Dirty(uid);
DirtyEntity(uid);
return true;
}

View File

@@ -393,6 +393,9 @@ namespace Robust.Shared.GameObjects
return mFrameUpdate!.DeclaringType != typeof(EntitySystem);
}
internal IEnumerable<Type> FrameUpdateOrder => _frameUpdateOrder.Select(c => c.GetType());
internal IEnumerable<Type> TickUpdateOrder => _updateOrder.Select(c => c.System.GetType());
private struct UpdateReg
{
[ViewVariables] public IEntitySystem System;

View File

@@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using Robust.Shared.IoC;
using Robust.Shared.Toolshed;
namespace Robust.Shared.GameObjects;
[ToolshedCommand]
internal sealed class EntitySystemUpdateOrderCommand : ToolshedCommand
{
[Dependency] private readonly IEntitySystemManager _entitySystemManager = default!;
[CommandImplementation("tick")]
public IEnumerable<Type> Tick()
{
var mgr = (EntitySystemManager)_entitySystemManager;
return mgr.TickUpdateOrder;
}
[CommandImplementation("frame")]
public IEnumerable<Type> Frame()
{
var mgr = (EntitySystemManager)_entitySystemManager;
return mgr.FrameUpdateOrder;
}
}

View File

@@ -48,7 +48,7 @@ public abstract class MetaDataSystem : EntitySystem
return;
metadata._entityName = value;
Dirty(uid, metadata);
Dirty(uid, metadata, metadata);
}
public void SetEntityDescription(EntityUid uid, string value, MetaDataComponent? metadata = null)
@@ -57,7 +57,7 @@ public abstract class MetaDataSystem : EntitySystem
return;
metadata._entityDescription = value;
Dirty(uid, metadata);
Dirty(uid, metadata, metadata);
}
internal void SetEntityPrototype(EntityUid uid, EntityPrototype? value, MetaDataComponent? metadata = null)
@@ -100,7 +100,7 @@ public abstract class MetaDataSystem : EntitySystem
RaiseLocalEvent(uid, ref ev);
}
Dirty(uid, metadata);
Dirty(uid, metadata, metadata);
}
/// <summary>