Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Tiberian Technologies / Blackhand Studios » Tiberian Technologies Forum » BRenBot for 4.1
BRenBot for 4.1 [message #485718] Thu, 06 February 2014 07:28 Go to next message
danpaul88 is currently offline  danpaul88
Messages: 5795
Registered: June 2004
Location: England
Karma: 0
General (5 Stars)
The server files for TT 4.1 include the very latest version of BRenBot, the source of which is available on the BRenBot SVN. This topic will cover a few of the important changes server owners should be aware of and I may update it from time to time if there is anything else suitable to add.



Reduced built-in functionality
As has been the trend with BRenBot for a while now I've been steadily removing features from the core of the bot in favour of providing plugins for those features.

The reason for this is to reduce the complexity of the core codebase and make it more maintainable as well as reducing the amount of configuration settings and commands that come with a stock installation. It also helps to improve the plugin API as I add new functions to expose functionality required by plugins.

The following functionality has been moved into plugins since the 4.0 release of BRenBot;

  • Donations (Note: Also gained an additional !teamdonate command as part of the move to a plugin)
  • Join Messages
  • Recommendations


These plugins are available on the BRenBot SVN.




Reworked Map Settings
The map settings code in BRenBot has been substantially overhauled to reduce code duplication and provide a more flexible architecture. Plugins can now access the global and per-map settings as well as their own custom settings which can be placed in the mapsettings.xml file.




teams.cfg
Mainly intended for use with mods, this file replaces the old autodetection logic which used to provide limited support for APB. This file contains the abbreviation, name and IRC colours to use for team 0 (Nod), 1 (GDI) and 2 (Neutral). The stock copy of this file contains the default settings for use with Renegade, however if you prefer to use different colours (or add background colours) for teams in IRC you can customise them through this file.




Updated Perl
BRenBot 1.53.19 is now built against Strawberry Perl rather than ActivePerl and is using a much newer version than before. No longer will you get the message about tied XML handles being deprecated.




Overhauled Plugin Loader
The plugin loader has been completely overhauled and now supports loading and unloading plugins at runtime. This allows you to turn features on and off in much the same way as the !modules and !set commands used to do. Those modules are being phased out in favour of plugin based solutions.

As well as offering improved functionality the new code should be much more efficient in terms of memory usage as it previously duplicated quite a lot of data between a few different hashes.

New commands;
!plugins - List all installed plugins. Green plugins are loaded, red plugins are not loaded and orange plugins have halted due to an error, or failed to load in the first place.

!plugin_load <name> - Loads the named plugin

!plugin_unload <name> - Unloads the named plugin

BRenBot will additionally remember which plugins are loaded and unloaded and on startup will only load those which were previously loaded the last time it was run. By default it will not load new plugins until it is told to do so.

Caveat: Due to the way Perl loads modules it is not possible to load a plugin a second time if it failed to load due to a syntax or other compilation error. This is because the module was partially loaded, but not to the point were the unloading mechanism can clear out the cached data, preventing !plugin_load from getting a fresh copy.




Notes for plugin developers
BRenBot now required that plugins return 1 from their start function to indicate that they have loaded successfully. Returning 0 or nothing tells BRenBot that you have failed to load and it will immediately unload the plugin and mark it as being in error.

You might want to return 0 if the version of BRenBot is too old to support the plugin. Examples of this can be found in the plugins mentioned at the top of this post.

There is also an additional, optional, function you may wish to implement which is called when BRenBot is about to unload your plugin. Since plugins can be unloaded it is important that your shutdown function tidies up any open file handles and whatnot in case your plugin is loaded again in future to avoid file permission problems or dangling handles.


There are now many more plugin API commands available for use in your plugins, which can be found in the plugins.pm source in the API. Additionally the regex hooks system used with renlog and gamelog has been extended to support ssgmlog.




Bug Reporting
Please report any bugs you might find or submit feature requests on the BRenBot Trello page at https://trello.com/b/dlqadUmV by commenting on the cards under "BRenBot 1.53.19".




Acknowledgements
Thanks to Ethenal for contributing some bug fixes to the BRenBot SVN.






There's probably a few more things that I'll add to this later, but for now it's a good starting point Smile


http://steamsignature.com/card/1/76561197975867233.png

[Updated on: Thu, 06 February 2014 08:01]

Report message to a moderator

Re: BRenBot for 4.1 [message #485723 is a reply to message #485718] Thu, 06 February 2014 10:07 Go to previous messageGo to next message
Gen_Blacky is currently offline  Gen_Blacky
Messages: 3250
Registered: September 2006
Karma: 1
General (3 Stars)
Quote:


Updated Perl
BRenBot 1.53.19 is now built against Strawberry Perl rather than ActivePerl and is using a much newer version than before. No longer will you get the message about tied XML handles being deprecated.



Good Thumbs Up. Using Strawberry and cpan modules is way better.


http://s18.postimage.org/jc6qbn4k9/bricks3.png

[Updated on: Thu, 06 February 2014 10:10]

Report message to a moderator

Re: BRenBot for 4.1 [message #485960 is a reply to message #485718] Tue, 11 February 2014 02:29 Go to previous messageGo to next message
Ethenal is currently offline  Ethenal
Messages: 2532
Registered: January 2007
Location: US of A
Karma: 0
General (2 Stars)

http://new.brenbot.com/plugins.php

You're still hosting that, do you intend to update that section of the site? Or do you just want people to get the plugins from the SVN?

It doesn't matter to me since I have the SVN checked out anyway, but I just noticed the BR distribution in the server files doesn't have any plugins. Razz

P.S. and lol, I should have commited the mapload event fix, I had seen the =~ "Level loaded OK" thing awhile ago and fixed it on mine, but forgot to push it.


-TLS-DJ-EYE-K wrote on Mon, 18 March 2013 07:29

Instead of showing us that u aren't more inteligent than a Toast, maybe you should start becomming good in renegade Thumbs Up

[Updated on: Tue, 11 February 2014 02:32]

Report message to a moderator

Re: BRenBot for 4.1 [message #485961 is a reply to message #485718] Tue, 11 February 2014 02:35 Go to previous message
danpaul88 is currently offline  danpaul88
Messages: 5795
Registered: June 2004
Location: England
Karma: 0
General (5 Stars)
I might still have the login details for that site lying around somewhere... if I dig them out I'll update it when I have chance.

Ethenal wrote on Tue, 11 February 2014 09:29

P.S. and lol, I should have commited the mapload event fix, I had seen the =~ "Level loaded OK" thing awhile ago and fixed it on mine, but forgot to push it.


Yeah, that was an annoying one to find... it looks perfectly normal at first glance, it probably took half an hour or more of debugging before I realised it was the "" marks causing the problem :/ That's the problem of jumping between so many different programming languages, you miss syntactic derps sometimes...


http://steamsignature.com/card/1/76561197975867233.png

[Updated on: Tue, 11 February 2014 02:38]

Report message to a moderator

Previous Topic: issue:
Next Topic: Updating removes skins???????
Goto Forum:
  


Current Time: Sun Dec 22 00:06:52 MST 2024

Total time taken to generate the page: 0.00925 seconds