Skip to content

Commit

Permalink
Merge
Browse files Browse the repository at this point in the history
  • Loading branch information
k3yw committed Jan 9, 2024
2 parents 56b2a3d + 7592997 commit a84b1c3
Show file tree
Hide file tree
Showing 132 changed files with 2,502 additions and 1,630 deletions.
2 changes: 1 addition & 1 deletion MSBuild/Robust.Engine.Version.props
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project>
<!-- This file automatically reset by Tools/version.py -->
<PropertyGroup><Version>198.0.1</Version></PropertyGroup>
<PropertyGroup><Version>203.0.0</Version></PropertyGroup>
</Project>
Expand Down
131 changes: 129 additions & 2 deletions RELEASE-NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,13 @@ END TEMPLATE-->

### New features

*None yet*
* `TextEdit.OnTextChanged`
* Add Pick and PickAndTake versions for System.Random for ICollections.

### Bugfixes

*None yet*
* Fix `IClipboardManager.GetText()` returning null in some cases.
* Fix possible NRE in server-side console command completion code.

### Other

Expand All @@ -54,6 +56,131 @@ END TEMPLATE-->
*None yet*


## 203.0.0

### Breaking changes

* `IComponentFactory.RegisterIgnore()` no longer supports overwriting existing registrations, components should get ignored before they are registered.
* Event bus subscriptions are now locked after `IEntityManager` has started, instead of after the first component gets added. Any event subscriptions now need to happen before startup (but after init).
* Event bus subscriptions must now be locked before raising any events.
* Delete FodyWeavers.xsd as it hasn't been used for a long time.
* Remove physics sleep cancelling as it was, in hindsight, a bad idea.

### New features

* `RobustUnitTest` now has a `ExtraComponents` field for automatically registering additional components.
* `IComponentFactory.RegisterIgnore()` now accepts more than one string.
* Added `IComponentFactory.RegisterTypes` for simultaneously registering multiple components.

### Bugfixes

* Clamp volume calculations for audio rather than throwing.


## 202.1.1

### Bugfixes

* Reverted some map/grid initialisation changes that might've been causing broadphase/physics errors.
* Fixed PVS sometimes sending entities without first sending their children.
* Fixed a container state handling bug caused by containers not removing expected entities when shutting down.
* Fixed a `EnsureEntity<T>` state handling bug caused by improper handling of entity deletions.
* Fixed a bad NetSyncEnabled debug assert.


## 202.1.0

### New features

* Add GetLocalEntitiesIntersecting overload that takes in a griduid and a Vector2i tile.


## 202.0.0

### Breaking changes

* Various entity manager methods now have a new `where T : IComponent` constraint.
* The `IComponentFactory.ComponentAdded` event has been renamed to `ComponentsAdded` and now provides an array of component registrations.
* `IComponentFactory.RegisterIgnore()` no longer supports overwriting existing registrations, components should get ignored before they are registered.

### New features

* Added `IComponentFactory.GetAllRegistrations()`
* Add IComponentState interface support for component states so structs can be used in lieu of classes.


## 201.0.0

### Breaking changes

* The `zCircleGradient` shader function arguments have changed. It now requires a pixel-size to ensure that the gradient is properly entered.

### Bugfixes

* Fixed some PVS null reference errors.


## 200.0.0

### Breaking changes

* MappingDataNode is now ordered.
* Make invalid AutoNetworkedFields compiler errors.

### New features

* `OSWindowStyles.NoTitleBar` (supported only on Linux X11 for now).

### Bugfixes

* Avoid calling DirtyEntity when a component's last modified tick is not current.
* Fix `tpgrid` allowing moving grids to nullspace.

### Other

* `OSWindowStyles.NoTitleOptions` is now supported on Linux X11.


## 199.0.0

### Breaking changes

* Various `IEntityManager` C# events now use `Entity<MetadataComponent>` instead of `EntityUid`
* Entity visibility masks now use a ushort instead of an integer.
* Run grid traversal on entity spawn.

### New features

* Added two new `IEntityManager` C# events that get raiseed before and after deleting ("flushing") all entities.
* Added a new `DeleteEntity()` override that takes in the entity's metadata and transform components.
* Add better audio logs.
* Expand z-library shader.
* Add a Box2i union for Vector2i and add a Contains variant that assumes the Vector2i is a tile and not a point.

### Bugfixes

* Try to prevent some NREs in PVS.
* More PVS fixes and cleanup.


## 198.1.0

### New features

* `IClydeViewport` now provides access to the light render target.
* Added a style-class to the `MenuBar` popup control.
* Added `NextGaussian()` extension method for `System.Random`.
* Added per-session variant of `PvsOverrideSystem.AddForceSend()`.

### Bugfixes

* Stopped the client from logging errors when attempting to delete invalid entities.

### Other

* The `DevWindow` UI inspector has been improved a bit and it now groups properties by their defining type.


## 198.0.1

### Bugfixes
Expand Down
1 change: 1 addition & 0 deletions Resources/Locale/en-US/commands.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ cmd-parse-failure-float = {$arg} is not a valid float.
cmd-parse-failure-bool = {$arg} is not a valid bool.
cmd-parse-failure-uid = {$arg} is not a valid entity UID.
cmd-parse-failure-mapid = {$arg} is not a valid MapId.
cmd-parse-failure-grid = {$arg} is not a valid grid.
cmd-parse-failure-entity-exist = UID {$arg} does not correspond to an existing entity.
cmd-error-file-not-found = Could not find file: {$file}.
Expand Down
3 changes: 2 additions & 1 deletion Robust.Benchmarks/Transform/RecursiveMoveBenchmark.cs
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,8 @@ public void GlobalSetup()
private void PvsTick()
{
_session.ClearState();
_pvs.GetVisibleChunks(_players, null);
_pvs.CacheSessionData(_players);
_pvs.GetVisibleChunks();
_pvs.ProcessVisibleChunksSequential();
}

