various compile fixes, added bs12 moderator rank

Signed-off-by: Cael_Aislinn <cael_aislinn@yahoo.com.au>
This commit is contained in:
Cael_Aislinn
2012-09-06 15:09:36 +10:00
parent f3346e75db
commit d02a411e2f
11 changed files with 266 additions and 24 deletions

View File

@@ -369,6 +369,7 @@
#include "code\defines\turf.dm"
#include "code\defines\world.dm"
#include "code\defines\area\Space Station 13 areas.dm"
#include "code\defines\obj\costume.dm"
#include "code\defines\obj\hydro.dm"
#include "code\defines\obj\machinery.dm"
#include "code\defines\obj\storage.dm"
@@ -502,6 +503,7 @@
#include "code\game\machinery\autolathe.dm"
#include "code\game\machinery\Beacon.dm"
#include "code\game\machinery\biogenerator.dm"
#include "code\game\machinery\camera_circuit.dm"
#include "code\game\machinery\cell_charger.dm"
#include "code\game\machinery\cloning.dm"
#include "code\game\machinery\constructable_frame.dm"
@@ -511,6 +513,7 @@
#include "code\game\machinery\door_control.dm"
#include "code\game\machinery\doppler_array.dm"
#include "code\game\machinery\flasher.dm"
#include "code\game\machinery\floodlight.dm"
#include "code\game\machinery\Freezer.dm"
#include "code\game\machinery\gateway.dm"
#include "code\game\machinery\hologram.dm"
@@ -527,6 +530,7 @@
#include "code\game\machinery\portable_turret.dm"
#include "code\game\machinery\recharger.dm"
#include "code\game\machinery\rechargestation.dm"
#include "code\game\machinery\records_scanner.dm"
#include "code\game\machinery\requests_console.dm"
#include "code\game\machinery\robot_fabricator.dm"
#include "code\game\machinery\seed_extractor.dm"
@@ -539,6 +543,7 @@
#include "code\game\machinery\teleporter.dm"
#include "code\game\machinery\turrets.dm"
#include "code\game\machinery\vending.dm"
#include "code\game\machinery\walllockers.dm"
#include "code\game\machinery\washing_machine.dm"
#include "code\game\machinery\atmoalter\area_atmos_computer.dm"
#include "code\game\machinery\atmoalter\canister.dm"
@@ -824,6 +829,7 @@
#include "code\game\objects\structures\stool_bed_chair_nest\bed.dm"
#include "code\game\objects\structures\stool_bed_chair_nest\chairs.dm"
#include "code\game\objects\structures\stool_bed_chair_nest\stools.dm"
#include "code\game\player\admin_report.dm"
#include "code\game\turfs\turf.dm"
#include "code\game\turfs\simulated\beach.dm"
#include "code\game\turfs\unsimulated\beach.dm"

View File

@@ -377,6 +377,34 @@ Turf and target are seperate in case you want to teleport some distance from a t
select = input("AI signals detected:", "AI selection") in ais
return ais[select]
/proc/get_sorted_mobs()
var/list/old_list = getmobs()
var/list/AI_list = list()
var/list/Dead_list = list()
var/list/keyclient_list = list()
var/list/key_list = list()
var/list/logged_list = list()
for(var/named in old_list)
var/mob/M = old_list[named]
if(issilicon(M))
AI_list |= M
else if(isobserver(M) || M.stat == 2)
Dead_list |= M
else if(M.key && M.client)
keyclient_list |= M
else if(M.key)
key_list |= M
else
logged_list |= M
old_list.Remove(named)
var/list/new_list = list()
new_list += AI_list
new_list += keyclient_list
new_list += key_list
new_list += logged_list
new_list += Dead_list
return new_list
//Returns a list of all mobs with their name
/proc/getmobs()

View File

@@ -35,6 +35,23 @@
admins[m_key] = a_lev
diary << ("ADMIN: [m_key] = [a_lev]")
// look for moderators in a separate file
text = file2text("config/moderators.txt")
if (!text)
diary << "Failed to load config/moderators.txt\n"
else
var/list/lines = dd_text2list(text, "\n")
for(var/line in lines)
if (!line)
continue
if (copytext(line, 1, 2) == ";")
continue
var/m_key = copytext(line, 1, length(line)+1)
var/a_lev = "Moderator"
admins[m_key] = a_lev
/world/proc/load_testers()
var/text = file2text("config/testers.txt")
if (!text)

