Remove most fully-obsoleted code (#5433)

This commit is contained in:
Kara
2024-09-11 02:38:26 -07:00
committed by GitHub
parent f682fb9cc7
commit 48d70a09c6
35 changed files with 1 additions and 750 deletions

View File

@@ -33,12 +33,6 @@ public interface IMidiRenderer : IDisposable
/// </summary>
bool LoopMidi { get; set; }
/// <summary>
/// This increases all note on velocities to 127.
/// </summary>
[Obsolete($"Use {nameof(VelocityOverride)} instead, you can set it to 127 to achieve the same effect.")]
bool VolumeBoost { get; set; }
/// <summary>
/// The midi program (instrument) the renderer is using.
/// </summary>

View File

@@ -205,14 +205,6 @@ internal sealed class MidiRenderer : IMidiRenderer
}
}
[ViewVariables(VVAccess.ReadWrite)]
[Obsolete($"Use {nameof(VelocityOverride)} instead, you can set it to 127 to achieve the same effect.")]
public bool VolumeBoost
{
get => VelocityOverride == 127;
set => VelocityOverride = value ? 127 : null;
}
[ViewVariables(VVAccess.ReadWrite)]
public EntityUid? TrackingEntity { get; set; } = null;

View File

@@ -14,15 +14,6 @@ namespace Robust.Client.Credits
/// </summary>
public static class CreditsManager
{
/// <summary>
/// Gets a list of open source software used in the engine and their license.
/// </summary>
[Obsolete("Use overload that takes in an explicit resource manager instead.")]
public static IEnumerable<LicenseEntry> GetLicenses()
{
return GetLicenses(IoCManager.Resolve<IResourceManager>());
}
/// <summary>
/// Gets a list of open source software used in the engine and their license.
/// </summary>

View File

@@ -99,15 +99,6 @@ namespace Robust.Client.GameObjects
Play(new Entity<AnimationPlayerComponent>(uid, component), animation, key);
}
/// <summary>
/// Start playing an animation.
/// </summary>
[Obsolete("Use Play(EntityUid<AnimationPlayerComponent> ent, Animation animation, string key) instead")]
public void Play(AnimationPlayerComponent component, Animation animation, string key)
{
Play(new Entity<AnimationPlayerComponent>(component.Owner, component), animation, key);
}
public void Play(Entity<AnimationPlayerComponent> ent, Animation animation, string key)
{
AddComponent(ent);

View File

@@ -34,9 +34,6 @@ namespace Robust.Client.GameStates
/// </summary>
int GetApplicableStateCount();
[Obsolete("use GetApplicableStateCount()")]
int CurrentBufferSize => GetApplicableStateCount();
/// <summary>
/// Total number of game states currently in the state buffer.
/// </summary>

View File

@@ -1,10 +0,0 @@
using System;
namespace Robust.Client.UserInterface.CustomControls;
[Obsolete("Use DefaultWindow instead")]
[Virtual]
public class SS14Window : DefaultWindow
{
}

View File

@@ -250,13 +250,6 @@ public sealed class PvsOverrideSystem : EntitySystem
AddSessionOverride(uid.Value, session);
}
[Obsolete("Use variant that takes in an EntityUid")]
public void AddSessionOverrides(NetEntity entity, Filter filter, bool removeExistingOverride = true)
{
if (TryGetEntity(entity, out var uid))
AddSessionOverrides(uid.Value, filter);
}
[Obsolete("Don't use this, clear specific overrides")]
public void ClearOverride(NetEntity entity)
{

View File

@@ -24,34 +24,8 @@ namespace Robust.Server.ServerStatus
IDictionary<string, string> ResponseHeaders { get; }
bool KeepAlive { get; set; }
[Obsolete("Use async versions instead")]
T? RequestBodyJson<T>();
Task<T?> RequestBodyJsonAsync<T>();
[Obsolete("Use async versions instead")]
void Respond(
string text,
HttpStatusCode code = HttpStatusCode.OK,
string contentType = "text/plain");
[Obsolete("Use async versions instead")]
void Respond(
string text,
int code = 200,
string contentType = "text/plain");
[Obsolete("Use async versions instead")]
void Respond(
byte[] data,
HttpStatusCode code = HttpStatusCode.OK,
string contentType = "text/plain");
[Obsolete("Use async versions instead")]
void Respond(
byte[] data,
int code = 200,
string contentType = "text/plain");
Task RespondNoContentAsync();
Task RespondAsync(
@@ -74,14 +48,8 @@ namespace Robust.Server.ServerStatus
int code = 200,
string contentType = "text/plain");
[Obsolete("Use async versions instead")]
void RespondError(HttpStatusCode code);
Task RespondErrorAsync(HttpStatusCode code);
[Obsolete("Use async versions instead")]
void RespondJson(object jsonData, HttpStatusCode code = HttpStatusCode.OK);
Task RespondJsonAsync(object jsonData, HttpStatusCode code = HttpStatusCode.OK);
Task<Stream> RespondStreamAsync(HttpStatusCode code = HttpStatusCode.OK);

View File

@@ -27,19 +27,6 @@ namespace Robust.Server.ServerStatus
/// </summary>
event Action<JsonNode> OnInfoRequest;
/// <summary>
/// Set information used by automatic-client-zipping to determine the layout of your dev setup,
/// and which assembly files to send.
/// </summary>
/// <param name="clientBinFolder">
/// The name of your client project in the bin/ folder on the top of your project.
/// </param>
/// <param name="clientAssemblyNames">
/// The list of client assemblies to send from the aforementioned folder.
/// </param>
[Obsolete("This API is deprecated as it cannot share information with standalone packaging. Use SetMagicAczProvider instead")]
void SetAczInfo(string clientBinFolder, string[] clientAssemblyNames);
void SetMagicAczProvider(IMagicAczProvider provider);
/// <summary>

View File

@@ -171,22 +171,6 @@ internal sealed partial class StatusHost
// -- Information Input --
public void SetAczInfo(string clientBinFolder, string[] clientAssemblyNames)
{
_aczLock.Wait();
try
{
if (_aczPrepared != null)
throw new InvalidOperationException("ACZ already prepared");
_aczInfo = (clientBinFolder, clientAssemblyNames);
}
finally
{
_aczLock.Release();
}
}
public void SetMagicAczProvider(IMagicAczProvider provider)
{
_magicAczProvider = provider;

View File

@@ -269,57 +269,11 @@ namespace Robust.Server.ServerStatus
_responseHeaders = new Dictionary<string, string>();
}
public T? RequestBodyJson<T>()
{
return JsonSerializer.Deserialize<T>(RequestBody);
}
public async Task<T?> RequestBodyJsonAsync<T>()
{
return await JsonSerializer.DeserializeAsync<T>(RequestBody);
}
public void Respond(string text, HttpStatusCode code = HttpStatusCode.OK, string contentType = MediaTypeNames.Text.Plain)
{
Respond(text, (int)code, contentType);
}
public void Respond(string text, int code = 200, string contentType = MediaTypeNames.Text.Plain)
{
_context.Response.StatusCode = code;
_context.Response.ContentType = contentType;
if (RequestMethod == HttpMethod.Head)
{
return;
}
using var writer = new StreamWriter(_context.Response.OutputStream, EncodingHelpers.UTF8);
writer.Write(text);
}
public void Respond(byte[] data, HttpStatusCode code = HttpStatusCode.OK, string contentType = MediaTypeNames.Text.Plain)
{
Respond(data, (int)code, contentType);
}
public void Respond(byte[] data, int code = 200, string contentType = MediaTypeNames.Text.Plain)
{
_context.Response.StatusCode = code;
_context.Response.ContentType = contentType;
_context.Response.ContentLength64 = data.Length;
if (RequestMethod == HttpMethod.Head)
{
_context.Response.Close();
return;
}
_context.Response.OutputStream.Write(data);
_context.Response.Close();
}
public Task RespondNoContentAsync()
{
RespondShared();
@@ -373,27 +327,11 @@ namespace Robust.Server.ServerStatus
_context.Response.Close();
}
public void RespondError(HttpStatusCode code)
{
Respond(code.ToString(), code);
}
public Task RespondErrorAsync(HttpStatusCode code)
{
return RespondAsync(code.ToString(), code);
}
public void RespondJson(object jsonData, HttpStatusCode code = HttpStatusCode.OK)
{
RespondShared();
_context.Response.ContentType = "application/json";
JsonSerializer.Serialize(_context.Response.OutputStream, jsonData);
_context.Response.Close();
}
public async Task RespondJsonAsync(object jsonData, HttpStatusCode code = HttpStatusCode.OK)
{
RespondShared();

View File

@@ -17,9 +17,6 @@ public abstract partial class SoundSpecifier
{
[DataField("params")]
public AudioParams Params { get; set; } = AudioParams.Default;
[Obsolete("Use SharedAudioSystem.GetSound(), or just pass sound specifier directly into SharedAudioSystem.")]
public abstract string GetSound(IRobustRandom? rand = null, IPrototypeManager? proto = null);
}
[Serializable, NetSerializable]
@@ -45,12 +42,6 @@ public sealed partial class SoundPathSpecifier : SoundSpecifier
if (@params.HasValue)
Params = @params.Value;
}
[Obsolete("Use SharedAudioSystem.GetSound(), or just pass sound specifier directly into SharedAudioSystem.")]
public override string GetSound(IRobustRandom? rand = null, IPrototypeManager? proto = null)
{
return Path.ToString();
}
}
[Serializable, NetSerializable]
@@ -70,15 +61,4 @@ public sealed partial class SoundCollectionSpecifier : SoundSpecifier
if (@params.HasValue)
Params = @params.Value;
}
[Obsolete("Use SharedAudioSystem.GetSound(), or just pass sound specifier directly into SharedAudioSystem.")]
public override string GetSound(IRobustRandom? rand = null, IPrototypeManager? proto = null)
{
if (Collection == null)
return string.Empty;
IoCManager.Resolve(ref rand, ref proto);
var soundCollection = proto.Index<SoundCollectionPrototype>(Collection);
return rand.Pick(soundCollection.PickFiles).ToString();
}
}

