Merge branch 'master' into BEF-staging

Conflicts:
	config/config.txt

Signed-off-by: Mloc-Argent <colmohici@gmail.com>
This commit is contained in:
Mloc-Argent
2013-07-04 13:08:28 +01:00
16 changed files with 125 additions and 37 deletions

View File

@@ -819,6 +819,8 @@
#include "code\modules\events\viral_infection.dm"
#include "code\modules\events\viral_outbreak.dm"
#include "code\modules\events\wallrot.dm"
#include "code\modules\ext_scripts\irc.dm"
#include "code\modules\ext_scripts\python.dm"
#include "code\modules\flufftext\Dreaming.dm"
#include "code\modules\flufftext\Hallucination.dm"
#include "code\modules\flufftext\TextFilters.dm"

View File

@@ -77,7 +77,6 @@
var/alert_desc_delta = "The station's self-destruct mechanism has been engaged. All crew are instructed to obey all instructions given by heads of staff. Any violations of these orders can be punished by death. This is not a drill."
var/forbid_singulo_possession = 0
var/useircbot = 0
//game_options.txt configs
@@ -119,6 +118,11 @@
var/gateway_delay = 18000 //How long the gateway takes before it activates. Default is half an hour.
var/ghost_interaction = 0
var/use_irc_bot = 0
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
/datum/configuration/New()
var/list/L = typesof(/datum/game_mode) - /datum/game_mode
@@ -363,8 +367,8 @@
if("allow_holidays")
Holiday = 1
if("useircbot")
useircbot = 1
if("use_irc_bot")
use_irc_bot = 1
if("ticklag")
Ticklag = text2num(value)
@@ -403,6 +407,21 @@
if("ghost_interaction")
config.ghost_interaction = 1
if("main_irc")
config.main_irc = value
if("admin_irc")
config.admin_irc = value
if("python_path")
if(value)
config.python_path = value
else
if(world.system_type == UNIX)
config.python_path = "/usr/bin/env python2"
else //probably windows, if not this should work anyway
config.python_path = "python"
else
diary << "Unknown setting in configuration: '[name]'"

View File

@@ -280,9 +280,12 @@ datum/shuttle_controller
for(var/mob/living/carbon/bug in end_location) // If someone somehow is still in the shuttle's docking area...
bug.gib()
for(var/mob/living/simple_animal/pest in end_location) // And for the other kind of bug...
pest.gib()
start_location.move_contents_to(end_location)
settimeleft(SHUTTLELEAVETIME)
send2irc("Server", "The Emergency Shuttle has docked with the station.")
//send2irc("Server", "The Emergency Shuttle has docked with the station.")
captain_announce("The Emergency Shuttle has docked with the station. You have [round(timeleft()/60,1)] minutes to board the Emergency Shuttle.")
world << sound('sound/AI/shuttledock.ogg')

View File

@@ -195,7 +195,7 @@ Implants;
if(escaped_on_pod_5 > 0)
feedback_set("escaped_on_pod_5",escaped_on_pod_5)
send2irc("Server", "Round just ended.")
send2mainirc("A round of [src.name] has ended - [surviving_total] survivors, [ghosts] ghosts.")
return 0

View File

@@ -142,7 +142,7 @@ var/global/datum/controller/gameticker/ticker
if(C.holder)
admins_number++
if(admins_number == 0)
send2irc("Server", "Round just started with no admins online!")
send2adminirc("Round has started with no admins online.")
supply_shuttle.process() //Start the supply shuttle regenerating points -- TLE
master_controller.process() //Start master_controller.process()

View File

@@ -235,5 +235,12 @@ var/prison_shuttle_timeleft = 0
AM.Move(D)
if(istype(T, /turf/simulated))
del(T)
for(var/mob/living/carbon/bug in end_location) // If someone somehow is still in the shuttle's docking area...
bug.gib()
for(var/mob/living/simple_animal/pest in end_location) // And for the other kind of bug...
pest.gib()
start_location.move_contents_to(end_location)
return

View File

@@ -77,6 +77,12 @@ var/specops_shuttle_timeleft = 0
if(istype(T, /turf/simulated))
del(T)
for(var/mob/living/carbon/bug in end_location) // If someone somehow is still in the shuttle's docking area...
bug.gib()
for(var/mob/living/simple_animal/pest in end_location) // And for the other kind of bug...
pest.gib()
start_location.move_contents_to(end_location)
for(var/turf/T in get_area_turfs(end_location) )

View File

@@ -162,6 +162,12 @@ var/syndicate_elite_shuttle_timeleft = 0
if(istype(T, /turf/simulated))
del(T)
for(var/mob/living/carbon/bug in end_location) // If someone somehow is still in the shuttle's docking area...
bug.gib()
for(var/mob/living/simple_animal/pest in end_location) // And for the other kind of bug...
pest.gib()
start_location.move_contents_to(end_location)
for(var/turf/T in get_area_turfs(end_location) )

View File

