Show count of rooms playing a slot

Closes #213
This commit is contained in:
jvyden 2022-03-04 22:23:57 -05:00
commit 9d3bc7b31a
No known key found for this signature in database
GPG key ID: 18BCF2BE0262B278

View file

@ -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;