View File

@@ -33,19 +33,6 @@ namespace Robust.Shared.Containers
}
}
[Obsolete]
public T MakeContainer<T>(EntityUid uid, string id)
where T : BaseContainer
=> _entMan.System<SharedContainerSystem>().MakeContainer<T>(uid, id, this);
[Obsolete]
public BaseContainer GetContainer(string id)
=> _entMan.System<SharedContainerSystem>().GetContainer(Owner, id, this);
[Obsolete]
public bool HasContainer(string id)
=> _entMan.System<SharedContainerSystem>().HasContainer(Owner, id, this);
[Obsolete]
public bool TryGetContainer(string id, [NotNullWhen(true)] out BaseContainer? container)
=> _entMan.System<SharedContainerSystem>().TryGetContainer(Owner, id, out container, this);
@@ -54,20 +41,6 @@ namespace Robust.Shared.Containers
public bool TryGetContainer(EntityUid entity, [NotNullWhen(true)] out BaseContainer? container)
=> _entMan.System<SharedContainerSystem>().TryGetContainingContainer(Owner, entity, out container, this);
[Obsolete]
public bool ContainsEntity(EntityUid entity)
=> _entMan.System<SharedContainerSystem>().ContainsEntity(Owner, entity, this);
[Obsolete]
public bool Remove(EntityUid toremove,
TransformComponent? xform = null,
MetaDataComponent? meta = null,
bool reparent = true,
bool force = false,
EntityCoordinates? destination = null,
Angle? localRotation = null)
=> _entMan.System<SharedContainerSystem>().RemoveEntity(Owner, toremove, this, xform, meta, reparent, force, destination, localRotation);
[Obsolete]
public AllContainersEnumerable GetAllContainers()
=> _entMan.System<SharedContainerSystem>().GetAllContainers(Owner, this);