@@ -106,15 +106,10 @@ var/list/adminhelp_ignored_words = list("unknown","the","a","an","of","monkey","
log_admin("HELP: [key_name(src)]: [original_msg] - heard by [admin_number_present] non-AFK admins.")
if(admin_number_present <= 0)
if(!admin_number_afk)
send2irc(ckey, "[original_msg] - No admins online")
send2adminirc("ADMINHELP from [key_name(src)]: [original_msg] - !!No admins online!!")
else
send2irc(ckey, "[original_msg] - All admins AFK ([admin_number_afk])")
send2adminirc("ADMINHELP from [key_name(src)]: [original_msg] - !!All admins AFK ([admin_number_afk])!!")
else
send2irc(ckey, original_msg)
send2adminirc("ADMINHELP from [key_name(src)]: [original_msg]")
feedback_add_details("admin_verb","AH") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
return
proc/send2irc(msg,msg2)
if(config.useircbot)
shell("python [config.nudge_script_path] [msg] [msg2]")
return

View File

@@ -0,0 +1,14 @@
/proc/send2irc(var/channel, var/msg)
if(config.use_irc_bot)
ext_python("ircbot_message.py", "[channel] [msg]")
return
/proc/send2mainirc(var/msg)
if(config.use_irc_bot && config.main_irc)
ext_python("ircbot_message.py", "[config.main_irc] [msg]")
return
/proc/send2adminirc(var/msg)
if(config.use_irc_bot && config.admin_irc)
ext_python("ircbot_message.py", "[config.admin_irc] [msg]")
return

View File

@@ -0,0 +1,9 @@
/proc/ext_python(var/script, var/args, var/scriptsprefix = 1)
if(scriptsprefix) script = "scripts/" + script
if(world.system_type == MS_WINDOWS)
script = replacetext(script, "/", "\\")
var/command = config.python_path + " " + script + " " + args
return shell(command)

View File

@@ -86,6 +86,9 @@ proc/move_mining_shuttle()
for(var/mob/living/carbon/bug in toArea) // If someone somehow is still in the shuttle's docking area...
bug.gib()
for(var/mob/living/simple_animal/pest in toArea) // And for the other kind of bug...
pest.gib()
fromArea.move_contents_to(toArea)
if (mining_shuttle_location)
mining_shuttle_location = 0

View File

@@ -7,26 +7,7 @@
message_admins("Admin logout: [key_name(src)]")
if(admins_number == 0) //Apparently the admin logging out is no longer an admin at this point, so we have to check this towards 0 and not towards 1. Awell.
var/cheesy_message = pick( list( \
"I have no admins online!",\
"I'm all alone :(",\
"I'm feeling lonely :(",\
"I'm so lonely :(",\
"Why does nobody love me? :(",\
"I want a man :(",\
"Where has everyone gone?",\
"I need a hug :(",\
"Someone come hold me :(",\
"I need someone on me :(",\
"What happened? Where has everyone gone?",\
"Forever alone :("\
) )
if(cheesy_message)
cheesy_message += " (No admins online)"
send2irc("Server", "[cheesy_message]")
send2adminirc("[key_name(src)] logged out - no more admins online.")
..()
return 1

View File

@@ -49,6 +49,9 @@ proc/move_research_shuttle()
for(var/mob/living/carbon/bug in toArea) // If someone somehow is still in the shuttle's docking area...
bug.gib()
for(var/mob/living/simple_animal/pest in toArea) // And for the other kind of bug...
pest.gib()
fromArea.move_contents_to(toArea)
if (research_shuttle_location)
research_shuttle_location = 0

View File

@@ -217,3 +217,16 @@ ALIEN_PLAYER_RATIO 0.2
## Uncomment this to enable external .rsc downloads. URLs must be separated by no more than one space.
## The linked .zip file should contain the required .rsc
#resource_urls http://firstserver.org/myresource.zip http://secondserver.org/myresource.zip http://10.22.11.1/myresource.zip
## Uncomment to enable sending data to the IRC bot.
#USE_IRC_BOT
## IRC channel to send information to. Leave blank to disable.
#MAIN_IRC #main
## IRC channel to send adminhelps to. Leave blank to disable adminhelps-to-irc.
#ADMIN_IRC #admin
## Path to the python executable on the system. Leave blank for default.
## Default is "python" on Windows, "/usr/bin/env python2" on UNIX.
PYTHON_PATH

27
scripts/ircbot_message.py Normal file
View File

@@ -0,0 +1,27 @@
#!/usr/bin/env python2
# Two arguments, channel and message.
# EG: "ircbot_message.py #adminchannel ADMINHELP, people are killing me!"
import sys,pickle,socket
def pack():
ip = sys.argv[1]
try:
data = sys.argv[2:] #The rest of the arguments is data
except:
data = "NO DATA SPECIFIED"
dictionary = {"ip":ip,"data":["PASSWORD"] + data}
pickled = pickle.dumps(dictionary)
nudge(pickled)
def nudge(data):
HOST = "IRCBOT IP"
PORT = 45678
size = 1024
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((HOST,PORT))
s.send(data)
s.close()
if __name__ == "__main__" and len(sys.argv) > 1: # If not imported and more than one argument
pack()