Raised This Month: $51 Target: $400
 12% 

[STB2] Save Temporary Bans 2


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Plugin ID:
2086
Plugin Version:
2.0
Plugin Category:
Server Management
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Storage temporary bans, in order not lose them after server reboot
    Old 11-21-2010 , 10:40   [STB2] Save Temporary Bans 2
    Reply With Quote #1

    [STB2] Save Temporary Bans 2
    - Storage temporary bans, in order not lose them after server reboot
    *PS
    If you already have SourceBans, don't use this !!


    If you didn't know,
    Source Dedicated Server handle bans from "computer memory" (server command listid)
    and these bans disapear when server reboot.
    To get bans work after server reboot, you need first execute permanent ban list.
    Add
    exec banned_user.cfg
    exec banned_ip.cfg

    in ...cfg/autoexec.cfg file
    When there come changes in SRCDS ban list in "memory" (more bans or unban),
    need save all current bans from "memory" to banned_user.cfg file
    Add
    writeid
    writeip

    in ...cfg/server.cfg file
    about forked server


    But this not work on temporary bans what have timelimit when expire (day, week, moth ban length).
    Then you need install plugin what keep these bans activate.


    • This plugin not save IP and permanent bans.
    • Save only bans by SteamID with timelimit when expire.
    • Maximum ban duration is 525600 minutes (year)
    • Can setup to use SourceMod own SQLite or MySQL.
    • Expired bans will disapear after server reboot or reloading plugin

    Immunity
    Admins with flag "e" (unban).
    Can override to different flag or "allow" one of admin groups use stb2_immunity
    Notice! Works only stb2_mode 1 and 2

    Cvars
    Plugin generate automatically configuration file in ...cfg/sourcemod/plugin.stb2.cfg
    Code:
    stb2_leave_srcds_ban "0"
    // When enabled, it not remove ban from srcds ban list after banning
    // min. 0.0 - max. 1.0
    
    stb2_mode "1"
    // Handle temporary bans after reboot
    //  0 = Add bans normally in server, banid
    //  1 = Kick client with ban msg
    //  2 = Kick client with ban msg, add 1 minute IP ban
    // min. 0.0 - max. 2.0
    Admin Commands
    Code:
    sm_stb2_banlist
    //List STB2 bans in console
    //Admins flag "d" (ban) can use this
     
    sm_stb2_unbanlist
    //List STB2 expired bans in console
    //Admins flag "d" (ban) can use this
    Installation
    - Move plugin stb2.smx in ...addons/sourcemod/plugins/
    - Move translation stb2.phrases.txt in ...addons/sourcemod/translations/
    - Edit with notepad ...addons/sourcemod/configs/databases.cfg
    Code:
    "Databases"
    {
        "driver_default"        "mysql"
        
        "default"
        {
            "driver"            "default"
            "host"                "localhost"
            "database"            "sourcemod"
            "user"                "root"
            "pass"                ""
            //"timeout"            "0"
            //"port"            "0"
        }
        
        "storage-local"
        {
            "driver"            "sqlite"
            "database"            "sourcemod-local"
        }
    
        "clientprefs"
        {
            "driver"            "sqlite"
            "host"                "localhost"
            "database"            "clientprefs-sqlite"
            "user"                "root"
            "pass"                ""
            //"timeout"            "0"
            //"port"            "0"
        }
    
        "stb2"
        {
            "driver"            "sqlite"
            "host"                "localhost"
            "database"            "stb2"
        }
    }
    Bans start save in ...addons/sourcemod/data/sqlite/stb2.sq3



    Chat announce
    Player Bacardi left the game (Banned)
    364d 20h 52m 55s left = 2012-06-01 17:15:33


    Screenshots
    Kick message to banned player when they try connect to server
    in stb2_mode 1 or 2


    Show list bans/unbans, print 5 id at time.
    Can also search certain id
    (Now using commands from rcon)



    Using MySQL
    - First, you have own MySQL database
    - Edit databases.cfg
    Code:
        "stb2"
        {
            "driver"            "mysql"
            "host"                "address"
            "database"            "databasename"
            "user"                "user"
            "pass"                "password"
        }
    - With this setup you have the opportunity use temporary bans in multiple servers

    Usage Admin commands
    - Show 5 bans what are recently added.
    sm_stb2_banlist

    - Show next 5 bans, etc. etc.
    sm_stb2_banlist 5

    - Show certain ban by steamid
    sm_stb2_banlist LIKE STEAM_0:1:12345

    - Show 5 bans which contains given text or number, example id from above
    sm_stb2_banlist LIKE %345%

    - sm_stb2_unbanlist works same way

    Credits
    SM Developer team
    Wiki SQL (SourceMod Scripting)
    Save Scores (1.3.4)
    SoD Player Stats

    log
    Code:
    Version 2.0, 2.6.2011
    - Rewrite whole crap
    - Renamed to [STB2] Save Temporary Bans 2
    
    Version 0.5, 1.6.2011
    - Fix error when player/admin have ' in name or in reason text
    
    Version 0.4, 27.12.2010
    - Quick update to stb_rejectmode 0, other way do executebans.
    - Forget add event server_removeban, updated
    
    Version 0.3, 26.12.2010
    - Re-write whole crap
    - Now should save all temporary bans by steamid with timelimit
    - sm_stb_list show now 5 bans at time, see next 5 bans add number, sm_stb_list 5
    - Cvar stb_printrejected 0/1, when enabled
    print in chat to all banned-player with ban time left when they try connect to server
    
    Version 0.2, 6.12.2010
    - Removed cvar 'stb_immunityflags'
    - Change check admin immunity, added immunity (so called "command") stb_immunity
    
    Version 0.1, 21.11.2010
    - Release
    Attached Thumbnails
    Click image for larger version