View File

@@ -193,16 +193,6 @@ namespace Robust.Shared.Containers
return true;
}
[Obsolete("Use variant without skipExistCheck argument")]
public bool TryGetContainingContainer(
EntityUid uid,
EntityUid containedUid,
[NotNullWhen(true)] out BaseContainer? container,
bool skipExistCheck)
{
return TryGetContainingContainer(uid, containedUid, out container);
}
public bool TryGetContainingContainer(
EntityUid uid,
EntityUid containedUid,

View File

@@ -46,17 +46,4 @@ public sealed partial class AppearanceComponent : Component
get { return _appearanceDataInit; }
set { AppearanceData = value ?? AppearanceData; _appearanceDataInit = value; }
}
[Obsolete("Use SharedAppearanceSystem instead")]
public bool TryGetData<T>(Enum key, [NotNullWhen(true)] out T data)
{
if (AppearanceData.TryGetValue(key, out var dat) && dat is T)
{
data = (T)dat;
return true;
}
data = default!;
return false;
}
}

View File

@@ -15,43 +15,6 @@ namespace Robust.Shared.GameObjects
return entMan.EnsureComponent<TimerComponent>(entity);
}
public static void AddTimer(this EntityUid entity, Timer timer, CancellationToken cancellationToken = default)
{
entity
.EnsureTimerComponent()
.AddTimer(timer, cancellationToken);
}
/// <summary>
/// Creates a task that will complete after a given delay.
/// The task is resumed on the main game logic thread.
/// </summary>
/// <param name="entity">The entity to add the timer to.</param>
/// <param name="milliseconds">The length of time, in milliseconds, to delay for.</param>
/// <param name="cancellationToken"></param>
/// <returns>The task that can be awaited.</returns>
public static Task DelayTask(this EntityUid entity, int milliseconds, CancellationToken cancellationToken = default)
{
return entity
.EnsureTimerComponent()
.Delay(milliseconds, cancellationToken);
}
/// <summary>
/// Creates a task that will complete after a given delay.
/// The task is resumed on the main game logic thread.
/// </summary>
/// <param name="entity">The entity to add the timer to.</param>
/// <param name="duration">The length of time to delay for.</param>
/// <param name="cancellationToken"></param>
/// <returns>The task that can be awaited.</returns>
public static Task DelayTask(this EntityUid entity, TimeSpan duration, CancellationToken cancellationToken = default)
{
return entity
.EnsureTimerComponent()
.Delay((int) duration.TotalMilliseconds, cancellationToken);
}
/// <summary>
/// Schedule an action to be fired after a certain delay.
/// The action will be resumed on the main game logic thread.
@@ -84,21 +47,6 @@ namespace Robust.Shared.GameObjects
.Spawn((int) duration.TotalMilliseconds, onFired, cancellationToken);
}
/// <summary>
/// Schedule an action that repeatedly fires after a delay specified in milliseconds.
/// </summary>
/// <param name="entity">The entity to add the timer to.</param>
/// <param name="milliseconds">The length of time, in milliseconds, to delay before firing the repeated action.</param>
/// <param name="onFired">The action to fire.</param>
/// <param name="cancellationToken">The CancellationToken for stopping the Timer.</param>
[Obsolete("Use a system update loop instead")]
public static void SpawnRepeatingTimer(this EntityUid entity, int milliseconds, Action onFired, CancellationToken cancellationToken)
{
entity
.EnsureTimerComponent()
.SpawnRepeating(milliseconds, onFired, cancellationToken);
}
/// <summary>
/// Schedule an action that repeatedly fires after a delay.
/// </summary>

View File

@@ -386,9 +386,6 @@ namespace Robust.Shared.GameObjects
}
}
[Obsolete("Use ChildEnumerator")]
public IEnumerable<EntityUid> ChildEntities => _children;
public TransformChildrenEnumerator ChildEnumerator => new(_children.GetEnumerator());
[ViewVariables] public int ChildCount => _children.Count;
@@ -405,16 +402,6 @@ namespace Robust.Shared.GameObjects
_entMan.EntitySysManager.GetEntitySystem<SharedTransformSystem>().AttachToGridOrMap(Owner, this);
}
/// <summary>
/// Sets another entity as the parent entity, maintaining world position.
/// </summary>
/// <param name="newParent"></param>
[Obsolete("Use TransformSystem.SetParent() instead")]
public void AttachParent(TransformComponent newParent)
{
_entMan.EntitySysManager.GetEntitySystem<SharedTransformSystem>().SetParent(Owner, this, newParent.Owner, newParent);
}
internal void UpdateChildMapIdsRecursive(
MapId newMapId,
EntityUid? newUid,
@@ -458,14 +445,6 @@ namespace Robust.Shared.GameObjects
return (worldPos, worldRot);
}
/// <see cref="GetWorldPositionRotation()"/>
[Obsolete("Use the system method instead")]
public (Vector2 WorldPosition, Angle WorldRotation) GetWorldPositionRotation(EntityQuery<TransformComponent> xforms)
{
var (worldPos, worldRot, _) = GetWorldPositionRotationMatrix(xforms);
return (worldPos, worldRot);
}
/// <summary>
/// Get the WorldPosition, WorldRotation, and WorldMatrix of this entity faster than each individually.
/// </summary>
@@ -502,16 +481,6 @@ namespace Robust.Shared.GameObjects
return GetWorldPositionRotationMatrix(xforms);
}
/// <summary>
/// Get the WorldPosition, WorldRotation, and InvWorldMatrix of this entity faster than each individually.
/// </summary>
[Obsolete("Use the system method instead")]
public (Vector2 WorldPosition, Angle WorldRotation, Matrix3x2 InvWorldMatrix) GetWorldPositionRotationInvMatrix()
{
var xformQuery = _entMan.GetEntityQuery<TransformComponent>();
return GetWorldPositionRotationInvMatrix(xformQuery);
}
/// <summary>
/// Get the WorldPosition, WorldRotation, and InvWorldMatrix of this entity faster than each individually.
/// </summary>
@@ -654,13 +623,6 @@ namespace Robust.Shared.GameObjects
/// If true, the entity is being detached to null-space
/// </summary>
public readonly bool Detaching = detaching;
[Obsolete("Use constructor that takes in EntityUid")]
public AnchorStateChangedEvent(TransformComponent transform, bool detaching = false)
: this(transform.Owner, transform, detaching)
{
}
}
/// <summary>

