Difference between revisions of "DBus Methods"

From Mumble Wiki
Jump to: navigation, search
(server-specific methods)
Line 85: Line 85:
 
== quit ==
 
== quit ==
 
shutdown the server
 
shutdown the server
 +
 +
== Server-specific methods ==
 +
getPlayers
 +
<-input:nothing
 +
->returns a list of PlayerInfoExtended(see below)
 +
 +
getChannels
 +
<-input:nothing
 +
->returns a list of ChannelInfo(idem)
 +
 +
getACL
 +
<-input:chan identifier(int)
 +
->returns a list containing [a list of ACLInfo, a list of GroupInfo, a boolean for inherit]
 +
 +
setACL (todo)
 +
<-
 +
->
 +
 +
getBans
 +
<-nothing
 +
->list of BanInfo
 +
 +
setBans
 +
<-list of BanInfo
 +
->nothing
 +
 +
getPlayerState
 +
<-player session id(unsigned int) (warning, unsigned ints are special, see below)
 +
->PlayerInfo
 +
 +
setPlayerState
 +
<-PlayerInfo
 +
->nothing
 +
 +
getPlayerNames
 +
<-list of session id(unsigned ints) (warning, same as above)
 +
->list of names(unicode strings)
 +
 +
getPlayerIds
 +
<-list of names(strs on unicode strs)
 +
->list of IDs(ints(regular ones))
 +
 +
addChannel
 +
<-name(str or unicode str) , parent's id(int)
 +
->id of the new chan(int)
 +
 +
removeChannel
 +
<-chan id(int)
 +
->nothing
 +
 +
setChannelState
 +
<-ChannelInfo
 +
->nothing
 +
 +
kickPlayer
 +
<-session id(unsigned int) , reason(str or unicode str)
 +
->nothing
 +
 +
--
 +
Warning:
 +
unsigned ints are a bit strange. They look like longs when Python reads them (1786L for instance) but Python must transform them before sending them ot dbus.)
 +
>>>import dbus
 +
>>>egg=178L
 +
>>>spam = dbus.UInt32(long)  #may vary depending on your plateform
 +
and now, spam is a dBus unsigned int and is ready to be sent
 +
 +
--
 +
Structures(e.g. omagad, what is PlayerInfo ???)
 +
 +
"PlayerInfo" is a tuple(static list) containing(dont forget to transform session before sending it):
 +
(session:long, mute:bool, deaf:bool, suppressed:bool, selfMute:bool, selfDeaf:bool, channel:int) 
 +
 +
"PlayerInfoExtended" is a tuple(static list) containing(you just receive it with getPlayerState, you never have to send one)(notice that the 7 first are exactly the same as PlayInfo):
 +
(session:long, mute:bool, deaf:bool, suppressed:bool, selfMute:bool, selfDeaf:bool, channel:int, id:int, name:unicode str, onlinesecs:int, bytespersecond:int)
 +
 +
"ChannelInfo" is a tuple containing:
 +
(id:int, name:str, parent:int, links:list of ints)
 +
 +
"GroupInfo":
 +
(name:str, inherited:bool, inherit:bool, inheritable:bool, add:list, remove:list, members:list)
 +
 +
"ACLInfo":
 +
(applyThere:bool, applySubs:bool, inherited:bool, id:int, group:str, allow:long, deny:long)
 +
 +
"BanInfo":
 +
(address:long, bits:int)
 +
 +
--
 +
 +
To access the server interface, proceed as following:
 +
>>>import dbus
 +
>>>bus = dbus.SystemBus() # assuming that you are using a system bus
 +
>>>server = bus.get_object('net.sourceforge.mumble.murmur', '/1') # assuming that you want to control the server number 1
 +
>>> # to use methods, do:
 +
>>>server.method(args)

Revision as of 23:09, 25 June 2008

This is a documentation of the DBus interface. Mostly useful for creating scripts for interacting with murmur.

net.sourceforge.mumble.Meta

start

Starts a virtual server

input parameters

  • [int] server_id The specific server