Expand Down
2 changes: 1 addition & 1 deletion Robust.Client/Audio/AudioManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ internal void LogALError(string message, [CallerMemberName] string callerMember
var error = AL.GetError();
if (error != ALError.NoError)
{
OpenALSawmill.Error("[{0}:{1}] AL error: {2}, {3}", callerMember, callerLineNumber, error, message);
OpenALSawmill.Error("[{0}:{1}] AL error: {2}, {3}. Stacktrace is {4}", callerMember, callerLineNumber, error, message, Environment.StackTrace);
}
}

Expand Down
2 changes: 1 addition & 1 deletion Robust.Client/Audio/AudioSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ private void ProcessStream(EntityUid entity, AudioComponent component, Transform
return;
}

var paramsGain = MathF.Pow(10, component.Params.Volume / 10);
var paramsGain = VolumeToGain(component.Params.Volume);

// Thought I'd never have to manually calculate gain again but this is the least
// unpleasant audio I could get at the moment.
Expand Down
50 changes: 46 additions & 4 deletions Robust.Client/Console/Commands/Debug.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System.Globalization;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime;
using System.Text;
using System.Text.RegularExpressions;
Expand Down Expand Up @@ -494,9 +495,9 @@ private static void _writeNode(Control control, int indents, TextWriter writer)
}
}

internal static List<(string, string)> PropertyValuesFor(Control control)
internal static List<MemberInfo> GetAllMembers(Control control)
{
var members = new List<(string, string)>();
var members = new List<MemberInfo>();
var type = control.GetType();

foreach (var fieldInfo in type.GetAllFields())
Expand All @@ -506,7 +507,7 @@ private static void _writeNode(Control control, int indents, TextWriter writer)
continue;
}

members.Add((fieldInfo.Name, fieldInfo.GetValue(control)?.ToString() ?? "null"));
members.Add(fieldInfo);
}

foreach (var propertyInfo in type.GetAllProperties())
Expand All @@ -516,7 +517,19 @@ private static void _writeNode(Control control, int indents, TextWriter writer)
continue;
}

members.Add((propertyInfo.Name, propertyInfo.GetValue(control)?.ToString() ?? "null"));
members.Add(propertyInfo);
}

return members;
}

internal static List<(string, string)> PropertyValuesFor(Control control)
{
var members = new List<(string, string)>();

foreach (var fieldInfo in GetAllMembers(control))
{
members.Add((fieldInfo.Name, fieldInfo.GetValue(control)?.ToString() ?? "null"));
}

foreach (var (attachedProperty, value) in control.AllAttachedProperties)
Expand All @@ -528,6 +541,35 @@ private static void _writeNode(Control control, int indents, TextWriter writer)
members.Sort((a, b) => string.Compare(a.Item1, b.Item1, StringComparison.Ordinal));
return members;
}

internal static Dictionary<string, List<(string, string)>> PropertyValuesForInheritance(Control control)
{
var returnVal = new Dictionary<string, List<(string, string)>>();
var engine = typeof(Control).Assembly;

foreach (var member in GetAllMembers(control))
{
var type = member.DeclaringType!;
var cname = type.Assembly == engine ? type.Name : type.ToString();

if (type != typeof(Control))
cname = $"Control > {cname}";

returnVal.GetOrNew(cname).Add((member.Name, member.GetValue(control)?.ToString() ?? "null"));
}

foreach (var (attachedProperty, value) in control.AllAttachedProperties)
{
var cname = $"Attached > {attachedProperty.OwningType.Name}";
returnVal.GetOrNew(cname).Add((attachedProperty.Name, value?.ToString() ?? "null"));
}

foreach (var v in returnVal.Values)
{
v.Sort((a, b) => string.Compare(a.Item1, b.Item1, StringComparison.Ordinal));
}
return returnVal;
}
}

internal sealed class SetClipboardCommand : LocalizedCommands
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,19 +43,25 @@ public void Execute(IConsoleShell shell, string argStr, string[] args)

GC.Collect();

Span<EntityUid> ents = stackalloc EntityUid[amount];
var stopwatch = new Stopwatch();
stopwatch.Start();

MeasureProfiler.StartCollectingData();

for (var i = 0; i < amount; i++)
{
_entities.SpawnEntity(prototype, MapCoordinates.Nullspace);
ents[i] = _entities.SpawnEntity(prototype, MapCoordinates.Nullspace);
}

MeasureProfiler.SaveData();

shell.WriteLine($"Client: Profiled spawning {amount} entities in {stopwatch.Elapsed.TotalMilliseconds:N3} ms");

foreach (var ent in ents)
{
_entities.DeleteEntity(ent);
}
}
}
#endif
82 changes: 0 additions & 82 deletions Robust.Client/FodyWeavers.xsd

This file was deleted.

2 changes: 1 addition & 1 deletion Robust.Client/GameObjects/ClientEntityManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public override void DirtyEntity(EntityUid uid, MetaDataComponent? meta = null)

public override void QueueDeleteEntity(EntityUid? uid)
{
if (uid == null)
if (uid == null || uid == EntityUid.Invalid)
return;

if (IsClientSide(uid.Value))
Expand Down
Loading

0 comments on commit a84b1c3

Please sign in to comment.