This commit is contained in:
ImBenji
2024-05-17 17:36:02 +01:00
parent 1f48f8f4b0
commit fff8de13c0
6 changed files with 5734 additions and 358 deletions

View File

@@ -175,7 +175,7 @@ class AnnouncementModule extends InfoModule {
bool sendToServer = true
}) async {
if (sendToServer) {
if (sendToServer && _shouldSendToServer()) {
scheduledTime ??= liveInformation.syncedTimeModule.Now().add(Duration(seconds: defaultAnnouncementDelay));
@@ -230,7 +230,7 @@ class AnnouncementModule extends InfoModule {
bool sendToServer = true
}) {
if (sendToServer) {
if (sendToServer && _shouldSendToServer()) {
scheduledTime ??= liveInformation.syncedTimeModule.Now().add(Duration(seconds: defaultAnnouncementDelay));
@@ -260,7 +260,7 @@ class AnnouncementModule extends InfoModule {
bool sendToServer = true
}) async {
if (sendToServer) {
if (sendToServer && _shouldSendToServer()) {
scheduledTime ??= liveInformation.syncedTimeModule.Now().add(Duration(seconds: defaultAnnouncementDelay));
@@ -324,6 +324,14 @@ class AnnouncementModule extends InfoModule {
queue.add(announcement);
}
// Server check
bool _shouldSendToServer() {
bool condition = liveInformation.roomCode != null;
print("Should send to server? " + (condition.toString()));
return condition;
}
// Constants
final List<NamedAnnouncementQueueEntry> manualAnnouncements = [