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)Chat Temp-Ban Plugin?
Pages: [1]   Go Down
  Print  
Author Topic: Chat Temp-Ban Plugin?  (Read 730 times) Bookmark and Share
Full Member
***
OS: Linux
Type: Owner dedicated server(s)
Gameservers: URT
Posts: 125
Offline Offline
Owner of BitchNipples Servers (Running B3)
« on: September 17, 2011, 07:41:53 PM »

Is there a plugin for issuing a chat Temp-Ban?

I have been looking and I don't think it exists but I had to ask.

There are players that don't really need a temp-ban but really need a temp-ban from using the chat and radio.

Anybody know?
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 17, 2011, 11:35:22 PM »

for UrT look for the censorurt plugin which mutes offending players before giving them warning
Logged

Full Member
***
OS: Linux
Type: Owner dedicated server(s)
Gameservers: URT
Posts: 125
Offline Offline
Owner of BitchNipples Servers (Running B3)
« Reply #2 on: September 18, 2011, 07:13:14 AM »

I tried the censoturt plugin before and it caused my b3 to not start
Logged
Full Member
***
OS: Linux
Type: Owner dedicated server(s)
Gameservers: URT
Posts: 125
Offline Offline
Owner of BitchNipples Servers (Running B3)
« Reply #3 on: September 18, 2011, 07:53:08 AM »

My server guy has my b3 installation in so many places and strangely installed that I cannot upgrade the thing and the reason the censorurt plugin doesn't work is that it is not for my version or b3.

It still doesn't do what I am interested in anyway.

I need a temp-chat ban just like the temp-ban system.

Issue a temp-chat ban and it expire after the set amount of time.

Anyway.... that is what I am looking for and I guess I will have to write it myself.

thanks anyway
Logged
Beta Testers
*
OS: Linux
Type: Owner dedicated server(s)
Gameservers: UrT
Posts: 244
Offline Offline
« Reply #4 on: September 18, 2011, 12:31:16 PM »

How do you imagine temp-ban-chat? It's simple mute command in my opinion.

The censorurt plugin worked for me since BBB v 1.4, so if it's not working for you, then you probably made some errors in config file. Post logs, and we'll try to help.
Logged

Full Member
***
OS: Linux
Type: Owner dedicated server(s)
Gameservers: URT
Posts: 125
Offline Offline
Owner of BitchNipples Servers (Running B3)
« Reply #5 on: September 18, 2011, 03:47:29 PM »

How do you imagine temp-ban-chat? It's simple mute command in my opinion.

The censorurt plugin worked for me since BBB v 1.4, so if it's not working for you, then you probably made some errors in config file. Post logs, and we'll try to help.

sigh... a simple mute is only good until they leave and come back and no more mute... I need to do a mute that will last a period of time like a temp-ban
Logged
Full Member
***
OS: Linux
Type: Owner dedicated server(s)
Gameservers: URT
Posts: 125
Offline Offline
Owner of BitchNipples Servers (Running B3)
« Reply #6 on: September 18, 2011, 07:59:10 PM »

So it would seem that this is more of a plugin request since I do not possess the knowledge to write it.

A plugin that works like the temp-ban system which would add an entry to the penalties table called tempchatban and you would set it like so
Code:
!tcb <playername/id> <duration> <reason>
and it would set a mute for that length of time and have it expire exactly as the tempban function does.

In the database it would set the:
id, type, clientid, adminid, duration, inactive, keyword, reason, data, time_add, time_edit, time_expire

As it is now if you mute someone it goes away if they leave and come back in so it is pretty useless.

Is this possible? Is anyone interested in this?
Logged
Beta Testers
*
OS: Linux
Type: Owner dedicated server(s)
Gameservers: UrT
Posts: 244
Offline Offline
« Reply #7 on: September 19, 2011, 05:10:38 AM »

Plugin requests are not very often fulfilled, so while waiting for response from anybody willing to do this, you could try out warning system.

From my point of view (as the server owner), warning system for swearing works much better than mute. You only need to set-up this correctly. I use 3 warnings system, with tempan according to the total time of warnings.
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 19, 2011, 09:26:01 AM »

If you look at the config file for the censorurt plugin, there is a setting called "warn_after". If you set "warn_after" to 0, then every time the plugin will mute a player it will also give them a warning.
With such settings, if the player reconnects to bypass the mute, he still get the warnings and will be tempbanned after 3 warnings.
Logged

Sr. Member
****
OS: Windows
Type: Owner dedicated server(s)
Gameservers: CoD4
Posts: 180
Offline Offline
WWW
« Reply #9 on: September 19, 2011, 10:14:11 AM »

idk if this is what you want but this is what i use on my CoD4 Server:


Code:
#Set the command level on line 21. Should be fairly obvious.

__version__ = '1.1'
__author__  = 'Spoon'