View File

@@ -281,24 +281,6 @@ namespace Robust.Shared.GameObjects
}
}
/// <inheritdoc />
[Obsolete]
public CompInitializeHandle<T> AddComponentUninitialized<T>(EntityUid uid) where T : IComponent, new()
{
var reg = _componentFactory.GetRegistration<T>();
var newComponent = (T)_componentFactory.GetComponent(reg);
#pragma warning disable CS0618 // Type or member is obsolete
newComponent.Owner = uid;
#pragma warning restore CS0618 // Type or member is obsolete
if (!uid.IsValid() || !EntityExists(uid))
throw new ArgumentException($"Entity {uid} is not valid.", nameof(uid));
AddComponentInternal(uid, newComponent, false, true, null);
return new CompInitializeHandle<T>(this, uid, newComponent, reg.Idx);
}
public void AddComponent(
EntityUid uid,
EntityPrototype.ComponentRegistryEntry entry,

View File

@@ -141,16 +141,6 @@ public partial class EntitySystem
EntityManager.DirtyEntity(uid, meta);
}
/// <summary>
/// Marks a component as dirty. This also implicitly dirties the entity this component belongs to.
/// </summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
[Obsolete("Use Dirty(EntityUid, Component, MetaDataComponent?")]
protected void Dirty(IComponent component, MetaDataComponent? meta = null)
{
EntityManager.Dirty(component.Owner, component, meta);
}
/// <inheritdoc cref="Dirty{T}"/>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
protected void Dirty(EntityUid uid, IComponent component, MetaDataComponent? meta = null)

View File

@@ -74,19 +74,6 @@ namespace Robust.Shared.GameObjects
/// </summary>
IComponent AddComponent(EntityUid uid, ushort netId, MetaDataComponent? meta = null);
/// <summary>
/// Adds an uninitialized Component type to an entity.
/// </summary>
/// <remarks>
/// This function returns a disposable initialize handle that you can use in a <see langword="using" /> statement, to set up a component
/// before initialization is ran on it.
/// </remarks>
/// <typeparam name="T">Concrete component type to add.</typeparam>
/// <param name="uid">Entity being modified.</param>
/// <returns>Component initialization handle. When you are done setting up the component, make sure to dispose this.</returns>
[Obsolete]
EntityManager.CompInitializeHandle<T> AddComponentUninitialized<T>(EntityUid uid) where T : IComponent, new();
/// <summary>
/// Adds a Component to an entity. If the entity is already Initialized, the component will
/// automatically be Initialized and Started.

View File

