mirror of
https://github.com/CHOMPstation/CHOMPstation.git
synced 2026-07-20 03:23:36 +01:00
Merge branch 'master' of github.com:Baystation12/Baystation12 into dev
This commit is contained in:
@@ -21,7 +21,7 @@
|
||||
var/path = root
|
||||
|
||||
for(var/i=0, i<max_iterations, i++)
|
||||
var/list/choices = flist(path)
|
||||
var/list/choices = sortList(flist(path))
|
||||
if(path != root)
|
||||
choices.Insert(1,"/")
|
||||
|
||||
@@ -57,4 +57,4 @@
|
||||
return 1
|
||||
fileaccess_timer = world.time + FTPDELAY
|
||||
return 0
|
||||
#undef FTPDELAY
|
||||
#undef FTPDELAY
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
var/sql_enabled = 1 // for sql switching
|
||||
var/allow_admin_ooccolor = 0 // Allows admins with relevant permissions to have their own ooc colour
|
||||
var/allow_vote_restart = 0 // allow votes to restart
|
||||
var/ert_admin_call_only = 0
|
||||
var/allow_vote_mode = 0 // allow votes to change mode
|
||||
var/allow_admin_jump = 1 // allows admin jumping
|
||||
var/allow_admin_spawning = 1 // allows admin item spawning
|
||||
@@ -138,7 +139,7 @@
|
||||
var/main_irc = ""
|
||||
var/admin_irc = ""
|
||||
var/python_path = "" //Path to the python executable. Defaults to "python" on windows and "/usr/bin/env python2" on unix
|
||||
|
||||
var/use_lib_nudge = 0 //Use the C library nudge instead of the python nudge.
|
||||
|
||||
/datum/configuration/New()
|
||||
var/list/L = typesof(/datum/game_mode) - /datum/game_mode
|
||||
@@ -290,6 +291,9 @@
|
||||
if ("vote_autogamemode_timeleft")
|
||||
config.vote_autogamemode_timeleft = text2num(value)
|
||||
|
||||
if("ert_admin_only")
|
||||
config.ert_admin_call_only = 1
|
||||
|
||||
if ("allow_ai")
|
||||
config.allow_ai = 1
|
||||
|
||||
@@ -470,6 +474,9 @@
|
||||
else //probably windows, if not this should work anyway
|
||||
config.python_path = "python"
|
||||
|
||||
if("use_lib_nudge")
|
||||
config.use_lib_nudge = 1
|
||||
|
||||
if("allow_cult_ghostwriter")
|
||||
config.cult_ghostwriter = 1
|
||||
|
||||
|
||||
+18
-25
@@ -90,29 +90,6 @@
|
||||
/obj/var/list/req_one_access = null
|
||||
/obj/var/req_one_access_txt = "0"
|
||||
|
||||
/obj/New()
|
||||
..()
|
||||
//NOTE: If a room requires more than one access (IE: Morgue + medbay) set the req_acesss_txt to "5;6" if it requires 5 and 6
|
||||
if(src.req_access_txt)
|
||||
var/list/req_access_str = text2list(req_access_txt,";")
|
||||
if(!req_access)
|
||||
req_access = list()
|
||||
for(var/x in req_access_str)
|
||||
var/n = text2num(x)
|
||||
if(n)
|
||||
req_access += n
|
||||
|
||||
if(src.req_one_access_txt)
|
||||
var/list/req_one_access_str = text2list(req_one_access_txt,";")
|
||||
if(!req_one_access)
|
||||
req_one_access = list()
|
||||
for(var/x in req_one_access_str)
|
||||
var/n = text2num(x)
|
||||
if(n)
|
||||
req_one_access += n
|
||||
|
||||
|
||||
|
||||
//returns 1 if this mob has sufficient access to use this object
|
||||
/obj/proc/allowed(mob/M)
|
||||
//check if it doesn't require any access at all
|
||||
@@ -140,9 +117,25 @@
|
||||
return null
|
||||
|
||||
/obj/proc/check_access(obj/item/I)
|
||||
//These generations have been moved out of /obj/New() because they were slowing down the creation of objects that never even used the access system.
|
||||
if(!src.req_access)
|
||||
src.req_access = list()
|
||||
if(src.req_access_txt)
|
||||
var/list/req_access_str = text2list(req_access_txt,";")
|
||||
for(var/x in req_access_str)
|
||||
var/n = text2num(x)
|
||||
if(n)
|
||||
req_access += n
|
||||
|
||||
if(!src.req_one_access)
|
||||
src.req_one_access = list()
|
||||
if(src.req_one_access_txt)
|
||||
var/list/req_one_access_str = text2list(req_one_access_txt,";")
|
||||
for(var/x in req_one_access_str)
|
||||
var/n = text2num(x)
|
||||
if(n)
|
||||
req_one_access += n
|
||||
|
||||
if(!src.req_access && !src.req_one_access) //no requirements
|
||||
return 1
|
||||
if(!istype(src.req_access, /list)) //something's very wrong
|
||||
return 1
|
||||
|
||||
|
||||
@@ -211,7 +211,7 @@ obj/machinery/computer/cryopod/Topic(href, href_list)
|
||||
|
||||
//Update any existing objectives involving this mob.
|
||||
for(var/datum/objective/O in all_objectives)
|
||||
if(istype(O,/datum/objective/mutiny)) //We don't want revs to get objectives that aren't for heads of staff. Letting them win or lose based on cryo is silly so we remove the objective.
|
||||
if(istype(O,/datum/objective/mutiny) && O.target == occupant.mind) //We don't want revs to get objectives that aren't for heads of staff. Letting them win or lose based on cryo is silly so we remove the objective.
|
||||
del(O) //TODO: Update rev objectives on login by head (may happen already?) ~ Z
|
||||
else if(O.target && istype(O.target,/datum/mind))
|
||||
if(O.target == occupant.mind)
|
||||
|
||||
@@ -244,12 +244,19 @@ var/GLOBAL_RADIO_TYPE = 1 // radio type to use
|
||||
|
||||
//#### Grab the connection datum ####//
|
||||
var/datum/radio_frequency/connection = null
|
||||
if(channel && channels && channels.len > 0)
|
||||
if (channel == "department")
|
||||
//world << "DEBUG: channel=\"[channel]\" switching to \"[channels[1]]\""
|
||||
channel = channels[1]
|
||||
connection = secure_radio_connections[channel]
|
||||
else
|
||||
if(channel == "headset")
|
||||
channel = null
|
||||
if(channel) // If a channel is specified, look for it.
|
||||
if(channels && channels.len > 0)
|
||||
if (channel == "department")
|
||||
//world << "DEBUG: channel=\"[channel]\" switching to \"[channels[1]]\""
|
||||
channel = channels[1]
|
||||
connection = secure_radio_connections[channel]
|
||||
if (!channels[channel]) // if the channel is turned off, don't broadcast
|
||||
return
|
||||
else
|
||||
// If we were to send to a channel we don't have, drop it.
|
||||
else // If a channel isn't specified, send to common.
|
||||
connection = radio_connection
|
||||
channel = null
|
||||
if (!istype(connection))
|
||||
@@ -744,7 +751,9 @@ var/GLOBAL_RADIO_TYPE = 1 // radio type to use
|
||||
|
||||
if(keyslot.syndie)
|
||||
src.syndie = 1
|
||||
|
||||
var/mob/living/silicon/robot/Ro = usr
|
||||
if(Ro.module)
|
||||
src.config(Ro.module.channels)
|
||||
|
||||
for (var/ch_name in channels)
|
||||
if(!radio_controller)
|
||||
@@ -761,12 +770,16 @@ var/GLOBAL_RADIO_TYPE = 1 // radio type to use
|
||||
if(usr.stat || !on)
|
||||
return
|
||||
if (href_list["mode"])
|
||||
subspace_transmission = !subspace_transmission
|
||||
if(!subspace_transmission)//Simple as fuck, clears the channel list to prevent talking/listening over them if subspace transmission is disabled
|
||||
if(subspace_transmission != 1)
|
||||
subspace_transmission = 1
|
||||
usr << "Subspace Transmission is disabled"
|
||||
else
|
||||
subspace_transmission = 0
|
||||
usr << "Subspace Transmission is enabled"
|
||||
if(subspace_transmission == 1)//Simple as fuck, clears the channel list to prevent talking/listening over them if subspace transmission is disabled
|
||||
channels = list()
|
||||
else
|
||||
recalculateChannels()
|
||||
usr << "Subspace Transmission is [(subspace_transmission) ? "enabled" : "disabled"]"
|
||||
..()
|
||||
|
||||
/obj/item/device/radio/borg/interact(mob/user as mob)
|
||||
@@ -785,7 +798,7 @@ var/GLOBAL_RADIO_TYPE = 1 // radio type to use
|
||||
<A href='byond://?src=\ref[src];mode=1'>Toggle Broadcast Mode</A><BR>
|
||||
"}
|
||||
|
||||
if(subspace_transmission)//Don't even bother if subspace isn't turned on
|
||||
if(!subspace_transmission)//Don't even bother if subspace isn't turned on
|
||||
for (var/ch_name in channels)
|
||||
dat+=text_sec_channel(ch_name, channels[ch_name])
|
||||
dat+={"[text_wires()]</TT></body></html>"}
|
||||
@@ -806,4 +819,4 @@ var/GLOBAL_RADIO_TYPE = 1 // radio type to use
|
||||
return
|
||||
|
||||
/obj/item/device/radio/off
|
||||
listening = 0
|
||||
listening = 0
|
||||
|
||||
@@ -189,7 +189,7 @@
|
||||
|
||||
/obj/item/stack/attack_hand(mob/user as mob)
|
||||
if (user.get_inactive_hand() == src)
|
||||
var/obj/item/stack/F = new src.type( user, amount=1)
|
||||
var/obj/item/stack/F = new src.type( user, 1)
|
||||
F.copy_evidences(src)
|
||||
user.put_in_hands(F)
|
||||
src.add_fingerprint(user)
|
||||
|
||||
@@ -285,16 +285,18 @@ BLIND // can't see anything
|
||||
var/mob/M = usr
|
||||
if (istype(M, /mob/dead/)) return
|
||||
if (usr.stat) return
|
||||
if(src.has_sensor >= 2)
|
||||
if(has_sensor >= 2)
|
||||
usr << "The controls are locked."
|
||||
return 0
|
||||
if(src.has_sensor <= 0)
|
||||
if(has_sensor <= 0)
|
||||
usr << "This suit does not have any sensors."
|
||||
return 0
|
||||
src.sensor_mode += 1
|
||||
if(src.sensor_mode > 3)
|
||||
src.sensor_mode = 0
|
||||
switch(src.sensor_mode)
|
||||
|
||||
var/list/modes = list("Off", "Binary sensors", "Vitals tracker", "Tracking beacon")
|
||||
var/switchMode = input("Select a sensor mode:", "Suit Sensor Mode", modes[sensor_mode + 1]) in modes
|
||||
sensor_mode = modes.Find(switchMode) - 1
|
||||
|
||||
switch(sensor_mode)
|
||||
if(0)
|
||||
usr << "You disable your suit's remote sensing equipment."
|
||||
if(1)
|
||||
|
||||
@@ -1,6 +1,15 @@
|
||||
/proc/send2irc(var/channel, var/msg)
|
||||
if(config.use_irc_bot && config.irc_bot_host)
|
||||
ext_python("ircbot_message.py", "[config.comms_password] [config.irc_bot_host] [channel] [msg]")
|
||||
if(config.use_lib_nudge)
|
||||
var/nudge_lib
|
||||
if(world.system_type == MS_WINDOWS)
|
||||
nudge_lib = "lib\\nudge.dll"
|
||||
else
|
||||
nudge_lib = "lib/nudge.so"
|
||||
|
||||
call(nudge_lib, "nudge")("[config.comms_password]","[config.irc_bot_host]","[channel]","[msg]")
|
||||
else
|
||||
ext_python("ircbot_message.py", "[config.comms_password] [config.irc_bot_host] [channel] [msg]")
|
||||
return
|
||||
|
||||
/proc/send2mainirc(var/msg)
|
||||
|
||||
@@ -233,6 +233,7 @@ proc/move_mining_shuttle()
|
||||
digspeed = 30
|
||||
origin_tech = "materials=2;powerstorage=3;engineering=2"
|
||||
desc = "Yours is the drill that will pierce through the rock walls."
|
||||
drill_verb = "drilling"
|
||||
|
||||
jackhammer
|
||||
name = "sonic jackhammer"
|
||||
@@ -241,6 +242,7 @@ proc/move_mining_shuttle()
|
||||
digspeed = 20 //faster than drill, but cannot dig
|
||||
origin_tech = "materials=3;powerstorage=2;engineering=2"
|
||||
desc = "Cracks rocks with sonic blasts, perfect for killing cave lizards."
|
||||
drill_verb = "hammering"
|
||||
|
||||
gold
|
||||
name = "golden pickaxe"
|
||||
@@ -259,6 +261,7 @@ proc/move_mining_shuttle()
|
||||
digspeed = 20 //Can slice though normal walls, all girders, or be used in reinforced wall deconstruction/ light thermite on fire
|
||||
origin_tech = "materials=4;plasmatech=3;engineering=3"
|
||||
desc = "A rock cutter that uses bursts of hot plasma. You could use it to cut limbs off of xenos! Or, you know, mine stuff."
|
||||
drill_verb = "cutting"
|
||||
|
||||
diamond
|
||||
name = "diamond pickaxe"
|
||||
@@ -275,6 +278,7 @@ proc/move_mining_shuttle()
|
||||
digspeed = 5 //Digs through walls, girders, and can dig up sand
|
||||
origin_tech = "materials=6;powerstorage=4;engineering=5"
|
||||
desc = "Yours is the drill that will pierce the heavens!"
|
||||
drill_verb = "drilling"
|
||||
|
||||
borgdrill
|
||||
name = "cyborg mining drill"
|
||||
@@ -282,6 +286,7 @@ proc/move_mining_shuttle()
|
||||
item_state = "jackhammer"
|
||||
digspeed = 15
|
||||
desc = ""
|
||||
drill_verb = "drilling"
|
||||
|
||||
/*****************************Shovel********************************/
|
||||
|
||||
|
||||
@@ -36,6 +36,10 @@
|
||||
species = new /datum/species/diona(src)
|
||||
..()
|
||||
|
||||
/mob/living/carbon/human/machine/New()
|
||||
species = new /datum/species/machine(src)
|
||||
h_style = "blue IPC screen"
|
||||
|
||||
/mob/living/carbon/human/New()
|
||||
|
||||
if(!species)
|
||||
|
||||
@@ -216,14 +216,17 @@
|
||||
set desc = "Take a blood sample from a suitable donor."
|
||||
|
||||
var/list/choices = list()
|
||||
for(var/mob/living/carbon/C in view(1,src))
|
||||
if(C.real_name != real_name)
|
||||
choices += C
|
||||
for(var/mob/living/carbon/human/H in oview(1,src))
|
||||
choices += H
|
||||
|
||||
var/mob/living/M = input(src,"Who do you wish to take a sample from?") in null|choices
|
||||
var/mob/living/carbon/human/M = input(src,"Who do you wish to take a sample from?") in null|choices
|
||||
|
||||
if(!M || !src) return
|
||||
|
||||
if(M.species.flags & NO_BLOOD)
|
||||
src << "\red That donor has no blood to take."
|
||||
return
|
||||
|
||||
if(donors.Find(M.real_name))
|
||||
src << "\red That donor offers you nothing new."
|
||||
return
|
||||
|
||||
@@ -233,7 +233,7 @@
|
||||
heat_level_2 = 3000
|
||||
heat_level_3 = 4000
|
||||
|
||||
flags = IS_WHITELISTED | NO_BREATHE | NO_SCAN | NO_BLOOD | NO_PAIN | IS_SYNTHETIC
|
||||
flags = NO_BREATHE | NO_SCAN | NO_BLOOD | NO_PAIN | IS_SYNTHETIC
|
||||
|
||||
blood_color = "#FFFFFF"
|
||||
flesh_color = "#AAAAAA"
|
||||
@@ -155,7 +155,6 @@
|
||||
modtype = input("Please, select a module!", "Robot", null, null) in modules
|
||||
|
||||
var/module_sprites[0] //Used to store the associations between sprite names and sprite index.
|
||||
var/channels = list()
|
||||
|
||||
if(module)
|
||||
return
|
||||
@@ -177,7 +176,7 @@
|
||||
|
||||
if("Miner")
|
||||
module = new /obj/item/weapon/robot_module/miner(src)
|
||||
channels = list("Supply" = 1)
|
||||
module.channels = list("Supply" = 1)
|
||||
if(camera && "Robots" in camera.network)
|
||||
camera.network.Add("MINE")
|
||||
module_sprites["Basic"] = "Miner_old"
|
||||
@@ -186,7 +185,7 @@
|
||||
|
||||
if("Medical")
|
||||
module = new /obj/item/weapon/robot_module/medical(src)
|
||||
channels = list("Medical" = 1)
|
||||
module.channels = list("Medical" = 1)
|
||||
if(camera && "Robots" in camera.network)
|
||||
camera.network.Add("Medical")
|
||||
module_sprites["Basic"] = "Medbot"
|
||||
@@ -196,7 +195,7 @@
|
||||
|
||||
if("Security")
|
||||
module = new /obj/item/weapon/robot_module/security(src)
|
||||
channels = list("Security" = 1)
|
||||
module.channels = list("Security" = 1)
|
||||
module_sprites["Basic"] = "secborg"
|
||||
module_sprites["Red Knight"] = "Security"
|
||||
module_sprites["Black Knight"] = "securityrobot"
|
||||
@@ -204,7 +203,7 @@
|
||||
|
||||
if("Engineering")
|
||||
module = new /obj/item/weapon/robot_module/engineering(src)
|
||||
channels = list("Engineering" = 1)
|
||||
module.channels = list("Engineering" = 1)
|
||||
if(camera && "Robots" in camera.network)
|
||||
camera.network.Add("Engineering")
|
||||
module_sprites["Basic"] = "Engineering"
|
||||
@@ -220,7 +219,7 @@
|
||||
if("Combat")
|
||||
module = new /obj/item/weapon/robot_module/combat(src)
|
||||
module_sprites["Combat Android"] = "droid-combat"
|
||||
channels = list("Security" = 1)
|
||||
module.channels = list("Security" = 1)
|
||||
|
||||
//Custom_sprite check and entry
|
||||
if (custom_sprite == 1)
|
||||
@@ -234,7 +233,7 @@
|
||||
status_flags &= ~CANPUSH
|
||||
|
||||
choose_icon(6,module_sprites)
|
||||
radio.config(channels)
|
||||
radio.config(module.channels)
|
||||
|
||||
/mob/living/silicon/robot/proc/updatename(var/prefix as text)
|
||||
if(prefix)
|
||||
@@ -1271,4 +1270,4 @@
|
||||
triesleft = 0
|
||||
return
|
||||
else
|
||||
src << "Your icon has been set. You now require a module reset to change it."
|
||||
src << "Your icon has been set. You now require a module reset to change it."
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
w_class = 100.0
|
||||
item_state = "electronic"
|
||||
flags = FPRINT|TABLEPASS | CONDUCT
|
||||
|
||||
var/channels = list()
|
||||
var/list/modules = list()
|
||||
var/obj/item/emag = null
|
||||
var/obj/item/borg/upgrade/jetpack = null
|
||||
@@ -265,4 +265,4 @@
|
||||
src.modules += new /obj/item/borg/combat/mobility(src)
|
||||
src.modules += new /obj/item/weapon/wrench(src) //Is a combat android really going to be stopped by a chair?
|
||||
src.emag = new /obj/item/weapon/gun/energy/lasercannon/cyborg(src)
|
||||
return
|
||||
return
|
||||
|
||||
@@ -276,7 +276,7 @@
|
||||
dat += "Status: [(active?"Injecting":"Standby")] <BR>"
|
||||
dat += "<A href='?src=\ref[src];togglestatus=1'>Toggle Status</A><BR>"
|
||||
|
||||
dat += "Stability: [stability]%<BR>"
|
||||
dat += "Instability: [stability]%<BR>"
|
||||
dat += "Reactor parts: [linked_shielding.len]<BR>"//TODO: perhaps add some sort of stability check
|
||||
dat += "Cores: [linked_cores.len]<BR><BR>"
|
||||
dat += "-Current Efficiency: [reported_core_efficiency]<BR>"
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
src.bitesize = 3
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/meat/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if(istype(W,/obj/item/weapon/kitchen/utensil/knife))
|
||||
if(istype(W,/obj/item/weapon/kitchenknife))
|
||||
new /obj/item/weapon/reagent_containers/food/snacks/rawcutlet(src)
|
||||
new /obj/item/weapon/reagent_containers/food/snacks/rawcutlet(src)
|
||||
new /obj/item/weapon/reagent_containers/food/snacks/rawcutlet(src)
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
user.visible_message("\blue [user] scans [A], the air around them humming gently.")
|
||||
if(istype(A,/turf/simulated/mineral))
|
||||
var/turf/simulated/mineral/M = A
|
||||
if(M.finds.len || M.artifact_find)
|
||||
if((M.finds && M.finds.len) || M.artifact_find)
|
||||
|
||||
//create a new scanlog entry
|
||||
var/datum/depth_scan/D = new()
|
||||
|
||||
@@ -69,7 +69,9 @@
|
||||
if(screen == 1)
|
||||
dat += "Select an event to trigger:<ul>"
|
||||
dat += "<li><A href='?src=\ref[src];triggerevent=Red alert'>Red alert</A></li>"
|
||||
dat += "<li><A href='?src=\ref[src];triggerevent=Emergency Response Team'>Emergency Response Team</A></li>"
|
||||
if(!config.ert_admin_call_only)
|
||||
dat += "<li><A href='?src=\ref[src];triggerevent=Emergency Response Team'>Emergency Response Team</A></li>"
|
||||
|
||||
dat += "<li><A href='?src=\ref[src];triggerevent=Grant Emergency Maintenance Access'>Grant Emergency Maintenance Access</A></li>"
|
||||
dat += "<li><A href='?src=\ref[src];triggerevent=Revoke Emergency Maintenance Access'>Revoke Emergency Maintenance Access</A></li>"
|
||||
dat += "</ul>"
|
||||
@@ -152,8 +154,9 @@
|
||||
revoke_maint_all_access()
|
||||
feedback_inc("alert_keycard_auth_maintRevoke",1)
|
||||
if("Emergency Response Team")
|
||||
trigger_armed_response_team(1)
|
||||
feedback_inc("alert_keycard_auth_ert",1)
|
||||
if(!config.ert_admin_call_only)
|
||||
trigger_armed_response_team(1)
|
||||
feedback_inc("alert_keycard_auth_ert",1)
|
||||
|
||||
var/global/maint_all_access = 0
|
||||
|
||||
@@ -170,4 +173,4 @@ var/global/maint_all_access = 0
|
||||
/obj/machinery/door/airlock/allowed(mob/M)
|
||||
if(maint_all_access && src.check_access_list(list(access_maint_tunnels)))
|
||||
return 1
|
||||
return ..(M)
|
||||
return ..(M)
|
||||
|
||||
@@ -99,14 +99,14 @@
|
||||
if(damage > warning_point) // while the core is still damaged and it's still worth noting its status
|
||||
if((world.timeofday - lastwarning) / 10 >= WARNING_DELAY)
|
||||
var/stability = num2text(round((damage / explosion_point) * 100))
|
||||
|
||||
|
||||
if(damage > emergency_point)
|
||||
|
||||
radio.autosay(addtext(emergency_alert, " Stability: ",stability,"%"), "Supermatter Monitor")
|
||||
radio.autosay(addtext(emergency_alert, " Instability: ",stability,"%"), "Supermatter Monitor")
|
||||
lastwarning = world.timeofday
|
||||
|
||||
else if(damage >= damage_archived) // The damage is still going up
|
||||
radio.autosay(addtext(warning_alert," Stability: ",stability,"%"), "Supermatter Monitor")
|
||||
radio.autosay(addtext(warning_alert," Instability: ",stability,"%"), "Supermatter Monitor")
|
||||
lastwarning = world.timeofday - 150
|
||||
|
||||
else // Phew, we're safe
|
||||
|
||||
@@ -15,6 +15,8 @@
|
||||
return 0
|
||||
if (affected.status & ORGAN_DESTROYED)
|
||||
return 0
|
||||
if (target_zone == "head" && target.species && (target.species.flags & IS_SYNTHETIC))
|
||||
return 1
|
||||
if (affected.status & ORGAN_ROBOT)
|
||||
return 0
|
||||
return 1
|
||||
|
||||
@@ -94,6 +94,9 @@ TRAITOR_SCALING
|
||||
## if objectives are disabled
|
||||
#OBJECTIVES_DISABLED
|
||||
|
||||
## make ERT's be only called by admins
|
||||
#ERT_ADMIN_ONLY
|
||||
|
||||
## If security is prohibited from being most antagonists
|
||||
#PROTECT_ROLES_FROM_ANTAGONIST
|
||||
|
||||
@@ -239,6 +242,10 @@ USEALIENWHITELIST
|
||||
## Default is "python" on Windows, "/usr/bin/env python2" on UNIX.
|
||||
#PYTHON_PATH
|
||||
|
||||
## Uncomment to use the C library nudge instead of the python script.
|
||||
## This helps security and stability on Linux, but you need to compile the library first.
|
||||
#USE_LIB_NUDGE
|
||||
|
||||
## Uncommen to allow ghosts to write in blood during Cult rounds.
|
||||
ALLOW_CULT_GHOSTWRITER
|
||||
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 15 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.8 KiB |
@@ -0,0 +1,109 @@
|
||||
#include "netutil.h"
|
||||
#include "string.h"
|
||||
|
||||
int net_ready = 0;
|
||||
void net_init()
|
||||
{
|
||||
#ifdef _WIN32
|
||||
WSADATA wsa;
|
||||
WSAStartup(MAKEWORD(2,0),&wsa);
|
||||
#endif
|
||||
net_ready = 1;
|
||||
}
|
||||
|
||||
socket_t connect_sock(char * host, char * port)
|
||||
{
|
||||
if(!net_ready)
|
||||
{
|
||||
net_init();
|
||||
}
|
||||
|
||||
socket_t out_sock = -1;
|
||||
struct addrinfo addr_in;
|
||||
struct addrinfo * addr_proc;
|
||||
int gai_status;
|
||||
|
||||
memset(&addr_in, 0, sizeof(addr_in));
|
||||
|
||||
addr_in.ai_family = AF_UNSPEC;
|
||||
addr_in.ai_socktype = SOCK_STREAM;
|
||||
addr_in.ai_flags = AI_PASSIVE;
|
||||
|
||||
gai_status = getaddrinfo(host, port, &addr_in, &addr_proc);
|
||||
|
||||
if(gai_status)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
struct addrinfo * ai_p;
|
||||
for(ai_p = addr_proc; ai_p != 0; ai_p = ai_p->ai_next)
|
||||
{
|
||||
out_sock = socket(ai_p->ai_family, ai_p->ai_socktype,
|
||||
ai_p->ai_protocol);
|
||||
|
||||
if((int)out_sock == -1)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
else if(connect(out_sock, ai_p->ai_addr, ai_p->ai_addrlen) == -1)
|
||||
{
|
||||
close_socket(out_sock);
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(!out_sock)
|
||||
{
|
||||
freeaddrinfo(addr_proc);
|
||||
return -1;
|
||||
}
|
||||
|
||||
freeaddrinfo(addr_proc);
|
||||
return out_sock;
|
||||
}
|
||||
|
||||
void send_n(socket_t sock, const char * buf, size_t n)
|
||||
{
|
||||
size_t to_send = n;
|
||||
const char * buf_i = buf;
|
||||
while(to_send)
|
||||
{
|
||||
int sent = send(sock, buf_i, to_send, 0);
|
||||
if(sent != -1)
|
||||
{
|
||||
to_send -= sent;
|
||||
buf_i += sent;
|
||||
}
|
||||
else
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
void recv_n(socket_t sock, char * buf, size_t n)
|
||||
{
|
||||
size_t total = 0;
|
||||
char * buf_i = buf;
|
||||
while(total < n)
|
||||
{
|
||||
int recved = recv(sock, buf_i, n - total, 0);
|
||||
if(recved > 0)
|
||||
{
|
||||
total += recved;
|
||||
buf_i += recved;
|
||||
}
|
||||
else
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
#ifndef NETUTIL_H
|
||||
#define NETUTIL_H
|
||||
|
||||
#ifdef _WIN32
|
||||
|
||||
#include <winsock2.h>
|
||||
#include <ws2tcpip.h>
|
||||
typedef SOCKET socket_t;
|
||||
|
||||
#define close_socket(sock) closesocket(sock)
|
||||
|
||||
#else
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netdb.h>
|
||||
#include <unistd.h>
|
||||
typedef int socket_t;
|
||||
|
||||
#define close_socket(sock) close(sock)
|
||||
|
||||
#endif
|
||||
|
||||
extern int net_ready;
|
||||
void init_net();
|
||||
|
||||
socket_t connect_sock(char * host, char * port);
|
||||
|
||||
void send_n(socket_t sock, const char * buf, size_t n);
|
||||
void recv_n(socket_t sock, char * buf, size_t n);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "netutil.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
#define DLL_EXPORT __declspec(dllexport)
|
||||
#else
|
||||
#define DLL_EXPORT __attribute__ ((visibility ("default")))
|
||||
#endif
|
||||
|
||||
size_t san_c(const char * input)
|
||||
{
|
||||
unsigned int count = strlen(input);
|
||||
|
||||
const char * i;
|
||||
for(i = input; *i; i++)
|
||||
{
|
||||
if(*i == '\\' || *i == '\'')
|
||||
{
|
||||
count++;
|
||||
}
|
||||
}
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
char * san_cpy(char * out_buf, const char * in_buf)
|
||||
{
|
||||
const char * i_in = in_buf;
|
||||
char * i_out = out_buf;
|
||||
while(*i_in)
|
||||
{
|
||||
if(*i_in == '\\' || *i_in == '\'')
|
||||
{
|
||||
*(i_out++) = '\\';
|
||||
}
|
||||
*(i_out++) = *(i_in++);
|
||||
}
|
||||
return i_out;
|
||||
}
|
||||
|
||||
DLL_EXPORT const char * nudge(int n, char *v[])
|
||||
{
|
||||
if(n != 4)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
size_t out_c = san_c(v[0]) + san_c(v[2]) + san_c(v[3]);
|
||||
|
||||
char * san_out = malloc(out_c + 56);
|
||||
|
||||
char * san_i = san_out;
|
||||
strcpy(san_i, "(dp1\nS'ip'\np2\nS'");
|
||||
san_i += 16;
|
||||
san_i = san_cpy(san_i, v[2]);
|
||||
strcpy(san_i, "'\np3\nsS'data'\np4\n(lp5\nS'");
|
||||
san_i += 24;
|
||||
san_i = san_cpy(san_i, v[0]);
|
||||
strcpy(san_i, "'\np6\naS'");
|
||||
san_i += 8;
|
||||
san_i = san_cpy(san_i, v[3]);
|
||||
strcpy(san_i, "'\np7\nas.");
|
||||
|
||||
socket_t nudge_sock = connect_sock(v[1], "45678");
|
||||
send_n(nudge_sock, san_out, out_c + 56);
|
||||
close_socket(nudge_sock);
|
||||
|
||||
return "1";
|
||||
}
|
||||
|
||||
+1226
-1215
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user