Make main region caps less annoying to work with
This commit is contained in:
@@ -32,6 +32,11 @@ async def amain():
|
||||
print("I'm here")
|
||||
await client.send_chat("Hello World!", chat_type=ChatType.SHOUT)
|
||||
client.session.message_handler.subscribe("ChatFromSimulator", _respond_to_chat)
|
||||
|
||||
# Example of how to work with caps
|
||||
async with client.main_region.caps_client.get("SimulatorFeatures") as features_resp:
|
||||
print("Features:", await features_resp.read_llsd())
|
||||
|
||||
while True:
|
||||
try:
|
||||
await asyncio.sleep(0.001)
|
||||
|
||||
@@ -376,6 +376,12 @@ class HippoClient(BaseClientSessionManager):
|
||||
self.settings = ClientSettings()
|
||||
self._resend_task: Optional[asyncio.Task] = None
|
||||
|
||||
@property
|
||||
def main_region(self) -> Optional[HippoClientRegion]:
|
||||
if not self.session:
|
||||
return None
|
||||
return self.session.main_region
|
||||
|
||||
async def aclose(self):
|
||||
try:
|
||||
if self.session:
|
||||
|
||||
Reference in New Issue
Block a user