Most of the plugins here are made by B3 users and the authors may not visit frequently. If you need support for plugins or if questions remain unanswered, you will have to contact the author directly. Read the full Support Disclaimer here
NOTE: Do not attach plugins to your forumtopics! Attachements are periodically removed by maintenance tasks. Upload your plugins to our Downloads section instead!

You are here: Big Brother Bot ForumAdd-OnsPlugins Discussion (Moderator: MordyT)Append/Add To Ban Reason?
Pages: [1]   Go Down
  Print  
Author Topic: Append/Add To Ban Reason?  (Read 392 times) Bookmark and Share
Full Member
***
OS: Windows
Type: Owner dedicated server(s)
Gameservers: CoD4, CoD6, CoD7
Posts: 80
Offline Offline
Currently hosting 40+ b3 Bots!!!
WWW
« on: September 01, 2011, 10:38:37 PM »

Is it possible to add a section in front of a kick/ban reason, such as the line "WBX- "?  Here is the kick command from one of the plugins I am working on:

Code:
event.client.kick(r['reason'], None, event.client)

I have tried using several different things to add to it, but none seem to work properly (the kick still performs but it does not put the kick into the database).  Where do I need to add something?  The current 'reason' is grabbed from the database (a copy of another), so I am not sure I can edit anything in the "r['reason']" line..any ideas?

Brendan "NinjaNife" West

