Skip to content

Commit add185f

Browse files
committed
Subroom description, save date, save player id
1 parent 24e3e25 commit add185f

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "recnetpy"
7-
version = "0.1.49"
7+
version = "0.1.5"
88
authors = [
99
{ name="RecNetBot Development"}
1010
]

src/recnetpy/dataclasses/subroom.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,21 @@ class SubRoom(VariableClass['SubRoomResponse']):
3232
max_players: int
3333
#: This is the visibilty of the image which has the possible value of ``['Private', 'Public', 'Unlisted']``.
3434
accessibility: str
35+
#: The blob that contains the data
3536
data_blob: Optional[str]
37+
#: The user who saved the last
3638
data_saved_at: Optional[int]
39+
#: The latest save description for the subroom
40+
description: Optional[str]
3741

3842
def __init__(self, data: 'SubRoomResponse'):
43+
if data.get("CurrentSave"):
44+
description = data["CurrentSave"].get("Description")
45+
saved_at = date_to_unix(data["CurrentSave"]["CreatedAt"])
46+
saved_by = data["CurrentSave"].get("SavedByAccountId", 1)
47+
else:
48+
saved_at, saved_by, description = None, 1, None
49+
3950
self.supports_join_in_progress = data['SupportsJoinInProgress']
4051
self.use_level_based_matchmaking = data['UseLevelBasedMatchmaking']
4152
self.use_age_based_matchmaking = data['UseAgeBasedMatchmaking']
@@ -45,7 +56,9 @@ def __init__(self, data: 'SubRoomResponse'):
4556
self.unity_scene_id = data['UnitySceneId']
4657
self.name = data['Name']
4758
self.data_blob = data.get("DataBlob", None)
48-
self.data_saved_at = date_to_unix(data['DataSavedAt']) if 'DataSavedAt' in data else None
59+
self.data_saved_at = saved_at
60+
self.data_saved_by = saved_by
61+
self.description = description
4962
self.is_sandbox = data['IsSandbox']
5063
self.max_players = data['MaxPlayers']
5164
self.accessibility = ACCESSIBILITY_DICT.get(data['Accessibility'])

0 commit comments

Comments
 (0)