View File

@@ -11,12 +11,12 @@
//when adding a new camera network, you should only need to update these two procs
New()
possibleNets["Engineering"] = ACCESS_CE
possibleNets["SS13"] = ACCESS_HOS
possibleNets["Mining"] = ACCESS_MINING
possibleNets["Cargo"] = ACCESS_QM
possibleNets["Research"] = ACCESS_RD
possibleNets["Medbay"] = ACCESS_CMO
possibleNets["Engineering"] = access_ce
possibleNets["SS13"] = access_hos
possibleNets["Mining"] = access_mining
possibleNets["Cargo"] = access_qm
possibleNets["Research"] = access_rd
possibleNets["Medbay"] = access_cmo
proc/updateBuildPath()
build_path = ""
@@ -102,7 +102,7 @@
var/obj/item/device/pda/pda = I
I = pda.id
if (I && istype(I))
if(ACCESS_CAPTAIN in I.access)
if(access_captain in I.access)
authorised = 1
else if (possibleNets[network] in I.access)
authorised = 1

View File

@@ -1,3 +1,5 @@
//these are probably broken
/obj/machinery/floodlight
name = "Emergency Floodlight"
icon = 'floodlight.dmi'
@@ -16,17 +18,17 @@
if (!on)
if (luminosity)
updateicon()
sd_SetLuminosity(0)
//sd_SetLuminosity(0)
return
if(!luminosity && cell && cell.charge > 0)
sd_SetLuminosity(10)
//sd_SetLuminosity(10)
updateicon()
if(!cell && luminosity)
on = 0
updateicon()
sd_SetLuminosity(0)
//sd_SetLuminosity(0)
return
cell.charge -= use
@@ -34,7 +36,7 @@
if(cell.charge <= 0 && luminosity)
on = 0
updateicon()
sd_SetLuminosity(0)
//sd_SetLuminosity(0)
return
/obj/machinery/floodlight/attack_hand(mob/user as mob)

View File

@@ -44,9 +44,13 @@
for (var/client/C)
if(C.listen_ooc)
if (src.client.holder && (!src.client.stealth || C.holder))
if (src.client.holder && (!src.client.stealth || (C.holder && C.holder.level > 0)))
if (src.client.holder.rank == "Admin Observer")
C << "<span class='adminobserverooc'><span class='prefix'>OOC:</span> <EM>[src.key][src.client.stealth ? "/([src.client.fakekey])" : ""]:</EM> <span class='message'>[msg]</span></span>"
else if (src.client.holder.rank == "Retired Admin")
C << "<span class='ooc'><span class='prefix'>OOC:</span> <EM>[src.key][src.client.stealth ? "/([src.client.fakekey])" : ""]:</EM> <span class='message'>[msg]</span></span>"
else if (src.client.holder.rank == "Moderator")
C << "<span class='modooc'><span class='prefix'>OOC:</span> <EM>[src.key][src.client.stealth ? "/([src.client.fakekey])" : ""]:</EM> <span class='message'>[msg]</span></span>"
else if (src.client.holder.level >= 5)
C << "<font color=[src.client.ooccolor]><b><span class='prefix'>OOC:</span> <EM>[src.key][src.client.stealth ? "/([src.client.fakekey])" : ""]:</EM> <span class='message'>[msg]</span></b></font>"
else

View File

