Skip to content
This repository was archived by the owner on Dec 20, 2021. It is now read-only.

Commit c4a99b0

Browse files
committed
Update wss.py
1 parent 54683d3 commit c4a99b0

File tree

1 file changed

+17
-13
lines changed

1 file changed

+17
-13
lines changed

vrcpy/wss.py

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def on_friend_active(self, friend):
6868
def on_friend_offline(self, friend):
6969
pass
7070

71-
def on_friend_location(self, friend):
71+
def on_friend_location(self, friend, world, location, instance):
7272
pass
7373

7474
def on_notification(self, notification):
@@ -77,19 +77,21 @@ def on_notification(self, notification):
7777
# WS handles
7878

7979
def __ws_friend_active(self, content):
80-
self.on_friend_active(objects.User(content))
80+
self.on_friend_active(objects.User(content["user"]))
8181

8282
def __ws_friend_location(self, content):
83-
#world = content["world"]
84-
#del content["world"]
83+
world = objects.World(content["world"])
84+
user = objects.User(content["user"])
85+
location = objects.Location(content["location"])
86+
instance = objects.Instance(content["instance"])
8587

86-
self.on_friend_location(objects.User(content))
88+
self.on_friend_location(user, world, location, instance)
8789

8890
def __ws_friend_offline(self, content):
8991
self.on_friend_offline(self.fetch_user_by_id(content["userId"]))
9092

9193
def __ws_notification(self, content):
92-
self.on_notification(None)
94+
self.on_notification(objects.Notification(content))
9395

9496
# Internal Client overwrites
9597

@@ -124,7 +126,7 @@ async def on_friend_active(self, friend):
124126
async def on_friend_offline(self, friend):
125127
pass
126128

127-
async def on_friend_location(self, friend):
129+
async def on_friend_location(self, friend, world):
128130
pass
129131

130132
async def on_notification(self, notification):
@@ -133,19 +135,21 @@ async def on_notification(self, notification):
133135
# WS handles
134136

135137
async def __ws_friend_active(self, content):
136-
await self.on_friend_active(aobjects.User(content))
138+
self.on_friend_active(aobjects.User(content["user"]))
137139

138140
async def __ws_friend_location(self, content):
139-
#world = content["world"]
140-
#del content["world"]
141+
world = aobjects.World(content["world"])
142+
user = aobjects.User(content["user"])
143+
location = aobjects.Location(content["location"])
144+
instance = aobjects.Instance(content["instance"])
141145

142-
await self.on_friend_location(aobjects.User(content))
146+
self.on_friend_location(user, world, location, instance)
143147

144148
async def __ws_friend_offline(self, content):
145-
await self.on_friend_offline(await self.fetch_user_by_id(content["userId"]))
149+
self.on_friend_offline(await self.fetch_user_by_id(content["userId"]))
146150

147151
async def __ws_notification(self, content):
148-
await self.on_notification(None)
152+
self.on_notification(aobjects.Notification(content))
149153

150154
# Internal Client overwrites
151155

0 commit comments

Comments
 (0)