mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-27 15:17:01 +01:00
- When clients in the lobby are kicked at round end, only afk clients actually get kicked.
- The admins now have the ability to kick all or just afk clients from the lobby - When admins use this action, a list of kicked clients is sent to admins and into the log. - Added a confirmation message to the admin command.
This commit is contained in:
@@ -842,10 +842,17 @@ proc/move_ferry()
|
||||
else
|
||||
ferry_location = 1
|
||||
|
||||
|
||||
proc/kick_clients_in_lobby(var/message)
|
||||
//Kicks all the clients currently in the lobby. The second parameter (kick_only_afk) determins if an is_afk() check is ran, or if all clients are kicked
|
||||
//defaults to kicking everyone (afk + non afk clients in the lobby)
|
||||
//returns a list of ckeys of the kicked clients
|
||||
proc/kick_clients_in_lobby(var/message, var/kick_only_afk = 0)
|
||||
var/list/kicked_client_names = list()
|
||||
for(var/client/C in clients)
|
||||
if(istype(C.mob, /mob/new_player))
|
||||
if(kick_only_afk && !C.is_afk()) //Ignore clients who are not afk
|
||||
continue
|
||||
if(message)
|
||||
C << message
|
||||
del(C)
|
||||
kicked_client_names.Add("[C.ckey]")
|
||||
del(C)
|
||||
return kicked_client_names
|
||||
@@ -194,7 +194,7 @@
|
||||
<tr id='title_tr'>
|
||||
<td align='center'>
|
||||
<font size='5'><b>Player panel</b></font><br>
|
||||
Hover over a line to see more information - <a href='?_src_=holder;secretsadmin=check_antagonist'>Check antagonists</a> - <a href='?_src_=holder;secretsadmin=kick_all_from_lobby'>Kick everyone in lobby</a>
|
||||
Hover over a line to see more information - <a href='?_src_=holder;secretsadmin=check_antagonist'>Check antagonists</a> - Kick <a href='?_src_=holder;secretsadmin=kick_all_from_lobby;afkonly=0'>everyone</a>/<a href='?_src_=holder;secretsadmin=kick_all_from_lobby;afkonly=1'>AFKers</a> in lobby
|
||||
<p>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -2063,9 +2063,16 @@
|
||||
check_antagonists()
|
||||
if("kick_all_from_lobby")
|
||||
if(ticker && ticker.current_state == GAME_STATE_PLAYING)
|
||||
message_admins("[key_name_admin(usr)] has kicked all clients from the lobby.", 1)
|
||||
log_admin("[key_name(usr)] has kicked all clients from the lobby.")
|
||||
kick_clients_in_lobby("\red The admin [usr.ckey] issued a 'kick all clients from lobby' command.")
|
||||
var/afkonly = text2num(href_list["afkonly"])
|
||||
if(alert("Are you sure you want to kick all [afkonly ? "AFK" : ""] clients from the lobby??","Message","Yes","Cancel") != "Yes")
|
||||
usr << "Kick clients from lobby aborted"
|
||||
return
|
||||
var/list/listkicked = kick_clients_in_lobby("\red The admin [usr.ckey] issued a 'kick all clients from lobby' command.", afkonly)
|
||||
var/strkicked = ""
|
||||
for(var/name in listkicked)
|
||||
strkicked += "[name], "
|
||||
message_admins("[key_name_admin(usr)] has kicked [afkonly ? "all AFK" : "all"] clients from the lobby. [length(listkicked)] clients kicked: [strkicked ? strkicked : "--"]", 1)
|
||||
log_admin("[key_name_admin(usr)] has kicked [afkonly ? "all AFK" : "all"] clients from the lobby. [length(listkicked)] clients kicked: [strkicked ? strkicked : "--"]")
|
||||
else
|
||||
usr << "You may only use this when the game is running"
|
||||
if("showailaws")
|
||||
|
||||
Reference in New Issue
Block a user