Browse Source

add {move,mute,deafen}User methods

Natenom/support-murmur-13-1446181288462
Michael Ziegler 15 years ago
parent
commit
825a8507ab
  1. 15
      pyweb/mumble/MumbleCtlDbus.py
  2. 22
      pyweb/mumble/MumbleCtlIce.py

15
pyweb/mumble/MumbleCtlDbus.py

@ -291,6 +291,21 @@ class MumbleCtlDbus_118(MumbleCtlBase):
else: else:
return -1 return -1
def moveUser(self, srvid, sessionid, channelid):
srv = self._getDbusServerObject(srvid)
(session, ismute, isdeaf, suppressed, selfMute, selfDeaf, channel) = srv.getPlayerState(dbus.UInt32(sessionid))
srv.setPlayerState((session, ismute, isdeaf, suppressed, selfMute, selfDeaf, channelid))
def muteUser(self, srvid, sessionid, mute):
srv = self._getDbusServerObject(srvid)
(session, ismute, isdeaf, suppressed, selfMute, selfDeaf, channel) = srv.getPlayerState(dbus.UInt32(sessionid))
srv.setPlayerState((session, mute, isdeaf, suppressed, selfMute, selfDeaf, channel))
def deafenUser(self, srvid, sessionid, deaf):
srv = self._getDbusServerObject(srvid)
(session, ismute, isdeaf, suppressed, selfMute, selfDeaf, channel) = srv.getPlayerState(dbus.UInt32(sessionid))
srv.setPlayerState((session, ismute, deaf, suppressed, selfMute, selfDeaf, channel))
@staticmethod @staticmethod
def convertDbusTypeToNative(data): def convertDbusTypeToNative(data):
#i know dbus.* type is extends python native type. #i know dbus.* type is extends python native type.

22
pyweb/mumble/MumbleCtlIce.py

@ -434,6 +434,28 @@ class MumbleCtlIce_118(MumbleCtlBase):
def getLog( self, srvid, first=0, last=100 ): def getLog( self, srvid, first=0, last=100 ):
return self._getIceServerObject(srvid).getLog( first, last ) return self._getIceServerObject(srvid).getLog( first, last )
@protectDjangoErrPage
def moveUser(self, srvid, sessionid, channelid):
srv = self._getIceServerObject(srvid)
state = srv.getState(sessionid)
state.channel = channelid
srv.setState(state)
@protectDjangoErrPage
def muteUser(self, srvid, sessionid, mute=True):
srv = self._getIceServerObject(srvid)
state = srv.getState(sessionid)
state.mute = mute
srv.setState(state)
@protectDjangoErrPage
def deafenUser(self, srvid, sessionid, deaf=True):
srv = self._getIceServerObject(srvid)
state = srv.getState(sessionid)
state.deaf = deaf
srv.setState(state)
class MumbleCtlIce_120(MumbleCtlIce_118): class MumbleCtlIce_120(MumbleCtlIce_118):
@protectDjangoErrPage @protectDjangoErrPage
def getRegisteredPlayers(self, srvid, filter = ''): def getRegisteredPlayers(self, srvid, filter = ''):

Loading…
Cancel
Save