From 9d3bc7b31a0847776a92c2f4f203b96abf7b8c41 Mon Sep 17 00:00:00 2001 From: jvyden Date: Fri, 4 Mar 2022 22:23:57 -0500 Subject: [PATCH] Show count of rooms playing a slot Closes #213 --- ProjectLighthouse/Types/Levels/Slot.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ProjectLighthouse/Types/Levels/Slot.cs b/ProjectLighthouse/Types/Levels/Slot.cs index f998cbe7..15ebc5f1 100644 --- a/ProjectLighthouse/Types/Levels/Slot.cs +++ b/ProjectLighthouse/Types/Levels/Slot.cs @@ -260,6 +260,8 @@ public class Slot Review? yourReview = null ) { + int playerCount = RoomHelper.Rooms.Count(r => r.Slot.SlotType == SlotType.User && r.Slot.SlotId == this.SlotId); + string slotData = LbpSerializer.StringElement("name", this.Name) + LbpSerializer.StringElement("id", this.SlotId) + LbpSerializer.StringElement("game", (int)this.GameVersion) + @@ -304,6 +306,7 @@ public class Slot yourReview?.Serialize("yourReview") + LbpSerializer.StringElement("reviewsEnabled", ServerSettings.Instance.LevelReviewsEnabled) + LbpSerializer.StringElement("commentsEnabled", ServerSettings.Instance.LevelCommentsEnabled) + + LbpSerializer.StringElement("playerCount", playerCount) + LbpSerializer.StringElement("reviewCount", this.ReviewCount); int yourPlays;