@@ -634,12 +634,6 @@ public sealed partial class EntityLookupSystem
GetEntitiesInRange(type, coordinates.MapId, coordinates.Position, range, entities, flags);
}
[Obsolete]
public HashSet<T> GetComponentsInRange<T>(MapCoordinates coordinates, float range) where T : IComponent
{
return GetComponentsInRange<T>(coordinates.MapId, coordinates.Position, range);
}
public void GetEntitiesInRange<T>(MapCoordinates coordinates, float range, HashSet<Entity<T>> entities, LookupFlags flags = DefaultFlags) where T : IComponent
{
GetEntitiesInRange(coordinates.MapId, coordinates.Position, range, entities, flags);
@@ -668,14 +662,6 @@ public sealed partial class EntityLookupSystem
GetEntitiesIntersecting(type, mapId, circle, transform, entities, flags);
}
[Obsolete]
public HashSet<T> GetComponentsInRange<T>(MapId mapId, Vector2 worldPos, float range) where T : IComponent
{
var entities = new HashSet<Entity<T>>();
GetEntitiesInRange(mapId, worldPos, range, entities);
return [..entities.Select(e => e.Comp)];
}
public void GetEntitiesInRange<T>(MapId mapId, Vector2 worldPos, float range, HashSet<Entity<T>> entities, LookupFlags flags = DefaultFlags) where T : IComponent
{
var shape = new PhysShapeCircle(range, worldPos);

View File

@@ -1107,13 +1107,6 @@ public abstract partial class SharedTransformSystem
#region Set Position+Rotation
[MethodImpl(MethodImplOptions.AggressiveInlining)]
[Obsolete("Use override with EntityUid")]
public void SetWorldPositionRotation(TransformComponent component, Vector2 worldPos, Angle worldRot)
{
SetWorldPositionRotation(component.Owner, worldPos, worldRot, component);
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void SetWorldPositionRotation(EntityUid uid, Vector2 worldPos, Angle worldRot, TransformComponent? component = null)
{

View File

@@ -100,13 +100,6 @@ namespace Robust.Shared.Log
[Obsolete("Use ISawmill.Log")]
public static void DebugS(string sawmill, string message) => LogS(LogLevel.Debug, sawmill, message);
/// <summary>
/// Log a message as debug, taking in a format string and format list using the regular <see cref="Format" /> syntax.
/// </summary>
/// <seealso cref="Log" />
[Obsolete("Use ISawmill.Debug")]
public static void Debug(string message, params object?[] args) => Log(LogLevel.Debug, message, args);
/// <summary>
/// Log a message as debug.
/// </summary>
@@ -128,13 +121,6 @@ namespace Robust.Shared.Log
[Obsolete("Use ISawmill.Info")]
public static void InfoS(string sawmill, string message) => LogS(LogLevel.Info, sawmill, message);
/// <summary>
/// Log a message as info, taking in a format string and format list using the regular <see cref="Format" /> syntax.
/// </summary>
/// <seealso cref="Log" />
[Obsolete("Use ISawmill.Info")]
public static void Info(string message, params object?[] args) => Log(LogLevel.Info, message, args);
/// <summary>
/// Log a message as info.
/// </summary>
@@ -156,13 +142,6 @@ namespace Robust.Shared.Log
[Obsolete("Use ISawmill.Warning")]
public static void WarningS(string sawmill, string message) => LogS(LogLevel.Warning, sawmill, message);
/// <summary>
/// Log a message as warning, taking in a format string and format list using the regular <see cref="Format" /> syntax.
/// </summary>
/// <seealso cref="Log" />
[Obsolete("Use ISawmill.Warning")]
public static void Warning(string message, params object?[] args) => Log(LogLevel.Warning, message, args);
/// <summary>
/// Log a message as warning.
/// </summary>
@@ -177,13 +156,6 @@ namespace Robust.Shared.Log
[Obsolete("Use ISawmill.Error")]
public static void ErrorS(string sawmill, string message, params object?[] args) => LogS(LogLevel.Error, sawmill, message, args);
/// <summary>
/// Log a message as error, taking in a format string and format list using the regular <see cref="Format" /> syntax.
/// </summary>
/// <seealso cref="Log" />
[Obsolete("Use ISawmill.Error")]
public static void ErrorS(string sawmill, Exception exception, string message, params object?[] args) => LogS(LogLevel.Error, sawmill, exception, message, args);
/// <summary>
/// Log a message as error.
/// </summary>
@@ -204,33 +176,5 @@ namespace Robust.Shared.Log
/// <seealso cref="Log" />
[Obsolete("Use ISawmill.Error")]
public static void Error(string message) => Log(LogLevel.Error, message);
/// <summary>
/// Log a message as fatal, taking in a format string and format list using the regular <see cref="Format" /> syntax.
/// </summary>
/// <seealso cref="Log" />
[Obsolete("Use ISawmill.Fatal")]
public static void FatalS(string sawmill, string message, params object?[] args) => LogS(LogLevel.Fatal, sawmill, message, args);
/// <summary>
/// Log a message as fatal.
/// </summary>
/// <seealso cref="Log" />
[Obsolete("Use ISawmill.Fatal")]
public static void FatalS(string sawmill, string message) => LogS(LogLevel.Fatal, sawmill, message);
/// <summary>
/// Log a message as fatal, taking in a format string and format list using the regular <see cref="Format" /> syntax.
/// </summary>
/// <seealso cref="Log" />
[Obsolete("Use ISawmill.Fatal")]
public static void Fatal(string message, params object?[] args) => Log(LogLevel.Fatal, message, args);
/// <summary>
/// Log a message as fatal.
/// </summary>
/// <seealso cref="Log" />
[Obsolete("Use ISawmill.Fatal")]
public static void Fatal(string message) => Log(LogLevel.Fatal, message);
}
}

View File

@@ -75,12 +75,6 @@ namespace Robust.Shared.Map.Components
#region TileAccess
[Obsolete("Use the MapSystem method")]
public TileRef GetTileRef(MapCoordinates coords)
{
return MapSystem.GetTileRef(Owner, this, coords);
}
[Obsolete("Use the MapSystem method")]
public TileRef GetTileRef(EntityCoordinates coords)
{
@@ -123,20 +117,6 @@ namespace Robust.Shared.Map.Components
MapSystem.SetTiles(Owner, this, tiles);
}
[Obsolete("Use the MapSystem method")]
public IEnumerable<TileRef> GetLocalTilesIntersecting(Box2Rotated localArea, bool ignoreEmpty = true,
Predicate<TileRef>? predicate = null)
{
return MapSystem.GetLocalTilesIntersecting(Owner, this, localArea, ignoreEmpty, predicate);
}
[Obsolete("Use the MapSystem method")]
public IEnumerable<TileRef> GetTilesIntersecting(Box2Rotated worldArea, bool ignoreEmpty = true,
Predicate<TileRef>? predicate = null)
{
return MapSystem.GetTilesIntersecting(Owner, this, worldArea, ignoreEmpty, predicate);
}
[Obsolete("Use the MapSystem method")]
public IEnumerable<TileRef> GetTilesIntersecting(Box2 worldArea, bool ignoreEmpty = true,
Predicate<TileRef>? predicate = null)
@@ -202,18 +182,6 @@ namespace Robust.Shared.Map.Components
return MapSystem.GetAnchoredEntitiesEnumerator(Owner, this, pos);
}
[Obsolete("Use the MapSystem method")]
public IEnumerable<EntityUid> GetLocalAnchoredEntities(Box2 localAABB)
{
return MapSystem.GetLocalAnchoredEntities(Owner, this, localAABB);
}
[Obsolete("Use the MapSystem method")]
public IEnumerable<EntityUid> GetAnchoredEntities(Box2 worldAABB)
{
return MapSystem.GetAnchoredEntities(Owner, this, worldAABB);
}
[Obsolete("Use the MapSystem method")]
public Vector2i TileIndicesFor(EntityCoordinates coords)
{
@@ -226,24 +194,6 @@ namespace Robust.Shared.Map.Components
return MapSystem.TileIndicesFor(Owner, this, worldPos);
}
[Obsolete("Use the MapSystem method")]
public IEnumerable<EntityUid> GetInDir(EntityCoordinates position, Direction dir)
{
return MapSystem.GetInDir(Owner, this, position, dir);
}
[Obsolete("Use the MapSystem method")]
public IEnumerable<EntityUid> GetLocal(EntityCoordinates coords)
{
return MapSystem.GetLocal(Owner, this, coords);
}
[Obsolete("Use the MapSystem method")]
public IEnumerable<EntityUid> GetCardinalNeighborCells(EntityCoordinates coords)
{
return MapSystem.GetCardinalNeighborCells(Owner, this, coords);
}
[Obsolete("Use the MapSystem method")]
public IEnumerable<EntityUid> GetCellsInSquareArea(EntityCoordinates coords, int n)
{
@@ -288,18 +238,6 @@ namespace Robust.Shared.Map.Components
return MapSystem.CoordinatesToTile(Owner, this, coords);
}
[Obsolete("Use the MapSystem method")]
public bool CollidesWithGrid(Vector2i indices)
{
return MapSystem.CollidesWithGrid(Owner, this, indices);
}
[Obsolete("Use the MapSystem method")]
public Vector2i GridTileToChunkIndices(Vector2i gridTile)
{
return MapSystem.GridTileToChunkIndices(Owner, this, gridTile);
}
[Obsolete("Use the MapSystem method")]
public EntityCoordinates GridTileToLocal(Vector2i gridTile)
{
@@ -312,12 +250,6 @@ namespace Robust.Shared.Map.Components
return MapSystem.GridTileToWorldPos(Owner, this, gridTile);
}
[Obsolete("Use the MapSystem method")]
public MapCoordinates GridTileToWorld(Vector2i gridTile)
{
return MapSystem.GridTileToWorld(Owner, this, gridTile);
}
[Obsolete("Use the MapSystem method")]
public bool TryGetTileRef(Vector2i indices, out TileRef tile)
{

View File

@@ -76,61 +76,30 @@ namespace Robust.Shared.Map
return true;
}
[Obsolete("Use SharedTransformSystem.ToMapCoordinates()")]
public MapCoordinates ToMap(IEntityManager entityManager)
{
return ToMap(entityManager, entityManager.System<SharedTransformSystem>());
}
[Obsolete("Use SharedTransformSystem.ToMapCoordinates()")]
public MapCoordinates ToMap(IEntityManager entityManager, SharedTransformSystem transformSystem)
{
return transformSystem.ToMapCoordinates(this);
}
[Obsolete("Use SharedTransformSystem.ToMapCoordinates()")]
public Vector2 ToMapPos(IEntityManager entityManager)
{
return ToMap(entityManager, entityManager.System<SharedTransformSystem>()).Position;
}
[Obsolete("Use SharedTransformSystem.ToMapCoordinates()")]
public Vector2 ToMapPos(IEntityManager entityManager, SharedTransformSystem transformSystem)
{
return ToMap(entityManager, transformSystem).Position;
}
[Obsolete("Use SharedTransformSystem.ToCoordinates()")]
public static EntityCoordinates FromMap(EntityUid entity, MapCoordinates coordinates, IEntityManager? entMan = null)
{
IoCManager.Resolve(ref entMan);
return FromMap(entity, coordinates, entMan.System<SharedTransformSystem>(), entMan);
}
[Obsolete("Use SharedTransformSystem.ToCoordinates()")]
public static EntityCoordinates FromMap(EntityUid entity, MapCoordinates coordinates, SharedTransformSystem transformSystem, IEntityManager? entMan = null)
{
return transformSystem.ToCoordinates(entity, coordinates);
}
[Obsolete("Use SharedTransformSystem.ToCoordinates()")]
public static EntityCoordinates FromMap(IEntityManager entityManager, EntityUid entityUid, MapCoordinates coordinates)
{
return FromMap(entityUid, coordinates, entityManager.System<SharedTransformSystem>(), entityManager);
}
[Obsolete("Use SharedTransformSystem.ToCoordinates()")]
public static EntityCoordinates FromMap(IMapManager mapManager, MapCoordinates coordinates)
{
return IoCManager.Resolve<IEntityManager>().System<SharedTransformSystem>().ToCoordinates(coordinates);
}
[Obsolete("Use overload with TransformSystem")]
public Vector2i ToVector2i(IEntityManager entityManager, IMapManager mapManager)
{
return ToVector2i(entityManager, mapManager, entityManager.System<SharedTransformSystem>());
}
/// <summary>
/// Converts this set of coordinates to Vector2i.
/// </summary>

