Skip to content

Commit

Permalink
Merge pull request cmss13-devs#15 from 800maximum123/campaign-what-ever
Browse files Browse the repository at this point in the history
GMTools | Blacklists and Adminlock Bypass!
  • Loading branch information
VoiceInYourHead authored Aug 11, 2024
2 parents 149e75b + 63b1cb3 commit e64265e
Show file tree
Hide file tree
Showing 4 changed files with 95 additions and 2 deletions.
2 changes: 0 additions & 2 deletions code/modules/admin/admin_verbs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,6 @@ var/list/roundstart_mod_verbs = list(
add_verb(src, /client/proc/toggle_vehicle_blockers)
add_verb(src, /client/proc/toggle_ai_xeno_weeding)
add_verb(src, /client/proc/toggle_rappel_menu)
add_verb(src, /client/proc/gm_lighting) //RU-PVE
add_verb(src, /client/proc/toggle_fire_support_menu)
if(CLIENT_HAS_RIGHTS(src, R_SERVER))
add_verb(src, admin_verbs_server)
Expand Down Expand Up @@ -377,7 +376,6 @@ var/list/roundstart_mod_verbs = list(
/client/proc/toggle_vehicle_blockers,
/client/proc/toggle_ai_xeno_weeding,
/client/proc/toggle_rappel_menu,
/client/proc/gm_lighting, //RU-PVE
/client/proc/toggle_fire_support_menu,
admin_verbs_admin,
admin_verbs_ban,
Expand Down
25 changes: 25 additions & 0 deletions code/modules/mob/new_player/new_player.dm
Original file line number Diff line number Diff line change
Expand Up @@ -207,9 +207,22 @@

if("SelectedJob")

// [RU-PVE-EDIT]

if(usr.client.total_enter_lock)
to_chat(usr, SPAN_NOTICE("You have BLACKLISTED from entering!"))
return 0

if(!enter_allowed)
if(!check_rights(, show_msg = FALSE) && !usr.client.enter_lock_bypass)
to_chat(usr, SPAN_NOTICE("There is an administrative lock on entering the game!"))
return 0
/*
if(!enter_allowed)
to_chat(usr, SPAN_WARNING("There is an administrative lock on entering the game! (The dropship likely crashed into the Almayer. This should take at most 20 minutes.)"))
return
*/
// [/RU-PVE-EDIT]

if(client.prefs.species != "Human")
if(!is_alien_whitelisted(src, client.prefs.species) && CONFIG_GET(flag/usealienwhitelist))
Expand All @@ -234,9 +247,21 @@
if(SSticker.current_state != GAME_STATE_PLAYING)
to_chat(usr, SPAN_WARNING("The round is either not ready, or has already finished!"))
return
// [RU-PVE-EDIT]
if(usr.client.total_enter_lock)
to_chat(usr, SPAN_WARNING("You have BLACKLISTED from entering!"))
return 0

if(!enter_allowed)
if(!check_rights(, show_msg = FALSE) && !usr.client.enter_lock_bypass)
to_chat(usr, SPAN_WARNING("There is an administrative lock on entering the game!"))
return 0
/*
if(!enter_allowed)
to_chat(usr, SPAN_WARNING("There is an administrative lock on entering the game! (The dropship likely crashed into the Almayer. This should take at most 20 minutes.)"))
return
*/
// [/RU-PVE-EDIT]
if(!RoleAuthority.assign_role(src, player_rank, 1))
to_chat(src, alert("[rank] is not available. Please try another."))
return
Expand Down
1 change: 1 addition & 0 deletions tools/build/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ export const DmTarget = new Juke.Target({
"code/**",
"html/**",
"icons/**",
"void-marines/**",
"interface/**",
`${DME_NAME}.dme`,
NamedVersionFile,
Expand Down
69 changes: 69 additions & 0 deletions void-marines/code/admin_tools.dm
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,72 @@
M.gender = FEMALE
M.update_hair()
M.update_body()

// ENTERING BYPASS and other shit. \\
/client
var/enter_lock_bypass = 0
var/total_enter_lock = 0

/client/proc/allow_to_join()
set name = "Entering Lock Bypass"
set category = "Game Master.Moderation"

if(!check_rights())
return
var/client/player = tgui_input_list(usr, "Выберите игрока, что сможет обойти запрет на вход.", "Allow Bypass Entering Lock", GLOB.clients)
if(!player.enter_lock_bypass)
player.enter_lock_bypass = 1
to_chat(player, FONT_SIZE_BIG(SPAN_NOTICE("Высшие силы даровали возможность тебе зайти!")))
if(player.prefs.toggles_sound & SOUND_ADMINHELP)
SEND_SOUND(player, sound('sound/effects/adminhelp_new.ogg'))
message_admins("[usr] Игроку [player.ckey] дали возможность зайти в игру.")
else
player.enter_lock_bypass = 0
to_chat(player, FONT_SIZE_BIG(SPAN_NOTICE("Высшие силы изъяли у тебя возможность зайти!")))
message_admins("[usr] У игрока [player.ckey] забрали возможность зайти в игру.")

/*
* Прок блокирующий вход игроку на раунд
*/
/client/proc/disallow_to_join()
set name = "Blacklist"
set category = "Game Master.Moderation"

if(!check_rights())
return
var/client/player = tgui_input_list(usr, "Выберите игрока, что будет исключен/включен.", "Blacklist", GLOB.clients)
if(!player.total_enter_lock)
player.total_enter_lock = 1
to_chat(player, FONT_SIZE_BIG(SPAN_NOTICE("Ты исключен из игры на раунд. Ты можешь только наблюдать за ходом игры, но не сможешь зайти.")))
if(player.prefs.toggles_sound & SOUND_ADMINHELP)
SEND_SOUND(player, sound('sound/effects/adminhelp_new.ogg'))
message_admins("[usr] исключил из игры [player.ckey].")
else
player.total_enter_lock = 0
to_chat(player, FONT_SIZE_BIG(SPAN_NOTICE("Тебя вернули в игру. Теперь ты можеь попытаться зайти.")))
if(player.prefs.toggles_sound & SOUND_ADMINHELP)
SEND_SOUND(player, sound('sound/effects/adminhelp_new.ogg'))
message_admins("[usr] вернул в игру [player.ckey]. Увы и ах!")

// var/client/player = target
// if(player == null)
// var/client/player = tgui_input_list(usr, "Выберите игрока, что будет исключен/включен.", "Blacklist", GLOB.clients)


// Some MODULAR code \\
/client/add_admin_verbs()
. = ..()
if(CLIENT_HAS_RIGHTS(src, R_BUILDMODE))
add_verb(src, /client/proc/disallow_to_join)
add_verb(src, /client/proc/allow_to_join)
add_verb(src, /client/proc/gm_lighting) //RU-PVE

/client/remove_admin_verbs()
. = ..()
remove_verb(src, list(
/client/proc/disallow_to_join,
/client/proc/allow_to_join,
/client/proc/gm_lighting,
))

0 comments on commit e64265e

Please sign in to comment.