Name:	kick_msg.gif
Views:	15868
Size:	27.3 KB
ID:	86928   Click image for larger version

Name:	console_msg.gif
Views:	16441
Size:	38.2 KB
ID:	86930  
    Attached Files
    File Type: zip stb2.zip (20.6 KB, 1874 views)
    File Type: smx stb2.smx (10.6 KB, 938 views)
    File Type: txt stb2.phrases.txt (1.5 KB, 1015 views)
    File Type: cfg databases_example.cfg (802 Bytes, 713 views)

    Last edited by Bacardi; 06-26-2012 at 02:54. Reason: rewrite whole crab
    Bacardi is offline
    Jamster
    Veteran Member
    Join Date: Jun 2008
    Old 11-21-2010 , 11:59   Re: [STB] Save Temporary Bans
    Reply With Quote #2

    A most needed plugin, good work man.
    Jamster is offline
    Bacardi
    Veteran Member
    Join Date: Jan 2010
    Location: mom's basement
    Old 11-21-2010 , 12:26   Re: [STB] Save Temporary Bans
    Reply With Quote #3

    Quote:
    Originally Posted by Jamster View Post
    A most needed plugin, good work man.
    Thanx, don't know about "good work" heh.
    Hope this work with less trouble and errors.

    *edit
    Those who want know how many minutes are x hours, days, weeks, months, or year.
    Can find from web.
    http://www.unitconversion.org/time/m...onversion.html

    *edit edit
    Feedback ?
    __________________
    Do not Private Message @me

    Last edited by Bacardi; 11-21-2010 at 14:09.
    Bacardi is offline
    Xp3r7
    SourceMod Donor
    Join Date: Jul 2006
    Old 11-21-2010 , 22:31   Re: [STB] Save Temporary Bans
    Reply With Quote #4

    Yes, this is a much needed plugin!

    I will add this to my servers soon.
    __________________
    Xp3r7 is offline
    Send a message via MSN to Xp3r7
    Snaggle
    AlliedModders Donor
    Join Date: Jul 2010
    Location: England
    Old 11-22-2010 , 02:59   Re: [STB] Save Temporary Bans
    Reply With Quote #5

    Great stuff, when I only had 1 server I needed something like this. It will be a great plugin for most servers.
    Snaggle is offline
    Bacardi
    Veteran Member
    Join Date: Jan 2010
    Location: mom's basement
    Old 11-22-2010 , 03:51   Re: [STB] Save Temporary Bans
    Reply With Quote #6

    Quote:
    Originally Posted by Snaggle View Post
    Great stuff, when I only had 1 server I needed something like this. It will be a great plugin for most servers.
    Great to hear

    To clarify now in this post... Those who have other
    addons beside SM.
    Like Mani Admin Plugin or Event Script,
    (I assume now) this plugin not save bans added by those plugins or other than SourceMod own plugins.

    Plugin only save ban or change ban when

    OnBanClient

    OnBanIdentity

    OnRemoveBan

    happen.

    Even if ban added by using
    srcds own command
    rcon bandid 1440 STEAM_id

    plugin not save.
    So this have very limited action... or how to say.

    When I have more time, I could look add
    rcon banid part in this plugin.

    *edit
    UPDATED version 0.3
    Should now save all temporary bans by steamid with ban time

    Last edited by Bacardi; 12-26-2010 at 06:41.
    Bacardi is offline
    Aion
    Member
    Join Date: Nov 2010
    Location: Russia, Voronezh
    Old 02-02-2011 , 17:31   Re: [STB] Save Temporary Bans
    Reply With Quote #7

    Bacardi
    Maybe, you could make a translation file for editing chat or panel messages?

    *edit
    And, maybe you think about how delete undanned players from list?
    Quote:
    13:25:14 x STEAM_0:0:103xxxxxxx name: Testing
    Ban expire or unbanned 0d -11h -31m -31s ago
    Unbanned by Console reason:
    Date: 02/03/2011 - 02:10:01

    Last edited by Aion; 02-03-2011 at 05:27.
    Aion is offline
    Bacardi
    Veteran Member
    Join Date: Jan 2010
    Location: mom's basement
    Old 02-05-2011 , 10:48   Re: [STB] Save Temporary Bans
    Reply With Quote #8

    Quote:
    Originally Posted by Aion View Post
    Bacardi
    Maybe, you could make a translation file for editing chat or panel messages?
    ok, I try remember this next version... I try also create this plugin more simple (code).

    Quote:
    Originally Posted by Aion View Post
    *edit
    And, maybe you think about how delete undanned players from list?
    Those "unbanned" info disapear when server reboot or you unload/load plugin.

    *edit
    I maybe need change my plugin cvar prefix...
    I didn't look if there already taken "stb_", I found that there is Simple Team Balancer what use this.

    Last edited by Bacardi; 02-05-2011 at 10:58.
    Bacardi is offline
    Aion
    Member
    Join Date: Nov 2010
    Location: Russia, Voronezh
    Old 02-20-2011 , 07:25   Re: [STB] Save Temporary Bans
    Reply With Quote #9

    Bacardi
    When we'll see a new version?

    p.S Don't forget about my request
    Aion is offline
    siangc
    Senior Member
    Join Date: Mar 2010
    Old 02-20-2011 , 08:37   Re: [STB] Save Temporary Bans
    Reply With Quote #10

    is it possible to somehow migrate this to sourcebans?
    __________________
    siangc is offline
    Reply



    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off

    Forum Jump


    All times are GMT -4. The time now is 17:33.


    Powered by vBulletin®
    Copyright ©2000 - 2024, vBulletin Solutions, Inc.
    Theme made by Freecode