AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [STB2] Save Temporary Bans 2 (https://forums.alliedmods.net/showthread.php?t=143548)

Bacardi 11-21-2010 10:40

[STB2] Save Temporary Bans 2
 
6 Attachment(s)
[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
https://forums.alliedmods.net/attach...1&d=1307038189

Show list bans/unbans, print 5 id at time.
Can also search certain id
(Now using commands from rcon)
https://forums.alliedmods.net/attach...1&d=1307038573


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


Jamster 11-21-2010 11:59

Re: [STB] Save Temporary Bans
 
A most needed plugin, good work man.

Bacardi 11-21-2010 12:26

Re: [STB] Save Temporary Bans
 
Quote:

Originally Posted by Jamster (Post 1353760)
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 ?

Xp3r7 11-21-2010 22:31

Re: [STB] Save Temporary Bans
 
Yes, this is a much needed plugin!

I will add this to my servers soon. :)

Snaggle 11-22-2010 02:59

Re: [STB] Save Temporary Bans
 
Great stuff, when I only had 1 server I needed something like this. It will be a great plugin for most servers.

Bacardi 11-22-2010 03:51

Re: [STB] Save Temporary Bans
 
Quote:

Originally Posted by Snaggle (Post 1354264)
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 :mrgreen:

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

Aion 02-02-2011 17:31

Re: [STB] Save Temporary Bans
 
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

Bacardi 02-05-2011 10:48

Re: [STB] Save Temporary Bans
 
Quote:

Originally Posted by Aion (Post 1405711)
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 (Post 1405711)
*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. :grrr:

Aion 02-20-2011 07:25

Re: [STB] Save Temporary Bans
 
Bacardi
When we'll see a new version? :)

p.S Don't forget about my request :)

siangc 02-20-2011 08:37

Re: [STB] Save Temporary Bans
 
is it possible to somehow migrate this to sourcebans?


All times are GMT -4. The time now is 18:36.

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