-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathavatar_swap_addon.py
45 lines (35 loc) · 1.41 KB
/
avatar_swap_addon.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import hashlib
class addon():
global_avatar = "<FireBoxRoom><Assets><AssetObject id=^body^ src=^https://assets.spyduck.net/avatar/obj/mallard/mallard.obj.gz^ tex_linear=^false^ /></Assets><Room><Ghost id=^januswebuser^ scale=^1 1 1^ body_id=^body^ anim_id=^idle^ eye_pos=^0 0.85 0^ /></Room></FireBoxRoom>"
rooms = []
def __init__(self):
self.log('Avatar Swap Addon initialized')
self.rooms.append(self.md5('https://vesta.janusvr.com/spyduck/centralia-church'))
self.rooms.append(self.md5('https://paradox.spyduck.net/rooms/lostsouls/church.php'))
self.rooms.append(self.md5('https://vesta.janusvr.com/spyduck/celestial-events-dreamscapes-1'))
def user_chat(self, userId=None, message=None, thread=None):
pass
def logon(self, userId=None, thread=None):
pass
def user_move(self, data=None, thread=None):
if thread.roomId in self.rooms and 'avatar' in data:
data['avatar'] = self.global_avatar
thread.data = data
def user_leave(self, userId=None, roomId=None, thread=None):
pass
def user_enter(self, userId=None, roomId=None, thread=None):
if roomId in self.rooms:
self.log(userId + ' has joined the paddling.')
pass
def log(self, msg, silent=False):
try:
if silent == False:
print(msg)
with open('vrpresence.log','a') as f:
f.write(str(msg, 'utf-8')+'\n')
except:
pass
def md5(self, data):
m = hashlib.md5()
m.update(bytes(data, 'utf-8'))
return m.hexdigest()