Request: Merge [ANY] SourceComms into SB 2.0 release
SB 2.0 will obviously break SC. So then SC will need a rewrite, more db migration, and a whole bunch more script patching. Server owners will then need to decide to drop SC functionality and migrate to SB 2.0 or wait months for the SC rewrite and migrate everything from 1.x at that time. Today the forum stats show about 8% (432/5733) of SB servers already running SourceComms and another 470 servers running extendedcomm. It would save a ton of development effort and operator time to do this inevitable merge of these projects now and have an all-in-one regulation system.
Thanks for the statistics, they do paint a clear picture. However, we don't want the core of SB 2 to be bloated with features that the majority of users don't use, which is why we introduced a web plugin system. That way people can just disable or remove the functionality. SourceComms is a perfect example for a game/web plugin combination, so I would be happy to help ppalex or someone else write it.
Oh, Hi, I'm the author of SourceComms =) Tell me, can I implement all the functionality through API (add a separate tab, use the general right of access, use RCON commands, etc.)? Where can I find a complete description of the features available through the API?
Documentation is in the works, but these links should explain the basics:
Development overview Example plugin (with comments but no context) RCON example API documentation
But I kind of went overboard yesterday and made a start on what you need. It has a controller, model, views, assets and some translations. If you start at CommsPlugin.php hopefully most of it will become clear.
Anyway, this is pre-alpha so things may change, but it should get you started. And if there's something missing, don't hesitate to ask so we can add it.
Mmm, i have problems to access documentation and other links failed to open stream: or document not found
Yesterday it worked.
Moreover, can you help me to install your version of "sourcecomm plugin" ? After I'm clicking on link "install" in sourcebans plugins settings - nothings happens. Could I install plugin manually? What I'm need to do?
I was in the middle of moving the docs, they're now on http://docs.sourcebans.net and http://docs.sourcebans.net/api. As for the installation, you may need to return true; at the end of runInstall() and runUninstall() in CommsPlugin.php. I uploaded a new SB 2.0 zip where you don't have to explicitly return true; anymore.
Thanks!
I think, that the work on comments system still in progress and i have question about it. In sb_comments table column object_type has enum type (earlier it was varchar(1)). This means for me, that i need to alter sb_comments table during installation my plugin to have ability to commenting. Altering sourcebans table looks bad, because this action will be incompatible with other plugins, which maybe wants to use comments system. What do you think about it?
You're right, it doesn't make sense for plugins to alter the core tables, so I guess we'll change it back to a varchar. Probably even a longer varchar so you can just put your plugin ID in there, instead of being limited to one character.
I don't understand how to be with SBCommnets->relations in model with VARCHAR object type. How can I (or anybody else) add an extra relation from another plugin?
I'm not sure if we want to give plugins the ability to add relations, plus you can already make a relation from your Comms model to SBComment. Do you really need the relation the other way around?
New sourcebans core code is far away from me :) I'm probably not very properly understand the essence of the "models" and their use.
Also I doesn't see comments in sourcebans alpha. Is it still in developing?
Correct, comments and demos are some of the more complex things that have not been implemented yet. There's a rough list of what still needs to be done on the roadmap.
Well, also don't forget you can add your own tables and fields to the sourcebans database utilizing some simple code as well.
And don't forget someone is almost always on the #sourcebans IRC channel on GameSurge....
Oh and don't forget to update your current documentation to indicate that your current SourceComms version only supports SourceBans 1.x versions.
I refactored events, now you can subscribe to any event and trigger them, instead of being limited to the ones we implement. But you have to subscribe manually by adding an init() method to your CommsPlugin class like so:
public function init()
{
SourceBans::app()->on('app.beginRequest', array($this, 'onBeginRequest'));
SourceBans::app()->on('app.beforeAction', array($this, 'onBeforeAction'));
}
The parameter for each event will be called $event and of class CEvent. So in your case, public function onBeforeAction($action) will change to public function onBeforeAction($event).
There's a list of events and a rough example in the documentation.