from b3.querybuilder import QueryBuilder
import b3, thread, time, string, datetime
import b3, re, traceback, sys, threading ,MySQLdb
import b3.plugin
import b3.events
from b3 import clients
from b3 import functions
# Import the necessary libaries you need here, for example, I need random for the randomization of answers part of it.
import random
#--------------------------------------------------------------------------------------------------
#This lot doesn't need to be changed for simple commands, it gets the admin plugin and registers commands.
class MutePlugin(b3.plugin.Plugin):
    _adminPlugin = None
    requiresConfigFile = False

    def onStartup(self):  
        self._adminPlugin = self.console.getPlugin('admin')  
        if not self._adminPlugin:  
            return False  
        #SET COMMAND LEVEL HERE
        self._adminPlugin.registerCommand(self, 'mute', 100, self.cmd_mute)
        self._adminPlugin.registerCommand(self, 'unmute', 100, self.cmd_unmute)
        self.registerEvent(b3.events.EVT_CLIENT_SAY)  
        self.registerEvent(b3.events.EVT_CLIENT_TEAM_SAY)  
        self.registerEvent(b3.events.EVT_CLIENT_AUTH)  
  
    def onEvent(self, event):  
        if event.type == b3.events.EVT_CLIENT_AUTH:
            self.getmute(event.client)  
            #event.client.setvar(self, 'muted', 0)
        elif event.type == b3.events.EVT_CLIENT_SAY or event.type == b3.events.EVT_CLIENT_TEAM_SAY:  
            if event.client.var(self, 'muted', 0).value == 1:  
                self._adminPlugin.warnClient(event.client, 'You are not allowed to talk', None, False, '', 1)  
            else:  
                return False

    def getmute(self, client):
        cursor = self.console.storage.query("""
        SELECT id, client_id, inactive, time_expire
        FROM penalties
        WHERE client_id = '%s' AND type = 'mute'
        ORDER BY id DESC LIMIT 1
        """ % (client.id))

        r = cursor.getRow()

        if cursor.rowcount > 0:
            self.debug('Mute Found')
            if r['inactive'] == 0:
                #if (int(time.time())) < r['time_expire']:
                if r['time_expire'] > self.console.time():
                    client.var(self, 'muted', 0).value = 1
                    client.message('^3You are now muted, shut up!')
                    self.console.say('%s has been muted' % client.exactName)
                else:
                    self.debug('Mute has expired')
                    client.var(self, 'muted', 0).value = 0
            else:
                self.debug('Mute has been deactived')
                client.var(self, 'muted', 0).value = 0
                return False
        else:
            self.debug('Player has never been muted')
            client.var(self, 'muted', 0).value = 0
            return False
        cursor.close()

    def cmd_mute(self, data, client=None, cmd=None):
        """\
        <player> <duration> [<reason>] - mute a player
        """
        m = data.split(' ',3)

        if not m[0]:
            client.message('^7Invalid parameters, you must supply a player name')
            return False

        if not m[1]:
            client.message('^7Invalid parameters, you must supply a duration')
            return False

        if not m[2]:
            client.message('^7Invalid parameters, you must supply a reason')
            return False

        sclient = self._adminPlugin.findClientPrompt(m[0], client)
        mins = int(m[1])
        reason = m[2]
        timeadd = (int(time.time()))
        timeend = (int(time.time()) + (mins*60))

        if sclient:
            if sclient.cid == client.cid:
                client.message('You cant mute yourself')
                return True
            elif sclient.maxLevel >= client.maxLevel:
                if sclient.maskGroup:
                    client.message('^7%s ^7is a masked higher level player, can\'t mute ' % client.exactName)
                else:
                    client.message('You cant mute %s' % (sclient.exactName))
                return True
            else:
                cursor = self.console.storage.query("""
                    INSERT INTO penalties ( type, client_id, admin_id, duration, inactive, reason, time_add, time_edit, time_expire )
                    VALUES ('mute', '%s', '%s', '%s', '0', '%s', '%s', '%s', '%s')
                    """ % (sclient.id, client.id, mins, reason, timeadd, timeadd, timeend)) #Have to escape quotes (')
                self.getmute(sclient)
                return True
        else:
            return False

    def cmd_unmute(self, data, client=None, cmd=None):
        """\
        <player> - unmutes a player
        """
        m = self._adminPlugin.parseUserCmd(data)
        if not m:
            client.message('^7Invalid parameters')
            return False

        sclient = self._adminPlugin.findClientPrompt(m[0], client)
        if sclient:
            cursor = self.console.storage.query("""
            SELECT id, client_id, inactive, time_expire
            FROM penalties
            WHERE client_id = '%s' AND type = 'mute'
            ORDER BY id DESC LIMIT 1
            """ % (sclient.id))

            r = cursor.getRow()

            if cursor.rowcount > 0:
                id = r['id']
        
                cursor = self.console.storage.query("""
                    UPDATE penalties
                    SET inactive = '%s'
                    WHERE id = '%s'
                    """ % (1, id))
                self.getmute(sclient)
            else:
                client.message('This user is not muted')
        else:
             return False

You can type !mute name duration reason it will add them to the penalties table.
The mute works like my old mute plugin warns the user when they are muted every time they talk but in this one the mute does not unmute when they get kicked, reconnect or on a map change the mute will stay untill the time has expired or a moderator unmutes them.

EDIT: You will have to edit your penalties table to allow mute as a type.
Logged

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


Rate this page +1 at Google Search


SimplePortal 2.3.1 © 2008-2009, SimplePortal