SourceBans icon indicating copy to clipboard operation
SourceBans copied to clipboard

Request: Merge [ANY] SourceComms into SB 2.0 release

Open cssBOT opened this issue 12 years ago • 14 comments

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.

cssBOT avatar Jul 04 '13 23:07 cssBOT

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.

ErikMinekus avatar Jul 05 '13 15:07 ErikMinekus

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?

ppalex7 avatar Jul 06 '13 11:07 ppalex7

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.

ErikMinekus avatar Jul 06 '13 22:07 ErikMinekus

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?

ppalex7 avatar Jul 07 '13 14:07 ppalex7

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.

ErikMinekus avatar Jul 07 '13 15:07 ErikMinekus

Thanks!

ppalex7 avatar Jul 07 '13 16:07 ppalex7

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?

ppalex7 avatar Jul 07 '13 16:07 ppalex7

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.

ErikMinekus avatar Jul 08 '13 08:07 ErikMinekus

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?

ppalex7 avatar Jul 12 '13 20:07 ppalex7

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?

ErikMinekus avatar Jul 13 '13 13:07 ErikMinekus

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?

ppalex7 avatar Jul 13 '13 14:07 ppalex7

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.

ErikMinekus avatar Jul 17 '13 16:07 ErikMinekus

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.

flyingmongoose avatar Jul 19 '13 16:07 flyingmongoose

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.

ErikMinekus avatar Aug 17 '13 19:08 ErikMinekus