Merge pull request #1754 from tigercat2000/log_to_dd

New proc to replace world.log <<, log_to_dd()
This commit is contained in:
Mark van Alphen
2015-08-16 17:49:00 +02:00
37 changed files with 107 additions and 96 deletions
+5 -5
View File
@@ -17,19 +17,19 @@ atom/proc/add_fibers(mob/living/carbon/human/M)
if(M.wear_suit)
fibertext = "Material from \a [M.wear_suit]."
if(prob(10*item_multiplier) && !(fibertext in suit_fibers))
//world.log << "Added fibertext: [fibertext]"
//log_to_dd("Added fibertext: [fibertext]")
suit_fibers += fibertext
if(!(M.wear_suit.body_parts_covered & UPPER_TORSO))
if(M.w_uniform)
fibertext = "Fibers from \a [M.w_uniform]."
if(prob(12*item_multiplier) && !(fibertext in suit_fibers)) //Wearing a suit means less of the uniform exposed.
//world.log << "Added fibertext: [fibertext]"
//log_to_dd("Added fibertext: [fibertext]")
suit_fibers += fibertext
if(!(M.wear_suit.body_parts_covered & HANDS))
if(M.gloves)
fibertext = "Material from a pair of [M.gloves.name]."
if(prob(20*item_multiplier) && !(fibertext in suit_fibers))
//world.log << "Added fibertext: [fibertext]"
//log_to_dd("Added fibertext: [fibertext]")
suit_fibers += fibertext
else if(M.w_uniform)
fibertext = "Fibers from \a [M.w_uniform]."
@@ -39,10 +39,10 @@ atom/proc/add_fibers(mob/living/carbon/human/M)
if(M.gloves)
fibertext = "Material from a pair of [M.gloves.name]."
if(prob(20*item_multiplier) && !(fibertext in suit_fibers))
//world.log << "Added fibertext: [fibertext]"
//log_to_dd("Added fibertext: [fibertext]")
suit_fibers += "Material from a pair of [M.gloves.name]."
else if(M.gloves)
fibertext = "Material from a pair of [M.gloves.name]."
if(prob(20*item_multiplier) && !(fibertext in suit_fibers))
//world.log << "Added fibertext: [fibertext]"
//log_to_dd("Added fibertext: [fibertext]")
suit_fibers += "Material from a pair of [M.gloves.name]."
+1 -1
View File
@@ -34,7 +34,7 @@ world/IsBanned(key,address,computer_id)
var/ckeytext = ckey(key)
if(!establish_db_connection())
world.log << "Ban database connection failure. Key [ckeytext] not checked"
log_to_dd("Ban database connection failure. Key [ckeytext] not checked")
diary << "Ban database connection failure. Key [ckeytext] not checked"
return
+2 -2
View File
@@ -102,7 +102,7 @@ var/list/admin_ranks = list() //list of all ranks with associated rights
establish_db_connection()
if(!dbcon.IsConnected())
world.log << "Failed to connect to database in load_admins(). Reverting to legacy system."
log_to_dd("Failed to connect to database in load_admins(). Reverting to legacy system.")
diary << "Failed to connect to database in load_admins(). Reverting to legacy system."
config.admin_legacy_system = 1
load_admins()
@@ -122,7 +122,7 @@ var/list/admin_ranks = list() //list of all ranks with associated rights
//find the client for a ckey if they are connected and associate them with the new admin datum
D.associate(directory[ckey])
if(!admin_datums)
world.log << "The database query in load_admins() resulted in no admins being added to the list. Reverting to legacy system."
log_to_dd("The database query in load_admins() resulted in no admins being added to the list. Reverting to legacy system.")
diary << "The database query in load_admins() resulted in no admins being added to the list. Reverting to legacy system."
config.admin_legacy_system = 1
load_admins()
+1 -1
View File
@@ -52,7 +52,7 @@ DEBUG
log_admin("appearance_keylist was empty")
else
if(!establish_db_connection())
world.log << "Database connection failed. Reverting to the legacy ban system."
log_to_dd("Database connection failed. Reverting to the legacy ban system.")
diary << "Database connection failed. Reverting to the legacy ban system."
config.ban_legacy_system = 1
appearance_loadbanfile()
+1 -1
View File
@@ -64,7 +64,7 @@ DEBUG
log_admin("jobban_keylist was empty")
else
if(!establish_db_connection())
world.log << "Database connection failed. Reverting to the legacy ban system."
log_to_dd("Database connection failed. Reverting to the legacy ban system.")
diary << "Database connection failed. Reverting to the legacy ban system."
config.ban_legacy_system = 1
jobban_loadbanfile()
+1 -1
View File
@@ -546,7 +546,7 @@ var/list/forbidden_varedit_object_types = list(
if("marked datum")
O.vars[variable] = holder.marked_datum
world.log << "### VarEdit by [src]: [O.type] [variable]=[html_encode("[O.vars[variable]]")]"
log_to_dd("### VarEdit by [src]: [O.type] [variable]=[html_encode("[O.vars[variable]]")]")
log_admin("[key_name(src)] modified [original_name]'s [variable] to [O.vars[variable]]")
message_admins("[key_name_admin(src)] modified [original_name]'s [variable] to [O.vars[variable]]", 1)
@@ -585,7 +585,7 @@ proc/SwapMaps_CreateFromTemplate(template_id)
else if(swapmaps_mode!=SWAPMAPS_TEXT && fexists("map_[template_id].txt"))
text=1
else
world.log << "SwapMaps error in SwapMaps_CreateFromTemplate(): map_[template_id] file not found."
log_to_dd("SwapMaps error in SwapMaps_CreateFromTemplate(): map_[template_id] file not found.")
return
if(text)
S=new
@@ -612,7 +612,7 @@ proc/SwapMaps_LoadChunk(chunk_id,turf/locorner)
else if(swapmaps_mode!=SWAPMAPS_TEXT && fexists("map_[chunk_id].txt"))
text=1
else
world.log << "SwapMaps error in SwapMaps_LoadChunk(): map_[chunk_id] file not found."
log_to_dd("SwapMaps error in SwapMaps_LoadChunk(): map_[chunk_id] file not found.")
return
if(text)
S=new
@@ -630,9 +630,9 @@ proc/SwapMaps_LoadChunk(chunk_id,turf/locorner)
proc/SwapMaps_SaveChunk(chunk_id,turf/corner1,turf/corner2)
if(!corner1 || !corner2)
world.log << "SwapMaps error in SwapMaps_SaveChunk():"
if(!corner1) world.log << " corner1 turf is null"
if(!corner2) world.log << " corner2 turf is null"
log_to_dd("SwapMaps error in SwapMaps_SaveChunk():")
if(!corner1) log_to_dd(" corner1 turf is null")
if(!corner2) log_to_dd(" corner2 turf is null")
return
var/swapmap/M=new
M.id=chunk_id
@@ -659,7 +659,7 @@ proc/SwapMaps_GetSize(id)
else if(swapmaps_mode!=SWAPMAPS_TEXT && fexists("map_[id].txt"))
text=1
else
world.log << "SwapMaps error in SwapMaps_GetSize(): map_[id] file not found."
log_to_dd("SwapMaps error in SwapMaps_GetSize(): map_[id] file not found.")
return
if(text)
S=new
+1 -1
View File
@@ -44,7 +44,7 @@ proc/createRandomZlevel()
if(air_master)
air_master.setup_allturfs(block(locate(1, 1, world.maxz), locate(world.maxx, world.maxy, world.maxz)))
create_lighting_overlays(world.maxz)
world.log << "away mission loaded: [map]"
log_to_dd("away mission loaded: [map]")
for(var/obj/effect/landmark/L in landmarks_list)
if (L.name != "awaystart")
+1 -1
View File
@@ -31,7 +31,7 @@
//search the href for script injection
if( findtext(href,"<script",1,0) )
world.log << "Attempted use of scripts within a topic call, by [src]"
log_to_dd("Attempted use of scripts within a topic call, by [src]")
message_admins("Attempted use of scripts within a topic call, by [src]")
//del(usr)
return
+2 -2
View File
@@ -4,7 +4,7 @@
var/releaseWhen = 60
var/list/area/areas = list() //List of areas to affect. Filled by start()
var/eventDept = "Security" //Department name in announcement
var/list/areaName = list("Brig") //Names of areas mentioned in AI and Engineering announcements
var/list/areaType = list(/area/security/prison, /area/security/brig, /area/security/permabrig) //Area types to include.
@@ -54,7 +54,7 @@
A << "<span class='danger'>Malicious program detected in the [english_list(areaName)] lighting and airlock control systems by [my_department].</span>"
else
world.log << "ERROR: Could not initate grey-tide. Unable to find suitable containment area."
log_to_dd("ERROR: Could not initate grey-tide. Unable to find suitable containment area.")
kill()
@@ -166,4 +166,4 @@ var/global/datum/controller/process/garbage_collector/garbageCollector
return ..()
/proc/gcwarning(msg)
world.log << "## GC WARNING: [msg]"
log_to_dd("## GC WARNING: [msg]")
@@ -136,7 +136,7 @@
tod = worldtime2text() //weasellos time of death patch
if(mind) mind.store_memory("Time of death: [tod]", 0)
if(ticker && ticker.mode)
// world.log << "k"
// log_to_dd("k")
sql_report_death(src)
ticker.mode.check_win() //Calls the rounds wincheck, mainly for wizard, malf, and changeling now
return ..(gibbed)
@@ -21,7 +21,7 @@
BorgIndexToWireColor[flagIndex] = colorIndex
BorgWireColorToIndex[colorIndex] = flagIndex
colorIndexList -= colorIndex // Shortens the list.
//world.log << "Flag: [flag], CIndex: [colorIndex], FIndex: [flagIndex]"
//log_to_dd("Flag: [flag], CIndex: [colorIndex], FIndex: [flagIndex]")
flagIndex+=1
return Borgwires
+23 -23
View File
@@ -19,42 +19,42 @@
/client/proc/nanomapgen_DumpImage()
set name = "Generate NanoUI Map"
set category = "Mapping"
if(holder)
nanomapgen_DumpTile(1, 1, text2num(input(usr,"Enter the Z level to generate")))
nanomapgen_DumpTile(1, 1, text2num(input(usr,"Enter the Z level to generate")))
/client/proc/nanomapgen_DumpTile(var/startX = 1, var/startY = 1, var/currentZ = 1, var/endX = -1, var/endY = -1)
if (endX < 0 || endX > world.maxx)
endX = world.maxx
if (endY < 0 || endY > world.maxy)
endY = world.maxy
if (currentZ < 0 || currentZ > world.maxz)
usr << "NanoMapGen: <B>ERROR: currentZ ([currentZ]) must be between 1 and [world.maxz]</B>"
sleep(3)
return NANOMAP_TERMINALERR
if (startX > endX)
usr << "NanoMapGen: <B>ERROR: startX ([startX]) cannot be greater than endX ([endX])</B>"
sleep(3)
return NANOMAP_TERMINALERR
if (startY > endX)
usr << "NanoMapGen: <B>ERROR: startY ([startY]) cannot be greater than endY ([endY])</B>"
sleep(3)
return NANOMAP_TERMINALERR
var/icon/Tile = icon(file("nano/mapbase1024.png"))
if (Tile.Width() != NANOMAP_MAX_ICON_DIMENSION || Tile.Height() != NANOMAP_MAX_ICON_DIMENSION)
world.log << "NanoMapGen: <B>ERROR: BASE IMAGE DIMENSIONS ARE NOT [NANOMAP_MAX_ICON_DIMENSION]x[NANOMAP_MAX_ICON_DIMENSION]</B>"
log_to_dd("NanoMapGen: <B>ERROR: BASE IMAGE DIMENSIONS ARE NOT [NANOMAP_MAX_ICON_DIMENSION]x[NANOMAP_MAX_ICON_DIMENSION]</B>")
sleep(3)
return NANOMAP_TERMINALERR
world.log << "NanoMapGen: <B>GENERATE MAP ([startX],[startY],[currentZ]) to ([endX],[endY],[currentZ])</B>"
log_to_dd("NanoMapGen: <B>GENERATE MAP ([startX],[startY],[currentZ]) to ([endX],[endY],[currentZ])</B>")
usr << "NanoMapGen: <B>GENERATE MAP ([startX],[startY],[currentZ]) to ([endX],[endY],[currentZ])</B>"
var/count = 0;
@@ -62,26 +62,26 @@
for(var/WorldY = startY, WorldY <= endY, WorldY++)
var/atom/Turf = locate(WorldX, WorldY, currentZ)
var/icon/TurfIcon = new(Turf.icon, Turf.icon_state)
TurfIcon.Scale(NANOMAP_ICON_SIZE, NANOMAP_ICON_SIZE)
Tile.Blend(TurfIcon, ICON_OVERLAY, ((WorldX - 1) * NANOMAP_ICON_SIZE), ((WorldY - 1) * NANOMAP_ICON_SIZE))
count++
if (count % 8000 == 0)
world.log << "NanoMapGen: <B>[count] tiles done</B>"
log_to_dd("NanoMapGen: <B>[count] tiles done</B>")
sleep(1)
var/mapFilename = "nanomap_z[currentZ]-new.png"
world.log << "NanoMapGen: <B>sending [mapFilename] to client</B>"
log_to_dd("NanoMapGen: <B>sending [mapFilename] to client</B>")
usr << browse(Tile, "window=picture;file=[mapFilename];display=0")
world.log << "NanoMapGen: <B>Done.</B>"
log_to_dd("NanoMapGen: <B>Done.</B>")
usr << "NanoMapGen: <B>Done. File [mapFilename] uploaded to your cache.</B>"
if (Tile.Width() != NANOMAP_MAX_ICON_DIMENSION || Tile.Height() != NANOMAP_MAX_ICON_DIMENSION)
+2 -2
View File
@@ -234,7 +234,7 @@
//remove the old powernet and replace it with a new one throughout the network.
/proc/propagate_network(var/obj/O, var/datum/powernet/PN)
//world.log << "propagating new network"
//log_to_dd("propagating new network")
var/list/worklist = list()
var/list/found_machines = list()
var/index = 1
@@ -282,7 +282,7 @@
//merge net2 into net1
for(var/obj/structure/cable/Cable in net2.cables) //merge cables
net1.add_cable(Cable)
if(!net2) return net1
for(var/obj/machinery/power/Node in net2.nodes) //merge power machines