View File

@@ -71,15 +71,6 @@ namespace Robust.Shared.Map
Entity<MapGridComponent> CreateGridEntity(MapId currentMapId, GridCreateOptions? options = null);
Entity<MapGridComponent> CreateGridEntity(EntityUid map, GridCreateOptions? options = null);
[Obsolete("Use GetComponent<MapGridComponent>(uid)")]
MapGridComponent GetGrid(EntityUid gridId);
[Obsolete("Use TryGetComponent(uid, out MapGridComponent? grid)")]
bool TryGetGrid([NotNullWhen(true)] EntityUid? euid, [NotNullWhen(true)] out MapGridComponent? grid);
[Obsolete("Use HasComponent<MapGridComponent>(uid)")]
bool GridExists([NotNullWhen(true)] EntityUid? euid);
IEnumerable<MapGridComponent> GetAllMapGrids(MapId mapId);
IEnumerable<Entity<MapGridComponent>> GetAllGrids(MapId mapId);

View File

@@ -39,35 +39,12 @@ internal partial class MapManager
return CreateGrid(map, options.Value.ChunkSize, default);
}
[Obsolete("Use GetComponent<MapGridComponent>(uid)")]
public MapGridComponent GetGrid(EntityUid gridId)
=> EntityManager.GetComponent<MapGridComponent>(gridId);
[Obsolete("Use HasComponent<MapGridComponent>(uid)")]
public bool IsGrid(EntityUid uid)
{
return EntityManager.HasComponent<MapGridComponent>(uid);
}
[Obsolete("Use TryGetComponent(uid, out MapGridComponent? grid)")]
public bool TryGetGrid([NotNullWhen(true)] EntityUid? euid, [MaybeNullWhen(false)] out MapGridComponent grid)
{
if (EntityManager.TryGetComponent(euid, out MapGridComponent? comp))
{
grid = comp;
return true;
}
grid = default;
return false;
}
[Obsolete("Use HasComponent<MapGridComponent>(uid)")]
public bool GridExists([NotNullWhen(true)] EntityUid? euid)
{
return EntityManager.HasComponent<MapGridComponent>(euid);
}
public IEnumerable<MapGridComponent> GetAllMapGrids(MapId mapId)
{
var query = EntityManager.AllEntityQueryEnumerator<MapGridComponent, TransformComponent>();

View File

@@ -242,12 +242,6 @@ public partial class SharedPhysicsSystem
Dirty(uid, body);
}
[Obsolete("Use overload that takes EntityUid")]
public void ResetDynamics(PhysicsComponent body, bool dirty = true)
{
ResetDynamics(body.Owner, body, dirty);
}
public void ResetMassData(EntityUid uid, FixturesComponent? manager = null, PhysicsComponent? body = null)
{
if (!PhysicsQuery.Resolve(uid, ref body))
@@ -392,12 +386,6 @@ public partial class SharedPhysicsSystem
Dirty(uid, body);
}
[Obsolete("Use overload that takes EntityUid")]
public void SetAngularDamping(PhysicsComponent body, float value, bool dirty = true)
{
SetAngularDamping(body.Owner, body, value, dirty);
}
public void SetLinearDamping(EntityUid uid, PhysicsComponent body, float value, bool dirty = true)
{
if (MathHelper.CloseTo(body.LinearDamping, value))
@@ -409,12 +397,6 @@ public partial class SharedPhysicsSystem
Dirty(uid, body);
}
[Obsolete("Use overload that takes EntityUid")]
public void SetLinearDamping(PhysicsComponent body, float value, bool dirty = true)
{
SetLinearDamping(body.Owner, body, value, dirty);
}
[Obsolete("Use SetAwake with EntityUid<PhysicsComponent>")]
public void SetAwake(EntityUid uid, PhysicsComponent body, bool value, bool updateSleepTime = true)
{
@@ -524,12 +506,6 @@ public partial class SharedPhysicsSystem
Dirty(uid, body);
}
[Obsolete("Use overload that takes EntityUid")]
public void SetBodyStatus(PhysicsComponent body, BodyStatus status, bool dirty = true)
{
SetBodyStatus(body.Owner, body, status, dirty);
}
/// <summary>
/// Sets the <see cref="PhysicsComponent.CanCollide"/> property; this handles whether the body is enabled.
/// </summary>
@@ -609,12 +585,6 @@ public partial class SharedPhysicsSystem
Dirty(uid, body);
}
[Obsolete("Use overload that takes EntityUid")]
public void SetFriction(PhysicsComponent body, float value, bool dirty = true)
{
SetFriction(body.Owner, body, value, dirty);
}
public void SetInertia(EntityUid uid, PhysicsComponent body, float value, bool dirty = true)
{
DebugTools.Assert(!float.IsNaN(value));
@@ -634,12 +604,6 @@ public partial class SharedPhysicsSystem
}
}
[Obsolete("Use overload that takes EntityUid")]
public void SetInertia(PhysicsComponent body, float value, bool dirty = true)
{
SetInertia(body.Owner, body, value, dirty);
}
public void SetLocalCenter(EntityUid uid, PhysicsComponent body, Vector2 value)
{
if (body.BodyType != BodyType.Dynamic) return;

View File

@@ -178,13 +178,6 @@ namespace Robust.Shared.Physics.Systems
return bodies;
}
[Obsolete("Use override that takes in a entity Uid")]
public HashSet<EntityUid> GetContactingEntities(PhysicsComponent body, bool approximate = false)
{
return GetContactingEntities(body.Owner, body);
}
public HashSet<EntityUid> GetContactingEntities(EntityUid uid, PhysicsComponent? body = null, bool approximate = false)
{
// HashSet to ensure that we only return each entity once, instead of once per colliding fixture.

View File

@@ -49,16 +49,6 @@ namespace Robust.Shared.Player
return AddPlayersByPvs(transformSystem.GetMapCoordinates(transform), rangeMultiplier, entityManager, playerMan, cfgMan);
}
/// <summary>
/// Adds all players inside an entity's PVS.
/// The current PVS range will be multiplied by <see cref="rangeMultiplier"/>.
/// </summary>
[Obsolete("Use overload that takes in managers")]
public Filter AddPlayersByPvs(TransformComponent origin, float rangeMultiplier = 2f)
{
return AddPlayersByPvs(origin.MapPosition, rangeMultiplier);
}
/// <summary>
/// Adds all players inside an entity's PVS.
/// The current PVS range will be multiplied by <see cref="rangeMultiplier"/>.
@@ -372,15 +362,6 @@ namespace Robust.Shared.Player
return Empty().AddPlayersByPvs(origin, rangeMultiplier, entityManager, playerManager, cfgManager);
}
/// <summary>
/// A filter with every player whose PVS overlaps this point.
/// </summary>
[Obsolete("Use overload that takes in managers")]
public static Filter Pvs(TransformComponent origin, float rangeMultiplier = 2f)
{
return Empty().AddPlayersByPvs(origin, rangeMultiplier);
}
/// <summary>
/// A filter with every player whose PVS overlaps this point.
/// </summary>