@@ -15,6 +15,13 @@ var/global/BSACooldown = 0
msg = dd_replacetext(msg, "%holder_ref%", "\ref[C.holder]")
C << msg
/obj/admins/proc/player_has_info(var/key as text)
var/savefile/info = new("data/player_saves/[copytext(key, 1, 2)]/[key]/info.sav")
var/list/infos
info >> infos
if(!infos || !infos.len) return 0
else return 1
/proc/msg_admin_attack(var/text) //Toggleable Attack Messages
var/rendered = "<span class=\"admin\"><span class=\"prefix\">ADMIN LOG:</span> <span class=\"message\">[text]</span></span>"
log_adminwarn(rendered)
@@ -2259,6 +2266,15 @@ var/global/BSACooldown = 0
return
//hahaha
if(href_list["vsc"])
if ((src.rank in list( "Moderator", "Temporary Admin", "Admin Candidate", "Trial Admin", "Badmin", "Game Admin", "Game Master" )))
if(href_list["vsc"] == "airflow")
vsc.ChangeSettingsDialog(usr,vsc.settings)
if(href_list["vsc"] == "plasma")
vsc.ChangeSettingsDialog(usr,vsc.plc.settings)
if(href_list["vsc"] == "default")
vsc.SetDefault(usr)
if(href_list["ac_view_wanted"]) //Admin newscaster Topic() stuff be here
src.admincaster_screen = 18 //The ac_ prefix before the hrefs stands for AdminCaster.

View File

@@ -106,10 +106,27 @@
verbs += /client/proc/cmd_admin_say
verbs += /client/proc/cmd_admin_gib_self
verbs += /client/proc/deadmin_self
else if (holder.level == -3) // Retired Admin
verbs += /client/proc/cmd_admin_say
verbs += /client/proc/cmd_mod_say
return
else return
//Moderator
if (holder.level >= 0)
if (holder.level == 0)
verbs -= /client/proc/cmd_admin_say
verbs -= /client/proc/investigate_show
verbs -= /client/proc/cmd_admin_gib_self
verbs += /client/proc/mod_panel
verbs += /client/proc/admin_play
verbs += /client/proc/admin_observe
verbs += /client/proc/cmd_mod_say
else return
//Temporary Admin
if (holder.level >= 1)
//--former tg mod commands, moved up a level
verbs += /obj/admins/proc/announce
verbs += /obj/admins/proc/startnow
verbs += /obj/admins/proc/toggleAI //Toggle the AI
@@ -128,8 +145,6 @@
verbs += /client/proc/cmd_admin_subtle_message
//verbs += /client/proc/warn - was never used
verbs += /client/proc/dsay
verbs += /client/proc/admin_play
verbs += /client/proc/admin_observe
verbs += /client/proc/game_panel
verbs += /client/proc/player_panel
verbs += /client/proc/player_panel_new
@@ -144,10 +159,8 @@
verbs += /client/proc/check_ai_laws
//verbs += /client/proc/cmd_admin_prison --Merged with player panel
//verbs += /obj/admins/proc/unprison --Merged with player panel
else return
//--end tg mod commands
//Temporary Admin
if (holder.level >= 1)
verbs += /obj/admins/proc/delay //game start delay
verbs += /obj/admins/proc/immreboot //immediate reboot
verbs += /obj/admins/proc/restart //restart
@@ -507,6 +520,14 @@
feedback_add_details("admin_verb","PPN") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
return
/client/proc/mod_panel()
set name = "Moderator Panel"
set category = "Admin"
if(holder)
holder.mod_panel()
// feedback_add_details("admin_verb","MP") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
return
/client/proc/check_antagonists()
set name = "Check Antagonists"
set category = "Admin"

View File