P.S.
I am finalizing several plugins/plugin modifications for my clan right now; if we to publicize them what would we do (they aren't quite finished so not sure if I will get around to it lol)?  Is there a process/special forum for such things, or do I just make a thread in this general plugin section?
Logged

Senior Dev.
*
OS: Linux
Type: Home user
Posts: 3484
Offline Offline
WWW
Support Specialty: B3-Core, UrT/SmG/BFBC2 parsers, Plugin development
« Reply #1 on: September 01, 2011, 10:59:33 PM »

the reason is never taken from database. But it can be taken from the plugin_admin.xml config file.

your code
Code:
event.client.kick(r['reason'], None, event.client)
which is equivalent to
Code:
event.client.kick(reason=r['reason'], keyword=None, admin=event.client)
would make B3 think player identified by event.client kicked himself.

Try :
Code:
event.client.kick(reason="whatever you want")
Logged

Full Member
***
OS: Windows
Type: Owner dedicated server(s)
Gameservers: CoD4, CoD6, CoD7
Posts: 80
Offline Offline
Currently hosting 40+ b3 Bots!!!
WWW
« Reply #2 on: September 02, 2011, 05:32:30 AM »

the reason is never taken from database. But it can be taken from the plugin_admin.xml config file.

your code
Code:
event.client.kick(r['reason'], None, event.client)
which is equivalent to
Code:
event.client.kick(reason=r['reason'], keyword=None, admin=event.client)
would make B3 think player identified by event.client kicked himself.

Try :
Code:
event.client.kick(reason="whatever you want")
As far as I know it actually does retrieve it from the database (the admin plugin isn't loaded at all).  What I am working on is a modified/expanded version of the Wideban plugin, which retrieves the list of penalties and if it finds one that matches it copies the penalty reason from the orignal ban.  All I am trying to do here is add an identifier to the front so we can tell which ban was done by this plugin and which is orignal.  I may have posted the wrong section of code in this case..  What do you think?  Thanks for the help.

Brendan "NinjaNife" West
« Last Edit: September 02, 2011, 05:47:38 AM by NinjaNife » Logged
Senior Dev.
*
OS: Linux
Type: Home user
Posts: 3484
Offline Offline
WWW
Support Specialty: B3-Core, UrT/SmG/BFBC2 parsers, Plugin development
« Reply #3 on: September 02, 2011, 05:40:21 AM »

I only know about B3 core and official plugins and no, warning reasons are not retrieved from the database.
If you witness they are, then you must not be using the same B3 as me. Can't help much here
Logged

Full Member
***
OS: Windows
Type: Owner dedicated server(s)
Gameservers: CoD4, CoD6, CoD7
Posts: 80
Offline Offline
Currently hosting 40+ b3 Bots!!!
WWW
« Reply #4 on: September 02, 2011, 06:02:51 AM »

I only know about B3 core and official plugins and no, warning reasons are not retrieved from the database.
If you witness they are, then you must not be using the same B3 as me. Can't help much here
I haven't actually witnessed it (no way to prove what it did besides the code), but I am not sure how it would retrieve it from the plugin_admin.xml since it was never loaded into the plugin..  Have you seen this plugin before?

http://forum.bigbrotherbot.net/plugins-by-grosbedo/wideban/

That is what I am using as my reference (unfortunately grosbedo has been inactive for almost a year, so that's why I'm not asking him for help lol).  Would you mind taking a look at that and seeing what it is doing?  Unfortunately I do not understand B3 well enough (the functions/calls and such) to know exactly what it is doing, but I do my best at guessing lol.  My failed attempt at learning I guess Wink  Thanks again for the help.

Brendan "NinjaNife" West
Logged
Senior Dev.
*
OS: Linux
Type: Home user
Posts: 3484
Offline Offline
WWW
Support Specialty: B3-Core, UrT/SmG/BFBC2 parsers, Plugin development
« Reply #5 on: September 02, 2011, 06:13:10 AM »

sorry, I have no time for that.
I can help with very specific cases when it only takes me a couple of minutes to clarify things.
Logged

Full Member
***
OS: Windows
Type: Owner dedicated server(s)
Gameservers: CoD4, CoD6, CoD7
Posts: 80
Offline Offline
Currently hosting 40+ b3 Bots!!!
WWW
« Reply #6 on: September 02, 2011, 06:18:46 AM »

sorry, I have no time for that.
I can help with very specific cases when it only takes me a couple of minutes to clarify things.
No problem.  Trial and error it is lol.  Would you happen to know the answer to my other question about how to submit plugins?  Thanks for your time Smiley

Brendan "NinjaNife" West
Logged
Full Member
***
OS: Windows
Type: Owner dedicated server(s)
Gameservers: CoD4, CoD6, CoD7
Posts: 80
Offline Offline
Currently hosting 40+ b3 Bots!!!
WWW
« Reply #7 on: September 02, 2011, 06:34:25 AM »

Wow..I just figured it out...  No idea how I missed it, but sometime last night I completely forgot to try using the + addition while wrapping the line with apostrophes >:O  I did everything else but that lol.  It works now, so that's what matters I guess.  Here is the line now (yeah, it was a simple fix..I'm just overcomplicating things I guess lol):

Code:
event.client.kick('WBX - ' + r['reason'], None, event.client)

Thanks again for your ideas.  Slowly but surely I am learning how this works Cheesy

Brendan "NinjaNife" West
« Last Edit: September 02, 2011, 06:36:46 AM by NinjaNife » Logged
Senior Dev.
*
OS: Linux
Type: Home user
Posts: 3484
Offline Offline
WWW
Support Specialty: B3-Core, UrT/SmG/BFBC2 parsers, Plugin development
« Reply #8 on: September 02, 2011, 07:27:18 AM »

you can submit your plugin straight in the download section of the forums.

Your submission will be accepted if it meets the minimum requirements :
* source file must be indented with 4 spaces (no tabs)
* source file must include the GPL licence at the top
* the plugin has a unique name
* a description that is enough for someone who never heard about it to know if the plugin could be of interest for him
* a readme file with description, install instructions (clear enough for a user who just discovered B3) and config instructions
* source files, and config files and readme file all packaged into a zip archive respecting the classic B3 folder hierarchy.
* a link to a topic in the forums dedicated to user support. (see http://forum.bigbrotherbot.net/releases/)
Logged

Tags:
Pages: [1]   Go Up
  Print  
 
Jump to:  


Rate this page +1 at Google Search


SimplePortal 2.3.1 © 2008-2009, SimplePortal