-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into improve_gliding
- Loading branch information
Showing
12 changed files
with
175 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,28 @@ | ||
using OpenDreamShared.Rendering; | ||
|
||
namespace OpenDreamClient.Rendering { | ||
sealed class ClientScreenOverlaySystem : SharedScreenOverlaySystem { | ||
public HashSet<EntityUid> ScreenObjects = new(); | ||
namespace OpenDreamClient.Rendering; | ||
|
||
[Dependency] private IEntityManager _entityManager = default!; | ||
internal sealed class ClientScreenOverlaySystem : SharedScreenOverlaySystem { | ||
public HashSet<EntityUid> ScreenObjects = new(); | ||
|
||
public override void Initialize() { | ||
SubscribeNetworkEvent<AddScreenObjectEvent>(OnAddScreenObject); | ||
SubscribeNetworkEvent<RemoveScreenObjectEvent>(OnRemoveScreenObject); | ||
} | ||
[Dependency] private readonly IEntityManager _entityManager = default!; | ||
|
||
public override void Shutdown() { | ||
ScreenObjects.Clear(); | ||
} | ||
public override void Initialize() { | ||
SubscribeNetworkEvent<AddScreenObjectEvent>(OnAddScreenObject); | ||
SubscribeNetworkEvent<RemoveScreenObjectEvent>(OnRemoveScreenObject); | ||
} | ||
|
||
public override void Shutdown() { | ||
ScreenObjects.Clear(); | ||
} | ||
|
||
private void OnAddScreenObject(AddScreenObjectEvent e) { | ||
EntityUid ent = _entityManager.GetEntity(e.ScreenObject); | ||
ScreenObjects.Add(ent); | ||
} | ||
private void OnAddScreenObject(AddScreenObjectEvent e) { | ||
EntityUid ent = _entityManager.GetEntity(e.ScreenObject); | ||
ScreenObjects.Add(ent); | ||
} | ||
|
||
private void OnRemoveScreenObject(RemoveScreenObjectEvent e) { | ||
EntityUid ent = _entityManager.GetEntity(e.ScreenObject); | ||
ScreenObjects.Remove(ent); | ||
} | ||
private void OnRemoveScreenObject(RemoveScreenObjectEvent e) { | ||
EntityUid ent = _entityManager.GetEntity(e.ScreenObject); | ||
ScreenObjects.Remove(ent); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
using System.Linq; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
using OpenDreamPackaging; | ||
using Robust.Packaging; | ||
using Robust.Packaging.AssetProcessing; | ||
using Robust.Server.ServerStatus; | ||
|
||
namespace OpenDreamRuntime; | ||
|
||
public sealed class DreamAczProvider : IMagicAczProvider, IFullHybridAczProvider { | ||
private readonly IDependencyCollection _dependencies; | ||
private readonly string _rootPath; | ||
private readonly string[] _resources; | ||
|
||
public DreamAczProvider(IDependencyCollection dependencies, string rootPath, string[] resources) { | ||
_dependencies = dependencies; | ||
_rootPath = rootPath; | ||
_resources = resources; | ||
} | ||
|
||
public async Task Package(AssetPass pass, IPackageLogger logger, CancellationToken cancel) { | ||
var contentDir = DefaultMagicAczProvider.FindContentRootPath(_dependencies); | ||
|
||
await DreamPackaging.WriteResources(contentDir, _rootPath, _resources, pass, logger, cancel); | ||
} | ||
|
||
public Task Package(AssetPass hybridPackageInput, AssetPass output, IPackageLogger logger, CancellationToken cancel) { | ||
var clientAssetGraph = new RobustClientAssetGraph(); | ||
var resourceInput = clientAssetGraph.Input; | ||
output.AddDependency(clientAssetGraph.Output); | ||
output.AddDependency(hybridPackageInput); | ||
|
||
AssetGraph.CalculateGraph( | ||
clientAssetGraph.AllPasses.Concat(new[] { hybridPackageInput, output }).ToArray(), | ||
logger); | ||
|
||
DreamPackaging.WriteRscResources(_rootPath, _resources, resourceInput); | ||
resourceInput.InjectFinished(); | ||
|
||
return Task.CompletedTask; | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,24 @@ | ||
using OpenDreamRuntime.Objects.Types; | ||
using OpenDreamShared.Rendering; | ||
using Robust.Server.GameStates; | ||
using Robust.Shared.Player; | ||
|
||
namespace OpenDreamRuntime.Rendering { | ||
public sealed class ServerScreenOverlaySystem : SharedScreenOverlaySystem { | ||
private readonly Dictionary<ICommonSession, HashSet<EntityUid>> _sessionToScreenObjects = new(); | ||
[Dependency] private readonly IEntityManager _entityManager = default!; | ||
namespace OpenDreamRuntime.Rendering; | ||
|
||
public override void Initialize() { | ||
SubscribeLocalEvent<ExpandPvsEvent>(HandleExpandPvsEvent); | ||
} | ||
public sealed class ServerScreenOverlaySystem : SharedScreenOverlaySystem { | ||
[Dependency] private readonly IEntityManager _entityManager = default!; | ||
[Dependency] private readonly PvsOverrideSystem _pvsOverride = default!; | ||
|
||
public void AddScreenObject(DreamConnection connection, DreamObjectMovable screenObject) { | ||
if (!_sessionToScreenObjects.TryGetValue(connection.Session, out var objects)) { | ||
objects = new HashSet<EntityUid>(); | ||
_sessionToScreenObjects.Add(connection.Session, objects); | ||
} | ||
public void AddScreenObject(DreamConnection connection, DreamObjectMovable screenObject) { | ||
_pvsOverride.AddForceSend(screenObject.Entity, connection.Session); | ||
|
||
objects.Add(screenObject.Entity); | ||
NetEntity ent = _entityManager.GetNetEntity(screenObject.Entity); | ||
RaiseNetworkEvent(new AddScreenObjectEvent(ent), connection.Session.ConnectedClient); | ||
} | ||
NetEntity ent = _entityManager.GetNetEntity(screenObject.Entity); | ||
RaiseNetworkEvent(new AddScreenObjectEvent(ent), connection.Session.ConnectedClient); | ||
} | ||
|
||
public void RemoveScreenObject(DreamConnection connection, DreamObjectMovable screenObject) { | ||
_sessionToScreenObjects[connection.Session].Remove(screenObject.Entity); | ||
NetEntity ent = _entityManager.GetNetEntity(screenObject.Entity); | ||
RaiseNetworkEvent(new RemoveScreenObjectEvent(ent), connection.Session.ConnectedClient); | ||
} | ||
public void RemoveScreenObject(DreamConnection connection, DreamObjectMovable screenObject) { | ||
_pvsOverride.RemoveForceSend(screenObject.Entity, connection.Session); | ||
|
||
private void HandleExpandPvsEvent(ref ExpandPvsEvent e) { | ||
if (_sessionToScreenObjects.TryGetValue(e.Session, out var objects)) { | ||
e.Entities ??= new(objects.Count); | ||
e.Entities.AddRange(objects); | ||
} | ||
} | ||
NetEntity ent = _entityManager.GetNetEntity(screenObject.Entity); | ||
RaiseNetworkEvent(new RemoveScreenObjectEvent(ent), connection.Session.ConnectedClient); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
using System.Text.Json.Nodes; | ||
using OpenDreamShared; | ||
using Robust.Server.ServerStatus; | ||
using Robust.Shared.Configuration; | ||
|
||
namespace OpenDreamRuntime; | ||
|
||
/// <summary> | ||
/// Adds additional data like info links to the server info endpoint | ||
/// </summary> | ||
public sealed class ServerInfoManager { | ||
private static readonly (CVarDef<string> cVar, string icon, string name)[] Vars = { | ||
// @formatter:off | ||
(OpenDreamCVars.InfoLinksDiscord, "discord", "Discord"), | ||
(OpenDreamCVars.InfoLinksForum, "forum", "Forum"), | ||
(OpenDreamCVars.InfoLinksGithub, "github", "GitHub"), | ||
(OpenDreamCVars.InfoLinksWebsite, "web", "Website"), | ||
(OpenDreamCVars.InfoLinksWiki, "wiki", "Wiki") | ||
// @formatter:on | ||
}; | ||
|
||
[Dependency] private readonly IStatusHost _statusHost = default!; | ||
[Dependency] private readonly IConfigurationManager _cfg = default!; | ||
|
||
public void Initialize() { | ||
_statusHost.OnInfoRequest += OnInfoRequest; | ||
} | ||
|
||
private void OnInfoRequest(JsonNode json) { | ||
foreach (var (cVar, icon, name) in Vars) { | ||
var url = _cfg.GetCVar(cVar); | ||
if (string.IsNullOrEmpty(url)) | ||
continue; | ||
|
||
StatusHostHelpers.AddLink(json, name, url, icon); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule RobustToolbox
updated
122 files