World¶
Runnable example
python/examples/world_browse.py — session list → join → list open worlds → focus → leave.
resoio.world.WorldClient ¶
Bases: _BaseClient[WorldStub]
Async client for the Resonite IO World service over a UDS.
Use as an async context manager so the gRPC channel closes deterministically.
Source code in src/resoio/_client.py
list_sessions
async
¶
list_sessions(
*,
search: str = "",
filter: SessionFilter = SessionFilter.ALL,
min_active_users: int = 0,
page: int = 0,
page_size: int = 0,
) -> ListSessionsResponse
List live sessions (filter / search / paging applied mod-side).
Source code in src/resoio/world.py
list_records
async
¶
list_records(
*,
source: RecordSource = RecordSource.PUBLIC,
required_tags: Sequence[str] = (),
owner_id: str = "",
search: str = "",
offset: int = 0,
count: int = 0,
sort: RecordSort = RecordSort.CREATION_DATE,
sort_direction: RecordSortDirection = RecordSortDirection.DESCENDING,
) -> ListRecordsResponse
List world records (use sort=RANDOM for the random tab).
search is a free-text query mirroring the World tab (+term
required / -term excluded / "phrase"; empty = no search).
Source code in src/resoio/world.py
join
async
¶
Join an existing session by session_id or by url.
Exactly one of session_id / url must be supplied.
Source code in src/resoio/world.py
start_world
async
¶
Start a new session from a world record.
Source code in src/resoio/world.py
list_open_worlds
async
¶
focus
async
¶
Focus a locally-open world by handle.
leave
async
¶
get_current
async
¶
Return the currently focused world, or None when in
userspace.
Source code in src/resoio/world.py
fetch_thumbnail
async
¶
Fetch a thumbnail image by its resdb:/// or https:// URI.
resoio.world.WorldRecord
dataclass
¶
WorldRecord(
record_id: str = betterproto2.field(1, betterproto2.TYPE_STRING),
owner_id: str = betterproto2.field(2, betterproto2.TYPE_STRING),
name: str = betterproto2.field(3, betterproto2.TYPE_STRING),
description: str = betterproto2.field(4, betterproto2.TYPE_STRING),
thumbnail_url: str = betterproto2.field(5, betterproto2.TYPE_STRING),
tags: list[str] = betterproto2.field(6, betterproto2.TYPE_STRING, repeated=True),
record_url: str = betterproto2.field(7, betterproto2.TYPE_STRING),
last_modification_unix_nanos: int = betterproto2.field(8, betterproto2.TYPE_INT64),
)
resoio.world.WorldSession
dataclass
¶
WorldSession(
session_id: str = betterproto2.field(1, betterproto2.TYPE_STRING),
name: str = betterproto2.field(2, betterproto2.TYPE_STRING),
description: str = betterproto2.field(3, betterproto2.TYPE_STRING),
host_user_id: str = betterproto2.field(4, betterproto2.TYPE_STRING),
host_username: str = betterproto2.field(5, betterproto2.TYPE_STRING),
session_urls: list[str] = betterproto2.field(
6, betterproto2.TYPE_STRING, repeated=True
),
thumbnail_url: str = betterproto2.field(7, betterproto2.TYPE_STRING),
joined_users: int = betterproto2.field(8, betterproto2.TYPE_INT32),
active_users: int = betterproto2.field(9, betterproto2.TYPE_INT32),
maximum_users: int = betterproto2.field(10, betterproto2.TYPE_INT32),
tags: list[str] = betterproto2.field(11, betterproto2.TYPE_STRING, repeated=True),
access_level: str = betterproto2.field(12, betterproto2.TYPE_STRING),
headless_host: bool = betterproto2.field(13, betterproto2.TYPE_BOOL),
mobile_friendly: bool = betterproto2.field(14, betterproto2.TYPE_BOOL),
corresponding_world_id: str = betterproto2.field(15, betterproto2.TYPE_STRING),
universe_id: str = betterproto2.field(16, betterproto2.TYPE_STRING),
session_begin_unix_nanos: int = betterproto2.field(17, betterproto2.TYPE_INT64),
last_update_unix_nanos: int = betterproto2.field(18, betterproto2.TYPE_INT64),
)
Bases: Message
ライブセッション 1 件の情報 (ブラウザのタイル相当)。
session_urls
class-attribute
instance-attribute
¶
join 先 URI 群 (Join に session_id を渡せば mod 側で解決するため通常は参照のみ)。
thumbnail_url
class-attribute
instance-attribute
¶
SessionInfo.ThumbnailUrl をそのまま載せる (空もありうる)。
access_level
class-attribute
instance-attribute
¶
SessionAccessLevel の enum 名 (例 "Anyone" / "ContactsPlus")。
resoio.world.OpenWorld
dataclass
¶
OpenWorld(
handle: int = betterproto2.field(1, betterproto2.TYPE_INT32),
session_id: str = betterproto2.field(2, betterproto2.TYPE_STRING),
name: str = betterproto2.field(3, betterproto2.TYPE_STRING),
focused: bool = betterproto2.field(4, betterproto2.TYPE_BOOL),
user_count: int = betterproto2.field(5, betterproto2.TYPE_INT32),
access_level: str = betterproto2.field(6, betterproto2.TYPE_STRING),
)
resoio.world.ListRecordsResponse
dataclass
¶
ListRecordsResponse(
records: list[WorldRecord] = betterproto2.field(
1, betterproto2.TYPE_MESSAGE, repeated=True
),
has_more: bool = betterproto2.field(2, betterproto2.TYPE_BOOL),
offset: int = betterproto2.field(3, betterproto2.TYPE_UINT32),
)
Bases: Message
resoio.world.RecordSort ¶
Bases: Enum
Record search ordering.
resoio.world.RecordSortDirection ¶
Bases: Enum
Record search ordering direction.
resoio.world.RecordSource ¶
Bases: Enum
World-record source (left-tab equivalent).
resoio.world.SessionFilter ¶
Bases: Enum
Live-session filter (left-tab equivalent).
ALL = no filter.
resoio.world.ListSessionsResponse
dataclass
¶
ListSessionsResponse(
sessions: list[WorldSession] = betterproto2.field(
1, betterproto2.TYPE_MESSAGE, repeated=True
),
total_count: int = betterproto2.field(2, betterproto2.TYPE_UINT32),
page: int = betterproto2.field(3, betterproto2.TYPE_UINT32),
page_size: int = betterproto2.field(4, betterproto2.TYPE_UINT32),
)
Bases: Message
total_count
class-attribute
instance-attribute
¶
ページング前の総件数。
resoio.world.FetchThumbnailResponse
dataclass
¶
FetchThumbnailResponse(
data: bytes = betterproto2.field(1, betterproto2.TYPE_BYTES),
content_type: str = betterproto2.field(2, betterproto2.TYPE_STRING),
)
Bases: Message
content_type
class-attribute
instance-attribute
¶
MIME (例 "image/webp")。判定不能なら空。