[EXTENSION] DBus Connectivity
1 Attachment(s)
This extension implements a basic D-Bus binding using the QT library. This extension is still in development and this release is a beta version.
Currently, it provides 2 interfaces:
Code:
import dbus; Known issues:
Planned Features:
Intended use for this extension: Whenever you want a script/program/web interface/whatever to execute a command or retrieve other info from the server, you currently need to implement the RCon protocol (or use a lib for it), send the server a command of some sort, and parse the command's output. DBus can greatly simplify this procedure by doing all this stuff, all you need to do is use the interface described above. E.g, GetAllPlayers() will return an array of structs, each one containing all the data you need to know about a player: Code:
mistagee@sphynx:~$ !440 How exactly all this works is demonstrated in the included Python script. I've put up a demo website that uses this extension here: http://www.dingens-kirchen.net/srcds/1 Package contents: My svn repository contains all the code files needed to compile this extension, and two binaries for the original engine that were compiled against versions 4.2 and 4.4 of the QT library. As I am not at all familiar with coding/compiling for Windows, this extension is currently in development for Linux only. If someone would like to make this fit for Windows please let me know :) Getting the extension: I'm keeping this extension (including compiled binaries) in a hg repository hosted by BitBucket here: http://bitbucket.org/Svedrin/sourcemod-dbus/wiki/Home. You can get it from there using the Mercurial client or by downloading a snapshot. Greetz |
Re: [EXTENSION] DBus Connectivity
A couple of questions -- will this return data from ServerCommand or is that one-way only? I'm most interested in getting the results of "stats" back for monitoring purposes.
I'm not familiar with DBus - it looks like communication is restricted to processes on the same machine? (you can't connect remotely?) Is the connection name not being configurable a technical limit or would it be possible to make it configurable (I have multiple servers running on the same machine)? |
Re: [EXTENSION] DBus Connectivity
Quote:
Btw, if there is a way to get that data directly, I'd include a function in the interface for that to make command parsing obsolete, as that is what this extension was made for in the first place. Quote:
Quote:
Greetz |
Re: [EXTENSION] DBus Connectivity
Update:
The service name can now be configured in addons/sourcemod/configs/dbus.ext.cfg. See the example file in svn for how this works. Greetz |
Re: [EXTENSION] DBus Connectivity
Interesting idea!
|
All times are GMT -4. The time now is 02:31. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.