View File

@@ -44,7 +44,7 @@ public interface ICommonSession
/// On the Server every player has a network channel,
/// on the Client only the LocalPlayer has a network channel, and that channel points to the server.
/// </remarks>
INetChannel Channel { get; [Obsolete] set; }
INetChannel Channel { get; set; }
LoginType AuthType { get; }
@@ -65,9 +65,6 @@ public interface ICommonSession
/// </summary>
SessionData Data { get; }
[Obsolete("Just use the Channel field instead.")]
INetChannel ConnectedClient => Channel;
/// <summary>
/// If true, this indicates that this is a client-side session, and should be ignored when applying a server's
/// game state.

View File

@@ -167,7 +167,4 @@ public interface ISharedPlayerManager
/// Set the session's status to <see cref="SessionStatus.InGame"/>.
/// </summary>
void JoinGame(ICommonSession session);
[Obsolete("Use GetSessionById()")]
ICommonSession GetSessionByUserId(NetUserId user) => GetSessionById(user);
}

View File

@@ -161,61 +161,6 @@ public interface IPrototypeManager
bool HasMapping<T>(string id);
bool TryGetMapping(Type kind, string id, [NotNullWhen(true)] out MappingDataNode? mappings);
/// <summary>
/// Returns whether a prototype variant <param name="variant"/> exists.
/// </summary>
/// <param name="variant">Identifier for the prototype variant.</param>
/// <returns>Whether the prototype variant exists.</returns>
[Obsolete("Variant is outdated naming, use *kind* functions instead")]
bool HasVariant(string variant);
/// <summary>
/// Returns the Type for a prototype variant.
/// </summary>
/// <param name="variant">Identifier for the prototype variant.</param>
/// <returns>The specified prototype Type.</returns>
/// <exception cref="KeyNotFoundException">
/// Thrown when the specified prototype variant isn't registered or doesn't exist.
/// </exception>
[Obsolete("Variant is outdated naming, use *kind* functions instead")]
Type GetVariantType(string variant);
/// <summary>
/// Attempts to get the Type for a prototype variant.
/// </summary>
/// <param name="variant">Identifier for the prototype variant.</param>
/// <param name="prototype">The specified prototype Type, or null.</param>
/// <returns>Whether the prototype type was found and <see cref="prototype"/> isn't null.</returns>
[Obsolete("Variant is outdated naming, use *kind* functions instead")]
bool TryGetVariantType(string variant, [NotNullWhen(true)] out Type? prototype);
/// <summary>
/// Attempts to get a prototype's variant.
/// </summary>
/// <param name="type"></param>
/// <param name="variant"></param>
/// <returns></returns>
[Obsolete("Variant is outdated naming, use *kind* functions instead")]
bool TryGetVariantFrom(Type type, [NotNullWhen(true)] out string? variant);
/// <summary>
/// Attempts to get a prototype's variant.
/// </summary>
/// <param name="prototype">The prototype in question.</param>
/// <param name="variant">Identifier for the prototype variant, or null.</param>
/// <returns>Whether the prototype variant was successfully retrieved.</returns>
[Obsolete("Variant is outdated naming, use *kind* functions instead")]
bool TryGetVariantFrom(IPrototype prototype, [NotNullWhen(true)] out string? variant);
/// <summary>
/// Attempts to get a prototype's variant.
/// </summary>
/// <param name="variant">Identifier for the prototype variant, or null.</param>
/// <typeparam name="T">The prototype in question.</typeparam>
/// <returns>Whether the prototype variant was successfully retrieved.</returns>
[Obsolete("Variant is outdated naming, use *kind* functions instead")]
bool TryGetVariantFrom<T>([NotNullWhen(true)] out string? variant) where T : class, IPrototype;
/// <summary>
/// Returns whether a prototype kind <param name="kind"/> exists.
/// </summary>
@@ -355,14 +300,6 @@ public interface IPrototypeManager
/// </summary>
void RegisterIgnore(string name);
/// <summary>
/// Loads a single prototype class type into the manager.
/// </summary>
/// <param name="protoClass">A prototype class type that implements IPrototype. This type also
/// requires a <see cref="PrototypeAttribute"/> with a non-empty class string.</param>
[Obsolete("Prototype type is outdated naming, use *king* functions instead")]
void RegisterType(Type protoClass);
/// <summary>
/// Loads several prototype kinds into the manager. Note that this will re-build a frozen dictionary and should be avoided if possible.
/// </summary>

