mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-19 19:13:30 +01:00
Merge remote-tracking branch 'remotes/git-svn' r4881 into bs12_with_tgport
Conflicts: baystation12.dme code/game/gamemodes/events.dm code/game/machinery/doors/door.dm code/game/machinery/gateway.dm code/game/objects/items/devices/flashlight.dm code/game/sound.dm code/global.dm code/modules/admin/admin_verbs.dm code/modules/awaymissions/zlevel.dm code/modules/food/recipes_microwave.dm code/modules/mining/mine_items.dm code/modules/mob/living/carbon/carbon.dm code/modules/mob/living/carbon/human/update_icons.dm code/modules/paperwork/clipboard.dm code/modules/paperwork/filingcabinet.dm code/modules/paperwork/folders.dm code/modules/paperwork/handlabeler.dm code/modules/paperwork/paper.dm code/modules/paperwork/paperbin.dm code/modules/paperwork/pen.dm code/modules/paperwork/photocopier.dm code/modules/paperwork/stamps.dm code/world.dm html/changelog.html maps/RandomZLevels/fileList.txt Signed-off-by: Cael_Aislinn <cael_aislinn@yahoo.com.au>
This commit is contained in:
@@ -40,6 +40,7 @@
|
||||
if(!need_update) return
|
||||
|
||||
clear_admin_verbs()
|
||||
handle_permission_verbs()
|
||||
|
||||
switch(rank)
|
||||
if("Game Master")
|
||||
@@ -68,8 +69,6 @@
|
||||
verbs += /client/proc/cmd_admin_delete
|
||||
verbs += /client/proc/cmd_admin_add_freeform_ai_law
|
||||
verbs += /client/proc/cmd_admin_rejuvenate
|
||||
//verbs += /client/proc/cmd_admin_drop_everything --Merged with view variables
|
||||
//verbs += /client/proc/cmd_modify_object_variables --Merged with view variables
|
||||
|
||||
if ("Admin Candidate")
|
||||
holder.level = 2
|
||||
@@ -81,7 +80,6 @@
|
||||
verbs += /client/proc/Jump
|
||||
verbs += /client/proc/jumptokey
|
||||
verbs += /client/proc/jumptomob
|
||||
//verbs += /client/proc/cmd_admin_attack_log --Merged with view variables
|
||||
|
||||
if ("Temporary Admin")
|
||||
holder.level = 1
|
||||
@@ -112,27 +110,15 @@
|
||||
|
||||
//Admin Observer
|
||||
if (holder.level == -1)
|
||||
verbs += /client/proc/investigate_show
|
||||
verbs += /client/proc/cmd_admin_say
|
||||
verbs += /client/proc/cmd_mod_say
|
||||
verbs += /client/proc/cmd_admin_gib_self
|
||||
verbs += /client/proc/deadmin_self
|
||||
verbs += /client/proc/cmd_mod_say verbs += /client/proc/cmd_admin_gib_self verbs += /client/proc/deadmin_self
|
||||
return
|
||||
|
||||
//Moderator
|
||||
if (holder.level >= 0)
|
||||
verbs += /client/proc/cmd_admin_pm_context
|
||||
verbs += /client/proc/cmd_admin_pm_panel
|
||||
verbs += /client/proc/cmd_mod_say
|
||||
verbs += /client/proc/hide_verbs
|
||||
verbs += /client/proc/deadmin_self
|
||||
verbs += /client/proc/Report
|
||||
verbs += /client/proc/display_admin_reports
|
||||
verbs += /datum/admins/proc/show_skills
|
||||
verbs += /client/proc/admin_ghost
|
||||
verbs += /datum/admins/proc/show_player_info
|
||||
verbs += /datum/admins/proc/PlayerNotes
|
||||
else return
|
||||
verbs += /client/proc/cmd_admin_pm_context verbs += /client/proc/cmd_admin_pm_panel
|
||||
verbs += /client/proc/hide_verbs verbs += /client/proc/deadmin_self
|
||||
verbs += /client/proc/Report verbs += /client/proc/display_admin_reports verbs += /datum/admins/proc/show_skills verbs += /client/proc/admin_ghost verbs += /datum/admins/proc/show_player_info verbs += /datum/admins/proc/PlayerNotes else return
|
||||
|
||||
//Extra moderator commands
|
||||
if(holder.level == 0)
|
||||
@@ -152,17 +138,28 @@
|
||||
verbs += /client/proc/toggle_hear_deadcast
|
||||
verbs += /client/proc/toggle_hear_radio
|
||||
verbs += /client/proc/deadmin_self
|
||||
verbs += /client/proc/player_panel_new
|
||||
verbs += /client/proc/cmd_admin_change_custom_event
|
||||
verbs += /datum/admins/proc/announce
|
||||
verbs += /datum/admins/proc/startnow
|
||||
verbs += /datum/admins/proc/toggleAI //Toggle the AI
|
||||
verbs += /datum/admins/proc/toggleenter //Toggle enterting
|
||||
verbs += /datum/admins/proc/toggleguests //Toggle guests entering
|
||||
verbs += /datum/admins/proc/toggleooc //toggle ooc
|
||||
verbs += /datum/admins/proc/toggleoocdead //toggle ooc for dead/unc
|
||||
verbs += /datum/admins/proc/show_player_panel
|
||||
verbs += /client/proc/deadchat //toggles deadchat
|
||||
verbs += /client/proc/cmd_admin_subtle_message
|
||||
verbs += /client/proc/dsay
|
||||
verbs += /client/proc/admin_ghost
|
||||
verbs += /client/proc/game_panel
|
||||
verbs += /client/proc/unjobban_panel
|
||||
verbs += /client/proc/jobbans
|
||||
verbs += /client/proc/player_panel
|
||||
verbs += /client/proc/player_panel_new
|
||||
verbs += /client/proc/unban_panel
|
||||
verbs += /datum/admins/proc/toggleooc
|
||||
verbs += /datum/admins/proc/toggleoocdead
|
||||
|
||||
//verbs += /client/proc/cmd_admin_attack_log --Merged with view variables
|
||||
else return
|
||||
verbs += /client/proc/jobbans
|
||||
verbs += /client/proc/unjobban_panel
|
||||
verbs += /client/proc/check_ai_laws
|
||||
verbs += /client/proc/investigate_show
|
||||
verbs += /client/proc/cmd_admin_gib_self
|
||||
verbs += /client/proc/player_panel_new verbs += /client/proc/cmd_admin_change_custom_event verbs += /client/proc/game_panel verbs += /client/proc/unjobban_panel verbs += /client/proc/jobbans verbs += /client/proc/unban_panel verbs += /datum/admins/proc/toggleooc verbs += /datum/admins/proc/toggleoocdead else return
|
||||
|
||||
//Admin Candidate
|
||||
if (holder.level >= 2)
|
||||
@@ -185,7 +182,6 @@
|
||||
verbs += /datum/admins/proc/toggleaban //abandon mob
|
||||
verbs += /datum/admins/proc/show_traitor_panel
|
||||
verbs += /client/proc/getserverlog //fetch an old serverlog to look at
|
||||
//verbs += /client/proc/cmd_admin_remove_plasma --This proc is outdated, does not do anything
|
||||
verbs += /client/proc/admin_call_shuttle
|
||||
verbs += /client/proc/admin_cancel_shuttle
|
||||
verbs += /client/proc/cmd_admin_dress
|
||||
@@ -229,11 +225,8 @@
|
||||
verbs += /client/proc/jumptocoord
|
||||
verbs += /client/proc/deadmin_self
|
||||
verbs += /client/proc/giveruntimelog //used by coders to retrieve runtime logs
|
||||
//verbs += /client/proc/cmd_admin_godmode --Merged with view variables
|
||||
//verbs += /client/proc/cmd_admin_gib --Merged with view variables
|
||||
//verbs += /proc/togglebuildmode --Merged with view variables
|
||||
//verbs += /client/proc/cmd_modify_object_variables --Merged with view variables
|
||||
verbs += /client/proc/togglebuildmodeself
|
||||
verbs += /client/proc/debug_controller
|
||||
else return
|
||||
|
||||
//Game Admin
|
||||
@@ -246,18 +239,13 @@
|
||||
verbs += /client/proc/cmd_admin_world_narrate
|
||||
verbs += /client/proc/cmd_debug_del_all
|
||||
verbs += /client/proc/cmd_debug_tog_aliens
|
||||
// verbs += /client/proc/mapload
|
||||
verbs += /client/proc/check_words
|
||||
verbs += /client/proc/drop_bomb
|
||||
verbs += /client/proc/kill_airgroup
|
||||
//verbs += /client/proc/cmd_admin_drop_everything --Merged with view variables
|
||||
verbs += /client/proc/make_sound
|
||||
verbs += /client/proc/play_local_sound
|
||||
verbs += /client/proc/send_space_ninja
|
||||
verbs += /client/proc/restart_controller //Can call via aproccall --I_hate_easy_things.jpg, Mport --Agouri
|
||||
verbs += /client/proc/debug_controller
|
||||
// verbs += /client/proc/Blobize //I need to remember to move/remove this later
|
||||
// verbs += /client/proc/Blobcount //I need to remember to move/remove this later
|
||||
verbs += /client/proc/toggle_clickproc //TODO ERRORAGE (Temporary proc while the new clickproc is being tested)
|
||||
verbs += /client/proc/toggle_gravity_on
|
||||
verbs += /client/proc/toggle_gravity_off
|
||||
@@ -266,14 +254,7 @@
|
||||
verbs += /client/proc/Set_Holiday //Force-set a Holiday
|
||||
verbs += /client/proc/admin_memo
|
||||
verbs += /client/proc/ToRban //ToRban frontend to access its features.
|
||||
verbs += /client/proc/game_panel
|
||||
//verbs += /client/proc/cmd_mass_modify_object_variables --Merged with view variables
|
||||
//verbs += /client/proc/cmd_admin_explosion --Merged with view variables
|
||||
//verbs += /client/proc/cmd_admin_emp --Merged with view variables
|
||||
//verbs += /client/proc/give_spell --Merged with view variables
|
||||
//verbs += /client/proc/cmd_admin_ninjafy --Merged with view variables
|
||||
//verbs += /client/proc/cmd_switch_radio --removed as tcommsat is staying
|
||||
else return
|
||||
verbs += /client/proc/game_panel else return
|
||||
|
||||
//Game Master
|
||||
if (holder.level >= 6)
|
||||
@@ -440,26 +421,6 @@
|
||||
/client/proc/playernotes,
|
||||
/client/proc/cmd_admin_change_custom_event
|
||||
)
|
||||
//verbs -= /client/proc/mapload
|
||||
//verbs -= /client/proc/cmd_admin_drop_everything --merged with view variables
|
||||
//verbs -= /client/proc/give_spell --Merged with view variables
|
||||
//verbs -= /client/proc/cmd_admin_ninjafy --Merged with view variables
|
||||
//verbs -= /client/proc/cmd_modify_object_variables --Merged with view variables
|
||||
//verbs -= /client/proc/cmd_admin_explosion --Merged with view variables
|
||||
//verbs -= /client/proc/cmd_admin_emp --Merged with view variables
|
||||
//verbs -= /client/proc/cmd_admin_godmode --Merged with view variables
|
||||
//verbs -= /client/proc/cmd_admin_gib --Merged with view variables
|
||||
//verbs -= /client/proc/cmd_mass_modify_object_variables --Merged with view variables
|
||||
//verbs -= /client/proc/cmd_admin_attack_log --Merged with view variables
|
||||
//verbs -= /proc/togglebuildmode --Merged with view variables
|
||||
//verbs -= /client/proc/cmd_admin_prison --Merged with player panel
|
||||
//verbs -= /datum/admins/proc/unprison --Merged with player panel
|
||||
//verbs -= /client/proc/cmd_switch_radio --removed because tcommsat is staying
|
||||
// verbs -= /client/proc/Blobize
|
||||
// verbs -= /client/proc/Blobcount
|
||||
//verbs -= /client/proc/warn
|
||||
//verbs -= /client/proc/cmd_admin_mute --was never used (according to stats trackind) - use show player panel --erro
|
||||
//verbs -= /client/proc/cmd_admin_remove_plasma --This proc is outdated, does not do anything
|
||||
return
|
||||
|
||||
/client/proc/admin_ghost()
|
||||
|
||||
@@ -19,6 +19,7 @@ var/list/admin_datums = list()
|
||||
var/fakekey = null
|
||||
var/ooccolor = "#b82e00"
|
||||
var/sound_adminhelp = 0 //If set to 1 this will play a sound when adminhelps are received.
|
||||
var/sql_permissions = 0 //Permissions for different admin command groups. Must not be editable ingame.
|
||||
|
||||
var/datum/marked_datum
|
||||
|
||||
@@ -84,6 +85,49 @@ var/list/admin_datums = list()
|
||||
usr << "\red Unfortunatly there were no candidates available"
|
||||
return
|
||||
|
||||
if(href_list["editadminpermissions"])
|
||||
if(!usr.client)
|
||||
return
|
||||
|
||||
var/adm_ckey = href_list["editadminckey"]
|
||||
if(!adm_ckey)
|
||||
usr << "\red no valid ckey"
|
||||
return
|
||||
|
||||
if(!usr.client.holder || !(usr.client.holder.sql_permissions & PERMISSIONS))
|
||||
usr << "\red You do not have permission to do this!"
|
||||
message_admins("[key_name_admin(usr)] attempted to edit the admin permissions of [adm_ckey] without authentication!")
|
||||
log_admin("[key_name(usr)] attempted to edit the admin permissions of [adm_ckey] without authentication!")
|
||||
return
|
||||
|
||||
switch(href_list["editadminpermissions"])
|
||||
if("permissions")
|
||||
usr << "Currently unavailable since nothing runs off of permissions"
|
||||
if("rank")
|
||||
var/new_rank = input("Please, select a rank", "New rank for player", null, null) as null|anything in list("Game Master","Game Admin", "Trial Admin", "Admin Observer")
|
||||
if(!new_rank)
|
||||
return
|
||||
message_admins("[key_name_admin(usr)] edited the admin rank of [adm_ckey] to [new_rank]")
|
||||
log_admin("[key_name(usr)] edited the admin rank of [adm_ckey] to [new_rank]")
|
||||
log_admin_rank_modification(adm_ckey, new_rank)
|
||||
if("remove")
|
||||
if(alert("Are you sure you want to remove [adm_ckey]?","Message","Yes","Cancel") == "Yes")
|
||||
message_admins("[key_name_admin(usr)] removed [adm_ckey] from the admins list")
|
||||
log_admin("[key_name(usr)] removed [adm_ckey] from the admins list")
|
||||
log_admin_rank_modification(adm_ckey, "Removed")
|
||||
if("add")
|
||||
var/new_ckey = input(usr,"New admin's ckey","Admin ckey", null) as text|null
|
||||
if(!new_ckey)
|
||||
return
|
||||
var/new_rank = input("Please, select a rank", "New rank for player", null, null) as null|anything in list("Game Master","Game Admin", "Trial Admin", "Admin Observer")
|
||||
if(!new_rank)
|
||||
return
|
||||
message_admins("[key_name_admin(usr)] added [new_ckey] as a new admin to the rank [new_rank]")
|
||||
log_admin("[key_name(usr)] added [new_ckey] as a new admin to the rank [new_rank]")
|
||||
log_admin_rank_modification(new_ckey, new_rank)
|
||||
|
||||
|
||||
|
||||
if(href_list["call_shuttle"])
|
||||
if (src.rank in list("Trial Admin", "Badmin", "Game Admin", "Game Master"))
|
||||
if( ticker.mode.name == "blob" )
|
||||
@@ -2651,4 +2695,4 @@ var/list/admin_datums = list()
|
||||
switch(href_list["notes"])
|
||||
if("show")
|
||||
show_player_info(ckey)
|
||||
return
|
||||
return
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
|
||||
|
||||
|
||||
//Before this proc is called, the holder variable must already be set, with the proper rank, level and permissions set.
|
||||
//This proc also DOES NOT CLEAR EXISTING ADMIN VERBS
|
||||
|
||||
/client/proc/handle_permission_verbs()
|
||||
if(!holder || !holder.rank || !holder.sql_permissions)
|
||||
return
|
||||
|
||||
if(holder.sql_permissions & PERMISSIONS)
|
||||
verbs += /client/proc/edit_admin_permissions
|
||||
@@ -0,0 +1,127 @@
|
||||
/client/proc/edit_admin_permissions()
|
||||
set category = "Admin"
|
||||
set name = "Permissions Panel"
|
||||
set desc = "Edit admin permissions"
|
||||
|
||||
if(!holder)
|
||||
return
|
||||
holder.edit_admin_permissions()
|
||||
|
||||
/datum/admins/proc/edit_admin_permissions()
|
||||
if(!usr.client)
|
||||
return
|
||||
|
||||
if(!usr.client.holder || !(usr.client.holder.sql_permissions & PERMISSIONS))
|
||||
usr << "\red You do not have permission to do this!"
|
||||
return
|
||||
|
||||
var/user = sqlfdbklogin
|
||||
var/pass = sqlfdbkpass
|
||||
var/db = sqlfdbkdb
|
||||
var/address = sqladdress
|
||||
var/port = sqlport
|
||||
|
||||
var/DBConnection/dbcon = new()
|
||||
dbcon.Connect("dbi:mysql:[db]:[address]:[port]","[user]","[pass]")
|
||||
if(!dbcon.IsConnected())
|
||||
usr << "\red Failed to establish database connection"
|
||||
return
|
||||
|
||||
var/DBQuery/select_query = dbcon.NewQuery("SELECT ckey, rank, level, flags FROM erro_admin ORDER BY rank, ckey")
|
||||
select_query.Execute()
|
||||
|
||||
var/output = "<div align='center'><h1>Current admins</h1>"
|
||||
|
||||
output += "<a href=\"byond://?src=\ref[src];editadminpermissions=add;editadminckey=none\">Add new admin</a>"
|
||||
|
||||
output += "<table width='90%' bgcolor='#e3e3e3' cellpadding='5' cellspacing='0'>"
|
||||
output += "<tr>"
|
||||
output += "<th width='125'><b>CKEY</b></th>"
|
||||
output += "<th width='125'><b>RANK</b></th>"
|
||||
output += "<th width='25'><b>LEVEL</b></th>"
|
||||
output += "<th width='75'><b>PERMISSIONS</b></th>"
|
||||
output += "<th width='150'><b>OPTIONS</b></th>"
|
||||
output += "</tr>"
|
||||
|
||||
var/color1 = "#f4f4f4"
|
||||
var/color2 = "#e7e7e7"
|
||||
var/i = 1 //Used to determine the color of each row
|
||||
|
||||
while(select_query.NextRow())
|
||||
i = !i
|
||||
var/adm_ckey = select_query.item[1]
|
||||
var/adm_rank = select_query.item[2]
|
||||
var/adm_level = select_query.item[3]
|
||||
var/adm_flags = text2num(select_query.item[4])
|
||||
output += "<tr bgcolor='[(i % 2) ? color1 : color2]'>"
|
||||
output += "<td align='center'><b>[adm_ckey]</b></td>"
|
||||
output += "<td align='center'><b>[adm_rank]</b></td>"
|
||||
output += "<td align='center'>[adm_level]</td>"
|
||||
var/list/permissionlist = bitfield2list(adm_flags, permissionwords_sql)
|
||||
output += "<td align='center'>"
|
||||
for(var/word in permissionlist)
|
||||
output += "[word]<BR>"
|
||||
output += "</td>"
|
||||
output += "<td align='center'><font size='2'>"
|
||||
|
||||
//Options
|
||||
output += "<a href=\"byond://?src=\ref[src];editadminpermissions=permissions;editadminckey=[adm_ckey]\">PERMISSIONS</a><br>"
|
||||
output += "<a href=\"byond://?src=\ref[src];editadminpermissions=rank;editadminckey=[adm_ckey]\">RANK</a><br>"
|
||||
output += "<a href=\"byond://?src=\ref[src];editadminpermissions=remove;editadminckey=[adm_ckey]\">REMOVE</a>"
|
||||
|
||||
output += "</font></td>"
|
||||
output += "</tr>"
|
||||
|
||||
output += "</table></div>"
|
||||
|
||||
usr << browse(output,"window=editadminpermissions;size=600x500")
|
||||
|
||||
|
||||
/datum/admins/proc/log_admin_rank_modification(var/adm_ckey, var/new_rank)
|
||||
if(!usr.client)
|
||||
return
|
||||
|
||||
if(!usr.client.holder || !(usr.client.holder.sql_permissions & PERMISSIONS))
|
||||
usr << "\red You do not have permission to do this!"
|
||||
return
|
||||
|
||||
var/user = sqlfdbklogin
|
||||
var/pass = sqlfdbkpass
|
||||
var/db = sqlfdbkdb
|
||||
var/address = sqladdress
|
||||
var/port = sqlport
|
||||
|
||||
var/DBConnection/dbcon = new()
|
||||
dbcon.Connect("dbi:mysql:[db]:[address]:[port]","[user]","[pass]")
|
||||
if(!dbcon.IsConnected())
|
||||
usr << "\red Failed to establish database connection"
|
||||
return
|
||||
|
||||
if(!adm_ckey || !new_rank)
|
||||
return
|
||||
|
||||
if(!istext(adm_ckey) || !istext(new_rank))
|
||||
return
|
||||
|
||||
var/DBQuery/select_query = dbcon.NewQuery("SELECT id FROM erro_admin WHERE ckey = '[adm_ckey]'")
|
||||
select_query.Execute()
|
||||
|
||||
var/new_admin = 1
|
||||
var/admin_id
|
||||
while(select_query.NextRow())
|
||||
new_admin = 0
|
||||
admin_id = text2num(select_query.item[1])
|
||||
|
||||
if(new_admin)
|
||||
var/DBQuery/insert_query = dbcon.NewQuery("INSERT INTO `erro_admin` (`id`, `ckey`, `rank`, `level`, `flags`) VALUES (null, '[adm_ckey]', '[new_rank]', -1, 0)")
|
||||
insert_query.Execute()
|
||||
var/DBQuery/log_query = dbcon.NewQuery("INSERT INTO `test`.`erro_admin_log` (`id` ,`datetime` ,`adminckey` ,`adminip` ,`log` ) VALUES (NULL , NOW( ) , '[usr.ckey]', '[usr.client.address]', 'Added new admin [adm_ckey] to rank [new_rank]');")
|
||||
log_query.Execute()
|
||||
usr << "\blue New admin added."
|
||||
else
|
||||
if(!isnull(admin_id) && isnum(admin_id))
|
||||
var/DBQuery/insert_query = dbcon.NewQuery("UPDATE `erro_admin` SET rank = '[new_rank]' WHERE id = [admin_id]")
|
||||
insert_query.Execute()
|
||||
var/DBQuery/log_query = dbcon.NewQuery("INSERT INTO `test`.`erro_admin_log` (`id` ,`datetime` ,`adminckey` ,`adminip` ,`log` ) VALUES (NULL , NOW( ) , '[usr.ckey]', '[usr.client.address]', 'Edited the rank of [adm_ckey] to [new_rank]');")
|
||||
log_query.Execute()
|
||||
usr << "\blue Admin rank changed."
|
||||
@@ -4,12 +4,14 @@ var/list/forbidden_varedit_object_types = list(
|
||||
/datum/feedback_variable //Prevents people messing with feedback gathering
|
||||
)
|
||||
|
||||
/*
|
||||
/client/proc/cmd_modify_object_variables(obj/O as obj|mob|turf|area in world)
|
||||
set category = "Debug"
|
||||
set name = "Edit Variables"
|
||||
set desc="(target) Edit a target item's variables"
|
||||
src.modify_variables(O)
|
||||
feedback_add_details("admin_verb","EDITV") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
*/
|
||||
|
||||
/client/proc/cmd_modify_ticker_variables()
|
||||
set category = "Debug"
|
||||
|
||||
Reference in New Issue
Block a user