Adds optional population caps for those that want them. These be dark measures, so tread carefully ye who dare enter this place.

There are three "levels" of popcaps, and you can use them in any assortment you like:

The "soft" cap produces a message on join, and takes no action.

The "hard" cap disallows joining whilst too many other people are alive and playing in game, but allows observing.

The "extreme" cap prevents people from joining the server at all while the cap is exceeded. It won't kick out people who failed to qualify during roundstart, but if they leave they won't be able to get back in.

In each case a customizable message config option has been given. Admins are also immune to most population caps (they still are hit by the ones in job shuffling, but can late join as normal afterwards)
This commit is contained in:
Incoming
2015-02-04 01:58:02 -05:00
parent 7dd1d73975
commit 7903aba6d3
7 changed files with 87 additions and 5 deletions
+5
View File
@@ -47,6 +47,11 @@ world/IsBanned(key,address,computer_id)
message_admins("<span class='adminnotice'>Failed Login: [key] - Guests not allowed</span>")
return list("reason"="guest", "desc"="\nReason: Guests not allowed. Please sign in with a byond account.")
//Population Cap Checking
if(config.extreme_popcap && living_player_count() >= config.extreme_popcap && !(ckey(key) in admin_datums))
log_access("Failed Login: [key] - Population cap reached")
return list("reason"="popcap", "desc"= "\nReason: [config.extreme_popcap_message]")
if(config.ban_legacy_system)
//Ban Checking