RemoteAdmin:admin broadcast
From OpenSimulator
(Difference between revisions)
												
			 (Created page with "'''admin_broadcast''' remotely allows to broadcast a general alert to all agents in a region   === Enabling admin_broadcast === If not all functions are enabled, use admin_dbroad...")  | 
			 (→Example)  | 
			||
| Line 71: | Line 71: | ||
</source>  | </source>  | ||
| + | === Python  ===  | ||
| + | |||
| + | <source lang="python">  | ||
| + | # Author : DrScofield   | ||
| + | # Source : http://xyzzyxyzzy.net/2008/01/23/using-pythons-xmlrpclib-with-opensim/  | ||
| + | # License : BSD License  | ||
| + | |||
| + | #!/usr/bin/python   | ||
| + | import xmlrpclib   | ||
| + | |||
| + | # XML-RPC URL (http_listener_port)   | ||
| + | simulatorUrl = "http://127.0.0.1:9000"  | ||
| + | |||
| + | # instantiate server object   | ||
| + | simulator = xmlrpclib.Server(simulatorUrl)   | ||
| + | |||
| + | # invoke admin_alert: requires password and message   | ||
| + | simulator.admin_broadcast({'password': 'secret', 'message': 'the answer is 42'})  | ||
| + | </source>  | ||
| + | |||
| + | [[Category:Users]]  | ||
| + | [[Category:Support]]  | ||
| + | [[Category:Tech Reference]]   | ||
| + | [[Category:Help]]  | ||
| + | [[Category:Configuration]]  | ||
| + | [[Category:Getting_Started]]  | ||
[[Category:Development]]  | [[Category:Development]]  | ||
Revision as of 05:26, 10 December 2011
admin_broadcast remotely allows to broadcast a general alert to all agents in a region
Contents | 
Enabling admin_broadcast
If not all functions are enabled, use admin_dbroadcast to enable the function in the [RemoteAdmin] section
enabled_methods = admin_broadcast,...
Parameters
Required Parameters
These parameters are required
| parameter | Description | Values | 
|---|---|---|
| message | Message to be broadcasted | 
Optional Parameters
There are no optional parameters
Returned Parameters
Returned Parameters
These parameters are returned by Remote Admin
| parameter | Description | Values | 
|---|---|---|
| success | true when successfull | true, false | 
| error | error message when not successfull | 
Error messages
No error Messages
Notes
- accepted is an optional returned parameter, probably used prior to success
 
Example
PHP
<?php // Including the RemoteAdmin PHP class. include('RemoteAdmin.php'); // Instantiate the class with parameters identical to the Python example above $myRemoteAdmin = new RemoteAdmin('127.0.0.1', 9000, 'secret'); // Invoke admin_create_user (multiple parameters) $parameters = array('message' => 'Welcome in my region'); $myRemoteAdmin->SendCommand('admin_broadcast', $parameters); ?>
Python
# Author : DrScofield # Source : http://xyzzyxyzzy.net/2008/01/23/using-pythons-xmlrpclib-with-opensim/ # License : BSD License #!/usr/bin/python import xmlrpclib # XML-RPC URL (http_listener_port) simulatorUrl = "http://127.0.0.1:9000" # instantiate server object simulator = xmlrpclib.Server(simulatorUrl) # invoke admin_alert: requires password and message simulator.admin_broadcast({'password': 'secret', 'message': 'the answer is 42'})