@@ -493,3 +493,112 @@
usr << browse(dat, "window=roundstatus;size=400x500")
else
alert("The game hasn't started yet!")
/obj/admins/proc/mod_panel()//The new one
if (!usr.client.holder)
return
var/dat = "<html><head><title>Player Menu</title></head>"
dat += "<body><table border=1 cellspacing=5><B><tr><th>Name/Real Name</th><th>IP/CID</th><th>Info</th><th>Options</th><th>Traitor?</th></tr></B>"
//add <th>IP:</th> to this if wanting to add back in IP checking <th>Type</th> <th>Assigned Job</th> <th>Traitor?</th>
//add <td>(IP: [M.lastKnownIP])</td> if you want to know their ip to the lists below
var/list/mobs = get_sorted_mobs()
var/i = 1
for(var/mob/M in mobs)
if(M.ckey)
var/color = "#e6e6e6"
i++
if(i%2 == 0)
color = "#f2f2f2"
//no idea what tg used to replace original_name, probably a proc floating around somewhere
//var/real = (M.real_name == M.original_name ? "<b>[M.name]/[M.real_name]</b>" : "<b>[M.original_name] (as [M.name]/[M.real_name])</b>")
var/real = "<b>[M.name]/[M.real_name]</b>"
var/turf/T = get_turf(M)
var/client_key = (M.key? M.key : "No key")
dat += "<tr align='center' bgcolor='[color]'><td>[real] <br>[M.client ? M.client : "No client ([client_key])"] at ([T.x], [T.y], [T.z])</td>" // Adds current name
/* if(isobserver(M))
dat += "<td>Ghost</td>"
else if(isalien(M))
dat += "<td>Alien</td>"
else if(islarva(M))
dat += "<td>Alien larva</td>"
else if(istajaran(M))
dat += "<td>Tajaran</td>"
else if(ishuman(M))
dat += "<td>[M.job]</td>"
else if(ismetroid(M))
dat += "<td>Metroid</td>"
else if(ismonkey(M))
dat += "<td>Monkey</td>"
else if(isAI(M))
dat += "<td>AI</td>"
else if(ispAI(M))
dat += "<td>pAI</td>"
else if(isrobot(M))
dat += "<td>Cyborg</td>"
else if(isanimal(M))
dat += "<td>Animal</td>"
else if(iscorgi(M))
dat += "<td>Corgi</td>"
else if(istype(M,/mob/new_player))
dat += "<td>New Player</td>"
else
dat += "<td>\red ERROR</td>\black"
if(M.mind && M.mind.assigned_role && istype(M, /mob/living/carbon/human)) // Adds a column to Player Panel that shows their current job.
var/mob/living/carbon/human/H = M
if (H.wear_id)
var/obj/item/weapon/card/id/id
if(istype(H.wear_id, /obj/item/device/pda))
var/obj/item/device/pda/PDA = H.wear_id
if(!isnull(PDA.id)) // The PDA may contain no ID
id = PDA.id // The ID is contained inside the PDA
else
id = H.wear_id // The ID was on the ID slot
if(!id) // Happens when there's no ID in the PDA located on the wear_id slot
dat += "<td>[M.mind.assigned_role] (No ID)</td>"
else if(isnull(id.assignment)) // Preventing runtime errors blocking the player panel
if(istype(id, /obj/item/weapon/card/id/syndicate))
dat += "<td><font color=purple>Antagonist</font></td>"
else
usr << "<font color=red>ERROR:</font> Inform the coders that an [id.name] was checked for its assignment variable, and it was null."
dat += "<td><font color=red>ERROR</font></td>"
else
if(M.mind.assigned_role == id.assignment) // Polymorph
dat += "<td>[M.mind.assigned_role]</td>"
else
dat += "<td>[M.mind.assigned_role] ([id.assignment])"
else
dat += "<td>[M.mind.assigned_role] (No ID)</td>"
else
dat += "<td>No Assigned Role</td>"
*/
dat += {"<td>IP: [M.client ? M.client.address : "Disconnected"]<br>
CID: [M.client ? M.client.computer_id : "Disconnected"]</td>
"}
dat += {"<td><A HREF='?src=\ref[src];player_info=[M.ckey]'>[player_has_info(M.ckey) ? "Info" : "N/A"] </A></td>
<td><A href='?src=\ref[usr];priv_msg=\ref[M]'><b>PM</b></A></td>
"}
switch(is_special_character(M))
if(0)
dat += {"<td align=center>Loyal</td>"}
if(1)
dat += {"<td align=center><font color=red>Antag</font></td>"}
if(2)
dat += {"<td align=center><font color=red><b>Mode-Antag</b></font></td>"}
dat += "</table></body></html>"
usr << browse(dat, "window=players;size=600x600")

View File

@@ -65,8 +65,12 @@
if(C.holder)
if(holder) //both are admins
C << "<font color='red'>Admin PM from-<b>[key_name(src, C, 1)]</b>: [msg]</font>"
src << "<font color='blue'>Admin PM to-<b>[key_name(C, src, 1)]</b>: [msg]</font>"
if(holder.rank == "Moderator") //If moderator
C << "<font color='maroon'>Mod PM from-<b>[key_name(src, C, 1)]</b>: [msg]</font>"
src << "<font color='blue'>Mod PM to-<b>[key_name(C, src, 1)]</b>: [msg]</font>"
else
C << "<font color='red'>Admin PM from-<b>[key_name(src, C, 1)]</b>: [msg]</font>"
src << "<font color='blue'>Admin PM to-<b>[key_name(C, src, 1)]</b>: [msg]</font>"
else //recipient is an admin but sender is not
C << "<font color='red'>Reply PM from-<b>[key_name(src, C, 1)]</b>: [msg]</font>"
@@ -78,10 +82,15 @@
else
if(holder) //sender is an admin but recipient is not. Do BIG RED TEXT
C << "<font color='red' size='4'><b>-- Administrator private message --</b></font>"
C << "<font color='red'>Admin PM from-<b>[key_name(src, C, 0)]</b>: [msg]</font>"
C << "<font color='red'><i>Click on the administrator's name to reply.</i></font>"
src << "<font color='blue'>Admin PM to-<b>[key_name(C, src, 1)]</b>: [msg]</font>"
if(holder.rank == "Moderator")
C << "<font color='maroon'>Mod PM from-<b>[key_name(src, C, 0)]</b>: [msg]</font>"
C << "<font color='maroon'><i>Click on the moderators's name to reply.</i></font>"
src << "<font color='blue'>Mod PM to-<b>[key_name(C, src, 1)]</b>: [msg]</font>"
else
C << "<font color='red' size='4'><b>-- Administrator private message --</b></font>"
C << "<font color='red'>Admin PM from-<b>[key_name(src, C, 0)]</b>: [msg]</font>"
C << "<font color='red'><i>Click on the administrator's name to reply.</i></font>"
src << "<font color='blue'>Admin PM to-<b>[key_name(C, src, 1)]</b>: [msg]</font>"
//always play non-admin recipients the adminhelp sound
C << 'sound/effects/adminhelp.ogg'

View File

@@ -25,6 +25,36 @@
for (var/client/C in admin_list)
if (src.holder.rank == "Admin Observer")
C << "<span class='adminobserver'><span class='prefix'>ADMIN:</span> <EM>[key_name(usr, C)]:</EM> <span class='message'>[msg]</span></span>"
else
else if(C.holder.level != 0)
C << "<span class='admin'><span class='prefix'>ADMIN:</span> <EM>[key_name(usr, C)]</EM> (<A HREF='?src=\ref[C.holder];adminplayerobservejump=\ref[mob]'>JMP</A>): <span class='message'>[msg]</span></span>"
/client/proc/cmd_mod_say(msg as text)
set category = "Special Verbs"
set name = "Msay"
set hidden = 1
if (!src.holder)
src << "Only administrators may use this command."
return
//todo: what? why does this not compile
/*if (src.muted || src.muted_complete)
src << "You are muted."
return*/
msg = copytext(sanitize(msg), 1, MAX_MESSAGE_LEN)
log_admin("MOD: [key_name(src)] : [msg]")
if (!msg)
return
//feedback_add_details("admin_verb","M") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
for (var/mob/M in world)
if (M.client && M.client.holder)
if (src.holder.rank == "Admin Observer")
M << "<span class='adminobserver'><span class='prefix'>MOD:</span> <EM>[key_name(usr, M)]:</EM> <span class='message'>[msg]</span></span>"
else if (src.holder.rank == "Moderator")
M << "<span class='mod'><span class='prefix'>MOD:</span> <EM>[key_name(usr, M)]</EM> (<A HREF='?src=\ref[M.client.holder];adminplayerobservejump=\ref[mob]'>JMP</A>): <span class='message'>[msg]</span></span>"
else
M << "<span class='adminmod'><span class='prefix'>MOD:</span> <EM>[key_name(usr, M)]</EM> (<A HREF='?src=\ref[M.client.holder];adminplayerobservejump=\ref[mob]'>JMP</A>): <span class='message'>[msg]</span></span>"