View File

@@ -806,30 +806,6 @@ namespace Robust.Shared.Prototypes
return _kinds[kind].Results.TryGetValue(id, out mappings);
}
[Obsolete("Variant is outdated naming, use *kind* functions instead")]
public bool HasVariant(string variant) => HasKind(variant);
[Obsolete("Variant is outdated naming, use *kind* functions instead")]
public Type GetVariantType(string variant) => GetKindType(variant);
[Obsolete("Variant is outdated naming, use *kind* functions instead")]
public bool TryGetVariantType(string variant, [NotNullWhen(true)] out Type? prototype)
{
return TryGetKindType(variant, out prototype);
}
[Obsolete("Variant is outdated naming, use *kind* functions instead")]
public bool TryGetVariantFrom(Type type, [NotNullWhen(true)] out string? variant)
{
return TryGetKindFrom(type, out variant);
}
[Obsolete("Variant is outdated naming, use *kind* functions instead")]
public bool TryGetVariantFrom<T>([NotNullWhen(true)] out string? variant) where T : class, IPrototype
{
return TryGetKindFrom<T>(out variant);
}
public bool HasKind(string kind)
{
return _kindNames.ContainsKey(kind);
@@ -918,20 +894,12 @@ namespace Robust.Shared.Prototypes
return TryGetKindFrom(typeof(T), out kind);
}
[Obsolete("Variant is outdated naming, use *kind* functions instead")]
public bool TryGetVariantFrom(IPrototype prototype, [NotNullWhen(true)] out string? variant)
{
return TryGetKindFrom(prototype, out variant);
}
/// <inheritdoc />
public void RegisterIgnore(string name)
{
_ignoredPrototypeTypes.Add(name);
}
void IPrototypeManager.RegisterType(Type type) => RegisterKind(type);
static string CalculatePrototypeName(Type type)
{
const string prototype = "Prototype";

View File

@@ -830,8 +830,6 @@ namespace Robust.UnitTesting
public sealed class ClientIntegrationInstance : IntegrationInstance
{
[Obsolete("Use Session instead")]
public LocalPlayer? Player => ((IPlayerManager) PlayerMan).LocalPlayer;
public ICommonSession? Session => ((IPlayerManager) PlayerMan).LocalSession;
public NetUserId? User => Session?.UserId;
public EntityUid? AttachedEntity => Session?.AttachedEntity;