-
Notifications
You must be signed in to change notification settings - Fork 146
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
# Description In theory the test works, too tired to want to figure it out right now. --- # TODO - [x] XMLDocs instead of random comments - [x] Announcer audio test - [x] Fix the resource error - [x] Remove random extra announcement files - [x] Fix test errors - Add alert announcements to every announcer --- # Changelog :cl: - fix: Fixed some NEIL announcements not playing audio --------- Signed-off-by: DEATHB4DEFEAT <[email protected]> Co-authored-by: Danger Revolution! <[email protected]>
- Loading branch information
1 parent
bffc876
commit 7d1b23f
Showing
110 changed files
with
123 additions
and
37 deletions.
There are no files selected for viewing
76 changes: 76 additions & 0 deletions
76
Content.IntegrationTests/Tests/Announcers/AnnouncerAudioTest.cs
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,76 @@ | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using Content.Server.Announcements.Systems; | ||
using Content.Server.StationEvents; | ||
using Content.Shared.Announcements.Prototypes; | ||
using Robust.Client.ResourceManagement; | ||
using Robust.Shared.GameObjects; | ||
using Robust.Shared.IoC.Exceptions; | ||
using Robust.Shared.Localization; | ||
using Robust.Shared.Prototypes; | ||
using Serilog; | ||
|
||
namespace Content.IntegrationTests.Tests.Announcers; | ||
|
||
/// <summary> | ||
/// Checks if every station event using the announcerSystem has a valid audio file associated with it | ||
/// </summary> | ||
[TestFixture] | ||
[TestOf(typeof(AnnouncerPrototype))] | ||
public sealed class AnnouncerAudioTest | ||
{ | ||
/// <inheritdoc cref="AnnouncerAudioTest" /> | ||
[Test] | ||
public async Task TestEventSounds() | ||
{ | ||
await using var pair = await PoolManager.GetServerClient(new PoolSettings { Connected = true }); | ||
var server = pair.Server; | ||
var client = pair.Client; | ||
|
||
var entSysMan = server.ResolveDependency<IEntitySystemManager>(); | ||
var proto = server.ResolveDependency<IPrototypeManager>(); | ||
var cache = client.ResolveDependency<IResourceCache>(); | ||
var announcer = entSysMan.GetEntitySystem<AnnouncerSystem>(); | ||
var events = entSysMan.GetEntitySystem<EventManagerSystem>(); | ||
|
||
await server.WaitAssertion(() => | ||
{ | ||
var succeeded = true; | ||
var why = new List<string>(); | ||
foreach (var announcerProto in proto.EnumeratePrototypes<AnnouncerPrototype>().OrderBy(a => a.ID)) | ||
{ | ||
foreach (var ev in events.AllEvents()) | ||
{ | ||
if (ev.Value.StartAnnouncement) | ||
{ | ||
var announcementId = announcer.GetAnnouncementId(ev.Key.ID); | ||
var path = announcer.GetAnnouncementPath(announcementId, announcerProto); | ||
if (!cache.ContentFileExists(path)) | ||
{ | ||
succeeded = false; | ||
why.Add($"\"{announcerProto.ID}\", \"{announcementId}\": \"{path}\""); | ||
} | ||
} | ||
if (ev.Value.EndAnnouncement) | ||
{ | ||
var announcementId = announcer.GetAnnouncementId(ev.Key.ID, true); | ||
var path = announcer.GetAnnouncementPath(announcementId, announcerProto); | ||
if (!cache.ContentFileExists(path)) | ||
{ | ||
succeeded = false; | ||
why.Add($"\"{announcerProto.ID}\", \"{announcementId}\": \"{path}\""); | ||
} | ||
} | ||
} | ||
} | ||
Assert.That(succeeded, Is.True, $"The following announcements do not have a valid announcement audio:\n {string.Join("\n ", why)}"); | ||
}); | ||
|
||
await pair.CleanReturnAsync(); | ||
} | ||
} |
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
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
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File renamed without changes.
Binary file not shown.
File renamed without changes.
Binary file not shown.
File renamed without changes.
Binary file not shown.
File renamed without changes.
Binary file not shown.