stop

Stops a virtual server

input parameters

  • [int] server_id The specific server

newServer

Creates a new virtual server

output parameters

  • [int] server_id The id of the new created server

deleteServer

deletes a virtual server

input parameters

  • [int] server_id The specific server

getBootedServers

Returns a list of all active servers

output parameters

  • [int]* server_id

getAllServers

Returns a list of all servers

output parameters

  • [int]* server_id

isBooted

check, whether a server is booted

input parameters

  • [int] server_id

output parameters

  • [boolean] is_booted

getConf

receive the configuration of a server by key

input parameters

  • [int] server_id
  • [string] key

output parameters

  • [string] value

getAllConf

receive the whole configuration of a server

input parameters

  • [int] server_id

output parameters

  • [string|string]* key->value map

getDefaultConf

receive the default configuration

output parameters

  • [string|string]* key->value map

setConf

set the value of a specific key on a specific server

input parameters

  • [int] server_id
  • [string] key
  • [string] value

setSuperUserPassword

set the superuser password on a specific server

input parameters

  • [int] server_id
  • [string] password

rotateLogs

rotate the logs

getLog

get the log of a specific server in a specific time frame

input parameters

  • [int] server_id
  • [int] min_seconds
  • [int] max_seconds

quit

shutdown the server

Server-specific methods

getPlayers <-input:nothing ->returns a list of PlayerInfoExtended(see below)

getChannels <-input:nothing ->returns a list of ChannelInfo(idem)

getACL <-input:chan identifier(int) ->returns a list containing [a list of ACLInfo, a list of GroupInfo, a boolean for inherit]

setACL (todo) <- ->

getBans <-nothing ->list of BanInfo

setBans <-list of BanInfo ->nothing

getPlayerState <-player session id(unsigned int) (warning, unsigned ints are special, see below) ->PlayerInfo

setPlayerState <-PlayerInfo ->nothing

getPlayerNames <-list of session id(unsigned ints) (warning, same as above) ->list of names(unicode strings)

getPlayerIds <-list of names(strs on unicode strs) ->list of IDs(ints(regular ones))

addChannel <-name(str or unicode str) , parent's id(int) ->id of the new chan(int)

removeChannel <-chan id(int) ->nothing

setChannelState <-ChannelInfo ->nothing

kickPlayer <-session id(unsigned int) , reason(str or unicode str) ->nothing

-- Warning: unsigned ints are a bit strange. They look like longs when Python reads them (1786L for instance) but Python must transform them before sending them ot dbus.) >>>import dbus >>>egg=178L >>>spam = dbus.UInt32(long) #may vary depending on your plateform and now, spam is a dBus unsigned int and is ready to be sent

-- Structures(e.g. omagad, what is PlayerInfo ???)

"PlayerInfo" is a tuple(static list) containing(dont forget to transform session before sending it): (session:long, mute:bool, deaf:bool, suppressed:bool, selfMute:bool, selfDeaf:bool, channel:int)

"PlayerInfoExtended" is a tuple(static list) containing(you just receive it with getPlayerState, you never have to send one)(notice that the 7 first are exactly the same as PlayInfo): (session:long, mute:bool, deaf:bool, suppressed:bool, selfMute:bool, selfDeaf:bool, channel:int, id:int, name:unicode str, onlinesecs:int, bytespersecond:int)

"ChannelInfo" is a tuple containing: (id:int, name:str, parent:int, links:list of ints)

"GroupInfo": (name:str, inherited:bool, inherit:bool, inheritable:bool, add:list, remove:list, members:list)

"ACLInfo": (applyThere:bool, applySubs:bool, inherited:bool, id:int, group:str, allow:long, deny:long)

"BanInfo": (address:long, bits:int)

--

To access the server interface, proceed as following: >>>import dbus >>>bus = dbus.SystemBus() # assuming that you are using a system bus >>>server = bus.get_object('net.sourceforge.mumble.murmur', '/1') # assuming that you want to control the server number 1 >>> # to use methods, do: >>>server.method(args)