Difference between revisions of "DBus Methods"
Deubeuliou (talk | contribs) (→Server-specific methods) |
Deubeuliou (talk | contribs) |
||
Line 92: | Line 92: | ||
* returns a list of PlayerInfoExtended(see below) | * returns a list of PlayerInfoExtended(see below) | ||
− | = getChannels = | + | == getChannels == |
* input:nothing | * input:nothing | ||
* returns a list of ChannelInfo(idem) | * returns a list of ChannelInfo(idem) | ||
− | = getACL = | + | == getACL == |
* input:chan identifier(int) | * input:chan identifier(int) | ||
* returns a list containing [a list of ACLInfo, a list of GroupInfo, a boolean for inherit] | * returns a list containing [a list of ACLInfo, a list of GroupInfo, a boolean for inherit] | ||
− | = setACL (todo) = | + | == setACL (todo) == |
* | * | ||
* | * | ||
− | = getBans = | + | == getBans == |
* nothing | * nothing | ||
* list of BanInfo | * list of BanInfo | ||
− | = setBans = | + | == setBans == |
* list of BanInfo | * list of BanInfo | ||
* nothing | * nothing | ||
− | = getPlayerState = | + | == getPlayerState == |
* player session id(unsigned int) (warning, unsigned ints are special, see below) | * player session id(unsigned int) (warning, unsigned ints are special, see below) | ||
* PlayerInfo | * PlayerInfo | ||
− | = setPlayerState = | + | == setPlayerState == |
* PlayerInfo | * PlayerInfo | ||
* nothing | * nothing | ||
− | = getPlayerNames = | + | == getPlayerNames == |
* list of session id(unsigned ints) (warning, same as above) | * list of session id(unsigned ints) (warning, same as above) | ||
* list of names(unicode strings) | * list of names(unicode strings) | ||
− | = getPlayerIds = | + | == getPlayerIds == |
* list of names(strs on unicode strs) | * list of names(strs on unicode strs) | ||
* list of IDs(ints(regular ones)) | * list of IDs(ints(regular ones)) | ||
− | = addChannel = | + | == addChannel == |
* name(str or unicode str) , parent's id(int) | * name(str or unicode str) , parent's id(int) | ||
* id of the new chan(int) | * id of the new chan(int) | ||
− | = removeChannel = | + | == removeChannel == |
* chan id(int) | * chan id(int) | ||
* nothing | * nothing | ||
− | = setChannelState = | + | == setChannelState == |
* ChannelInfo | * ChannelInfo | ||
* nothing | * nothing | ||
− | = kickPlayer = | + | == kickPlayer == |
* session id(unsigned int) , reason(str or unicode str) | * session id(unsigned int) , reason(str or unicode str) | ||
* nothing | * 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.) | 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 | >>>import dbus | ||
Line 151: | Line 151: | ||
and now, spam is a dBus unsigned int and is ready to be sent | 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): | "PlayerInfo" is a tuple(static list) containing(dont forget to transform session before sending it): | ||
Line 171: | Line 171: | ||
(address:long, bits:int) | (address:long, bits:int) | ||
− | + | = Implementation = | |
− | |||
To access the server interface, proceed as following: | To access the server interface, proceed as following: | ||
>>>import dbus | >>>import dbus |
Revision as of 23:19, 25 June 2008
This is a documentation of the DBus interface. Mostly useful for creating scripts for interacting with murmur.
Contents
- 1 net.sourceforge.mumble.Meta
- 2 Server-specific methods
- 3 Warning
- 4 Structures(e.g. omagad, what is PlayerInfo ???)
- 5 Implementation
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)
Implementation
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)