Skip to content

Commit

Permalink
[MAKEROOM] added makeroom plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
danielepantaleone authored and thomasleveil committed May 27, 2015
1 parent 50b507c commit 81c852c
Show file tree
Hide file tree
Showing 17 changed files with 1,383 additions and 1 deletion.
1 change: 1 addition & 0 deletions .travis.yml
Expand Up @@ -55,6 +55,7 @@ before_script:

script:
- nosetests --where=tests --verbosity=3 --with-cov --cov b3 --cov-report term-missing --cov-config .coveragerc --exclude-dir-file=tests/exclude_dir.txt --exclude-test-file=tests/exclude_test.txt
- py.test --cov=makeroom --cov-report=term-missing tests/plugins/makeroom
- python setup.py egg_info --tag-build .dev${TRAVIS_COMMIT:0:7} --tag-date sdist bdist_wheel
- python setup.py build_exe

Expand Down
3 changes: 2 additions & 1 deletion b3/conf/b3.distribution.ini
Expand Up @@ -106,8 +106,9 @@ welcome: @conf/plugin_welcome.ini
# countryfilter: @conf/plugin_countryfilter.ini
# customcommands: @conf/plugin_customcommands.ini
# geowelcome: @conf/plugin_geowelcome.ini
# location: @conf/plugin_location.ini
# ipban: @conf/plugin_ipban.ini
# location: @conf/plugin_location.ini
# makeroom: @conf/plugin_makeroom.ini
# translator: @conf/plugin_translator.ini
# xlrstats: @conf/plugin_xlrstats.ini

Expand Down
1 change: 1 addition & 0 deletions b3/conf/b3.distribution.xml
Expand Up @@ -137,6 +137,7 @@
<!-- <plugin name="geowelcome" config="@conf/plugin_geowelcome.ini" /> -->
<!-- <plugin name="ipban" config="@conf/plugin_ipban.ini" /> -->
<!-- <plugin name="location" config="@conf/plugin_location.ini" /> -->
<!-- <plugin name="makeroom" config="@conf/plugin_makeroom.ini" /> -->
<!-- <plugin name="translator" config="@conf/plugin_translator.ini" /> -->
<!-- <plugin name="xlrstats" config="@conf/plugin_xlrstats.ini" /> -->

Expand Down
56 changes: 56 additions & 0 deletions b3/conf/plugin_makeroom.ini
@@ -0,0 +1,56 @@
# Groups are (keyword / level : description)
# ==============================================
# superadmin / 100 : Super admin (server owner)
# senioradmin / 80 : Senior admins
# fulladmin / 60 : Full admins
# admin / 40 : Admins
# mod / 20 : Moderators
# reg / 2 : Regular players (VIP)
# user / 1 : Registered players (those who typed !register)
# guest / 0 : Unregistered players

[global_settings]
# level (inclusive) under which players to kick will be chosen from (default: reg)
non_member_level: reg

# delay in seconds between the time the info_message is shown and the kick happens.
# If you set this to 0, then no info_message will be shown and kick will happen instantly.
delay: 2

# delay in seconds to keep the freed slot free after the kick happened.
# If you set this to 0, then the first player to join is accepted (member or not).
# If set to a value higher than 0 (let's say 15), then for 15s any non-member connecting would be kicked to give a
# chance to a member to use the freed slot.
retain_free_duration: 15


[commands]
# Command to free a slot
makeroom-mkr: mod

# Command to enable/disable automation
makeroomauto-mrauto: fulladmin

[messages]
# You can use the following keywords in your messages : $clientname

# kick_message will be displayed to all players when a player is kicked to free a slot
kick_message: kicking $clientname to free a slot

# kick_reason will be displayed to the player to be kicked
kick_reason: to make room for a server member

# info_message will be displayed to all before a player get kicked
info_message: Making room for clan member, please come back again

[automation]
# enabled : yes/no
# If yes, then this plugin will make sure that min_free_slots are kept free
# and kick all connecting player until min_free_slots are free.
enabled: no

# The total number of slots on the server
total_slots: 32

# The number of slots to keep free
min_free_slots: 1
68 changes: 68 additions & 0 deletions b3/plugins/makeroom/README.md
@@ -0,0 +1,68 @@
Makeroom plugin for BigBrotherBot [![BigBrotherBot](http://i.imgur.com/7sljo4G.png)][B3]
=================================

Description
-----------

This plugin provides a command that will kick the player who last joined server from the lowest group.
This command is useful on popular servers which need to make room for member players.


Commands
--------

`!makeroom` : kick the last non-member player who entered the game
`!makeroomauto <on|off>` : will makeroom every time the server gets full


Installation
------------

* copy `makeroom.py` into `b3/extplugins`
* copy `plugin_makeroom.ini` in the same directory as your `b3.xml` file
* update your main b3 config file with :

```xml
<plugin name="makeroom" config="@conf/plugin_makeroom.ini"/>
```

Changelog
---------

### 1.7 - 2014-08-17
- add new config file option `retain_free_duration` to retain a freed slot for a while. Any non-member joining the
server will be kicked unless a member joined or the duration expires

### 1.6 - 2014-08-17
- config file option `non_member_level` accepts B3 group keywords additionally to B3 group levels

### 1.5 - 2011-11-20
- fix config option "non_member_level" not being read
- only one kick action can take place at once. If there is a delay set, then wait for the first request
to complete before accepting a new one

### 1.4.1 - 2011-07-11
- just more debug messages

### 1.4.0 - 2011-07-11
- fix automated mode where any last connected player would be the one kicked
whatever his level

### 1.3.1 - 2011-07-09
- fix issue in automation mode where the last player to connect
would not be kicked if his level is equals to the non_member_level

### 1.3 - 2011-06-20
- add an automation feature to keep some free slot

### 1.2 - 2011-06-08
- add info message and delay between info message and actual kick

### 1.1.1 - 2011-05-29
- fix saving the kick into database

### 1.1 - 2011-05-12
- messages can be customized in the plugin config file


[B3]: http://www.bigbrotherbot.net/ "BigBrotherBot (B3)"

0 comments on commit 81c852c

Please sign in to comment.