|
@ -23,7 +23,6 @@ from os.path import join |
|
|
from django.utils.http import urlquote |
|
|
from django.utils.http import urlquote |
|
|
from django.conf import settings |
|
|
from django.conf import settings |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def cmp_names( a, b ): |
|
|
def cmp_names( a, b ): |
|
|
return cmp( a.name, b.name ); |
|
|
return cmp( a.name, b.name ); |
|
|
|
|
|
|
|
@ -144,6 +143,23 @@ class mmChannel( object ): |
|
|
doc="True if this channel is the server's default channel." |
|
|
doc="True if this channel is the server's default channel." |
|
|
); |
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
def as_dict( self ): |
|
|
|
|
|
if self.parent: |
|
|
|
|
|
parentid = self.parent.chanid; |
|
|
|
|
|
else: |
|
|
|
|
|
parentid = None; |
|
|
|
|
|
|
|
|
|
|
|
return { 'chanid': self.chanid, |
|
|
|
|
|
'description': self.description, |
|
|
|
|
|
'linked': [], |
|
|
|
|
|
'linkedIDs': [], |
|
|
|
|
|
'name': self.name, |
|
|
|
|
|
'parent': parentid, |
|
|
|
|
|
'players': [ pl.as_dict() for pl in self.players ], |
|
|
|
|
|
'subchans': [ sc.as_dict() for sc in self.subchans ] |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class mmPlayer( object ): |
|
|
class mmPlayer( object ): |
|
@ -208,6 +224,28 @@ class mmPlayer( object ): |
|
|
""" Call callback on myself. """ |
|
|
""" Call callback on myself. """ |
|
|
callback( self, lvl ); |
|
|
callback( self, lvl ); |
|
|
|
|
|
|
|
|
|
|
|
def as_dict( self ): |
|
|
|
|
|
comment = None; |
|
|
|
|
|
texture = None; |
|
|
|
|
|
if self.mumbleuser: |
|
|
|
|
|
comment = self.mumbleuser.comment; |
|
|
|
|
|
if self.mumbleuser.hasTexture(): |
|
|
|
|
|
texture = self.mumbleuser.textureUrl; |
|
|
|
|
|
|
|
|
|
|
|
return { 'bytesPerSec': self.bytesPerSec, |
|
|
|
|
|
'dbaseid': self.dbaseid, |
|
|
|
|
|
'deafened': self.deafened, |
|
|
|
|
|
'muted': self.muted, |
|
|
|
|
|
'name': self.name, |
|
|
|
|
|
'onlinesince': self.onlinesince, |
|
|
|
|
|
'selfdeafened': self.selfdeafened, |
|
|
|
|
|
'selfmuted': self.selfmuted, |
|
|
|
|
|
'suppressed': self.suppressed, |
|
|
|
|
|
'userid': self.userid, |
|
|
|
|
|
'comment': comment, |
|
|
|
|
|
'texture': texture, |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class mmACL: |
|
|
class mmACL: |
|
|