From 5a62077f2c86d7b6a54b3d128dd7e62a96adf0bd Mon Sep 17 00:00:00 2001 From: CHOMPStation2StaffMirrorBot <94713762+CHOMPStation2StaffMirrorBot@users.noreply.github.com> Date: Sun, 14 Sep 2025 11:05:26 -0700 Subject: [PATCH] [MIRROR] JSON Logging Refactor (#11623) Co-authored-by: Selis <12716288+ItsSelis@users.noreply.github.com> Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com> --- SQL/DBSchema.sql | 25 - archive/maps/gateway_archive_vr/labyrinth.dm | 2 +- .../events/wildlife_encounter.dm | 10 +- code/ZAS/Fire.dm | 22 +- code/ZAS/Variable Settings.dm | 4 +- code/__defines/_flags.dm | 2 + code/__defines/_helpers.dm | 14 + code/__defines/_tick.dm | 2 - code/__defines/logging.dm | 132 ++- code/__defines/shuttle.dm | 2 +- code/__defines/stack_trace.dm | 4 + code/__defines/tgs.config.dm | 6 +- code/_compile_options.dm | 7 + code/_global_vars/logging.dm | 43 + code/_helpers/_lists.dm | 2 +- code/_helpers/files.dm | 14 - code/_helpers/global_lists.dm | 2 - code/_helpers/guid.dm | 19 + code/_helpers/logging.dm | 423 --------- code/_helpers/logging/_logging.dm | 274 ++++++ code/_helpers/logging/admin.dm | 42 + code/_helpers/logging/attack.dm | 40 + code/_helpers/logging/debug.dm | 53 +- code/_helpers/logging/game.dm | 27 + code/_helpers/logging/mob.dm | 54 ++ code/_helpers/logging/pda.dm | 3 + code/_helpers/logging/research.dm | 6 + code/_helpers/logging/talk.dm | 25 + code/_helpers/logging/ui.dm | 19 +- code/_helpers/logging_vr.dm | 53 -- code/_helpers/mobs.dm | 26 +- code/_helpers/stack_trace.dm | 4 + code/_helpers/text.dm | 12 + code/_helpers/time.dm | 9 +- code/_helpers/turfs.dm | 4 +- code/_helpers/type2type.dm | 64 +- code/_helpers/unsorted.dm | 42 +- code/_macros.dm | 16 - code/_onclick/hud/ability_screen_objects.dm | 4 +- code/_onclick/telekinesis.dm | 2 +- code/controllers/autotransfer.dm | 2 +- .../configuration/configuration.dm | 2 +- .../configuration/entries/general.dm | 46 +- code/controllers/globals.dm | 4 +- code/controllers/hooks.dm | 4 +- code/controllers/master.dm | 4 +- code/controllers/master_controller.dm | 2 +- code/controllers/subsystems/air.dm | 2 +- code/controllers/subsystems/chemistry.dm | 1 - code/controllers/subsystems/dbcore.dm | 22 +- code/controllers/subsystems/events.dm | 4 +- code/controllers/subsystems/events2.dm | 4 +- code/controllers/subsystems/game_master.dm | 6 +- code/controllers/subsystems/garbage.dm | 2 +- code/controllers/subsystems/job.dm | 6 +- code/controllers/subsystems/machines.dm | 8 +- code/controllers/subsystems/mapping.dm | 22 +- code/controllers/subsystems/media_tracks.dm | 14 +- .../subsystems/overmap_renamer_vr.dm | 4 +- code/controllers/subsystems/pathfinder_ch.dm | 6 +- code/controllers/subsystems/pois.dm | 4 +- .../subsystems/processing/bellies_vr.dm | 6 +- .../subsystems/processing/fastprocess.dm | 4 +- code/controllers/subsystems/processing/obj.dm | 6 +- .../subsystems/processing/processing.dm | 6 +- .../subsystems/processing/projectiles.dm | 4 +- .../subsystems/processing/turfs.dm | 6 +- code/controllers/subsystems/reflect_ch.dm | 4 +- code/controllers/subsystems/shuttles.dm | 6 +- code/controllers/subsystems/sqlite.dm | 10 +- code/controllers/subsystems/supply.dm | 2 +- code/controllers/subsystems/ticker.dm | 16 +- code/controllers/subsystems/time_track.dm | 126 ++- code/controllers/subsystems/transcore_vr.dm | 16 +- code/controllers/subsystems/vote.dm | 8 +- code/controllers/subsystems/webhooks.dm | 20 +- code/datums/api.dm | 6 +- code/datums/autolathe/autolathe.dm | 2 +- .../antags/changeling/changeling.dm | 2 +- code/datums/components/recursive_move.dm | 12 +- .../species/shadekin/powers/phase_shift.dm | 2 +- code/datums/datacore.dm | 4 +- code/datums/datum.dm | 10 + code/datums/elements/turf_transparency.dm | 2 +- code/datums/helper_datums/getrev.dm | 2 +- code/datums/mind.dm | 4 +- code/datums/repositories/unique.dm | 2 +- code/defines/procs/announce.dm | 10 +- code/game/antagonist/antagonist.dm | 20 +- code/game/antagonist/antagonist_objectives.dm | 4 +- code/game/antagonist/antagonist_print.dm | 2 +- code/game/antagonist/outsider/raider.dm | 4 +- code/game/antagonist/outsider/technomancer.dm | 4 +- code/game/antagonist/outsider/wizard.dm | 2 +- code/game/antagonist/station/rogue_ai.dm | 4 +- code/game/area/Away Mission areas.dm | 4 +- code/game/area/Space Station 13 areas_vr.dm | 2 +- code/game/gamemodes/calamity/calamity.dm | 2 +- code/game/gamemodes/cult/narsie.dm | 4 +- code/game/gamemodes/cult/runes.dm | 4 +- .../endgame/supermatter_cascade/universe.dm | 2 +- code/game/gamemodes/events.dm | 2 +- .../gamemodes/events/holidays/Holidays.dm | 6 +- code/game/gamemodes/game_mode.dm | 16 +- .../newmalf_ability_trees/HELPERS.dm | 2 +- code/game/gamemodes/meteor/meteor.dm | 4 +- code/game/gamemodes/meteor/meteors.dm | 2 +- code/game/gamemodes/nuclear/nuclear.dm | 36 +- code/game/gamemodes/setupgame.dm | 2 +- code/game/jobs/job_controller.dm | 4 +- code/game/jobs/whitelist.dm | 8 +- code/game/jobs/whitelist_vr.dm | 2 +- code/game/machinery/atm_ret_field.dm | 2 +- code/game/machinery/camera/camera.dm | 4 +- code/game/machinery/camera/motion.dm | 2 +- code/game/machinery/computer/guestpass.dm | 2 +- code/game/machinery/computer/shuttle.dm | 10 +- code/game/machinery/doors/firedoor.dm | 2 +- .../embedded_controller/docking_program.dm | 2 +- .../embedded_controller/mapping_helpers.dm | 9 +- code/game/machinery/flasher.dm | 2 +- code/game/machinery/gear_dispenser.dm | 14 +- code/game/machinery/machinery.dm | 2 +- code/game/machinery/navbeacon.dm | 4 +- code/game/machinery/nuclear_bomb.dm | 4 +- code/game/machinery/pointdefense.dm | 2 +- .../machinery/telecomms/telecomunications.dm | 2 +- .../machinery/virtual_reality/vr_procs.dm | 4 +- code/game/mecha/equipment/mecha_equipment.dm | 10 +- .../game/mecha/equipment/tools/cable_layer.dm | 4 +- code/game/mecha/equipment/tools/clamp.dm | 4 +- code/game/mecha/equipment/tools/cloak.dm | 4 +- code/game/mecha/equipment/tools/drill.dm | 16 +- .../mecha/equipment/tools/energy_relay.dm | 4 +- code/game/mecha/equipment/tools/generator.dm | 10 +- code/game/mecha/equipment/tools/jetpack.dm | 6 +- code/game/mecha/equipment/tools/passenger.dm | 4 +- .../mecha/equipment/tools/repair_droid.dm | 4 +- code/game/mecha/equipment/tools/shield.dm | 4 +- .../game/mecha/equipment/tools/shield_omni.dm | 4 +- code/game/mecha/equipment/tools/sleeper.dm | 8 +- .../game/mecha/equipment/tools/syringe_gun.dm | 12 +- .../equipment/weapons/ballistic/ballistic.dm | 2 +- code/game/mecha/equipment/weapons/honk.dm | 2 +- code/game/mecha/equipment/weapons/weapons.dm | 2 +- code/game/mecha/mecha.dm | 71 +- code/game/mecha/micro/micro_equipment.dm | 6 +- code/game/memory_profiler_ch.dm | 2 +- code/game/objects/effects/chem/chemsmoke.dm | 6 +- code/game/objects/effects/gibs.dm | 3 +- code/game/objects/effects/landmarks.dm | 4 +- .../objects/effects/map_effects/beam_point.dm | 6 +- code/game/objects/effects/prop/columnblast.dm | 2 +- code/game/objects/effects/prop/snake.dm | 8 +- code/game/objects/items/blueprints_vr.dm | 2 +- .../items/devices/communicator/UI_tgui.dm | 2 +- .../items/devices/communicator/messaging.dm | 4 +- .../items/devices/radio/encryptionkey.dm | 55 ++ .../objects/items/devices/radio/jammer.dm | 15 + .../objects/items/devices/radio/jammer_vr.dm | 14 - .../game/objects/items/devices/radio/radio.dm | 36 +- .../objects/items/devices/radio/radio_vr.dm | 33 - .../objects/items/devices/transfer_valve.dm | 2 +- .../items/devices/uplink_random_lists.dm | 2 +- .../weapons/grenades/anti_photon_grenade.dm | 2 +- .../game/objects/items/weapons/tanks/tanks.dm | 6 +- code/game/objects/structures/artstuff.dm | 8 +- code/game/objects/structures/catwalk.dm | 2 +- code/game/objects/structures/droppod.dm | 2 +- code/game/objects/structures/lattice.dm | 2 +- code/game/objects/structures/low_wall.dm | 4 +- code/game/turfs/simulated/fancy_shuttles.dm | 8 +- code/game/turfs/simulated/wall_types.dm | 2 +- code/game/turfs/unsimulated/sky_vr.dm | 2 +- code/game/vehicles/vehicle.dm | 4 +- code/game/world.dm | 115 +-- code/js/view_variables.js | 22 +- code/modules/admin/IsBanned.dm | 21 +- code/modules/admin/ToRban.dm | 8 +- code/modules/admin/admin.dm | 48 +- code/modules/admin/admin_tools.dm | 54 +- code/modules/admin/admin_verb_lists_vr.dm | 1 - code/modules/admin/admin_verbs.dm | 4 + code/modules/admin/banjob.dm | 3 +- code/modules/admin/holder2.dm | 2 +- code/modules/admin/player_panel.dm | 2 +- code/modules/admin/topic.dm | 4 +- code/modules/admin/verbs/BrokenInhands.dm | 2 +- code/modules/admin/verbs/adminsay.dm | 6 +- code/modules/admin/verbs/antag-ooc.dm | 2 +- code/modules/admin/verbs/cinematic.dm | 2 +- code/modules/admin/verbs/custom_event.dm | 8 +- code/modules/admin/verbs/debug.dm | 46 +- code/modules/admin/verbs/dice.dm | 4 +- code/modules/admin/verbs/grief_fixers.dm | 4 +- code/modules/admin/verbs/mapping.dm | 8 +- code/modules/admin/verbs/playsound.dm | 2 +- code/modules/admin/verbs/pray.dm | 2 +- code/modules/admin/verbs/randomverbs.dm | 6 +- code/modules/admin/verbs/striketeam.dm | 2 +- code/modules/admin/verbs/trader.dm | 2 +- code/modules/ai/ai_holder.dm | 2 +- code/modules/ai/ai_holder_debug.dm | 4 +- code/modules/assembly/holder.dm | 2 +- code/modules/assembly/proximity.dm | 2 +- code/modules/asset_cache/asset_cache_item.dm | 2 +- code/modules/awaymissions/gateway.dm | 4 +- code/modules/awaymissions/gateway_vr.dm | 2 +- .../overmap_renamer/overmap_renamer.dm | 8 +- code/modules/awaymissions/zlevel.dm | 6 +- code/modules/blob2/overmind/overmind.dm | 2 +- code/modules/client/client defines.dm | 3 + code/modules/client/client procs.dm | 83 +- code/modules/client/persistent_client.dm | 107 +++ .../preference_setup/general/12_traits.dm | 6 +- .../preference_setup/loadout/02_loadout.dm | 6 +- code/modules/client/preferences.dm | 4 +- code/modules/client/preferences_savefile.dm | 28 +- code/modules/client/shock.dm | 2 +- code/modules/client/verbs/ooc.dm | 4 +- code/modules/clothing/clothing.dm | 2 +- code/modules/customitems/item_spawning.dm | 6 +- code/modules/emotes/custom_emote.dm | 2 +- code/modules/error_handler/_defines.dm | 9 - code/modules/error_handler/error_handler.dm | 195 ++-- code/modules/error_handler/error_viewer.dm | 270 +++--- code/modules/error_handler/~defines.dm | 6 - code/modules/events/atmos_leak.dm | 6 +- code/modules/events/canister_leak.dm | 6 +- code/modules/events/carp_migration.dm | 2 +- code/modules/events/electrical_storm.dm | 2 +- code/modules/events/event_container.dm | 4 +- code/modules/events/event_dynamic.dm | 2 +- code/modules/events/prison_break.dm | 2 +- code/modules/events/spacefish_migration.dm | 2 +- code/modules/events/supply_demand_vr.dm | 8 +- code/modules/food/kitchen/gibber.dm | 2 +- .../events/command/manifest_malfunction.dm | 2 +- .../event2/events/command/money_hacker.dm | 6 +- .../event2/events/command/raise_funds.dm | 14 +- .../events/engineering/airlock_failure.dm | 4 +- .../event2/events/engineering/blob.dm | 4 +- .../events/engineering/brand_intelligence.dm | 2 +- .../events/engineering/canister_leak.dm | 2 +- .../event2/events/engineering/gas_leak.dm | 2 +- .../event2/events/engineering/wallrot.dm | 4 +- .../event2/events/engineering/window_break.dm | 10 +- .../event2/events/everyone/comms_blackout.dm | 4 +- .../events/everyone/electrical_fault.dm | 10 +- .../event2/events/everyone/infestation.dm | 2 +- .../event2/events/everyone/pda_spam.dm | 6 +- .../events/everyone/sudden_weather_shift.dm | 4 +- .../event2/events/ghost_pod_spawner.dm | 2 +- .../event2/events/medical/appendicitis.dm | 4 +- .../event2/events/security/prison_break.dm | 2 +- .../events/security/security_advisement.dm | 2 +- .../events/security/spider_infestation.dm | 2 +- .../event2/events/security/surprise_carp.dm | 6 +- code/modules/holodeck/HolodeckControl.dm | 2 +- code/modules/holomap/mapper.dm | 2 +- code/modules/hydroponics/grown.dm | 4 +- code/modules/hydroponics/seed_gene_mut.dm | 2 +- .../hydroponics/spreading/spreading.dm | 2 +- .../spreading/spreading_response.dm | 2 +- .../hydroponics/trays/tray_update_icons.dm | 2 +- code/modules/keybindings/bindings_movekeys.dm | 2 +- code/modules/lighting/lighting_fake_sun_vr.dm | 2 +- .../logging/categories/log_category_admin.dm | 33 + .../categories/log_category_compats.dm | 7 + .../logging/categories/log_category_debug.dm | 23 + .../logging/categories/log_category_game.dm | 48 + .../logging/categories/log_category_href.dm | 6 + .../categories/log_category_internal.dm | 6 + .../logging/categories/log_category_misc.dm | 20 + .../logging/categories/log_category_pda.dm | 3 + code/modules/logging/log_category.dm | 70 ++ code/modules/logging/log_entry.dm | 127 +++ code/modules/logging/log_holder.dm | 356 ++++++++ code/modules/looking_glass/lg_area.dm | 2 +- code/modules/looking_glass/lg_console.dm | 2 +- code/modules/looking_glass/lg_imageholder.dm | 4 +- code/modules/lore_codex/codex_tree.dm | 2 +- code/modules/maps/bapi-dmm/bapi_dmm_reader.dm | 2 +- .../modules/materials/materials/_materials.dm | 4 +- code/modules/media/juke_remote.dm | 2 +- code/modules/media/mediamanager.dm | 2 +- code/modules/metric/activity.dm | 6 +- .../mining/machinery/machine_processing.dm | 2 +- code/modules/mining/mineral_effect.dm | 2 +- code/modules/mining/resonator_vr.dm | 5 - code/modules/mob/dead/observer/observer.dm | 2 +- code/modules/mob/dead/observer/say.dm | 4 +- code/modules/mob/emote.dm | 2 +- code/modules/mob/language/generic.dm | 2 +- code/modules/mob/language/language.dm | 4 +- code/modules/mob/language/station.dm | 6 +- code/modules/mob/language/station_vr.dm | 2 +- code/modules/mob/living/carbon/human/human.dm | 2 +- .../mob/living/carbon/human/human_damage.dm | 4 +- .../mob/living/carbon/human/human_powers.dm | 4 +- code/modules/mob/living/carbon/human/life.dm | 3 - .../human/species/lleill/lleill_abilities.dm | 26 - .../living/carbon/human/species/species.dm | 2 +- .../human/species/station/prommie_blob.dm | 2 +- .../human/species/station/traits/positive.dm | 4 +- code/modules/mob/living/damage_procs.dm | 4 +- code/modules/mob/living/living_defense.dm | 6 +- code/modules/mob/living/say.dm | 4 +- code/modules/mob/living/silicon/ai/malf.dm | 2 +- code/modules/mob/living/silicon/pai/pai_vr.dm | 2 +- .../mob/living/silicon/pai/software.dm | 2 +- code/modules/mob/living/silicon/say.dm | 4 +- .../subtypes/animal/alien animals/stardog.dm | 14 +- .../subtypes/animal/borer/borer_captive.dm | 2 +- .../simple_mob/subtypes/glamour/ddraig.dm | 15 - code/modules/mob/login.dm | 26 +- code/modules/mob/logout.dm | 2 +- code/modules/mob/mob.dm | 6 + code/modules/mob/mob_defines.dm | 18 +- code/modules/mob/mob_movement.dm | 2 +- code/modules/mob/new_player/lobby_browser.dm | 2 +- code/modules/mob/new_player/login.dm | 4 +- code/modules/mob/new_player/logout.dm | 2 +- code/modules/mob/new_player/new_player_vr.dm | 2 +- code/modules/mob/say_vr.dm | 8 +- code/modules/multiz/stairs.dm | 10 +- code/modules/news/news_init.dm | 4 +- .../nifsoft/software/13_soulcatcher.dm | 4 +- code/modules/organs/blood.dm | 8 +- code/modules/organs/organ.dm | 2 +- code/modules/organs/subtypes/standard.dm | 2 +- code/modules/overmap/champagne.dm | 2 +- code/modules/overmap/events/event_handler.dm | 2 +- code/modules/overmap/ships/panicbutton.dm | 2 +- code/modules/overmap/spacetravel.dm | 2 +- code/modules/pda/messenger.dm | 2 +- code/modules/pda/pda.dm | 2 +- code/modules/pda/utilities.dm | 2 +- .../persistence/storage/smartfridge.dm | 2 +- code/modules/planet/sun.dm | 2 +- code/modules/planet/weather.dm | 8 +- code/modules/power/apc.dm | 2 +- code/modules/power/fusion/core/core_field.dm | 2 +- .../power/singularity/containment_field.dm | 2 +- code/modules/power/smes.dm | 2 +- code/modules/projectiles/gun.dm | 16 +- code/modules/random_map/drop/supply.dm | 2 +- code/modules/reagents/Chemistry-Colours.dm | 2 +- code/modules/reagents/reactions/_reactions.dm | 2 +- .../reagent_containers/_reagent_containers.dm | 2 +- .../reagents/reagent_containers/spray.dm | 9 +- code/modules/reagents/reagents/medicine_vr.dm | 11 - code/modules/recycling/recycling.dm | 2 +- code/modules/resleeving/machines.dm | 2 +- code/modules/rogueminer_vr/controller.dm | 6 +- code/modules/rogueminer_vr/zonemaster.dm | 10 +- code/modules/scripting/IDE.dm | 2 +- .../scripting/Implementations/Telecomms.dm | 2 +- .../scripting/Implementations/_Logic.dm | 6 +- .../security levels/keycard authentication.dm | 8 +- code/modules/shieldgen/shield_generator.dm | 2 +- code/modules/shuttles/landmarks.dm | 2 +- code/modules/shuttles/shuttle_emergency.dm | 4 +- code/modules/shuttles/shuttles_multi.dm | 2 +- code/modules/shuttles/shuttles_web.dm | 4 +- code/modules/shuttles/web_datums.dm | 12 +- code/modules/spells/spell_code.dm | 2 +- code/modules/tgs_commands/vorestation.dm | 4 +- code/modules/tgui/modules/power_monitor.dm | 2 +- code/modules/tickets/tickets.dm | 4 +- code/modules/turbolift/turbolift.dm | 4 +- code/modules/turbolift/turbolift_floor.dm | 2 +- code/modules/turbolift/turbolift_map.dm | 4 +- code/modules/unit_tests/_unit_tests.dm | 1 + code/modules/unit_tests/font_awesome_icons.dm | 3 +- code/modules/unit_tests/mapping.dm | 19 + code/modules/unit_tests/unit_test.dm | 9 +- code/modules/vore/eating/belly_messages.dm | 4 +- code/modules/vore/eating/belly_obj_liquids.dm | 2 +- code/modules/vore/eating/belly_obj_vr.dm | 2 +- code/modules/vore/eating/bellymodes_vr.dm | 2 +- code/modules/vore/eating/living_vr.dm | 10 +- code/modules/vore/eating/soulcatcher.dm | 4 +- code/modules/vore/eating/vore_procs.dm | 2 +- code/modules/vore/eating/vore_vr.dm | 4 +- code/modules/vore/eating/vorepanel_vr.dm | 2 +- code/modules/vore/persist/persist_vr.dm | 12 +- code/modules/vore/trycatch_vr.dm | 15 +- code/modules/webhooks/_webhook.dm | 6 +- code/modules/xenoarcheaology/effect_master.dm | 1 - code/modules/xenobio2/controller.dm | 2 +- code/modules/xenobio2/mob/xeno procs.dm | 4 +- code/modules/xgm/xgm_gas_data.dm | 2 +- config/example/config.txt | 10 + config/example/logging.txt | 26 +- html/statbrowser.js | 837 +++++++++--------- maps/expedition_vr/alienship/_alienship.dm | 2 +- maps/offmap_vr/common_offmaps.dm | 2 +- maps/submaps/_helpers.dm | 6 +- maps/submaps/engine_submaps/engine.dm | 2 +- maps/tether/tether-07-solars.dmm | 92 +- maps/tether/tether_areas.dm | 4 +- .../virgo_minitest/virgo_minitest_shuttles.dm | 5 - maps/~map_system/maps.dm | 2 +- maps/~map_system/maps_vr.dm | 4 +- .../code/game/machinery/bluespace_denier.dm | 2 +- .../game/objects/effects/step_triggers.dm | 2 +- .../code/modules/event/horde_infestation.dm | 4 +- .../code/modules/event/infectedroom.dm | 8 +- .../code/modules/lore_codex/codex_tree.dm | 2 +- .../code/modules/lore_codex/cooking_codex.dm | 2 +- .../code/modules/overmap/dynamic_sector.dm | 10 +- .../code/modules/paperwork/faxmachine.dm | 2 +- .../maps/common/common_shuttles_crew.dm | 2 +- modular_chomp/maps/common/common_things.dm | 2 +- .../maps/common/common_wildlife_encounter.dm | 8 +- modular_chomp/maps/~map_system/maps.dm | 2 +- .../tgui/interfaces/LogViewer/CategoryBar.tsx | 52 ++ .../interfaces/LogViewer/CategoryViewer.tsx | 149 ++++ .../tgui/interfaces/LogViewer/constants.ts | 1 + .../tgui/interfaces/LogViewer/functions.ts | 8 + .../tgui/interfaces/LogViewer/index.tsx | 53 ++ .../tgui/interfaces/LogViewer/types.ts | 36 + tgui/packages/tgui/interfaces/PlayerNotes.tsx | 148 ++-- vorestation.dme | 32 +- 425 files changed, 4081 insertions(+), 2568 deletions(-) create mode 100644 code/__defines/_flags.dm create mode 100644 code/__defines/stack_trace.dm create mode 100644 code/_compile_options.dm create mode 100644 code/_helpers/guid.dm delete mode 100644 code/_helpers/logging.dm create mode 100644 code/_helpers/logging/_logging.dm create mode 100644 code/_helpers/logging/admin.dm create mode 100644 code/_helpers/logging/attack.dm create mode 100644 code/_helpers/logging/game.dm create mode 100644 code/_helpers/logging/mob.dm create mode 100644 code/_helpers/logging/pda.dm create mode 100644 code/_helpers/logging/research.dm create mode 100644 code/_helpers/logging/talk.dm delete mode 100644 code/_helpers/logging_vr.dm create mode 100644 code/_helpers/stack_trace.dm delete mode 100644 code/game/objects/items/devices/radio/jammer_vr.dm delete mode 100644 code/game/objects/items/devices/radio/radio_vr.dm create mode 100644 code/modules/client/persistent_client.dm delete mode 100644 code/modules/error_handler/_defines.dm delete mode 100644 code/modules/error_handler/~defines.dm create mode 100644 code/modules/logging/categories/log_category_admin.dm create mode 100644 code/modules/logging/categories/log_category_compats.dm create mode 100644 code/modules/logging/categories/log_category_debug.dm create mode 100644 code/modules/logging/categories/log_category_game.dm create mode 100644 code/modules/logging/categories/log_category_href.dm create mode 100644 code/modules/logging/categories/log_category_internal.dm create mode 100644 code/modules/logging/categories/log_category_misc.dm create mode 100644 code/modules/logging/categories/log_category_pda.dm create mode 100644 code/modules/logging/log_category.dm create mode 100644 code/modules/logging/log_entry.dm create mode 100644 code/modules/logging/log_holder.dm create mode 100644 code/modules/unit_tests/mapping.dm create mode 100644 tgui/packages/tgui/interfaces/LogViewer/CategoryBar.tsx create mode 100644 tgui/packages/tgui/interfaces/LogViewer/CategoryViewer.tsx create mode 100644 tgui/packages/tgui/interfaces/LogViewer/constants.ts create mode 100644 tgui/packages/tgui/interfaces/LogViewer/functions.ts create mode 100644 tgui/packages/tgui/interfaces/LogViewer/index.tsx create mode 100644 tgui/packages/tgui/interfaces/LogViewer/types.ts diff --git a/SQL/DBSchema.sql b/SQL/DBSchema.sql index 14283388b0..d85dc3555a 100644 --- a/SQL/DBSchema.sql +++ b/SQL/DBSchema.sql @@ -62,18 +62,6 @@ CREATE TABLE IF NOT EXISTS `erro_admin_log` ( -- Data exporting was unselected. --- Dumping structure for table ss13.erro_attacklog -CREATE TABLE IF NOT EXISTS `erro_attacklog` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `time` datetime DEFAULT NULL, - `ckey` varchar(64) DEFAULT NULL, - `mob` varchar(128) DEFAULT NULL, - `message` varchar(1024) NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=886 DEFAULT CHARSET=latin1; - --- Data exporting was unselected. - -- Dumping structure for table ss13.erro_ban CREATE TABLE IF NOT EXISTS `erro_ban` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -117,19 +105,6 @@ CREATE TABLE IF NOT EXISTS `erro_connection_log` ( -- Data exporting was unselected. --- Dumping structure for table ss13.erro_dialog -CREATE TABLE IF NOT EXISTS `erro_dialog` ( - `mid` int(11) NOT NULL AUTO_INCREMENT, - `time` datetime NOT NULL, - `ckey` varchar(32) NOT NULL, - `mob` varchar(128) DEFAULT NULL, - `type` varchar(32) NOT NULL, - `message` text NOT NULL, - PRIMARY KEY (`mid`) -) ENGINE=InnoDB AUTO_INCREMENT=3345 DEFAULT CHARSET=latin1; - --- Data exporting was unselected. - -- Dumping structure for table ss13.erro_feedback CREATE TABLE IF NOT EXISTS `erro_feedback` ( `id` int(11) NOT NULL AUTO_INCREMENT, diff --git a/archive/maps/gateway_archive_vr/labyrinth.dm b/archive/maps/gateway_archive_vr/labyrinth.dm index 8c1d15cf53..6fb71a91b3 100644 --- a/archive/maps/gateway_archive_vr/labyrinth.dm +++ b/archive/maps/gateway_archive_vr/labyrinth.dm @@ -185,7 +185,7 @@ else M.make_jittery(500) chassis.use_power(energy_drain) - log_message("Honked from [src.name]. HONK!") + src.log_message("Honked from [src.name]. HONK!") do_after_cooldown() return diff --git a/archive/maps/southern_cross/events/wildlife_encounter.dm b/archive/maps/southern_cross/events/wildlife_encounter.dm index 04d7c10e01..267107d03a 100644 --- a/archive/maps/southern_cross/events/wildlife_encounter.dm +++ b/archive/maps/southern_cross/events/wildlife_encounter.dm @@ -20,7 +20,7 @@ /datum/event2/event/wildlife_encounter/set_up() for(var/mob/living/L in GLOB.player_list) //if(!(L.z in get_location_z_levels())) - // log_debug("Not on the right z-level") + // log_mapping("Not on the right z-level") // continue // Not on the right z-level. if(L.stat) continue // Don't want dead people. @@ -34,7 +34,7 @@ /datum/event2/event/wildlife_encounter/start() if(!victim) - log_debug("Failed to find a target for random encounter. Aborting.") + log_game("Failed to find a target for random encounter. Aborting.") abort() return @@ -60,19 +60,19 @@ for(var/i = 1 to potential_victims.len) if (get_dist(spawning_turf, potential_victims[i]) < world.view) spawning_turf = null - log_debug("Failed to locate position out of sight of [potential_victims[i]].") + log_game("Failed to locate position out of sight of [potential_victims[i]].") attempts++ potential_victims = null - log_debug("Sending [number_of_packs] [build_path]\s after \the [victim].") + log_game("Sending [number_of_packs] [build_path]\s after \the [victim].") for(var/i = 1 to number_of_packs) if(spawning_turf) var/mob/living/simple_mob/M = new build_path(spawning_turf) M.ai_holder?.give_destination(get_turf(victim)) else - log_debug("Failed to locate turf to spawn encounter.") + log_game("Failed to locate turf to spawn encounter.") /datum/event2/event/wildlife_encounter/proc/item_to_spawn() return pick(prob(22);/mob/living/simple_mob/animal/sif/savik, diff --git a/code/ZAS/Fire.dm b/code/ZAS/Fire.dm index 7b6c36e790..2a43b049d6 100644 --- a/code/ZAS/Fire.dm +++ b/code/ZAS/Fire.dm @@ -237,8 +237,8 @@ If it gains pressure too slowly, it may leak or just rupture instead of explodin if((temperature > PHORON_MINIMUM_BURN_TEMPERATURE || force_burn) && (no_check ||check_recombustability(zone? zone.fuel_objs : null))) #ifdef FIREDBG - log_debug("***************** FIREDBG *****************") - log_debug("Burning [zone? zone.name : "zoneless gas_mixture"]!") + log_world("***************** FIREDBG *****************") + log_world("Burning [zone? zone.name : "zoneless gas_mixture"]!") #endif var/gas_fuel = 0 @@ -291,13 +291,13 @@ If it gains pressure too slowly, it may leak or just rupture instead of explodin var/used_oxidizers = used_fuel*(FIRE_REACTION_OXIDIZER_AMOUNT/FIRE_REACTION_FUEL_AMOUNT) #ifdef FIREDBG - log_debug("gas_fuel = [gas_fuel], liquid_fuel = [liquid_fuel], total_oxidizers = [total_oxidizers]") - log_debug("fuel_area = [fuel_area], total_fuel = [total_fuel], reaction_limit = [reaction_limit]") - log_debug("firelevel -> [firelevel] (gas: [gas_firelevel], liquid: [liquid_firelevel])") - log_debug("liquid_reaction_progress = [liquid_reaction_progress]") - log_debug("gas_reaction_progress = [gas_reaction_progress]") - log_debug("total_reaction_progress = [total_reaction_progress]") - log_debug("used_fuel = [used_fuel], used_oxidizers = [used_oxidizers]; ") + log_world("gas_fuel = [gas_fuel], liquid_fuel = [liquid_fuel], total_oxidizers = [total_oxidizers]") + log_world("fuel_area = [fuel_area], total_fuel = [total_fuel], reaction_limit = [reaction_limit]") + log_world("firelevel -> [firelevel] (gas: [gas_firelevel], liquid: [liquid_firelevel])") + log_world("liquid_reaction_progress = [liquid_reaction_progress]") + log_world("gas_reaction_progress = [gas_reaction_progress]") + log_world("total_reaction_progress = [total_reaction_progress]") + log_world("used_fuel = [used_fuel], used_oxidizers = [used_oxidizers]; ") #endif //if the reaction is progressing too slow then it isn't self-sustaining anymore and burns out @@ -326,8 +326,8 @@ If it gains pressure too slowly, it may leak or just rupture instead of explodin update_values() #ifdef FIREDBG - log_debug("used_gas_fuel = [used_gas_fuel]; used_liquid_fuel = [used_liquid_fuel]; total = [used_fuel]") - log_debug("new temperature = [temperature]; new pressure = [return_pressure()]") + log_world("used_gas_fuel = [used_gas_fuel]; used_liquid_fuel = [used_liquid_fuel]; total = [used_fuel]") + log_world("new temperature = [temperature]; new pressure = [return_pressure()]") #endif return firelevel diff --git a/code/ZAS/Variable Settings.dm b/code/ZAS/Variable Settings.dm index 015396c24a..7c46e4572b 100644 --- a/code/ZAS/Variable Settings.dm +++ b/code/ZAS/Variable Settings.dm @@ -170,7 +170,7 @@ var/global/vs_control/vsc = new vars[ch] = vw if(how == "Toggle") newvar = (newvar?"ON":"OFF") - to_world(span_world(span_blue("[key_name(user)] changed the setting [display_description] to [newvar]."))) + to_chat(world, span_world(span_blue("[key_name(user)] changed the setting [display_description] to [newvar]."))) if(ch in plc.settings) ChangeSettingsDialog(user,plc.settings) else @@ -323,7 +323,7 @@ var/global/vs_control/vsc = new plc.N2O_HALLUCINATION = initial(plc.N2O_HALLUCINATION) - to_world(span_world(span_blue("[key_name(user)] changed the global phoron/ZAS settings to \"[def]\""))) + to_chat(world, span_world(span_blue("[key_name(user)] changed the global phoron/ZAS settings to \"[def]\""))) /pl_control/var/list/settings = list() diff --git a/code/__defines/_flags.dm b/code/__defines/_flags.dm new file mode 100644 index 0000000000..4bd4edcca7 --- /dev/null +++ b/code/__defines/_flags.dm @@ -0,0 +1,2 @@ +/// 33554431 (2^24 - 1) is the maximum value our bitflags can reach. +#define MAX_BITFLAG_DIGITS 8 diff --git a/code/__defines/_helpers.dm b/code/__defines/_helpers.dm index b7cf727299..85dd40153b 100644 --- a/code/__defines/_helpers.dm +++ b/code/__defines/_helpers.dm @@ -13,6 +13,17 @@ /// The Y/Height dimension of ICON_SIZE. This will more than likely be the smaller axis. #define ICON_SIZE_Y 32 +//Returns the hex value of a decimal number +//len == length of returned string +#define num2hex(X, len) num2text(X, len, 16) + +//Returns an integer given a hex input, supports negative values "-ff" +//skips preceding invalid characters +#define hex2num(X) text2num(X, 16) + +/// Until a condition is true, sleep +#define UNTIL(X) while(!(X)) stoplag() + /// Takes a datum as input, returns its ref string #define text_ref(datum) ref(datum) @@ -24,3 +35,6 @@ /// A null statement to guard against EmptyBlock lint without necessitating the use of pass() /// Used to avoid proc-call overhead. But use sparingly. Probably pointless in most places. #define EMPTY_BLOCK_GUARD ; + +/// Abstraction over using mob.client to just check if there's a connected player. +#define HAS_CONNECTED_PLAYER(mob) (mob.client) diff --git a/code/__defines/_tick.dm b/code/__defines/_tick.dm index 5c7b2a3a86..9fc9aa96cc 100644 --- a/code/__defines/_tick.dm +++ b/code/__defines/_tick.dm @@ -28,5 +28,3 @@ #define TICK_CHECK_HIGH_PRIORITY ( TICK_USAGE > 95 ) /// runs stoplag if tick_usage is above 95, for high priority usage #define CHECK_TICK_HIGH_PRIORITY ( TICK_CHECK_HIGH_PRIORITY? stoplag() : 0 ) - -#define UNTIL(X) while(!(X)) stoplag() diff --git a/code/__defines/logging.dm b/code/__defines/logging.dm index 3b64f81c74..f87ab3f428 100644 --- a/code/__defines/logging.dm +++ b/code/__defines/logging.dm @@ -1,5 +1,133 @@ +/// The number of entries to store per category, don't make this too large or you'll start to see performance issues +#define CONFIG_MAX_CACHED_LOG_ENTRIES 1000 + +/// The number of *minimum* ticks between each log re-render, making this small will cause performance issues +/// Admins can still manually request a re-render +#define LOG_UPDATE_TIMEOUT 5 SECONDS + +// The maximum number of entries allowed in the signaler investigate log, keep this relatively small to prevent performance issues when an admin tries to query it +#define INVESTIGATE_SIGNALER_LOG_MAX_LENGTH 500 + +//Investigate logging defines +#define INVESTIGATE_CARGO "cargo" +#define INVESTIGATE_RESEARCH "research" + +// Logging types for log_message() +#define LOG_ATTACK (1 << 0) +#define LOG_SAY (1 << 1) +#define LOG_WHISPER (1 << 2) +#define LOG_EMOTE (1 << 3) +#define LOG_DSAY (1 << 4) +#define LOG_PDA (1 << 5) +#define LOG_CHAT (1 << 6) +#define LOG_COMMENT (1 << 7) +#define LOG_TELECOMMS (1 << 8) +#define LOG_OOC (1 << 9) +#define LOG_LOOC (1 << 10) +#define LOG_ADMIN (1 << 11) +#define LOG_OWNERSHIP (1 << 12) +#define LOG_GAME (1 << 13) +#define LOG_ADMIN_PRIVATE (1 << 14) +#define LOG_ASAY (1 << 15) +#define LOG_MECHA (1 << 16) +#define LOG_VIRUS (1 << 17) +#define LOG_SHUTTLE (1 << 18) +#define LOG_ECON (1 << 19) +#define LOG_VICTIM (1 << 20) +#define LOG_RADIO_EMOTE (1 << 21) +#define LOG_SPEECH_INDICATORS (1 << 22) +#define LOG_TRANSPORT (1 << 23) + +//Individual logging panel pages +#define INDIVIDUAL_GAME_LOG (LOG_GAME) +#define INDIVIDUAL_ATTACK_LOG (LOG_ATTACK | LOG_VICTIM) +#define INDIVIDUAL_SAY_LOG (LOG_SAY | LOG_WHISPER | LOG_DSAY | LOG_SPEECH_INDICATORS) +#define INDIVIDUAL_EMOTE_LOG (LOG_EMOTE | LOG_RADIO_EMOTE) +#define INDIVIDUAL_COMMS_LOG (LOG_PDA | LOG_CHAT | LOG_COMMENT | LOG_TELECOMMS) +#define INDIVIDUAL_OOC_LOG (LOG_OOC | LOG_LOOC | LOG_ADMIN) +#define INDIVIDUAL_SHOW_ALL_LOG (LOG_ATTACK | LOG_SAY | LOG_WHISPER | LOG_EMOTE | LOG_RADIO_EMOTE | LOG_DSAY | LOG_PDA | LOG_CHAT | LOG_COMMENT | LOG_TELECOMMS | LOG_OOC | LOG_LOOC | LOG_ADMIN | LOG_OWNERSHIP | LOG_GAME | LOG_ADMIN_PRIVATE | LOG_ASAY | LOG_MECHA | LOG_VIRUS | LOG_SHUTTLE | LOG_ECON | LOG_VICTIM | LOG_SPEECH_INDICATORS) + +// Log entry keys +#define LOG_ENTRY_KEY_TIMESTAMP "ts" +#define LOG_ENTRY_KEY_CATEGORY "cat" +#define LOG_ENTRY_KEY_MESSAGE "msg" +#define LOG_ENTRY_KEY_DATA "data" +#define LOG_ENTRY_KEY_WORLD_STATE "w-state" +#define LOG_ENTRY_KEY_SEMVER_STORE "s-store" +#define LOG_ENTRY_KEY_ID "id" +#define LOG_ENTRY_KEY_SCHEMA_VERSION "s-ver" + +// Internal categories +#define LOG_CATEGORY_INTERNAL_CATEGORY_NOT_FOUND "internal-category-not-found" +#define LOG_CATEGORY_INTERNAL_ERROR "internal-error" + +// Misc categories +#define LOG_CATEGORY_ATTACK "attack" +#define LOG_CATEGORY_CONFIG "config" +#define LOG_CATEGORY_QDEL "qdel" +#define LOG_CATEGORY_RUNTIME "runtime" +#define LOG_CATEGORY_SUSPICIOUS_LOGIN "suspicious-logins" +#define LOG_CATEGORY_VORE "vore" + +// Admin categories +#define LOG_CATEGORY_ADMIN "admin" +#define LOG_CATEGORY_ADMIN_DSAY "admin-dsay" + +// Admin private categories +#define LOG_CATEGORY_ADMIN_PRIVATE "adminprivate" +#define LOG_CATEGORY_ADMIN_PRIVATE_ASAY "adminprivate-asay" +#define LOG_CATEGORY_ADMIN_PRIVATE_MSAY "adminprivate-msay" +#define LOG_CATEGORY_ADMIN_PRIVATE_ESAY "adminprivate-esay" + +// Debug categories +#define LOG_CATEGORY_DEBUG "debug" +#define LOG_CATEGORY_DEBUG_ASSET "debug-asset" +#define LOG_CATEGORY_DEBUG_MAPPING "debug-mapping" +#define LOG_CATEGORY_DEBUG_MOBTAG "debug-mobtag" +#define LOG_CATEGORY_DEBUG_SQL "debug-sql" + +// Compatibility categories, for when stuff is changed and you need existing functionality to work +#define LOG_CATEGORY_COMPAT_GAME "game-compat" + +// Game categories +#define LOG_CATEGORY_GAME "game" +#define LOG_CATEGORY_GAME_ACCESS "game-access" +#define LOG_CATEGORY_GAME_EMOTE "game-emote" +#define LOG_CATEGORY_GAME_OOC "game-ooc" +#define LOG_CATEGORY_GAME_LOOC "game-looc" +#define LOG_CATEGORY_GAME_PRAYER "game-prayer" +#define LOG_CATEGORY_GAME_SAY "game-say" +#define LOG_CATEGORY_GAME_TOPIC "game-topic" +#define LOG_CATEGORY_GAME_VOTE "game-vote" +#define LOG_CATEGORY_GAME_WHISPER "game-whisper" + +// HREF categories +#define LOG_CATEGORY_HREF "href" +#define LOG_CATEGORY_HREF_TGUI "href-tgui" + +// PDA categories +#define LOG_CATEGORY_PDA "pda" + +// Flags that apply to the entry_flags var on logging categories +// These effect how entry datums process the inputs passed into them +/// Enables data list usage for readable log entries +/// You'll likely want to disable internal formatting to make this work properly +#define ENTRY_USE_DATA_W_READABLE (1<<0) + + +#define SCHEMA_VERSION "schema-version" + +// Default log schema version +#define LOG_CATEGORY_SCHEMA_VERSION_NOT_SET "0.0.1" + +//wrapper macros for easier grepping +#define DIRECT_OUTPUT(A, B) A << B +#define DIRECT_INPUT(A, B) A >> B +#define SEND_IMAGE(target, image) DIRECT_OUTPUT(target, image) +#define SEND_SOUND(target, sound) DIRECT_OUTPUT(target, sound) #define SEND_TEXT(target, text) DIRECT_OUTPUT(target, text) #define WRITE_FILE(file, text) DIRECT_OUTPUT(file, text) #define READ_FILE(file, text) DIRECT_INPUT(file, text) - -#define INVESTIGATE_RESEARCH "research" +//This is an external call, "true" and "false" are how rust parses out booleans +#define WRITE_LOG(log, text) rustg_log_write(log, text, "true") +#define WRITE_LOG_NO_FORMAT(log, text) rustg_log_write(log, text, "false") diff --git a/code/__defines/shuttle.dm b/code/__defines/shuttle.dm index 9bf7dcad6f..76989a0e95 100644 --- a/code/__defines/shuttle.dm +++ b/code/__defines/shuttle.dm @@ -23,5 +23,5 @@ #ifndef DEBUG_SHUTTLES #define log_shuttle(M) #else - #define log_shuttle(M) log_debug("[M]") + #define log_shuttle(M) log_world("[M]") #endif diff --git a/code/__defines/stack_trace.dm b/code/__defines/stack_trace.dm new file mode 100644 index 0000000000..4911b4a0d5 --- /dev/null +++ b/code/__defines/stack_trace.dm @@ -0,0 +1,4 @@ +/// gives us the stack trace from CRASH() without ending the current proc. +#define stack_trace(message) _stack_trace(message, __FILE__, __LINE__) + +#define WORKAROUND_IDENTIFIER "%//%" diff --git a/code/__defines/tgs.config.dm b/code/__defines/tgs.config.dm index c57439c7e4..0dc0e64f9a 100644 --- a/code/__defines/tgs.config.dm +++ b/code/__defines/tgs.config.dm @@ -3,9 +3,9 @@ #define TGS_READ_GLOBAL(Name) GLOB.##Name #define TGS_WRITE_GLOBAL(Name, Value) GLOB.##Name = ##Value #define TGS_WORLD_ANNOUNCE(message) to_chat(world, span_boldannounce("[html_encode(##message)]")) -#define TGS_INFO_LOG(message) log_to_dd("TGS Info: [##message]") -#define TGS_WARNING_LOG(message) log_to_dd("TGS Warn: [##message]") -#define TGS_ERROR_LOG(message) log_to_dd("TGS Error: [##message]") +#define TGS_INFO_LOG(message) log_world("TGS Info: [##message]") +#define TGS_WARNING_LOG(message) log_world("TGS Warn: [##message]") +#define TGS_ERROR_LOG(message) stack_trace("TGS Error: [##message]") #define TGS_NOTIFY_ADMINS(event) message_admins(##event) #define TGS_CLIENT_COUNT GLOB.clients.len #define TGS_PROTECT_DATUM(Path) GENERAL_PROTECT_DATUM(##Path) diff --git a/code/_compile_options.dm b/code/_compile_options.dm new file mode 100644 index 0000000000..bc43d51fa2 --- /dev/null +++ b/code/_compile_options.dm @@ -0,0 +1,7 @@ +// Comment this out if you are debugging problems that might be obscured by custom error handling in world/Error +#ifdef DEBUG +#define USE_CUSTOM_ERROR_HANDLER +#endif + +// We do not have dreamlua implemented +#define DISABLE_DREAMLUAU diff --git a/code/_global_vars/logging.dm b/code/_global_vars/logging.dm index 5ac744da96..4e04f43faf 100644 --- a/code/_global_vars/logging.dm +++ b/code/_global_vars/logging.dm @@ -5,6 +5,44 @@ GLOBAL_PROTECT(round_id) GLOBAL_VAR_INIT(log_directory, "data/logs/") //See world.dm for the full calculated path GLOBAL_PROTECT(log_directory) +#define DECLARE_LOG_NAMED(log_var_name, log_file_name, start)\ +GLOBAL_VAR(##log_var_name);\ +GLOBAL_PROTECT(##log_var_name);\ +/world/_initialize_log_files(temp_log_override = null){\ + ..();\ + GLOB.##log_var_name = temp_log_override || "[GLOB.log_directory]/[##log_file_name].log";\ + if(!temp_log_override && ##start){\ + start_log(GLOB.##log_var_name);\ + }\ +} + +#define DECLARE_LOG(log_name, start) DECLARE_LOG_NAMED(##log_name, "[copytext(#log_name, 1, length(#log_name) - 3)]", start) +#define START_LOG TRUE +#define DONT_START_LOG FALSE + +/// Populated by log declaration macros to set log file names and start messages +/world/proc/_initialize_log_files(temp_log_override = null) + // Needs to be here to avoid compiler warnings + SHOULD_CALL_PARENT(TRUE) + return + +// All individual log files. +// These should be used where the log category cannot easily be a json log file. +DECLARE_LOG(config_error_log, DONT_START_LOG) +DECLARE_LOG(perf_log, DONT_START_LOG) // Declared here but name is set in time_track subsystem + +#ifdef REFERENCE_TRACKING_LOG_APART +DECLARE_LOG_NAMED(harddel_log, "harddels", START_LOG) +#endif + +#if defined(UNIT_TESTS) || defined(SPACEMAN_DMM) +DECLARE_LOG_NAMED(test_log, "tests", START_LOG) +#endif + +/// All admin related log lines minus their categories +GLOBAL_LIST_EMPTY(admin_activities) +GLOBAL_PROTECT(admin_activities) + GLOBAL_VAR(diary) GLOBAL_PROTECT(diary) @@ -30,3 +68,8 @@ GLOBAL_PROTECT(bombers) /// Stores who uploaded laws to which silicon-based lifeform, and what the law was GLOBAL_LIST_EMPTY(lawchanges) GLOBAL_PROTECT(lawchanges) + +#undef DECLARE_LOG +#undef DECLARE_LOG_NAMED +#undef START_LOG +#undef DONT_START_LOG diff --git a/code/_helpers/_lists.dm b/code/_helpers/_lists.dm index bfac0f758d..0688d3c390 100644 --- a/code/_helpers/_lists.dm +++ b/code/_helpers/_lists.dm @@ -910,7 +910,7 @@ GLOBAL_LIST_EMPTY(json_cache) GLOB.json_cache[json_to_decode] = json_decode(json_to_decode) . = GLOB.json_cache[json_to_decode] catch(var/exception/e) - log_error("Exception during JSON decoding ([json_to_decode]): [e]") + log_runtime("Exception during JSON decoding ([json_to_decode]): [e]") return list() //takes an input_key, as text, and the list of keys already used, outputting a replacement key in the format of "[input_key] ([number_of_duplicates])" if it finds a duplicate diff --git a/code/_helpers/files.dm b/code/_helpers/files.dm index a776c3363d..716df480f9 100644 --- a/code/_helpers/files.dm +++ b/code/_helpers/files.dm @@ -1,17 +1,3 @@ -//checks if a file exists and contains text -//returns text as a string if these conditions are met -/proc/return_file_text(filename) - if(fexists(filename) == 0) - error("File not found ([filename])") - return - - var/text = file2text(filename) - if(!text) - error("File empty ([filename])") - return - - return text - /** * For FTP requests. (i.e. downloading runtime logs.) * diff --git a/code/_helpers/global_lists.dm b/code/_helpers/global_lists.dm index 144198ba08..4008bf548e 100644 --- a/code/_helpers/global_lists.dm +++ b/code/_helpers/global_lists.dm @@ -193,7 +193,6 @@ GLOBAL_LIST_EMPTY(mannequins) if (isnull(GLOB.all_languages[L.name])) GLOB.all_languages[L.name] = L else - log_debug("Language name conflict! [T] is named [L.name], but that is taken by [GLOB.all_languages[L.name].type]") if(isnull(GLOB.language_name_conflicts[L.name])) GLOB.language_name_conflicts[L.name] = list(GLOB.all_languages[L.name]) GLOB.language_name_conflicts[L.name] += L @@ -204,7 +203,6 @@ GLOBAL_LIST_EMPTY(mannequins) if(isnull(GLOB.language_keys[L.key])) GLOB.language_keys[L.key] = L else - log_debug("Language key conflict! [L] has key [L.key], but that is taken by [(GLOB.language_keys[L.key])]") if(isnull(GLOB.language_key_conflicts[L.key])) GLOB.language_key_conflicts[L.key] = list(GLOB.language_keys[L.key]) GLOB.language_key_conflicts[L.key] += L diff --git a/code/_helpers/guid.dm b/code/_helpers/guid.dm new file mode 100644 index 0000000000..49903cceb3 --- /dev/null +++ b/code/_helpers/guid.dm @@ -0,0 +1,19 @@ +/** + * returns a GUID like identifier (using a mostly made up record format) + * guids are not on their own suitable for access or security tokens, as most of their bits are predictable. + * (But may make a nice salt to one) +**/ +/proc/GUID() + var/const/GUID_VERSION = "b" + var/const/GUID_VARIANT = "d" + var/node_id = copytext_char(md5("[rand()*rand(1,9999999)][world.name][world.hub][world.hub_password][world.internet_address][world.address][world.contents.len][world.status][world.port][rand()*rand(1,9999999)]"), 1, 13) + + var/time_high = "[num2hex(text2num(time2text(world.realtime,"YYYY")), 2)][num2hex(world.realtime, 6)]" + + var/time_mid = num2hex(world.timeofday, 4) + + var/time_low = num2hex(world.time, 3) + + var/time_clock = num2hex(TICK_DELTA_TO_MS(world.tick_usage), 3) + + return "{[time_high]-[time_mid]-[GUID_VERSION][time_low]-[GUID_VARIANT][time_clock]-[node_id]}" diff --git a/code/_helpers/logging.dm b/code/_helpers/logging.dm deleted file mode 100644 index 52a4cb9e94..0000000000 --- a/code/_helpers/logging.dm +++ /dev/null @@ -1,423 +0,0 @@ -//print an error message to world.log - -//This is an external call, "true" and "false" are how rust parses out booleans -#define WRITE_LOG(log, text) rustg_log_write(log, text, "true") -#define WRITE_LOG_NO_FORMAT(log, text) rustg_log_write(log, text, "false") - -/* For logging round startup. */ -/proc/start_log(log) - WRITE_LOG(log, "START: Starting up [GLOB.log_directory].") - return log - -/* Close open log handles. This should be called as late as possible, and no logging should hapen after. */ -/proc/shutdown_logging() - rustg_log_close_all() - -/proc/error(msg) - to_world_log("## ERROR: [msg]") - -#define WARNING(MSG) warning("[MSG] in [__FILE__] at line [__LINE__] src: [src] usr: [usr].") -//print a warning message to world.log -/proc/warning(msg) - to_world_log("## WARNING: [msg]") - -//print a testing-mode debug message to world.log -/proc/testing(msg) - if (CONFIG_GET(flag/log_debug)) //CHOMPEdit - to_world_log("## TESTING: [msg]") - -/proc/log_admin(text) - GLOB.admin_log.Add(text) - if (CONFIG_GET(flag/log_admin)) - WRITE_LOG(GLOB.diary, "ADMIN: [text]") - -/proc/log_admin_private(text) - GLOB.admin_log.Add(text) - if (CONFIG_GET(flag/log_admin)) - WRITE_LOG(GLOB.diary, "ADMINPRIVATE: [text]") - -/proc/log_adminpm(text, client/source, client/dest) - GLOB.admin_log.Add(text) - if (CONFIG_GET(flag/log_admin)) - WRITE_LOG(GLOB.diary, "ADMINPM: [key_name(source)]->[key_name(dest)]: [html_decode(text)]") - -/proc/log_pray(text, client/source) - GLOB.admin_log.Add(text) - if (CONFIG_GET(flag/log_admin)) - WRITE_LOG(GLOB.diary, "PRAY: [key_name(source)]: [text]") - -/proc/log_debug(text) - if (CONFIG_GET(flag/log_debug)) - WRITE_LOG(GLOB.debug_log, "DEBUG: [sanitize(text)]") - - for(var/client/C in GLOB.admins) - if(C.prefs?.read_preference(/datum/preference/toggle/show_debug_logs)) - to_chat(C, - type = MESSAGE_TYPE_DEBUG, - html = span_filter_debuglogs("DEBUG: [text]")) - -/proc/log_game(text) - if (CONFIG_GET(flag/log_game)) - WRITE_LOG(GLOB.diary, "GAME: [text]") - -/proc/log_vote(text) - if (CONFIG_GET(flag/log_vote)) - WRITE_LOG(GLOB.diary, "VOTE: [text]") - -/proc/log_access_in(client/new_client) - if (CONFIG_GET(flag/log_access)) - var/message = "[key_name(new_client)] - IP:[new_client.address] - CID:[new_client.computer_id] - BYOND v[new_client.byond_version]" - WRITE_LOG(GLOB.diary, "ACCESS IN: [message]") //VOREStation Edit - -/proc/log_access_out(mob/last_mob) - if (CONFIG_GET(flag/log_access)) - var/message = "[key_name(last_mob)] - IP:[last_mob.lastKnownIP] - CID:Logged Out - BYOND Logged Out" - WRITE_LOG(GLOB.diary, "ACCESS OUT: [message]") - -/proc/log_say(text, mob/speaker) - if (CONFIG_GET(flag/log_say)) - WRITE_LOG(GLOB.diary, "SAY: [speaker.simple_info_line()]: [html_decode(text)]") - - //Log the message to in-game dialogue logs, as well. //CHOMPEdit Begin - if(speaker.client) - //speaker.dialogue_log += span_bold("([time_stamp()])") + " (" + span_bold("[speaker]/[speaker.client]") + ") " + span_underline("SAY:") + " - " + span_green("[text]") - if(!SSdbcore.IsConnected()) - establish_db_connection() - if(!SSdbcore.IsConnected()) - return null - var/datum/db_query/query_insert = SSdbcore.NewQuery("INSERT INTO erro_dialog (mid, time, ckey, mob, type, message) VALUES (null, NOW(), :sender_ckey, :sender_mob, :message_type, :message_content)", \ - list("sender_ckey" = speaker.ckey, "sender_mob" = speaker.real_name, "message_type" = "say", "message_content" = text)) - if(!query_insert.Execute()) - log_debug("Error during logging: "+query_insert.ErrorMsg()) - qdel(query_insert) - return - qdel(query_insert) - //GLOB.round_text_log += span_bold("([time_stamp()])") + " (" + span_bold("[speaker]/[speaker.client]") + ") " + span_underline("SAY:") + " - " + span_green("[text]") - //CHOMPEdit End - -/proc/log_ooc(text, client/user) - if (CONFIG_GET(flag/log_ooc)) - WRITE_LOG(GLOB.diary, "OOC: [user.simple_info_line()]: [html_decode(text)]") - if(!SSdbcore.IsConnected()) - establish_db_connection() - if(!SSdbcore.IsConnected()) - return null - var/datum/db_query/query_insert = SSdbcore.NewQuery("INSERT INTO erro_dialog (mid, time, ckey, mob, type, message) VALUES (null, NOW(), :sender_ckey, :sender_mob, :message_type, :message_content)", \ - list("sender_ckey" = user.ckey, "sender_mob" = user.mob.real_name, "message_type" = "ooc", "message_content" = text)) - if(!query_insert.Execute()) - log_debug("Error during logging: "+query_insert.ErrorMsg()) - qdel(query_insert) - return - qdel(query_insert) - //GLOB.round_text_log += span_bold("([time_stamp()])") + " (" + span_bold("[user]") + ") " + span_underline("OOC:") + " - " + span_blue(span_bold("[text]")) - -/proc/log_aooc(text, client/user) - if (CONFIG_GET(flag/log_ooc)) - WRITE_LOG(GLOB.diary, "AOOC: [user.simple_info_line()]: [html_decode(text)]") - if(!SSdbcore.IsConnected()) - establish_db_connection() - if(!SSdbcore.IsConnected()) - return null - var/datum/db_query/query_insert = SSdbcore.NewQuery("INSERT INTO erro_dialog (mid, time, ckey, mob, type, message) VALUES (null, NOW(), :sender_ckey, :sender_mob, :message_type, :message_content)", \ - list("sender_ckey" = user.ckey, "sender_mob" = user.mob.real_name, "message_type" = "aooc", "message_content" = text)) - if(!query_insert.Execute()) - log_debug("Error during logging: "+query_insert.ErrorMsg()) - qdel(query_insert) - return - qdel(query_insert) - //GLOB.round_text_log += span_bold("([time_stamp()])") + " (" + span_bold("[user]") + ") " + span_underline("AOOC:") + " - " + span_red(span_bold("[text]")) - -/proc/log_looc(text, client/user) - if (CONFIG_GET(flag/log_ooc)) - WRITE_LOG(GLOB.diary, "LOOC: [user.simple_info_line()]: [html_decode(text)]") - if(!SSdbcore.IsConnected()) - establish_db_connection() - if(!SSdbcore.IsConnected()) - return null - var/datum/db_query/query_insert = SSdbcore.NewQuery("INSERT INTO erro_dialog (mid, time, ckey, mob, type, message) VALUES (null, NOW(), :sender_ckey, :sender_mob, :message_type, :message_content)", \ - list("sender_ckey" = user.ckey, "sender_mob" = user.mob.real_name, "message_type" = "looc", "message_content" = text)) - if(!query_insert.Execute()) - log_debug("Error during logging: "+query_insert.ErrorMsg()) - qdel(query_insert) - return - qdel(query_insert) - //GLOB.round_text_log += span_bold("([time_stamp()])") + " (" + span_bold("[user]") + ") " + span_underline("LOOC:") + " - " + span_orange(span_bold("[text]")) - -/proc/log_whisper(text, mob/speaker) - if (CONFIG_GET(flag/log_whisper)) - WRITE_LOG(GLOB.diary, "WHISPER: [speaker.simple_info_line()]: [html_decode(text)]") - - if(speaker.client) - //speaker.dialogue_log += span_bold("([time_stamp()])") + " (" + span_bold("[speaker]/[speaker.client]") + ") " + span_underline("SAY:") + " - " + span_gray(span_italics("[text]")) - //GLOB.round_text_log += span_bold("([time_stamp()])") + " (" + span_bold("[speaker]/[speaker.client]") + ") " + span_underline("SAY:") + " - " + span_gray(span_italics("[text]")) - if(!SSdbcore.IsConnected()) - establish_db_connection() - if(!SSdbcore.IsConnected()) - return null - var/datum/db_query/query_insert = SSdbcore.NewQuery("INSERT INTO erro_dialog (mid, time, ckey, mob, type, message) VALUES (null, NOW(), :sender_ckey, :sender_mob, :message_type, :message_content)", \ - list("sender_ckey" = speaker.ckey, "sender_mob" = speaker.real_name, "message_type" = "whisper", "message_content" = text)) - if(!query_insert.Execute()) - log_debug("Error during logging: "+query_insert.ErrorMsg()) - qdel(query_insert) - return - qdel(query_insert) - -/proc/log_emote(text, mob/speaker) - if (CONFIG_GET(flag/log_emote)) - WRITE_LOG(GLOB.diary, "EMOTE: [speaker.simple_info_line()]: [html_decode(text)]") - //CHOMPEdit Begin - if(speaker.client) - //speaker.dialogue_log += span_bold("([time_stamp()])") + " (" + span_bold("[speaker]/[speaker.client]") + ") " + span_underline("EMOTE:") + " - " + span_pink("[text]") - //GLOB.round_text_log += span_bold("([time_stamp()])") + " (" + span_bold("[speaker]/[speaker.client]") + ") " + span_underline("EMOTE:") + " - " + span_pink("[text]") - if(!SSdbcore.IsConnected()) - establish_db_connection() - if(!SSdbcore.IsConnected()) - return null - var/datum/db_query/query_insert = SSdbcore.NewQuery("INSERT INTO erro_dialog (mid, time, ckey, mob, type, message) VALUES (null, NOW(), :sender_ckey, :sender_mob, :message_type, :message_content)", \ - list("sender_ckey" = speaker.ckey, "sender_mob" = speaker.real_name, "message_type" = "emote", "message_content" = text)) - if(!query_insert.Execute()) - log_debug("Error during logging: "+query_insert.ErrorMsg()) - qdel(query_insert) - return - qdel(query_insert) - //CHOMPEdit End - -/proc/log_attack(attacker, defender, message) - if (CONFIG_GET(flag/log_attack)) - WRITE_LOG(GLOB.diary, "ATTACK: [attacker] against [defender]: [message]") - -/proc/log_adminsay(text, mob/speaker) - if (CONFIG_GET(flag/log_adminchat)) - WRITE_LOG(GLOB.diary, "ADMINSAY: [speaker.simple_info_line()]: [html_decode(text)]") - -/proc/log_modsay(text, mob/speaker) - if (CONFIG_GET(flag/log_adminchat)) - WRITE_LOG(GLOB.diary, "MODSAY: [speaker.simple_info_line()]: [html_decode(text)]") - -/proc/log_eventsay(text, mob/speaker) - if (CONFIG_GET(flag/log_adminchat)) - WRITE_LOG(GLOB.diary, "EVENTSAY: [speaker.simple_info_line()]: [html_decode(text)]") - -/proc/log_ghostsay(text, mob/speaker) - if (CONFIG_GET(flag/log_say)) - WRITE_LOG(GLOB.diary, "DEADCHAT: [speaker.simple_info_line()]: [html_decode(text)]") - //CHOMPEdit Begin - if(speaker.client) - if(!SSdbcore.IsConnected()) - establish_db_connection() - if(!SSdbcore.IsConnected()) - return null - var/datum/db_query/query_insert = SSdbcore.NewQuery("INSERT INTO erro_dialog (mid, time, ckey, mob, type, message) VALUES (null, NOW(), :sender_ckey, :sender_mob, :message_type, :message_content)", \ - list("sender_ckey" = speaker.ckey, "sender_mob" = speaker.real_name, "message_type" = "deadsay", "message_content" = text)) - if(!query_insert.Execute()) - log_debug("Error during logging: "+query_insert.ErrorMsg()) - qdel(query_insert) - return - qdel(query_insert) - - //speaker.dialogue_log += span_bold("([time_stamp()])") + " (" + span_bold("[speaker]/[speaker.client]") + ") " + span_underline("DEADSAY:") + " - " + span_green("[text]") - //GLOB.round_text_log += span_small(span_purple(span_bold("([time_stamp()])") + " (" + span_bold("[speaker]/[speaker.client]") + ") " + span_underline("DEADSAY:") + " - [text]")) - //CHOMPEdit End - -/proc/log_ghostemote(text, mob/speaker) - if (CONFIG_GET(flag/log_emote)) - WRITE_LOG(GLOB.diary, "DEADEMOTE: [speaker.simple_info_line()]: [html_decode(text)]") - //CHOMPEdit Begin - if(speaker.client) - if(!SSdbcore.IsConnected()) - establish_db_connection() - if(!SSdbcore.IsConnected()) - return null - var/datum/db_query/query_insert = SSdbcore.NewQuery("INSERT INTO erro_dialog (mid, time, ckey, mob, type, message) VALUES (null, NOW(), :sender_ckey, :sender_mob, :message_type, :message_content)", \ - list("sender_ckey" = speaker.ckey, "sender_mob" = speaker.real_name, "message_type" = "deademote", "message_content" = text)) - if(!query_insert.Execute()) - log_debug("Error during logging: "+query_insert.ErrorMsg()) - qdel(query_insert) - return - qdel(query_insert) - //CHOMPEdit End - -/proc/log_adminwarn(text) - if (CONFIG_GET(flag/log_adminwarn)) - WRITE_LOG(GLOB.diary, "ADMINWARN: [html_decode(text)]") - -/proc/log_pda(text, mob/speaker) - if (CONFIG_GET(flag/log_pda)) - WRITE_LOG(GLOB.diary, "PDA: [speaker.simple_info_line()]: [html_decode(text)]") - //CHOMPEdit Begin - if(speaker.client) - if(!SSdbcore.IsConnected()) - establish_db_connection() - if(!SSdbcore.IsConnected()) - return null - var/datum/db_query/query_insert = SSdbcore.NewQuery("INSERT INTO erro_dialog (mid, time, ckey, mob, type, message) VALUES (null, NOW(), :sender_ckey, :sender_mob, :message_type, :message_content)", \ - list("sender_ckey" = speaker.ckey, "sender_mob" = speaker.real_name, "message_type" = "pda", "message_content" = text)) - if(!query_insert.Execute()) - log_debug("Error during logging: "+query_insert.ErrorMsg()) - qdel(query_insert) - return - qdel(query_insert) - - //speaker.dialogue_log += span_bold("([time_stamp()])") + " (" + span_bold("[speaker]/[speaker.client]") + ") " + span_underline("MSG:") + " - " + span_darkgreen("[text]") - //GLOB.round_text_log += span_bold("([time_stamp()])") + " (" + span_bold("[speaker]/[speaker.client]") + ") " + span_underline("MSG:") + " - " + span_darkgreen("[text]") - //CHOMPEdit End - -/proc/log_to_dd(text) - to_world_log(text) //this comes before the config check because it can't possibly runtime - if(config?.loaded && CONFIG_GET(flag/log_world_output)) - WRITE_LOG(GLOB.diary, "DD_OUTPUT: [text]") - -/proc/log_error(text) - to_world_log(text) - WRITE_LOG(GLOB.error_log, "RUNTIME: [text]") - -/proc/log_misc(text) - WRITE_LOG(GLOB.diary, "MISC: [text]") - -/proc/log_sql(text) - WRITE_LOG(GLOB.sql_error_log, "SQL: [text]") - -/proc/log_query_debug(text) - WRITE_LOG(GLOB.query_debug_log, "SQL: [text]") - -/proc/log_topic(text) - if(GLOB.Debug2) - WRITE_LOG(GLOB.diary, "TOPIC: [text]") - -/proc/log_unit_test(text) - to_world_log("## UNIT_TESTS: [text]") - -#ifdef REFERENCE_TRACKING_LOG -#define log_reftracker(msg) WRITE_LOG(GLOB.diary, "## REF SEARCH [msg]") -#else -#define log_reftracker(msg) -#endif - -/proc/log_asset(text) - WRITE_LOG(GLOB.diary, "ASSET: [text]") - -/// Puts the text into the research html file, not log. See [INVESTIGATE_RESEARCH] for [/atom/proc/investigate_log] -/proc/log_research(text) - if(!text) - return - var/html_file = file("[GLOB.log_directory]/[INVESTIGATE_RESEARCH].html") - WRITE_FILE(html_file, "[time_stamp()] [text]
") - -/proc/report_progress(var/progress_message) - admin_notice(span_boldannounce("[progress_message]"), R_DEBUG) - to_world_log(progress_message) - -//pretty print a direction bitflag, can be useful for debugging. -/proc/print_dir(var/dir) - var/list/comps = list() - if(dir & NORTH) comps += "NORTH" - if(dir & SOUTH) comps += "SOUTH" - if(dir & EAST) comps += "EAST" - if(dir & WEST) comps += "WEST" - if(dir & UP) comps += "UP" - if(dir & DOWN) comps += "DOWN" - - return english_list(comps, nothing_text="0", and_text="|", comma_text="|") - -//more or less a logging utility -//Always return "Something/(Something)", even if it's an error message. -/proc/key_name(var/whom, var/include_link = FALSE, var/include_name = TRUE, var/highlight_special_characters = TRUE) - var/mob/M - var/client/C - var/key - - if(!whom) - return "INVALID/INVALID" - if(istype(whom, /client)) - C = whom - M = C.mob - key = C.key - else if(ismob(whom)) - M = whom - C = M.client - key = M.key - else if(istype(whom, /datum/mind)) - var/datum/mind/D = whom - key = D.key - M = D.current - if(D.current) - C = D.current.client - else if(istype(whom, /datum)) - var/datum/D = whom - return "INVALID/([D.type])" - else if(istext(whom)) - return "AUTOMATED/[whom]" //Just give them the text back - else - return "INVALID/INVALID" - - . = "" - - if(key) - if(include_link && C) - . += "" - - if(C && C.holder && C.holder.fakekey) - . += C.holder.rank_names() // CHOMPEdit: Stealth mode displays staff rank in PM Messages - else - . += key - - if(include_link) - if(C) . += "" - else . += " (DC)" - else - . += "INVALID" - - if(include_name) - var/name = "INVALID" - if(M) - if(M.real_name) - name = M.real_name - else if(M.name) - name = M.name - - if(include_link && is_special_character(M) && highlight_special_characters) - name = span_orange("[name]") //Orange - - . += "/([name])" - - return . - -/proc/key_name_admin(var/whom, var/include_name = 1) - return key_name(whom, 1, include_name) - -// Helper procs for building detailed log lines -// -// These procs must not fail under ANY CIRCUMSTANCES! -// - -/datum/proc/log_info_line() - return "[src] ([type])" - -/atom/log_info_line() - . = ..() - var/turf/t = get_turf(src) - if(istype(t)) - return "[.] @ [t.log_info_line()]" - else if(loc) - return "[.] @ ([loc]) (0,0,0) ([loc.type])" - else - return "[.] @ (NULL) (0,0,0) (NULL)" - -/turf/log_info_line() - return "([src]) ([x],[y],[z]) ([type])" - -/mob/log_info_line() - return "[..()] (ckey=[ckey])" - -/proc/log_info_line(var/datum/d) - if(!d) - return "*null*" - if(!istype(d)) - return json_encode(d) - return d.log_info_line() - -/mob/proc/simple_info_line() - return "[key_name(src)] ([x],[y],[z])" - -/client/proc/simple_info_line() - return "[key_name(src)] ([mob.x],[mob.y],[mob.z])" diff --git a/code/_helpers/logging/_logging.dm b/code/_helpers/logging/_logging.dm new file mode 100644 index 0000000000..b38409a1d3 --- /dev/null +++ b/code/_helpers/logging/_logging.dm @@ -0,0 +1,274 @@ +//print a warning message to world.log +#define WARNING(MSG) warning("[MSG] in [__FILE__] at line [__LINE__] src: [UNLINT(src)] usr: [usr].") +/proc/warning(msg) + msg = "## WARNING: [msg]" + log_world(msg) + +//not an error or a warning, but worth to mention on the world log, just in case. +#define NOTICE(MSG) notice(MSG) +/proc/notice(msg) + msg = "## NOTICE: [msg]" + log_world(msg) + +#define SET_SERIALIZATION_SEMVER(semver_list, semver) semver_list[type] = semver +#define CHECK_SERIALIZATION_SEMVER(wanted, actual) (__check_serialization_semver(wanted, actual)) + +/// Checks if the actual semver is equal or later than the wanted semver +/// Must be passed as TEXT; you're probably looking for CHECK_SERIALIZATION_SEMVER, look right above +/proc/__check_serialization_semver(wanted, actual) + if(wanted == actual) + return TRUE + + var/list/wanted_versions = semver_to_list(wanted) + var/list/actual_versions = semver_to_list(actual) + + if(!wanted_versions || !actual_versions) + stack_trace("Invalid semver string(s) passed to __check_serialization_semver: '[wanted]' and '[actual]'") + return FALSE + + if(wanted_versions[1] != actual_versions[1]) + return FALSE // major must always + + if(wanted_versions[2] > actual_versions[2]) + return FALSE // actual must be later than wanted + + // patch is not checked + return TRUE + +//print a testing-mode debug message to world.log and world +#ifdef TESTING +#define testing(msg) log_world("## TESTING: [msg]"); to_chat(world, "## TESTING: [msg]") + +GLOBAL_LIST_INIT(testing_global_profiler, list("_PROFILE_NAME" = "Global")) +// we don't really check if a word or name is used twice, be aware of that +#define testing_profile_start(NAME, LIST) LIST[NAME] = world.timeofday +#define testing_profile_current(NAME, LIST) round((world.timeofday - LIST[NAME])/10,0.1) +#define testing_profile_output(NAME, LIST) testing("[LIST["_PROFILE_NAME"]] profile of [NAME] is [testing_profile_current(NAME,LIST)]s") +#define testing_profile_output_all(LIST) { for(var/_NAME in LIST) { testing_profile_current(,_NAME,LIST); }; }; +#else +#define testing(msg) +#define testing_profile_start(NAME, LIST) +#define testing_profile_current(NAME, LIST) +#define testing_profile_output(NAME, LIST) +#define testing_profile_output_all(LIST) +#endif + +#if defined(UNIT_TESTS) || defined(SPACEMAN_DMM) +/proc/log_test(text) + WRITE_LOG(GLOB.test_log, text) + SEND_TEXT(world.log, text) +#endif + +#if defined(REFERENCE_TRACKING_LOG_APART) +#define log_reftracker(msg) log_harddel("## REF SEARCH [msg]") + +/proc/log_harddel(text) + WRITE_LOG(GLOB.harddel_log, text) + +#elif defined(REFERENCE_TRACKING) // Doing it locally +#define log_reftracker(msg) log_world("## REF SEARCH [msg]") + +#else //Not tracking at all +#define log_reftracker(msg) +#endif + +/** + * Generic logging helper + * + * reads the type of the log + * and writes it to the respective log file + * unless log_globally is FALSE + * Arguments: + * * message - The message being logged + * * message_type - the type of log the message is(ATTACK, SAY, etc) + * * color - color of the log text + * * log_globally - boolean checking whether or not we write this log to the log file + */ +/atom/proc/log_message(message, message_type, color = null, log_globally = TRUE, list/data) + if(!log_globally) + return + + var/log_text = "[key_name_and_tag(src)] [message] [loc_name(src)]" + switch(message_type) + /// ship both attack logs and victim logs to the end of round attack.log just to ensure we don't lose information + if(LOG_ATTACK, LOG_VICTIM) + log_attack(log_text, data) + if(LOG_SAY) + log_say(log_text, data) + if(LOG_WHISPER) + log_whisper(log_text, data) + if(LOG_EMOTE) + log_emote(log_text, data) + if(LOG_PDA) + log_pda(log_text, data) + if(LOG_OOC) + log_ooc(log_text, data) + if(LOG_LOOC) + log_looc(log_text, data) + if(LOG_ADMIN) + log_admin(log_text, data) + if(LOG_ADMIN_PRIVATE) + log_admin_private(log_text, data) + if(LOG_ASAY) + log_adminsay(log_text, data) + if(LOG_GAME) + log_game(log_text, data) + else + stack_trace("Invalid individual logging type: [message_type]. Defaulting to [LOG_GAME] (LOG_GAME).") + log_game(log_text, data) + +/* For logging round startup. */ +/proc/start_log(log) + WRITE_LOG(log, "Starting up round ID [GLOB.round_id].\n-------------------------") + +/* Close open log handles. This should be called as late as possible, and no logging should hapen after. */ +/proc/shutdown_logging() + rustg_log_close_all() + logger.shutdown_logging() + +/* Helper procs for building detailed log lines */ +/proc/key_name(whom, include_link = null, include_name = TRUE) + var/mob/M + var/client/C + var/key + var/ckey + var/fallback_name + + if(!whom) + return "*null*" + if(istype(whom, /client)) + C = whom + M = C.mob + key = C.key + ckey = C.ckey + else if(ismob(whom)) + M = whom + C = M.client + key = M.key + ckey = M.ckey + else if(istext(whom)) + key = whom + ckey = ckey(whom) + C = GLOB.directory[ckey] + if(C) + M = C.mob + else if(istype(whom,/datum/mind)) + var/datum/mind/mind = whom + key = mind.key + ckey = ckey(key) + if(mind.current) + M = mind.current + if(M.client) + C = M.client + else + fallback_name = mind.name + else // Catch-all cases if none of the types above match + var/swhom = null + + if(istype(whom, /atom)) + var/atom/A = whom + swhom = "[A.name]" + else if(isdatum(whom)) + swhom = "[whom]" + + if(!swhom) + swhom = "*invalid*" + + return "\[[swhom]\]" + + . = "" + + if(!ckey) + include_link = FALSE + + if(key) + if(C?.holder && C.holder.fakekey && !include_name) + if(include_link) + . += "" + . += "Administrator" + else + if(include_link) + . += "" + . += key + if(!C) + . += "\[DC\]" + + if(include_link) + . += "" + else + . += "*no key*" + + if(include_name) + if(M) + if(M.real_name) + . += "/([M.real_name])" + else if(M.name) + . += "/([M.name])" + else if(fallback_name) + . += "/([fallback_name])" + + return . + +/proc/key_name_admin(whom, include_name = TRUE) + return key_name(whom, TRUE, include_name) + +/proc/key_name_and_tag(whom, include_link = null, include_name = TRUE) + var/tag = "!tagless!" // whom can be null in key_name() so lets set this as a safety + if(isatom(whom)) + var/atom/subject = whom + tag = subject.tag + return "[key_name(whom, include_link, include_name)] ([tag])" + +/proc/loc_name(atom/A) + if(!istype(A)) + return "(INVALID LOCATION)" + + var/turf/T = A + if (!istype(T)) + T = get_turf(A) + + if(istype(T)) + return "([AREACOORD(T)])" + else if(A.loc) + return "(UNKNOWN (?, ?, ?))" + +// Virgo specific Helper procs for building detailed log lines +// +// These procs must not fail under ANY CIRCUMSTANCES! +// Are these even still required? + +/proc/report_progress(var/progress_message) + admin_notice(span_boldannounce("[progress_message]"), R_DEBUG) + log_world(progress_message) + +/datum/proc/log_info_line() + return "[src] ([type])" + +/atom/log_info_line() + . = ..() + var/turf/t = get_turf(src) + if(istype(t)) + return "[.] @ [t.log_info_line()]" + else if(loc) + return "[.] @ ([loc]) (0,0,0) ([loc.type])" + else + return "[.] @ (NULL) (0,0,0) (NULL)" + +/turf/log_info_line() + return "([src]) ([x],[y],[z]) ([type])" + +/mob/log_info_line() + return "[..()] (ckey=[ckey])" + +/proc/log_info_line(var/datum/d) + if(!d) + return "*null*" + if(!istype(d)) + return json_encode(d) + return d.log_info_line() + +/mob/proc/simple_info_line() + return "[key_name(src)] ([x],[y],[z])" + +/client/proc/simple_info_line() + return "[key_name(src)] ([mob.x],[mob.y],[mob.z])" diff --git a/code/_helpers/logging/admin.dm b/code/_helpers/logging/admin.dm new file mode 100644 index 0000000000..cff42007ac --- /dev/null +++ b/code/_helpers/logging/admin.dm @@ -0,0 +1,42 @@ +/* Items with ADMINPRIVATE prefixed are stripped from public logs. */ + +// For backwards compatibility these are currently also added to LOG_CATEGORY_GAME with their respective prefix +// This is to avoid breaking any existing tools that rely on the old format, but should be removed in the future + +/// General logging for admin actions +/proc/log_admin(text, list/data) + GLOB.admin_activities.Add(text) + logger.Log(LOG_CATEGORY_ADMIN, text, data) + logger.Log(LOG_CATEGORY_COMPAT_GAME, "ADMIN: [text]") + +/// General logging for admin actions +/proc/log_admin_private(text, list/data) + GLOB.admin_activities.Add(text) + logger.Log(LOG_CATEGORY_ADMIN_PRIVATE, text, data) + logger.Log(LOG_CATEGORY_COMPAT_GAME, "ADMINPRIVATE: [text]") + +/// Logging for AdminSay (ASAY) messages +/proc/log_adminsay(text, list/data) + GLOB.admin_activities.Add(text) + logger.Log(LOG_CATEGORY_ADMIN_PRIVATE_ASAY, text, data) + logger.Log(LOG_CATEGORY_COMPAT_GAME, "ADMINPRIVATE: ASAY: [text]") + +/proc/log_modsay(text, list/data) + logger.Log(LOG_CATEGORY_ADMIN_PRIVATE_MSAY, text, data) + logger.Log(LOG_CATEGORY_COMPAT_GAME, "ADMINPRIVATE: MODSAY: [text]") + +/proc/log_eventsay(text, list/data) + logger.Log(LOG_CATEGORY_ADMIN_PRIVATE_ESAY, text, data) + logger.Log(LOG_CATEGORY_COMPAT_GAME, "ADMINPRIVATE: EVENTSAY: [text]") + +/** + * Writes to a special log file if the log_suspicious_login config flag is set, + * which is intended to contain all logins that failed under suspicious circumstances. + * + * Mirrors this log entry to log_access when access_log_mirror is TRUE, so this proc + * doesn't need to be used alongside log_access and can replace it where appropriate. + */ +/proc/log_suspicious_login(text, list/data, access_log_mirror = TRUE) + logger.Log(LOG_CATEGORY_SUSPICIOUS_LOGIN, text) + if(access_log_mirror) + log_access(text) diff --git a/code/_helpers/logging/attack.dm b/code/_helpers/logging/attack.dm new file mode 100644 index 0000000000..69a843023b --- /dev/null +++ b/code/_helpers/logging/attack.dm @@ -0,0 +1,40 @@ +/// Generic attack logging +/proc/log_attack(text, list/data) + logger.Log(LOG_CATEGORY_ATTACK, text, data) + +/** + * Log a combat message in the attack log + * + * Arguments: + * * atom/user - argument is the actor performing the action + * * atom/target - argument is the target of the action + * * what_done - is a verb describing the action (e.g. punched, throwed, kicked, etc.) + * * atom/object - is a tool with which the action was made (usually an item) + * * addition - is any additional text, which will be appended to the rest of the log line + */ +/proc/log_combat(atom/user, atom/target, what_done, atom/object=null, addition=null) + var/ssource = key_name(user) + var/starget = key_name(target) + + var/mob/living/living_target = target + var/hp = istype(living_target) ? " (NEWHP: [living_target.health]) " : "" + + var/sobject = "" + if(object) + sobject = " with [object]" + var/saddition = "" + if(addition) + saddition = " [addition]" + + var/postfix = "[sobject][saddition][hp]" + + var/message = "[what_done] [starget][postfix]" + user.log_message(message, LOG_ATTACK, color="red") + + if(user != target) + var/reverse_message = "was [what_done] by [ssource][postfix]" + target.log_message(reverse_message, LOG_VICTIM, color="orange", log_globally=FALSE) + +/// Log for vore interactions +/proc/log_vore(text, list/data) + logger.Log(LOG_CATEGORY_VORE, text, data) diff --git a/code/_helpers/logging/debug.dm b/code/_helpers/logging/debug.dm index 18bce9523f..752a606956 100644 --- a/code/_helpers/logging/debug.dm +++ b/code/_helpers/logging/debug.dm @@ -1,11 +1,50 @@ +/// Logging for loading and caching assets +/proc/log_asset(text, list/data) + logger.Log(LOG_CATEGORY_DEBUG_ASSET, text, data) + /// Logging for config errors /// Rarely gets called; just here in case the config breaks. /proc/log_config(text, list/data) - var/entry = "CONFIG: " - - entry += text - entry += " | DATA: " - entry += data - - WRITE_LOG(GLOB.diary, entry) + logger.Log(LOG_CATEGORY_CONFIG, text, data) + SEND_TEXT(world.log, text) + +/// Logging for mapping errors +/proc/log_mapping(text, skip_world_log) +#ifdef UNIT_TESTS + GLOB.unit_test_mapping_logs += text +#endif +#ifdef MAP_TEST + message_admins("Mapping: [text]") +#endif + logger.Log(LOG_CATEGORY_DEBUG_MAPPING, text) + if(skip_world_log) + return + SEND_TEXT(world.log, text) + +/// Logging for game performance +/proc/log_perf(list/perf_info) + . = "[perf_info.Join(",")]\n" + WRITE_LOG_NO_FORMAT(GLOB.perf_log, .) + +/// Logging for hard deletes +/proc/log_qdel(text, list/data) + logger.Log(LOG_CATEGORY_QDEL, text, data) + +/* Log to the logfile only. */ +/proc/log_runtime(text, list/data) + logger.Log(LOG_CATEGORY_RUNTIME, text, data) + +/// Logging for DB errors +/proc/log_sql(text, list/data) + logger.Log(LOG_CATEGORY_DEBUG_SQL, text, data) + +/// Logging for world/Topic +/proc/log_topic(text, list/data) + logger.Log(LOG_CATEGORY_GAME_TOPIC, text, data) + +/// Log to both DD and the logfile. +/proc/log_world(text, list/data) +#ifdef USE_CUSTOM_ERROR_HANDLER + logger.Log(LOG_CATEGORY_RUNTIME, text, data) +#endif SEND_TEXT(world.log, text) diff --git a/code/_helpers/logging/game.dm b/code/_helpers/logging/game.dm new file mode 100644 index 0000000000..dc825141d8 --- /dev/null +++ b/code/_helpers/logging/game.dm @@ -0,0 +1,27 @@ +/// Logging for generic/unsorted game messages +/proc/log_game(text, list/data) + logger.Log(LOG_CATEGORY_GAME, text, data) + +/// Logging for emotes +/proc/log_emote(text, list/data) + logger.Log(LOG_CATEGORY_GAME_EMOTE, text, data) + +/// Logging for messages sent in OOC +/proc/log_ooc(text, list/data) + logger.Log(LOG_CATEGORY_GAME_OOC, text, data) + +/// Logging for messages sent in LOOC +/proc/log_looc(text, list/data) + logger.Log(LOG_CATEGORY_GAME_LOOC, text, data) + +/// Logging for prayed messages +/proc/log_prayer(text, list/data) + logger.Log(LOG_CATEGORY_GAME_PRAYER, text, data) + +/// Logging for logging in & out of the game, with error messages. +/proc/log_access(text, list/data) + logger.Log(LOG_CATEGORY_GAME_ACCESS, text, data) + +/// Logging for OOC votes +/proc/log_vote(text, list/data) + logger.Log(LOG_CATEGORY_GAME_VOTE, text, data) diff --git a/code/_helpers/logging/mob.dm b/code/_helpers/logging/mob.dm new file mode 100644 index 0000000000..9db2f0f6db --- /dev/null +++ b/code/_helpers/logging/mob.dm @@ -0,0 +1,54 @@ +/** + * Logs a message to the mob_tags log, including the mobs tag + * Arguments: + * * text - text to log. + */ +/mob/proc/log_mob_tag(text, list/data) + logger.Log(LOG_CATEGORY_DEBUG_MOBTAG, text, data) + +/// Logs a message in a mob's individual log, and in the global logs as well if log_globally is true +/mob/log_message(message, message_type, color = null, log_globally = TRUE, list/data) + if(!LAZYLEN(message)) + stack_trace("Empty message") + return + + // Cannot use the list as a map if the key is a number, so we stringify it (thank you BYOND) + var/smessage_type = num2text(message_type, MAX_BITFLAG_DIGITS) + + if(HAS_CONNECTED_PLAYER(src)) + if(!islist(persistent_client.logging[smessage_type])) + persistent_client.logging[smessage_type] = list() + + if(!islist(logging[smessage_type])) + logging[smessage_type] = list() + + var/colored_message = message + if(color) + if(color[1] == "#") + colored_message = "[message]" + else + colored_message = "[message]" + + //This makes readability a bit better for admins. + switch(message_type) + if(LOG_WHISPER) + colored_message = "(WHISPER) [colored_message]" + if(LOG_OOC) + colored_message = "(OOC) [colored_message]" + if(LOG_LOOC) + colored_message = "(LOOC) [colored_message]" + if(LOG_ASAY) + colored_message = "(ASAY) [colored_message]" + if(LOG_EMOTE) + colored_message = "(EMOTE) [colored_message]" + if(LOG_RADIO_EMOTE) + colored_message = "(RADIOEMOTE) [colored_message]" + + var/list/timestamped_message = list("\[[time_stamp(format = "YYYY-MM-DD hh:mm:ss")]\] [key_name_and_tag(src)] [loc_name(src)] (Event #[LAZYLEN(logging[smessage_type])])" = colored_message) + + logging[smessage_type] += timestamped_message + + if(HAS_CONNECTED_PLAYER(src)) + persistent_client.logging[smessage_type] += timestamped_message + + ..() diff --git a/code/_helpers/logging/pda.dm b/code/_helpers/logging/pda.dm new file mode 100644 index 0000000000..f37aea47ad --- /dev/null +++ b/code/_helpers/logging/pda.dm @@ -0,0 +1,3 @@ +/// Logging for PDA messages sent +/proc/log_pda(text, list/data) + logger.Log(LOG_CATEGORY_PDA, text, data) diff --git a/code/_helpers/logging/research.dm b/code/_helpers/logging/research.dm new file mode 100644 index 0000000000..f352123f9a --- /dev/null +++ b/code/_helpers/logging/research.dm @@ -0,0 +1,6 @@ +/// Puts the text into the research html file, not log. See [INVESTIGATE_RESEARCH] for [/atom/proc/investigate_log] +/proc/log_research(text) + if(!text) + return + var/html_file = file("[GLOB.log_directory]/[INVESTIGATE_RESEARCH].html") + WRITE_FILE(html_file, "[time_stamp(format = "YYYY-MM-DD hh:mm:ss")] [text]
") diff --git a/code/_helpers/logging/talk.dm b/code/_helpers/logging/talk.dm new file mode 100644 index 0000000000..36e8dfb3d8 --- /dev/null +++ b/code/_helpers/logging/talk.dm @@ -0,0 +1,25 @@ +/** + * Helper for logging chat messages or other logs with arbitrary inputs (e.g. announcements) + * + * This proc compiles a log string by prefixing the tag to the message + * and suffixing what it was forced_by if anything + * if the message lacks a tag and suffix then it is logged on its own + * Arguments: + * * message - The message being logged + * * message_type - the type of log the message is(ATTACK, SAY, etc) + * * tag - tag that indicates the type of text(announcement, telepathy, etc) + * * log_globally - boolean checking whether or not we write this log to the log file + * * forced_by - source that forced the dialogue if any + */ +/atom/proc/log_talk(message, message_type, tag = null, log_globally = TRUE, forced_by = null, custom_say_emote = null) + var/prefix = tag ? "([tag]) " : "" + var/suffix = forced_by ? " FORCED by [forced_by]" : "" + log_message("[prefix][custom_say_emote ? "*[custom_say_emote]*, " : ""]\"[message]\"[suffix]", message_type, log_globally = log_globally) + +/// Logging for generic spoken messages +/proc/log_say(text, list/data) + logger.Log(LOG_CATEGORY_GAME_SAY, text, data) + +/// Logging for whispered messages +/proc/log_whisper(text, list/data) + logger.Log(LOG_CATEGORY_GAME_WHISPER, text, data) diff --git a/code/_helpers/logging/ui.dm b/code/_helpers/logging/ui.dm index 57e927c5b3..1c72f314f3 100644 --- a/code/_helpers/logging/ui.dm +++ b/code/_helpers/logging/ui.dm @@ -1,13 +1,17 @@ -/proc/log_href(text) - //WRITE_LOG(GLOB.world_href_log, "HREF: [text]") - WRITE_LOG(GLOB.href_logfile, "HREF: [text]") +/proc/log_href(text, list/data) + logger.Log(LOG_CATEGORY_HREF, text, data) /** * Appends a tgui-related log entry. All arguments are optional. */ -/proc/log_tgui(user, message, context, - datum/tgui_window/window, - datum/src_object) +/proc/log_tgui( + user, + message, + context, + datum/tgui_window/window, + datum/src_object, +) + var/entry = "" // Insert user info if(!user) @@ -32,5 +36,4 @@ // Insert message if(message) entry += "\n[message]" - //WRITE_LOG(GLOB.tgui_log, entry) - WRITE_LOG(GLOB.diary, entry) + logger.Log(LOG_CATEGORY_HREF_TGUI, entry) diff --git a/code/_helpers/logging_vr.dm b/code/_helpers/logging_vr.dm deleted file mode 100644 index a4cd514d56..0000000000 --- a/code/_helpers/logging_vr.dm +++ /dev/null @@ -1,53 +0,0 @@ -/proc/log_nsay(text, inside, mob/speaker) - if (CONFIG_GET(flag/log_say)) - WRITE_LOG(GLOB.diary, "NSAY (NIF:[inside]): [speaker.simple_info_line()]: [html_decode(text)]") - //CHOMPEdit Begin - if(speaker.client) - if(!SSdbcore.IsConnected()) - establish_db_connection() - if(!SSdbcore.IsConnected()) - return null - var/datum/db_query/query_insert = SSdbcore.NewQuery("INSERT INTO erro_dialog (mid, time, ckey, mob, type, message) VALUES (null, NOW(), :sender_ckey, :sender_mob, :message_type, :message_content)", \ - list("sender_ckey" = speaker.ckey, "sender_mob" = speaker.real_name, "message_type" = "nsay", "message_content" = text)) - if(!query_insert.Execute()) - log_debug("Error during logging: "+query_insert.ErrorMsg()) - qdel(query_insert) - return - qdel(query_insert) - //CHOMPEdit End - -/proc/log_nme(text, inside, mob/speaker) - if (CONFIG_GET(flag/log_emote)) - WRITE_LOG(GLOB.diary, "NME (NIF:[inside]): [speaker.simple_info_line()]: [html_decode(text)]") - //CHOMPEdit Begin - if(speaker.client) - if(!SSdbcore.IsConnected()) - establish_db_connection() - if(!SSdbcore.IsConnected()) - return null - var/datum/db_query/query_insert = SSdbcore.NewQuery("INSERT INTO erro_dialog (mid, time, ckey, mob, type, message) VALUES (null, NOW(), :sender_ckey, :sender_mob, :message_type, :message_content)", \ - list("sender_ckey" = speaker.ckey, "sender_mob" = speaker.real_name, "message_type" = "nme", "message_content" = text)) - if(!query_insert.Execute()) - log_debug("Error during logging: "+query_insert.ErrorMsg()) - qdel(query_insert) - return - qdel(query_insert) - //CHOMPEdit End - -/proc/log_subtle(text, mob/speaker) - if (CONFIG_GET(flag/log_emote)) - WRITE_LOG(GLOB.diary, "SUBTLE: [speaker.simple_info_line()]: [html_decode(text)]") - //CHOMPEdit Begin - if(speaker.client) - if(!SSdbcore.IsConnected()) - establish_db_connection() - if(!SSdbcore.IsConnected()) - return null - var/datum/db_query/query_insert = SSdbcore.NewQuery("INSERT INTO erro_dialog (mid, time, ckey, mob, type, message) VALUES (null, NOW(), :sender_ckey, :sender_mob, :message_type, :message_content)", \ - list("sender_ckey" = speaker.ckey, "sender_mob" = speaker.real_name, "message_type" = "subtle", "message_content" = text)) - if(!query_insert.Execute()) - log_debug("Error during logging: "+query_insert.ErrorMsg()) - qdel(query_insert) - return - qdel(query_insert) - //CHOMPEdit End diff --git a/code/_helpers/mobs.dm b/code/_helpers/mobs.dm index f2d222ea79..2f4263d520 100644 --- a/code/_helpers/mobs.dm +++ b/code/_helpers/mobs.dm @@ -150,7 +150,7 @@ Proc for attack log creation, because really why not 6 is additional information, anything that needs to be added */ -/proc/add_attack_logs(mob/user, mob/target, what_done, var/admin_notify = TRUE, var/use_async = TRUE) //CHOMPEdit +/proc/add_attack_logs(mob/user, mob/target, what_done, var/admin_notify = TRUE) if(islist(target)) //Multi-victim adding var/list/targets = target for(var/mob/M in targets) @@ -160,27 +160,11 @@ Proc for attack log creation, because really why not var/user_str = key_name(user) var/target_str = key_name(target) - if(ismob(user)) //CHOMPEdit Begin - if(SSdbcore.Connect()) - user.attack_log += text("\[[time_stamp()]\] [span_red("Attacked [target_str]: [what_done]")]") - var/datum/db_query/query_insert = SSdbcore.NewQuery("INSERT INTO erro_attacklog (id, time, ckey, mob, message) VALUES (null, NOW(), :t_ckey, :t_mob, :t_content)", list("t_ckey" = user.ckey, "t_mob" = user.real_name, "t_content" = "Attacked [target_str]: [what_done]")) - spawn() //Change this to a spawn so it doesn't hold us up - query_insert.Execute(async=use_async) - qdel(query_insert) - //if(SSdbcore.Connect()) - // rustg_sql_query_async(SSdbcore.connection, "INSERT INTO erro_attacklog (id, time, ckey, mob, message) VALUES (null, NOW(), :t_ckey, :t_mob, :t_content)", json_encode(list("t_ckey" = user.ckey, "t_mob" = user.real_name, "t_content" = "Attacked [target_str]: [what_done]"))) + if(ismob(user)) + user.attack_log += text("\[[time_stamp()]\] [span_red("Attacked [target_str]: [what_done]")]") if(ismob(target)) - if(SSdbcore.Connect()) - target.attack_log += text("\[[time_stamp()]\] [span_orange("Attacked by [user_str]: [what_done]")]") - var/datum/db_query/query_insert = SSdbcore.NewQuery("INSERT INTO erro_attacklog (id, time, ckey, mob, message) VALUES (null, NOW(), :t_ckey, :t_mob, :t_content)", list("t_ckey" = target.ckey, "t_mob" = target.real_name, "t_content" = "Attacked by [user_str]: [what_done]")) - spawn() //Change this to a spawn so it doesn't hold us up - if(query_insert) - query_insert.Execute(async=use_async) - qdel(query_insert) - //if(SSdbcore.Connect()) - // rustg_sql_query_async(SSdbcore.connection, "INSERT INTO erro_attacklog (id, time, ckey, mob, message) VALUES (null, NOW(), :t_ckey, :t_mob, :t_content)", json_encode(list("t_ckey" = target.ckey, "t_mob" = target.real_name, "t_content" = "Attacked by [user_str]: [what_done]"))) - //CHOMPEdit End - log_attack(user_str,target_str,what_done) + target.attack_log += text("\[[time_stamp()]\] [span_orange("Attacked by [user_str]: [what_done]")]") + log_combat(user, target, what_done) if(admin_notify) msg_admin_attack("[key_name_admin(user)] vs [target_str]: [what_done]") diff --git a/code/_helpers/stack_trace.dm b/code/_helpers/stack_trace.dm new file mode 100644 index 0000000000..bb2d78de11 --- /dev/null +++ b/code/_helpers/stack_trace.dm @@ -0,0 +1,4 @@ +/// gives us the stack trace from CRASH() without ending the current proc. +/// Do not call directly, use the [stack_trace] macro instead. +/proc/_stack_trace(message, file, line) + CRASH("[message][WORKAROUND_IDENTIFIER][json_encode(list(file, line))][WORKAROUND_IDENTIFIER]") diff --git a/code/_helpers/text.dm b/code/_helpers/text.dm index 10497416e6..400959bfa4 100644 --- a/code/_helpers/text.dm +++ b/code/_helpers/text.dm @@ -669,3 +669,15 @@ GLOBAL_LIST_EMPTY(text_tag_cache) temp = findtextEx(haystack, ascii2text(text2ascii(needles,i)), start, end) //Note: ascii2text(text2ascii) is faster than copytext() if(temp) end = temp return end + +/// Converts a semver string into a list of numbers +/proc/semver_to_list(semver_string) + var/static/regex/semver_regex = regex(@"(\d+)\.(\d+)\.(\d+)", "") + if(!semver_regex.Find(semver_string)) + return null + + return list( + text2num(semver_regex.group[1]), + text2num(semver_regex.group[2]), + text2num(semver_regex.group[3]), + ) diff --git a/code/_helpers/time.dm b/code/_helpers/time.dm index 9eea7fd893..cb923220f3 100644 --- a/code/_helpers/time.dm +++ b/code/_helpers/time.dm @@ -50,11 +50,10 @@ var/next_station_date_change = 1 DAY station_date = num2text((text2num(time2text(REALTIMEOFDAY, "YYYY"))+544)) + "-" + time2text(REALTIMEOFDAY, "MM-DD") //CHOMP EDIT return station_date -//ISO 8601 -/proc/time_stamp() - var/date_portion = time2text(world.timeofday, "YYYY-MM-DD") - var/time_portion = time2text(world.timeofday, "hh:mm:ss") - return "[date_portion]T[time_portion]" +/// Returns UTC timestamp with the specifified format and optionally deciseconds +/proc/time_stamp(format = "hh:mm:ss", show_ds) + var/time_string = time2text(world.timeofday, format, TIMEZONE_UTC) + return show_ds ? "[time_string]:[world.timeofday % 10]" : time_string /* //ChompREMOVE /proc/get_timezone_offset() diff --git a/code/_helpers/turfs.dm b/code/_helpers/turfs.dm index 47d6995e4d..d4e1b08e6d 100644 --- a/code/_helpers/turfs.dm +++ b/code/_helpers/turfs.dm @@ -79,7 +79,7 @@ var/turf/target = locate(dst_origin.x + x_pos, dst_origin.y + y_pos, dst_origin.z + z_pos) if(!target) - error("Null turf in translation @ ([dst_origin.x + x_pos], [dst_origin.y + y_pos], [dst_origin.z + z_pos])") + log_world("## ERROR Null turf in translation @ ([dst_origin.x + x_pos], [dst_origin.y + y_pos], [dst_origin.z + z_pos])") turf_map[source] = target //if target is null, preserve that information in the turf map return turf_map @@ -106,7 +106,7 @@ //You can stay, though. if(istype(T,/turf/space)) - error("Tried to translate a space turf: src=[log_info_line(T)] dst=[log_info_line(B)]") + log_world("## ERROR Tried to translate a space turf: src=[log_info_line(T)] dst=[log_info_line(B)]") return FALSE // TODO - Is this really okay to do nothing? var/turf/X //New Destination Turf diff --git a/code/_helpers/type2type.dm b/code/_helpers/type2type.dm index 026c0e8b99..59cd38a927 100644 --- a/code/_helpers/type2type.dm +++ b/code/_helpers/type2type.dm @@ -8,13 +8,6 @@ * angle2dir */ -//Splits the text of a file at seperator and returns them in a list. -//returns an empty list if the file doesn't exist -/world/proc/file2list(filename, seperator="\n", trim = TRUE) - if (trim) - return splittext(trim(file2text(filename)),seperator) - return splittext(file2text(filename),seperator) - //returns a string the last bit of a type, without the preceeding '/' /proc/type2top(the_type) //handle the builtins manually @@ -36,54 +29,18 @@ else //regex everything else (works for /proc too) return lowertext(replacetext("[the_type]", "[type2parent(the_type)]/", "")) -// Returns an integer given a hexadecimal number string as input. -/proc/hex2num(hex) - if (!istext(hex)) - return - - var/num = 0 - var/power = 1 - var/i = length(hex) - - while (i) - var/char = text2ascii(hex, i) - switch(char) - if(48) pass() // 0 -- do nothing - if(49 to 57) num += (char - 48) * power // 1-9 - if(97, 65) num += power * 10 // A - if(98, 66) num += power * 11 // B - if(99, 67) num += power * 12 // C - if(100, 68) num += power * 13 // D - if(101, 69) num += power * 14 // E - if(102, 70) num += power * 15 // F - else - return - power *= 16 - i-- - return num - -// Returns the hex value of a number given a value assumed to be a base-ten value -/proc/num2hex(num, padlength) - . = "" - while(num > 0) - var/hexdigit = GLOB.hexNums[(num & 0xF) + 1] - . = "[hexdigit][.]" - num >>= 4 //go to the next half-byte - - //pad with zeroes - var/left = padlength - length(.) - while (left-- > 0) - . = "0[.]" - /proc/text2numlist(text, delimiter="\n") var/list/num_list = list() for(var/x in splittext(text, delimiter)) num_list += text2num(x) return num_list -// Splits the text of a file at seperator and returns them in a list. -/proc/file2list(filename, seperator="\n") - return splittext(return_file_text(filename),seperator) +//Splits the text of a file at seperator and returns them in a list. +//returns an empty list if the file doesn't exist +/world/proc/file2list(filename, seperator="\n", trim = TRUE) + if (trim) + return splittext(trim(file2text(filename)),seperator) + return splittext(file2text(filename),seperator) // Turns a direction into text /proc/num2dir(direction) @@ -93,7 +50,7 @@ if (4.0) return EAST if (8.0) return WEST else - to_world_log("UNKNOWN DIRECTION: [direction]") + log_world("UNKNOWN DIRECTION: [direction]") // Turns a direction into text /proc/dir2text(direction) @@ -597,12 +554,13 @@ if(fexists(filename)) . = file2text(filename) if(!. && error_on_invalid_return) - error("File empty ([filename])") + log_world("## ERROR File empty ([filename])") else if(error_on_invalid_return) - error("File not found ([filename])") + log_world("## ERROR File not found ([filename])") catch(var/exception/E) if(error_on_invalid_return) - error("Exception when loading file as string: [E]") + log_world("## ERROR Exception when loading file as string: [E]") + log_runtime(E) /// Return html to load a url. diff --git a/code/_helpers/unsorted.dm b/code/_helpers/unsorted.dm index 0d041757a1..e401845763 100644 --- a/code/_helpers/unsorted.dm +++ b/code/_helpers/unsorted.dm @@ -14,31 +14,6 @@ locate(min(CENTER.x+(RADIUS),world.maxx), min(CENTER.y+(RADIUS),world.maxy), CENTER.z) \ ) -//Inverts the colour of an HTML string -/proc/invertHTML(HTMLstring) - - if (!( istext(HTMLstring) )) - CRASH("Given non-text argument!") - else - if (length(HTMLstring) != 7) - CRASH("Given non-HTML argument!") - var/textr = copytext(HTMLstring, 2, 4) - var/textg = copytext(HTMLstring, 4, 6) - var/textb = copytext(HTMLstring, 6, 8) - var/r = hex2num(textr) - var/g = hex2num(textg) - var/b = hex2num(textb) - textr = num2hex(255 - r) - textg = num2hex(255 - g) - textb = num2hex(255 - b) - if (length(textr) < 2) - textr = text("0[]", textr) - if (length(textg) < 2) - textr = text("0[]", textg) - if (length(textb) < 2) - textr = text("0[]", textb) - return text("#[][][]", textr, textg, textb) - //Returns the middle-most value /proc/dd_range(var/low, var/high, var/num) return max(low,min(high,num)) @@ -1219,7 +1194,7 @@ var/list/WALLITEMS = list( colour = pick(list("FF0000","FF7F00","FFFF00","00FF00","0000FF","4B0082","8F00FF")) else for(var/i=1;i<=3;i++) - var/temp_col = "[num2hex(rand(lower,upper))]" + var/temp_col = "[num2hex(rand(lower,upper), 2)]" if(length(temp_col )<2) temp_col = "0[temp_col]" colour += temp_col @@ -1514,21 +1489,6 @@ var/mob/dview/dview_mob /proc/pass(...) return -//gives us the stack trace from CRASH() without ending the current proc. -/proc/stack_trace(msg) - CRASH(msg) - -/datum/proc/stack_trace(msg) - CRASH(msg) - -GLOBAL_REAL_VAR(list/stack_trace_storage) -/proc/gib_stack_trace() - stack_trace_storage = list() - stack_trace() - stack_trace_storage.Cut(1, min(3,stack_trace_storage.len)) - . = stack_trace_storage - stack_trace_storage = null - // \ref behaviour got changed in 512 so this is necesary to replicate old behaviour. // If it ever becomes necesary to get a more performant REF(), this lies here in wait // #define REF(thing) (thing && istype(thing, /datum) && (thing:datum_flags & DF_USE_TAG) && thing:tag ? "[thing:tag]" : "\ref[thing]") diff --git a/code/_macros.dm b/code/_macros.dm index 7124629bb6..e423455e9a 100644 --- a/code/_macros.dm +++ b/code/_macros.dm @@ -9,34 +9,18 @@ #define RANDOM_BLOOD_TYPE pick(4;"O-", 36;"O+", 3;"A-", 28;"A+", 1;"B-", 20;"B+", 1;"AB-", 5;"AB+") #define DEFAULT_BLOOD_TYPE "A+" -// #define to_chat(target, message) target << message Not anymore! -//#define to_chat to_chat_filename=__FILE__;to_chat_line=__LINE__;to_chat_src=src;__to_chat -//#define to_chat __to_chat -#define to_world(message) to_chat(world, message) -#define to_world_log(message) world.log << message -// TODO - Baystation has this log to crazy places. For now lets just world.log, but maybe look into it later. -#define log_world(message) to_world_log(message) #define to_file(file_entry, source_var) file_entry << source_var #define from_file(file_entry, target_var) file_entry >> target_var #define show_browser(target, browser_content, browser_name) target << browse(browser_content, browser_name) #define send_rsc(target, rsc_content, rsc_name) target << browse_rsc(rsc_content, rsc_name) #define open_link(target, url) target << link(url) -// From TG, might be useful to have. -#define DIRECT_OUTPUT(A, B) A << B -#define DIRECT_INPUT(A, B) A >> B -#define SEND_IMAGE(target, image) DIRECT_OUTPUT(target, image) -#define SEND_SOUND(target, sound) DIRECT_OUTPUT(target, sound) -//#define WRITE_LOG is in logging.dm - #define CanInteract(user, state) (CanUseTopic(user, state) == STATUS_INTERACTIVE) #define sequential_id(key) uniqueness_repository.Generate(/datum/uniqueness_generator/id_sequential, key) #define random_id(key,min_id,max_id) uniqueness_repository.Generate(/datum/uniqueness_generator/id_random, key, min_id, max_id) -#define ARGS_DEBUG log_debug("[__FILE__] - [__LINE__]") ; for(var/arg in args) { log_debug("\t[log_info_line(arg)]") } - #define WORLD_ICON_SIZE 32 //Needed for the R-UST port #define PIXEL_MULTIPLIER WORLD_ICON_SIZE/32 //Needed for the R-UST port diff --git a/code/_onclick/hud/ability_screen_objects.dm b/code/_onclick/hud/ability_screen_objects.dm index 05e48d8bd3..6dda894c59 100644 --- a/code/_onclick/hud/ability_screen_objects.dm +++ b/code/_onclick/hud/ability_screen_objects.dm @@ -273,7 +273,7 @@ // Makes the ability be triggered. The subclasses of this are responsible for carrying it out in whatever way it needs to. /obj/screen/ability/proc/activate() - to_world("[src] had activate() called.") + to_chat(world, "[src] had activate() called.") return // This checks if the ability can be used. @@ -308,7 +308,7 @@ if(object_used && verb_to_call) call(object_used,verb_to_call)(arguments_to_use) // call(object_used,verb_to_call)(arguments_to_use) -// to_world(span_world("Attempted to call([object_used],[verb_to_call])([arguments_to_use])")) +// to_chat(world, span_world("Attempted to call([object_used],[verb_to_call])([arguments_to_use])")) // if(hascall(object_used, verb_to_call)) // call(object_used,verb_to_call)(arguments_to_use) // else diff --git a/code/_onclick/telekinesis.dm b/code/_onclick/telekinesis.dm index 6ef4ee4949..7fadb38a0a 100644 --- a/code/_onclick/telekinesis.dm +++ b/code/_onclick/telekinesis.dm @@ -38,7 +38,7 @@ O.host = user O.focus_object(src) else - warning("Strange attack_tk(): TK([user.has_telegrip()]) empty hand([!user.get_active_hand()])") + WARNING("Strange attack_tk(): TK([user.has_telegrip()]) empty hand([!user.get_active_hand()])") return diff --git a/code/controllers/autotransfer.dm b/code/controllers/autotransfer.dm index f726f68bdc..a8e3702738 100644 --- a/code/controllers/autotransfer.dm +++ b/code/controllers/autotransfer.dm @@ -21,7 +21,7 @@ var/datum/controller/transfer_controller/transfer_controller //VOREStation Edit START if (round_duration_in_ds >= shift_last_vote - 2 MINUTES) shift_last_vote = 1000000000000 //Setting to a stupidly high number since it'll be not used again. //CHOMPEdit - to_world(span_world(span_notice("Warning: This upcoming round-extend vote will be your last chance to vote for shift extension. Wrap up your scenes in the next 60 minutes if the round is extended."))) //CHOMPStation Edit + to_chat(world, span_world(span_notice("Warning: This upcoming round-extend vote will be your last chance to vote for shift extension. Wrap up your scenes in the next 60 minutes if the round is extended."))) //CHOMPStation Edit if (round_duration_in_ds >= shift_hard_end - 1 MINUTE) init_shift_change(null, 1) shift_hard_end = timerbuffer + CONFIG_GET(number/vote_autotransfer_interval) //If shuttle somehow gets recalled, let's force it to call again next time a vote would occur. diff --git a/code/controllers/configuration/configuration.dm b/code/controllers/configuration/configuration.dm index a2f5b2c9d1..116dbd811a 100644 --- a/code/controllers/configuration/configuration.dm +++ b/code/controllers/configuration/configuration.dm @@ -254,7 +254,7 @@ value = new_value E = new_ver else - warning("[new_ver.type] is deprecated but gave no proper return for DeprecationUpdate()") + WARNING("[new_ver.type] is deprecated but gave no proper return for DeprecationUpdate()") var/validated = E.ValidateAndSet(value) if(!validated) diff --git a/code/controllers/configuration/entries/general.dm b/code/controllers/configuration/entries/general.dm index 8c3ec32dbd..4d539335c7 100644 --- a/code/controllers/configuration/entries/general.dm +++ b/code/controllers/configuration/entries/general.dm @@ -19,9 +19,18 @@ /// log messages sent in OOC /datum/config_entry/flag/log_ooc +/// log messages sent in LOOC +/datum/config_entry/flag/log_looc + /// log login/logout /datum/config_entry/flag/log_access +/// Config entry which special logging of failed logins under suspicious circumstances. +/datum/config_entry/flag/log_suspicious_login + +/// log prayers +/datum/config_entry/flag/log_prayer + /// log client say /datum/config_entry/flag/log_say @@ -29,13 +38,12 @@ /datum/config_entry/flag/log_admin protection = CONFIG_ENTRY_LOCKED -/// log debug output -/datum/config_entry/flag/log_debug - default = TRUE - /// log game events /datum/config_entry/flag/log_game +/// log assets +/datum/config_entry/flag/log_asset + /// log voting /datum/config_entry/flag/log_vote @@ -51,8 +59,8 @@ /// log admin chat messages /datum/config_entry/flag/log_adminchat -/// log warnings admins get about bomb construction and such -/datum/config_entry/flag/log_adminwarn +/// log EVENT chat messages +/datum/config_entry/flag/log_eventchat /// log pda messages /datum/config_entry/flag/log_pda @@ -72,9 +80,16 @@ /// logs graffiti /datum/config_entry/flag/log_graffiti +/// log all world.Topic() calls +/datum/config_entry/flag/log_world_topic + /// logs all timers in buckets on automatic bucket reset (Useful for timer debugging) /datum/config_entry/flag/log_timers_on_bucket_reset +/// Log human readable versions of json log entries +/datum/config_entry/flag/log_as_human_readable + default = TRUE + // FIXME: Unused ///datum/config_entry/string/nudge_script_path // where the nudge.py script is located // default = "nudge.py" @@ -194,6 +209,22 @@ config_entry_value = 15 min_val = 0 +/datum/config_entry/number/error_cooldown // The "cooldown" time for each occurrence of a unique error + default = 600 + integer = FALSE + min_val = 0 + +/datum/config_entry/number/error_limit // How many occurrences before the next will silence them + default = 50 + +/datum/config_entry/number/error_silence_time // How long a unique error will be silenced for + default = 6000 + integer = FALSE + +/datum/config_entry/number/error_msg_delay // How long to wait between messaging admins about occurrences of a unique error + default = 50 + integer = FALSE + /datum/config_entry/number/fps default = 20 integer = FALSE @@ -850,3 +881,6 @@ /// If admins with +DEBUG can queue byond-tracy to run the next round. /datum/config_entry/flag/allow_tracy_queue protection = CONFIG_ENTRY_LOCKED + +/// log vore interactions +/datum/config_entry/flag/log_vore diff --git a/code/controllers/globals.dm b/code/controllers/globals.dm index 8a5580ec40..86cda2893c 100644 --- a/code/controllers/globals.dm +++ b/code/controllers/globals.dm @@ -53,7 +53,7 @@ GLOBAL_REAL(GLOB, /datum/controller/global_vars) var/list/global_procs = typesof(/datum/controller/global_vars/proc) var/expected_len = vars.len - gvars_datum_in_built_vars.len if(global_procs.len != expected_len) - warning("Unable to detect all global initialization procs! Expected [expected_len] got [global_procs.len]!") + WARNING("Unable to detect all global initialization procs! Expected [expected_len] got [global_procs.len]!") if(global_procs.len) var/list/expected_global_procs = vars - gvars_datum_in_built_vars for(var/I in global_procs) @@ -65,6 +65,6 @@ GLOBAL_REAL(GLOB, /datum/controller/global_vars) call(src, I)() var/end_tick = world.time if(end_tick - start_tick) - warning("Global [replacetext("[I]", "InitGlobal", "")] slept during initialization!") + WARNING("Global [replacetext("[I]", "InitGlobal", "")] slept during initialization!") //populate_legacy_globals() diff --git a/code/controllers/hooks.dm b/code/controllers/hooks.dm index 20ba87735d..8cfaa59294 100644 --- a/code/controllers/hooks.dm +++ b/code/controllers/hooks.dm @@ -26,14 +26,14 @@ /proc/callHook(hook, list/arguments=null) var/hook_path = text2path("/hook/[hook]") if(!hook_path) - error("Invalid hook '/hook/[hook]' called.") + log_world("## ERROR Invalid hook '/hook/[hook]' called.") return 0 var/requester = new hook_path var/status = 1 for(var/P in typesof("[hook_path]/proc")) if(!call(requester, P)(arglist(arguments))) - error("Hook '[P]' failed or runtimed.") + log_world("## ERROR Hook '[P]' failed or runtimed.") status = 0 return status diff --git a/code/controllers/master.dm b/code/controllers/master.dm index 8730d0c27f..12c767a8f8 100644 --- a/code/controllers/master.dm +++ b/code/controllers/master.dm @@ -506,11 +506,11 @@ ADMIN_VERB(cmd_controller_view_ui, R_SERVER|R_DEBUG, "Controller Overview", "Vie // Gave invalid return value. if(result && !(result in valid_results)) - warning("[subsystem.name] subsystem initialized, returning invalid result [result]. This is a bug.") + WARNING("[subsystem.name] subsystem initialized, returning invalid result [result]. This is a bug.") // just returned ..() or didn't implement Initialize() at all if(result == SS_INIT_NONE) - warning("[subsystem.name] subsystem does not implement Initialize() or it returns ..(). If the former is true, the SS_NO_INIT flag should be set for this subsystem.") + WARNING("[subsystem.name] subsystem does not implement Initialize() or it returns ..(). If the former is true, the SS_NO_INIT flag should be set for this subsystem.") if(result != SS_INIT_FAILURE) // Some form of success, implicit failure, or the SS in unused. diff --git a/code/controllers/master_controller.dm b/code/controllers/master_controller.dm index 6f157b7bcf..6fcf3e8596 100644 --- a/code/controllers/master_controller.dm +++ b/code/controllers/master_controller.dm @@ -16,7 +16,7 @@ var/global/last_tick_duration = 0 /datum/controller/game_controller/New() //There can be only one master_controller. Out with the old and in with the new. if(master_controller != src) - log_debug("Rebuilding Master Controller") + log_world("Rebuilding Master Controller") if(istype(master_controller)) qdel(master_controller) master_controller = src diff --git a/code/controllers/subsystems/air.dm b/code/controllers/subsystems/air.dm index e2f8432da2..1d5cf94623 100644 --- a/code/controllers/subsystems/air.dm +++ b/code/controllers/subsystems/air.dm @@ -167,7 +167,7 @@ Total Unsimulated Turfs: [world.maxx*world.maxy*world.maxz - simulated_turf_coun for(var/turf/T in E.connecting_turfs) edge_log += "+--- Connecting Turf [T] ([T.type]) @ [T.x], [T.y], [T.z] ([T.loc])" - log_debug("Active Edges on ZAS Startup\n" + edge_log.Join("\n")) + log_mapping("Active Edges on ZAS Startup\n" + edge_log.Join("\n")) startup_active_edge_log = edge_log.Copy() return SS_INIT_SUCCESS diff --git a/code/controllers/subsystems/chemistry.dm b/code/controllers/subsystems/chemistry.dm index 6de865b9fd..158b413b5d 100644 --- a/code/controllers/subsystems/chemistry.dm +++ b/code/controllers/subsystems/chemistry.dm @@ -15,7 +15,6 @@ SUBSYSTEM_DEF(chemistry) var/list/chemical_reagents = list() /datum/controller/subsystem/chemistry/Recover() - log_debug("[name] subsystem Recover().") chemical_reactions = SSchemistry.chemical_reactions chemical_reagents = SSchemistry.chemical_reagents diff --git a/code/controllers/subsystems/dbcore.dm b/code/controllers/subsystems/dbcore.dm index b8acc18c9b..aaafbb0282 100644 --- a/code/controllers/subsystems/dbcore.dm +++ b/code/controllers/subsystems/dbcore.dm @@ -84,7 +84,7 @@ SUBSYSTEM_DEF(dbcore) var/datum/db_query/query = popleft(processing_queries) if(world.time - query.last_activity_time > (5 MINUTES)) stack_trace("Found undeleted query, check the sql.log for the undeleted query and add a delete call to the query datum.") - log_debug("Undeleted query: \"[query.sql]\" LA: [query.last_activity] LAT: [query.last_activity_time]") + log_sql("Undeleted query: \"[query.sql]\" LA: [query.last_activity] LAT: [query.last_activity_time]") qdel(query) if(MC_TICK_CHECK) return @@ -141,7 +141,7 @@ SUBSYSTEM_DEF(dbcore) /datum/controller/subsystem/dbcore/Shutdown() shutting_down = TRUE - log_debug("Clearing DB queries standby:[length(queries_standby)] active: [length(queries_active)] all: [length(all_queries)]") + log_sql("Clearing DB queries standby:[length(queries_standby)] active: [length(queries_active)] all: [length(all_queries)]") //This is as close as we can get to the true round end before Disconnect() without changing where it's called, defeating the reason this is a subsystem if(SSdbcore.Connect()) //Execute all waiting queries @@ -162,7 +162,7 @@ SUBSYSTEM_DEF(dbcore) query_round_shutdown.Execute(FALSE) qdel(query_round_shutdown) - log_debug("Done clearing DB queries standby:[length(queries_standby)] active: [length(queries_active)] all: [length(all_queries)]") + log_sql("Done clearing DB queries standby:[length(queries_standby)] active: [length(queries_active)] all: [length(all_queries)]") if(IsConnected()) Disconnect() //stop_db_daemon() @@ -237,7 +237,7 @@ SUBSYSTEM_DEF(dbcore) else connection = null last_error = result["data"] - log_debug("Connect() failed | [last_error]") + log_sql("Connect() failed | [last_error]") ++failed_connections /datum/controller/subsystem/dbcore/proc/CheckSchemaVersion() @@ -245,9 +245,9 @@ SUBSYSTEM_DEF(dbcore) if(Connect()) log_world("Database connection established.") else - log_debug("Your server failed to establish a connection with the database.") + log_sql("Your server failed to establish a connection with the database.") else - log_debug("Database is not enabled in configuration.") + log_sql("Database is not enabled in configuration.") /datum/controller/subsystem/dbcore/proc/InitializeRound() if(!Connect()) @@ -539,12 +539,12 @@ Ignore_errors instructes mysql to continue inserting rows if some of them have e . = (status != DB_QUERY_BROKEN) var/timed_out = !. && findtext(last_error, "Operation timed out") if(!. && log_error) - log_debug("[last_error] | Query used: [sql] | Arguments: [json_encode(arguments)]") + log_sql("[last_error] | Query used: [sql] | Arguments: [json_encode(arguments)]") if(!async && timed_out) - log_debug("Query execution started at [start_time]") - log_debug("Query execution ended at [REALTIMEOFDAY]") - log_debug("Slow query timeout detected.") - log_debug("Query used: [sql]") + log_sql("Query execution started at [start_time]") + log_sql("Query execution ended at [REALTIMEOFDAY]") + log_sql("Slow query timeout detected.") + log_sql("Query used: [sql]") slow_query_check() /// Sleeps until execution of the query has finished. diff --git a/code/controllers/subsystems/events.dm b/code/controllers/subsystems/events.dm index f5b495b8a3..cc5e950913 100644 --- a/code/controllers/subsystems/events.dm +++ b/code/controllers/subsystems/events.dm @@ -58,7 +58,7 @@ SUBSYSTEM_DEF(events) active_events -= E if(!E.event_meta || !E.severity) // datum/event is used here and there for random reasons, maintaining "backwards compatibility" - log_debug("Event of '[E.type]' with missing meta-data has completed.") + log_game("Event of '[E.type]' with missing meta-data has completed.") return finished_events += E @@ -69,7 +69,7 @@ SUBSYSTEM_DEF(events) if(EM.add_to_queue) EC.available_events += EM - log_debug("Event '[EM.name]' has completed at [stationtime2text()].") + log_game("Event '[EM.name]' has completed at [stationtime2text()].") /datum/controller/subsystem/events/proc/delay_events(var/severity, var/delay) var/datum/event_container/EC = event_containers[severity] diff --git a/code/controllers/subsystems/events2.dm b/code/controllers/subsystems/events2.dm index a30d2a970a..8f9f8bb1d8 100644 --- a/code/controllers/subsystems/events2.dm +++ b/code/controllers/subsystems/events2.dm @@ -30,10 +30,10 @@ SUBSYSTEM_DEF(event_ticker) event_started(E) /datum/controller/subsystem/event_ticker/proc/event_started(datum/event2/event/E) - log_debug("Event [E.type] is now being ran.") + log_game("Event [E.type] is now being ran.") active_events += E /datum/controller/subsystem/event_ticker/proc/event_finished(datum/event2/event/E) - log_debug("Event [E.type] has finished.") + log_game("Event [E.type] has finished.") active_events -= E finished_events += E diff --git a/code/controllers/subsystems/game_master.dm b/code/controllers/subsystems/game_master.dm index ae0a268741..0ea110c074 100644 --- a/code/controllers/subsystems/game_master.dm +++ b/code/controllers/subsystems/game_master.dm @@ -21,7 +21,7 @@ SUBSYSTEM_DEF(game_master) var/next_event = 0 // Minimum amount of time of nothingness until the GM can pick something again. - var/debug_messages = FALSE // If true, debug information is written to `log_debug()`. + var/debug_messages = FALSE // If true, debug information is written to `log_world()`. /datum/controller/subsystem/game_master/Initialize() var/list/subtypes = subtypesof(/datum/event2/meta) @@ -116,7 +116,7 @@ SUBSYSTEM_DEF(game_master) // if(hours < 1 && mins <= 20) // Don't do anything for the first twenty minutes of the round. // if(!quiet) -// log_debug("Game Master unable to start event: It is too early.") +// log_game_master("Game Master unable to start event: It is too early.") // return FALSE if(hours >= 2 && mins >= 40) // Don't do anything in the last twenty minutes of the round, as well. if(!quiet) @@ -133,7 +133,7 @@ SUBSYSTEM_DEF(game_master) /datum/controller/subsystem/game_master/proc/log_game_master(message) if(debug_messages) - log_debug("GAME MASTER: [message]") + log_world("GAME MASTER: [message]") // This object makes the actual decisions. diff --git a/code/controllers/subsystems/garbage.dm b/code/controllers/subsystems/garbage.dm index d00060e43c..b1d77a3fc5 100644 --- a/code/controllers/subsystems/garbage.dm +++ b/code/controllers/subsystems/garbage.dm @@ -117,7 +117,7 @@ SUBSYSTEM_DEF(garbage) if(LAZYLEN(I.extra_details)) entry["Deleted Metadata"] = I.extra_details - log_debug("", del_log) + log_qdel("", del_log) /datum/controller/subsystem/garbage/fire() //the fact that this resets its processing each fire (rather then resume where it left off) is intentional. diff --git a/code/controllers/subsystems/job.dm b/code/controllers/subsystems/job.dm index 9cb94996b5..03b6fc3490 100644 --- a/code/controllers/subsystems/job.dm +++ b/code/controllers/subsystems/job.dm @@ -149,7 +149,7 @@ SUBSYSTEM_DEF(job) /datum/controller/subsystem/job/proc/job_debug_message(message) if(debug_messages) - log_debug("JOB DEBUG: [message]") + log_world("JOB DEBUG: [message]") //CHOMPadd start /datum/controller/subsystem/job/proc/load_camp_lists() @@ -163,11 +163,11 @@ SUBSYSTEM_DEF(job) fdel(savepath) var/json_to_file = json_encode(shift_keys) if(!json_to_file) - log_debug("Saving: [savepath] failed jsonencode") + log_world("Saving: [savepath] failed jsonencode") return //Write it out rustg_file_write(json_to_file, savepath) if(!fexists(savepath)) - log_debug("Saving: failed to save [savepath]") + log_world("Saving: failed to save [savepath]") //CHOMPadd end diff --git a/code/controllers/subsystems/machines.dm b/code/controllers/subsystems/machines.dm index 991fac53f1..80ee1e4fc4 100644 --- a/code/controllers/subsystems/machines.dm +++ b/code/controllers/subsystems/machines.dm @@ -192,19 +192,19 @@ SUBSYSTEM_DEF(machines) /datum/controller/subsystem/machines/Recover() for(var/datum/D as anything in SSmachines.networks) if(!istype(D, /datum/pipe_network)) - error("Found wrong type during SSmachinery recovery: list=SSmachines.networks, item=[D], type=[D?.type]") + log_world("## ERROR Found wrong type during SSmachinery recovery: list=SSmachines.networks, item=[D], type=[D?.type]") SSmachines.networks -= D for(var/datum/D as anything in SSmachines.processing_machines) if(!istype(D, /obj/machinery)) - error("Found wrong type during SSmachinery recovery: list=SSmachines.machines, item=[D], type=[D?.type]") + log_world("## ERROR Found wrong type during SSmachinery recovery: list=SSmachines.machines, item=[D], type=[D?.type]") SSmachines.processing_machines -= D for(var/datum/D as anything in SSmachines.powernets) if(!istype(D, /datum/powernet)) - error("Found wrong type during SSmachinery recovery: list=SSmachines.powernets, item=[D], type=[D?.type]") + log_world("## ERROR Found wrong type during SSmachinery recovery: list=SSmachines.powernets, item=[D], type=[D?.type]") SSmachines.powernets -= D for(var/datum/D as anything in SSmachines.powerobjs) if(!istype(D, /obj/item)) - error("Found wrong type during SSmachinery recovery: list=SSmachines.powerobjs, item=[D], type=[D?.type]") + log_world("## ERROR Found wrong type during SSmachinery recovery: list=SSmachines.powerobjs, item=[D], type=[D?.type]") SSmachines.powerobjs -= D all_machines = SSmachines.all_machines diff --git a/code/controllers/subsystems/mapping.dm b/code/controllers/subsystems/mapping.dm index f49d004998..50fb5f2bc9 100644 --- a/code/controllers/subsystems/mapping.dm +++ b/code/controllers/subsystems/mapping.dm @@ -59,7 +59,7 @@ SUBSYSTEM_DEF(mapping) var/turf/T = get_turf(engine_loader) if(!isturf(T)) - to_world_log("[log_info_line(engine_loader)] not on a turf! Cannot place engine template.") + log_mapping("[log_info_line(engine_loader)] not on a turf! Cannot place engine template.") return // Choose an engine type @@ -68,7 +68,7 @@ SUBSYSTEM_DEF(mapping) var/chosen_name = pick(CONFIG_GET(str_list/engine_map)) chosen_type = map_templates[chosen_name] if(!istype(chosen_type)) - error("Configured engine map [chosen_name] is not a valid engine map name!") + log_mapping("Configured engine map [chosen_name] is not a valid engine map name!") if(!istype(chosen_type)) var/list/engine_types = list() for(var/map in map_templates) @@ -76,7 +76,7 @@ SUBSYSTEM_DEF(mapping) if(istype(MT)) engine_types += MT chosen_type = pick(engine_types) - to_world_log("Chose Engine Map: [chosen_type.name]") + log_mapping("Chose Engine Map: [chosen_type.name]") admin_notice(span_danger("Chose Engine Map: [chosen_type.name]"), R_DEBUG) // Annihilate movable atoms @@ -94,12 +94,12 @@ SUBSYSTEM_DEF(mapping) for(var/list/maplist in deffo_load) if(!islist(maplist)) - error("Lateload Z level [maplist] is not a list! Must be in a list!") + log_mapping("Lateload Z level [maplist] is not a list! Must be in a list!") continue for(var/mapname in maplist) var/datum/map_template/MT = map_templates[mapname] if(!istype(MT)) - error("Lateload Z level \"[mapname]\" is not a valid map!") + log_mapping("Lateload Z level \"[mapname]\" is not a valid map!") continue admin_notice("Lateload: [MT]", R_DEBUG) MT.load_new_z(centered = FALSE) @@ -112,7 +112,7 @@ SUBSYSTEM_DEF(mapping) return if(!islist(picklist)) //So you can have a 'chain' of z-levels that make up one away mission - error("Randompick Z level [picklist] is not a list! Must be in a list!") + log_mapping("Randompick Z level [picklist] is not a list! Must be in a list!") return for(var/map in picklist) @@ -122,7 +122,7 @@ SUBSYSTEM_DEF(mapping) map = pick(map) var/datum/map_template/MT = map_templates[map] if(!istype(MT)) - error("Randompick Z level \"[map]\" is not a valid map!") + log_mapping("Randompick Z level \"[map]\" is not a valid map!") else admin_notice("Gateway: [MT]", R_DEBUG) MT.load_new_z(centered = FALSE) @@ -134,7 +134,7 @@ SUBSYSTEM_DEF(mapping) return if(!islist(picklist)) //So you can have a 'chain' of z-levels that make up one away mission - error("Randompick Z level [picklist] is not a list! Must be in a list!") + log_mapping("Randompick Z level [picklist] is not a list! Must be in a list!") return for(var/map in picklist) @@ -144,7 +144,7 @@ SUBSYSTEM_DEF(mapping) map = pick(map) var/datum/map_template/MT = map_templates[map] if(!istype(MT)) - error("Randompick Z level \"[map]\" is not a valid map!") + log_mapping("Randompick Z level \"[map]\" is not a valid map!") else admin_notice("OM Adventure: [MT]", R_DEBUG) MT.load_new_z(centered = FALSE) @@ -156,7 +156,7 @@ SUBSYSTEM_DEF(mapping) return if(!islist(picklist)) //So you can have a 'chain' of z-levels that make up one away mission - error("Randompick Z level [picklist] is not a list! Must be in a list!") + log_mapping("Randompick Z level [picklist] is not a list! Must be in a list!") return for(var/map in picklist) @@ -166,7 +166,7 @@ SUBSYSTEM_DEF(mapping) map = pick(map) var/datum/map_template/MT = map_templates[map] if(!istype(MT)) - error("Randompick Z level \"[map]\" is not a valid map!") + log_mapping("Randompick Z level \"[map]\" is not a valid map!") else admin_notice("Redgate: [MT]", R_DEBUG) MT.load_new_z(centered = FALSE) diff --git a/code/controllers/subsystems/media_tracks.dm b/code/controllers/subsystems/media_tracks.dm index 3f2693bc52..28c2e5ae21 100644 --- a/code/controllers/subsystems/media_tracks.dm +++ b/code/controllers/subsystems/media_tracks.dm @@ -23,33 +23,33 @@ SUBSYSTEM_DEF(media_tracks) report_progress("Loading jukebox track: [filename]") if(!fexists(filename)) - error("File not found: [filename]") + log_world("## ERROR File not found: [filename]") continue var/list/jsonData = json_decode(file2text(filename)) if(!istype(jsonData)) - error("Failed to read tracks from [filename], json_decode failed.") + log_world("## ERROR Failed to read tracks from [filename], json_decode failed.") continue for(var/entry in jsonData) // Critical problems that will prevent the track from working if(!istext(entry["url"])) - error("Jukebox entry in [filename]: bad or missing 'url'. Tracks must have a URL.") + log_world("## ERROR Jukebox entry in [filename]: bad or missing 'url'. Tracks must have a URL.") continue if(!istext(entry["title"])) - error("Jukebox entry in [filename]: bad or missing 'title'. Tracks must have a title.") + log_world("## ERROR Jukebox entry in [filename]: bad or missing 'title'. Tracks must have a title.") continue if(!isnum(entry["duration"])) - error("Jukebox entry in [filename]: bad or missing 'duration'. Tracks must have a duration (in deciseconds).") + log_world("## ERROR Jukebox entry in [filename]: bad or missing 'duration'. Tracks must have a duration (in deciseconds).") continue // Noncritical problems, we can keep going anyway, but warn so it can be fixed if(!istext(entry["artist"])) - warning("Jukebox entry in [filename], [entry["title"]]: bad or missing 'artist'. Please consider crediting the artist.") + WARNING("Jukebox entry in [filename], [entry["title"]]: bad or missing 'artist'. Please consider crediting the artist.") if(!istext(entry["genre"])) - warning("Jukebox entry in [filename], [entry["title"]]: bad or missing 'genre'. Please consider adding a genre.") + WARNING("Jukebox entry in [filename], [entry["title"]]: bad or missing 'genre'. Please consider adding a genre.") var/datum/track/T = new(entry["url"], entry["title"], entry["duration"], entry["artist"], entry["genre"]) diff --git a/code/controllers/subsystems/overmap_renamer_vr.dm b/code/controllers/subsystems/overmap_renamer_vr.dm index 4880dbbdc9..5004a24944 100644 --- a/code/controllers/subsystems/overmap_renamer_vr.dm +++ b/code/controllers/subsystems/overmap_renamer_vr.dm @@ -28,8 +28,8 @@ if we end up with multiple renamable lateload overmap objects.*/ V.modify_descriptors() if(V.visitable_renamed) //could just if(D.modify_descriptors()), but having a var recording renaming is useful for debugging and stuff! if(V.known) - to_world_log("##Overmap Renamer: Renamed Debris Field as: [V.name]") + log_mapping("##Overmap Renamer: Renamed Debris Field as: [V.name]") admin_notice(span_danger("Debris Field name chosen as [V.name]"), R_DEBUG) else - to_world_log("##Overmap Renamer: Renamed Debris Field as: [V.real_name]") + log_mapping("##Overmap Renamer: Renamed Debris Field as: [V.real_name]") admin_notice(span_danger("Debris Field name chosen as [V.real_name]"), R_DEBUG) diff --git a/code/controllers/subsystems/pathfinder_ch.dm b/code/controllers/subsystems/pathfinder_ch.dm index 3c74e284ea..9bda44d372 100644 --- a/code/controllers/subsystems/pathfinder_ch.dm +++ b/code/controllers/subsystems/pathfinder_ch.dm @@ -63,21 +63,21 @@ SUBSYSTEM_DEF(pathfinder) stoplag(1) if(world.time > started + PATHFINDER_TIMEOUT) stack_trace("pathfinder timeout; check debug logs.") - log_debug("pathfinder timeout of instance with debug variables [instance.debug_log_string()]") + log_runtime("pathfinder timeout of instance with debug variables [instance.debug_log_string()]") return else while(pathfinding_mutex) stoplag(3) if(world.time > started + PATHFINDER_TIMEOUT) stack_trace("pathfinder timeout; check debug logs.") - log_debug("pathfinder timeout of instance with debug variables [instance.debug_log_string()]") + log_runtime("pathfinder timeout of instance with debug variables [instance.debug_log_string()]") return --pathfinding_blocked pathfinding_mutex = TRUE . = instance.search() if(world.time > started + PATHFINDER_TIMEOUT) stack_trace("pathfinder timeout; check debug logs.") - log_debug("pathfinder timeout of instance with debug variables [instance.debug_log_string()]") + log_runtime("pathfinder timeout of instance with debug variables [instance.debug_log_string()]") pathfinding_mutex = FALSE #undef PATHFINDER_TIMEOUT diff --git a/code/controllers/subsystems/pois.dm b/code/controllers/subsystems/pois.dm index 053e6abfc1..f63f19d152 100644 --- a/code/controllers/subsystems/pois.dm +++ b/code/controllers/subsystems/pois.dm @@ -12,7 +12,7 @@ SUBSYSTEM_DEF(points_of_interest) /datum/controller/subsystem/points_of_interest/Initialize() while (poi_queue.len) load_next_poi() - to_world_log("Initializing POIs") + log_mapping("Initializing POIs") admin_notice(span_danger("Initializing POIs"), R_DEBUG) return SS_INIT_SUCCESS @@ -50,7 +50,7 @@ SUBSYSTEM_DEF(points_of_interest) return var/turf/T = get_turf(poi_to_load) if(!isturf(T)) - to_world_log("[log_info_line(poi_to_load)] not on a turf! Cannot place poi template.") + log_mapping("[log_info_line(poi_to_load)] not on a turf! Cannot place poi template.") return // Choose a poi diff --git a/code/controllers/subsystems/processing/bellies_vr.dm b/code/controllers/subsystems/processing/bellies_vr.dm index ad2a3e23e8..11b49b570c 100644 --- a/code/controllers/subsystems/processing/bellies_vr.dm +++ b/code/controllers/subsystems/processing/bellies_vr.dm @@ -9,12 +9,12 @@ PROCESSING_SUBSYSTEM_DEF(bellies) runlevels = RUNLEVEL_GAME|RUNLEVEL_POSTGAME /datum/controller/subsystem/processing/bellies/Recover() - log_debug("[name] subsystem Recover().") + log_runtime("[name] subsystem Recover().") if(SSbellies.current_thing) - log_debug("current_thing was: (\ref[SSbellies.current_thing])[SSbellies.current_thing]([SSbellies.current_thing.type]) - currentrun: [SSbellies.currentrun.len] vs total: [SSbellies.processing.len]") + log_runtime("current_thing was: (\ref[SSbellies.current_thing])[SSbellies.current_thing]([SSbellies.current_thing.type]) - currentrun: [SSbellies.currentrun.len] vs total: [SSbellies.processing.len]") var/list/old_processing = SSbellies.processing.Copy() for(var/datum/D in old_processing) if(!isbelly(D)) - log_debug("[name] subsystem Recover() found inappropriate item in list: [D.type]") + log_runtime("[name] subsystem Recover() found inappropriate item in list: [D.type]") if(CHECK_BITFIELD(D.datum_flags, DF_ISPROCESSING)) processing |= D diff --git a/code/controllers/subsystems/processing/fastprocess.dm b/code/controllers/subsystems/processing/fastprocess.dm index 407477f9b0..91e0de8775 100644 --- a/code/controllers/subsystems/processing/fastprocess.dm +++ b/code/controllers/subsystems/processing/fastprocess.dm @@ -7,9 +7,9 @@ PROCESSING_SUBSYSTEM_DEF(fastprocess) flags = SS_NO_INIT /datum/controller/subsystem/processing/fastprocess/Recover() - log_debug("[name] subsystem Recover().") + log_runtime("[name] subsystem Recover().") if(SSfastprocess.current_thing) - log_debug("current_thing was: (\ref[SSfastprocess.current_thing])[SSfastprocess.current_thing]([SSfastprocess.current_thing.type]) - currentrun: [SSfastprocess.currentrun.len] vs total: [SSfastprocess.processing.len]") + log_runtime("current_thing was: (\ref[SSfastprocess.current_thing])[SSfastprocess.current_thing]([SSfastprocess.current_thing.type]) - currentrun: [SSfastprocess.currentrun.len] vs total: [SSfastprocess.processing.len]") var/list/old_processing = SSfastprocess.processing.Copy() for(var/datum/D in old_processing) if(CHECK_BITFIELD(D.datum_flags, DF_ISPROCESSING)) diff --git a/code/controllers/subsystems/processing/obj.dm b/code/controllers/subsystems/processing/obj.dm index 8812a59663..8f4f562e1d 100644 --- a/code/controllers/subsystems/processing/obj.dm +++ b/code/controllers/subsystems/processing/obj.dm @@ -5,12 +5,12 @@ PROCESSING_SUBSYSTEM_DEF(obj) wait = 20 /datum/controller/subsystem/processing/obj/Recover() - log_debug("[name] subsystem Recover().") + log_runtime("[name] subsystem Recover().") if(SSobj.current_thing) - log_debug("current_thing was: (\ref[SSobj.current_thing])[SSobj.current_thing]([SSobj.current_thing.type]) - currentrun: [SSobj.currentrun.len] vs total: [SSobj.processing.len]") + log_runtime("current_thing was: (\ref[SSobj.current_thing])[SSobj.current_thing]([SSobj.current_thing.type]) - currentrun: [SSobj.currentrun.len] vs total: [SSobj.processing.len]") var/list/old_processing = SSobj.processing.Copy() for(var/datum/D in old_processing) if(!isobj(D)) - log_debug("[name] subsystem Recover() found inappropriate item in list: [D.type]") + log_runtime("[name] subsystem Recover() found inappropriate item in list: [D.type]") if(CHECK_BITFIELD(D.datum_flags, DF_ISPROCESSING)) processing |= D diff --git a/code/controllers/subsystems/processing/processing.dm b/code/controllers/subsystems/processing/processing.dm index 42ebfba08c..fb9d6d16e6 100644 --- a/code/controllers/subsystems/processing/processing.dm +++ b/code/controllers/subsystems/processing/processing.dm @@ -16,9 +16,9 @@ SUBSYSTEM_DEF(processing) var/datum/current_thing /datum/controller/subsystem/processing/Recover() - log_debug("[name] subsystem Recover().") + log_runtime("[name] subsystem Recover().") if(SSprocessing.current_thing) - log_debug("current_thing was: (\ref[SSprocessing.current_thing])[SSprocessing.current_thing]([SSprocessing.current_thing.type]) - currentrun: [SSprocessing.currentrun.len] vs total: [SSprocessing.processing.len]") + log_runtime("current_thing was: (\ref[SSprocessing.current_thing])[SSprocessing.current_thing]([SSprocessing.current_thing.type]) - currentrun: [SSprocessing.currentrun.len] vs total: [SSprocessing.processing.len]") var/list/old_processing = SSprocessing.processing.Copy() for(var/datum/D in old_processing) if(CHECK_BITFIELD(D.datum_flags, DF_ISPROCESSING)) @@ -66,7 +66,6 @@ SUBSYSTEM_DEF(processing) msg += "- Process subsystems are processed tail-first -\n" if(!currentrun || !processing) msg += "ERROR: A critical list [currentrun ? "processing" : "currentrun"] is gone!" - log_game(msg) log_world(msg) return msg += "Lists: current_run: [currentrun.len], processing: [processing.len]\n" @@ -93,7 +92,6 @@ SUBSYSTEM_DEF(processing) for(var/i in start to end) msg += "[describeThis(processing[i])][i == position ? " << TAIL" : ""]\n" msg += "---\n" - log_game(msg) log_world(msg) /datum/proc/DebugSubsystemProcess(var/wait, var/times_fired, var/datum/controller/subsystem/processing/subsystem) diff --git a/code/controllers/subsystems/processing/projectiles.dm b/code/controllers/subsystems/processing/projectiles.dm index 3e5e1b2127..f901b3125a 100644 --- a/code/controllers/subsystems/processing/projectiles.dm +++ b/code/controllers/subsystems/processing/projectiles.dm @@ -9,9 +9,9 @@ PROCESSING_SUBSYSTEM_DEF(projectiles) var/global_iterations_per_move = 16 /datum/controller/subsystem/processing/projectiles/Recover() - log_debug("[name] subsystem Recover().") + log_runtime("[name] subsystem Recover().") if(SSprojectiles.current_thing) - log_debug("current_thing was: (\ref[SSprojectiles.current_thing])[SSprojectiles.current_thing]([SSprojectiles.current_thing.type]) - currentrun: [SSprojectiles.currentrun.len] vs total: [SSprojectiles.processing.len]") + log_runtime("current_thing was: (\ref[SSprojectiles.current_thing])[SSprojectiles.current_thing]([SSprojectiles.current_thing.type]) - currentrun: [SSprojectiles.currentrun.len] vs total: [SSprojectiles.processing.len]") var/list/old_processing = SSprojectiles.processing.Copy() for(var/datum/D in old_processing) if(CHECK_BITFIELD(D.datum_flags, DF_ISPROCESSING)) diff --git a/code/controllers/subsystems/processing/turfs.dm b/code/controllers/subsystems/processing/turfs.dm index 509ec4f17b..bb1044bc43 100644 --- a/code/controllers/subsystems/processing/turfs.dm +++ b/code/controllers/subsystems/processing/turfs.dm @@ -4,12 +4,12 @@ PROCESSING_SUBSYSTEM_DEF(turfs) flags = SS_NO_INIT /datum/controller/subsystem/processing/turfs/Recover() - log_debug("[name] subsystem Recover().") + log_runtime("[name] subsystem Recover().") if(SSturfs.current_thing) - log_debug("current_thing was: (\ref[SSturfs.current_thing])[SSturfs.current_thing]([SSturfs.current_thing.type]) - currentrun: [SSturfs.currentrun.len] vs total: [SSturfs.processing.len]") + log_runtime("current_thing was: (\ref[SSturfs.current_thing])[SSturfs.current_thing]([SSturfs.current_thing.type]) - currentrun: [SSturfs.currentrun.len] vs total: [SSturfs.processing.len]") var/list/old_processing = SSturfs.processing.Copy() for(var/datum/D in old_processing) if(!isturf(D)) - log_debug("[name] subsystem Recover() found inappropriate item in list: [D.type]") + log_runtime("[name] subsystem Recover() found inappropriate item in list: [D.type]") if(CHECK_BITFIELD(D.datum_flags, DF_ISPROCESSING)) processing |= D diff --git a/code/controllers/subsystems/reflect_ch.dm b/code/controllers/subsystems/reflect_ch.dm index 0c8fcfa394..da3e4f80e3 100644 --- a/code/controllers/subsystems/reflect_ch.dm +++ b/code/controllers/subsystems/reflect_ch.dm @@ -14,9 +14,9 @@ SUBSYSTEM_DEF(reflector) var/obj/structure/reflector/current_thing /datum/controller/subsystem/reflector/Recover() - log_debug("[name] subsystem Recover().") + log_runtime("[name] subsystem Recover().") if(SSreflector.current_thing) - log_debug("current_thing was: (\ref[SSreflector.current_thing])[SSreflector.current_thing]([SSreflector.current_thing.type]) - currentrun: [SSreflector.currentrun.len] vs total: [SSreflector.processing.len]") + log_runtime("current_thing was: (\ref[SSreflector.current_thing])[SSreflector.current_thing]([SSreflector.current_thing.type]) - currentrun: [SSreflector.currentrun.len] vs total: [SSreflector.processing.len]") var/list/old_processing = SSreflector.processing.Copy() for(var/datum/D in old_processing) if(CHECK_BITFIELD(D.datum_flags, DF_ISPROCESSING)) diff --git a/code/controllers/subsystems/shuttles.dm b/code/controllers/subsystems/shuttles.dm index ac8825feb4..ded9b4c462 100644 --- a/code/controllers/subsystems/shuttles.dm +++ b/code/controllers/subsystems/shuttles.dm @@ -58,7 +58,7 @@ SUBSYSTEM_DEF(shuttles) var/datum/shuttle/S = working_shuttles[working_shuttles.len] working_shuttles.len-- if(!istype(S) || QDELETED(S)) - error("Bad entry in SSshuttles.process_shuttles - [log_info_line(S)] ") + log_world("## ERROR Bad entry in SSshuttles.process_shuttles - [log_info_line(S)] ") process_shuttles -= S continue // NOTE - In old system, /datum/shuttle/ferry was processed only if (F.process_state || F.always_process) @@ -147,7 +147,7 @@ SUBSYSTEM_DEF(shuttles) if(initial(shuttle.category) != shuttle_type) // Skip if its an "abstract class" datum shuttle = new shuttle() shuttle_areas |= shuttle.shuttle_area - log_debug("Initialized shuttle [shuttle] ([shuttle.type])") + log_world("Initialized shuttle [shuttle] ([shuttle.type])") return shuttle // Historical note: No need to call shuttle.init_docking_controllers(), controllers register themselves // and shuttles fetch refs in New(). Shuttles also dock() themselves in new if they want. @@ -161,7 +161,7 @@ SUBSYSTEM_DEF(shuttles) S.motherdock = S.current_location.landmark_tag mothership.shuttle_area |= S.shuttle_area else - error("Shuttle [S] was unable to find mothership [mothership]!") + log_world("## ERROR Shuttle [S] was unable to find mothership [mothership]!") // Let shuttles scan their owned areas for objects they want to configure (Called after mothership hookup) /datum/controller/subsystem/shuttles/proc/hook_up_shuttle_objects(shuttles_list) diff --git a/code/controllers/subsystems/sqlite.dm b/code/controllers/subsystems/sqlite.dm index bb2da0b118..1857a7db6f 100644 --- a/code/controllers/subsystems/sqlite.dm +++ b/code/controllers/subsystems/sqlite.dm @@ -24,10 +24,10 @@ SUBSYSTEM_DEF(sqlite) if(!sqlite_db) - to_world_log("Failed to load or create a SQLite database.") - log_debug("ERROR: SQLite database is active in config but failed to load.") + log_sql("Failed to load or create a SQLite database.") + log_sql("ERROR: SQLite database is active in config but failed to load.") else - to_world_log("Sqlite database connected.") + log_sql("Sqlite database connected.") // Makes the tables, if they do not already exist in the sqlite file. /datum/controller/subsystem/sqlite/proc/init_schema(database/sqlite_object) @@ -66,7 +66,7 @@ SUBSYSTEM_DEF(sqlite) // The desc parameter should be unique for each call, to make it easier to track down where the error occured. /datum/controller/subsystem/sqlite/proc/sqlite_check_for_errors(var/database/query/query_used, var/desc) if(query_used && query_used.ErrorMsg()) - log_debug("SQLite Error: [desc] : [query_used.ErrorMsg()]") + log_sql("SQLite Error: [desc] : [query_used.ErrorMsg()]") return TRUE return FALSE @@ -171,7 +171,7 @@ SUBSYSTEM_DEF(sqlite) // This stops mods/admins/etc from guessing the author by shoving names in an MD5 hasher until they pick the right one. // Don't use this for things needing actual security. /datum/controller/subsystem/sqlite/proc/get_feedback_pepper() - var/pepper_file = file2list("config/sqlite_feedback_pepper.txt") + var/pepper_file = world.file2list("config/sqlite_feedback_pepper.txt") var/pepper = null for(var/line in pepper_file) if(!line) diff --git a/code/controllers/subsystems/supply.dm b/code/controllers/subsystems/supply.dm index 1d07c787d0..d3788fbfe4 100644 --- a/code/controllers/subsystems/supply.dm +++ b/code/controllers/subsystems/supply.dm @@ -170,7 +170,7 @@ SUBSYSTEM_DEF(supply) A.req_access = L.Copy() LAZYCLEARLIST(A.req_one_access) else - log_debug(span_danger("Supply pack with invalid access restriction [SP.access] encountered!")) + log_runtime(span_danger("Supply pack with invalid access restriction [SP.access] encountered!")) //supply manifest generation begin var/obj/item/paper/manifest/slip diff --git a/code/controllers/subsystems/ticker.dm b/code/controllers/subsystems/ticker.dm index d25a8aa500..5f94f93234 100644 --- a/code/controllers/subsystems/ticker.dm +++ b/code/controllers/subsystems/ticker.dm @@ -176,7 +176,7 @@ SUBSYSTEM_DEF(ticker) end_game_state = END_GAME_MODE_FINISHED // Only do this cleanup once! mode.cleanup() //call a transfer shuttle vote - to_world(span_boldannounce("The round has ended!")) + to_chat(world, span_boldannounce("The round has ended!")) SSvote.start_vote(new /datum/vote/crew_transfer) // FIXME: IMPROVE THIS LATER! @@ -184,7 +184,7 @@ SUBSYSTEM_DEF(ticker) post_game_tick() if (world.time - last_restart_notify >= 1 MINUTE && !delay_end) - to_world(span_boldannounce("Restarting in [round(restart_timeleft/600, 1)] minute\s.")) + to_chat(world, span_boldannounce("Restarting in [round(restart_timeleft/600, 1)] minute\s.")) last_restart_notify = world.time /datum/controller/subsystem/ticker/proc/setup() @@ -276,7 +276,7 @@ SUBSYSTEM_DEF(ticker) var/list/runnable_modes = config.get_runnable_modes() if((GLOB.master_mode == "random") || (GLOB.master_mode == "secret")) if(!runnable_modes.len) - to_world(span_filter_system(span_bold("Unable to choose playable game mode.") + " Reverting to pregame lobby.")) + to_chat(world, span_filter_system(span_bold("Unable to choose playable game mode.") + " Reverting to pregame lobby.")) return 0 if(GLOB.secret_force_mode != "secret") src.mode = config.pick_mode(GLOB.secret_force_mode) @@ -289,7 +289,7 @@ SUBSYSTEM_DEF(ticker) src.mode = config.pick_mode(GLOB.master_mode) if(!src.mode) - to_world(span_boldannounce("Serious error in mode setup! Reverting to pregame lobby.")) //Uses setup instead of set up due to computational context. + to_chat(world, span_boldannounce("Serious error in mode setup! Reverting to pregame lobby.")) //Uses setup instead of set up due to computational context. return 0 job_master.ResetOccupations() @@ -298,21 +298,21 @@ SUBSYSTEM_DEF(ticker) job_master.DivideOccupations() // Apparently important for new antagonist system to register specific job antags properly. if(!src.mode.can_start()) - to_world(span_filter_system(span_bold("Unable to start [mode.name].") + " Not enough players readied, [CONFIG_GET(keyed_list/player_requirements)[mode.config_tag]] players needed. Reverting to pregame lobby.")) + to_chat(world, span_filter_system(span_bold("Unable to start [mode.name].") + " Not enough players readied, [CONFIG_GET(keyed_list/player_requirements)[mode.config_tag]] players needed. Reverting to pregame lobby.")) mode.fail_setup() mode = null job_master.ResetOccupations() return 0 if(hide_mode) - to_world(span_world(span_notice("The current game mode is - Secret!"))) + to_chat(world, span_world(span_notice("The current game mode is - Secret!"))) if(runnable_modes.len) var/list/tmpmodes = list() for (var/datum/game_mode/M in runnable_modes) tmpmodes+=M.name tmpmodes = sortList(tmpmodes) if(tmpmodes.len) - to_world(span_filter_system(span_bold("Possibilities:") + " [english_list(tmpmodes, and_text= "; ", comma_text = "; ")]")) + to_chat(world, span_filter_system(span_bold("Possibilities:") + " [english_list(tmpmodes, and_text= "; ", comma_text = "; ")]")) else src.mode.announce() return 1 @@ -327,7 +327,7 @@ SUBSYSTEM_DEF(ticker) feedback_set_details("end_proper", "nuke") restart_timeleft = 1 MINUTE // No point waiting five minutes if everyone's dead. if(!delay_end) - to_world(span_boldannounce("Rebooting due to destruction of [station_name()] in [round(restart_timeleft/600)] minute\s.")) + to_chat(world, span_boldannounce("Rebooting due to destruction of [station_name()] in [round(restart_timeleft/600)] minute\s.")) last_restart_notify = world.time else feedback_set_details("end_proper", "proper completion") diff --git a/code/controllers/subsystems/time_track.dm b/code/controllers/subsystems/time_track.dm index 239e99c0b6..eed18d3e27 100644 --- a/code/controllers/subsystems/time_track.dm +++ b/code/controllers/subsystems/time_track.dm @@ -1,7 +1,6 @@ SUBSYSTEM_DEF(time_track) name = "Time Tracking" - wait = 600 - flags = SS_NO_INIT|SS_NO_TICK_CHECK + wait = 100 runlevels = RUNLEVEL_LOBBY | RUNLEVELS_DEFAULT var/time_dilation_current = 0 @@ -15,6 +14,70 @@ SUBSYSTEM_DEF(time_track) var/last_tick_realtime = 0 var/last_tick_byond_time = 0 var/last_tick_tickcount = 0 + var/list/sendmaps_names_map = list( + "SendMaps" = "send_maps", + "SendMaps: Initial housekeeping" = "initial_house", + "SendMaps: Cleanup" = "cleanup", + "SendMaps: Client loop" = "client_loop", + "SendMaps: Per client" = "per_client", + "SendMaps: Per client: Deleted images" = "deleted_images", + "SendMaps: Per client: HUD update" = "hud_update", + "SendMaps: Per client: Statpanel update" = "statpanel_update", + "SendMaps: Per client: Map data" = "map_data", + "SendMaps: Per client: Map data: Check eye position" = "check_eye_pos", + "SendMaps: Per client: Map data: Update chunks" = "update_chunks", + "SendMaps: Per client: Map data: Send turfmap updates" = "turfmap_updates", + "SendMaps: Per client: Map data: Send changed turfs" = "changed_turfs", + "SendMaps: Per client: Map data: Send turf chunk info" = "turf_chunk_info", + "SendMaps: Per client: Map data: Send obj changes" = "obj_changes", + "SendMaps: Per client: Map data: Send mob changes" = "mob_changes", + "SendMaps: Per client: Map data: Send notable turf visual contents" = "send_turf_vis_conts", + "SendMaps: Per client: Map data: Send pending animations" = "pending_animations", + "SendMaps: Per client: Map data: Look for movable changes" = "look_for_movable_changes", + "SendMaps: Per client: Map data: Look for movable changes: Check notable turf visual contents" = "check_turf_vis_conts", + "SendMaps: Per client: Map data: Look for movable changes: Check HUD/image visual contents" = "check_hud/image_vis_contents", + "SendMaps: Per client: Map data: Look for movable changes: Loop through turfs in range" = "turfs_in_range", + "SendMaps: Per client: Map data: Look for movable changes: Movables examined" = "movables_examined", + ) + +/datum/controller/subsystem/time_track/Initialize() + //GLOB.perf_log = "[GLOB.log_directory]/perf-[GLOB.round_id ? GLOB.round_id : "NULL"]-[SSmapping.current_map.map_name].csv" + GLOB.perf_log = "[GLOB.log_directory]/perf-[GLOB.round_id ? GLOB.round_id : "NULL"]-[using_map.name].csv" + world.Profile(PROFILE_RESTART, type = "sendmaps") + //Need to do the sendmaps stuff in its own file, since it works different then everything else + var/list/sendmaps_headers = list() + for(var/proper_name in sendmaps_names_map) + sendmaps_headers += sendmaps_names_map[proper_name] + sendmaps_headers += "[sendmaps_names_map[proper_name]]_count" + log_perf( + list( + "time", + "players", + "tidi", + "tidi_fastavg", + "tidi_avg", + "tidi_slowavg", + "maptick", + "num_timers", + "air_turf_cost", + "air_eg_cost", + "air_highpressure_cost", + "air_hotspots_cost", + "air_superconductivity_cost", + "air_pipenets_cost", + "air_rebuilds_cost", + "air_turf_count", + "air_eg_count", + "air_hotspot_count", + "air_network_count", + "air_delta_count", + "air_superconductive_count", + "all_queries", + "queries_active", + "queries_standby" + ) + sendmaps_headers + ) + return SS_INIT_SUCCESS /datum/controller/subsystem/time_track/fire() @@ -30,11 +93,64 @@ SUBSYSTEM_DEF(time_track) time_dilation_avg_fast = MC_AVERAGE_FAST(time_dilation_avg_fast, time_dilation_current) time_dilation_avg = MC_AVERAGE(time_dilation_avg, time_dilation_avg_fast) time_dilation_avg_slow = MC_AVERAGE_SLOW(time_dilation_avg_slow, time_dilation_avg) - - log_game("TIDI: [time_dilation_current];[time_dilation_avg_fast];[time_dilation_avg];[time_dilation_avg_slow]") + //GLOB.glide_size_multiplier = (current_byondtime - last_tick_byond_time) / (current_realtime - last_tick_realtime) else first_run = FALSE - log_debug("TiDi Starting Log") last_tick_realtime = current_realtime last_tick_byond_time = current_byondtime last_tick_tickcount = current_tickcount + + var/sendmaps_json = world.Profile(PROFILE_REFRESH, type = "sendmaps", format="json") + var/list/send_maps_data = null + try + send_maps_data = json_decode(sendmaps_json) + catch + text2file(sendmaps_json,"bad_sendmaps.json") + can_fire = FALSE + return + var/send_maps_sort = send_maps_data.Copy() //Doing it like this guarantees us a properly sorted list + + for(var/list/packet in send_maps_data) + send_maps_sort[packet["name"]] = packet + + var/list/send_maps_values = list() + for(var/entry_name in sendmaps_names_map) + var/list/packet = send_maps_sort[entry_name] + if(!packet) //If the entry does not have a value for us, just put in 0 for both + send_maps_values += 0 + send_maps_values += 0 + continue + send_maps_values += packet["value"] + send_maps_values += packet["calls"] + + //SSblackbox.record_feedback("associative", "time_dilation_current", 1, list("[ISOtime()]" = list("current" = "[time_dilation_current]", "avg_fast" = "[time_dilation_avg_fast]", "avg" = "[time_dilation_avg]", "avg_slow" = "[time_dilation_avg_slow]"))) + log_perf( + list( + world.time, + length(GLOB.clients), + time_dilation_current, + time_dilation_avg_fast, + time_dilation_avg, + time_dilation_avg_slow, + MAPTICK_LAST_INTERNAL_TICK_USAGE, + length(SStimer.timer_id_dict), + SSair.cost_turfs, + //SSair.cost_groups, + //SSair.cost_highpressure, + SSair.cost_hotspots, + //SSair.cost_superconductivity, + //SSair.cost_pipenets, + //SSair.cost_rebuilds, + //length(SSair.active_turfs), + //length(SSair.excited_groups), + //length(SSair.hotspots), + //length(SSair.networks), + //length(SSair.high_pressure_delta), + //length(SSair.active_super_conductivity), + SSdbcore.all_queries_num, + SSdbcore.queries_active_num, + SSdbcore.queries_standby_num + ) + send_maps_values + ) + + SSdbcore.reset_tracking() diff --git a/code/controllers/subsystems/transcore_vr.dm b/code/controllers/subsystems/transcore_vr.dm index 1b52b1fbb8..f218669b0f 100644 --- a/code/controllers/subsystems/transcore_vr.dm +++ b/code/controllers/subsystems/transcore_vr.dm @@ -35,7 +35,7 @@ SUBSYSTEM_DEF(transcore) for(var/t in subtypesof(/datum/transcore_db)) var/datum/transcore_db/db = new t() if(!db.key) - warning("Instantiated transcore DB without a key: [t]") + WARNING("Instantiated transcore DB without a key: [t]") continue databases[db.key] = db return SS_INIT_SUCCESS @@ -105,7 +105,7 @@ SUBSYSTEM_DEF(transcore) //Invalid record if(!curr_MR) - log_debug("Tried to process [name] in transcore w/o a record!") + log_runtime("Tried to process [name] in transcore w/o a record!") db.backed_up -= curr_MR.mindname continue @@ -147,7 +147,7 @@ SUBSYSTEM_DEF(transcore) /datum/controller/subsystem/transcore/Recover() for(var/key in SStranscore.databases) if(!SStranscore.databases[key]) - warning("SStranscore recovery found missing database value for key: [key]") + WARNING("SStranscore recovery found missing database value for key: [key]") continue if(key == "default") default_db = SStranscore.databases[key] @@ -156,10 +156,10 @@ SUBSYSTEM_DEF(transcore) /datum/controller/subsystem/transcore/proc/leave_round(var/mob/M) if(!istype(M)) - warning("Non-mob asked to be removed from transcore: [M] [M?.type]") + WARNING("Non-mob asked to be removed from transcore: [M] [M?.type]") return if(!M.mind) - warning("No mind mob asked to be removed from transcore: [M] [M?.type]") + WARNING("No mind mob asked to be removed from transcore: [M] [M?.type]") return for(var/key in databases) @@ -175,7 +175,7 @@ SUBSYSTEM_DEF(transcore) if(isnull(key)) return default_db if(!databases[key]) - warning("Tried to find invalid transcore database: [key]") + WARNING("Tried to find invalid transcore database: [key]") return default_db return databases[key] @@ -271,7 +271,6 @@ SUBSYSTEM_DEF(transcore) ASSERT(MR) backed_up[MR.mindname] = MR backed_up = sortAssoc(backed_up) - log_debug("Added [MR.mindname] to transcore DB.") // Remove a mind_record from the backup-checking list. Keeps track of it in has_left // Why do we do that? ~Leshana /datum/transcore_db/proc/stop_backup(var/datum/transhuman/mind_record/MR) @@ -279,7 +278,6 @@ SUBSYSTEM_DEF(transcore) has_left[MR.mindname] = MR backed_up.Remove("[MR.mindname]") MR.cryo_at = world.time - log_debug("Put [MR.mindname] in transcore suspended DB.") // Called from body_record to add itself to the transcore. /datum/transcore_db/proc/add_body(var/datum/transhuman/body_record/BR) @@ -288,13 +286,11 @@ SUBSYSTEM_DEF(transcore) qdel(body_scans[BR.mydna.name]) body_scans[BR.mydna.name] = BR body_scans = sortAssoc(body_scans) - log_debug("Added [BR.mydna.name] to transcore body DB.") // Remove a body record from the database (Usually done when someone cryos) // Why? ~Leshana /datum/transcore_db/proc/remove_body(var/datum/transhuman/body_record/BR) ASSERT(BR) body_scans.Remove("[BR.mydna.name]") - log_debug("Removed [BR.mydna.name] from transcore body DB.") // Moves all mind records from the databaes into the disk and shuts down all backup canary processing. /datum/transcore_db/proc/core_dump(var/obj/item/disk/transcore/disk) diff --git a/code/controllers/subsystems/vote.dm b/code/controllers/subsystems/vote.dm index 02cad13531..e06984b3f7 100644 --- a/code/controllers/subsystems/vote.dm +++ b/code/controllers/subsystems/vote.dm @@ -46,16 +46,16 @@ SUBSYSTEM_DEF(vote) break if(!players_are_in_round) - log_debug("The crew transfer shuttle would have been called at vote time due to no players being present.") //YW Edit -// init_shift_change(null, 1) //YW Edit + log_game("The crew transfer shuttle was automatically called at vote time due to no players being present.") + init_shift_change(null, 1) return initiate_vote(VOTE_CREW_TRANSFER, "the server", 1) - log_debug("The server has called a crew transfer vote.") + log_game("The server has called a crew transfer vote.") /datum/controller/subsystem/vote/proc/autogamemode() initiate_vote(VOTE_GAMEMODE, "the server", 1) - log_debug("The server has called a gamemode vote.") + log_game("The server has called a gamemode vote.") /datum/controller/subsystem/vote/proc/reset() initiator = null diff --git a/code/controllers/subsystems/webhooks.dm b/code/controllers/subsystems/webhooks.dm index 17a12f6f77..9b9d53bbe3 100644 --- a/code/controllers/subsystems/webhooks.dm +++ b/code/controllers/subsystems/webhooks.dm @@ -13,7 +13,7 @@ SUBSYSTEM_DEF(webhooks) /datum/controller/subsystem/webhooks/proc/load_webhooks() if(!fexists(HTTP_POST_DLL_LOCATION)) - to_world_log("Unable to locate HTTP POST lib at [HTTP_POST_DLL_LOCATION], webhooks will not function on this run.") + log_world("Unable to locate HTTP POST lib at [HTTP_POST_DLL_LOCATION], webhooks will not function on this run.") return var/list/all_webhooks_by_id = list() @@ -32,7 +32,7 @@ SUBSYSTEM_DEF(webhooks) var/list/wmention = webhook_data["mentions"] if(wmention && !islist(wmention)) wmention = list(wmention) - to_world_log("Setting up webhook [wid].") + log_world("Setting up webhook [wid].") if(wid && wurl && all_webhooks_by_id[wid]) var/decl/webhook/webhook = all_webhooks_by_id[wid] webhook.urls = islist(wurl) ? wurl : list(wurl) @@ -44,19 +44,19 @@ SUBSYSTEM_DEF(webhooks) if(wmention) webhook.mentions = wmention?.Copy() webhook_decls[wid] = webhook - to_world_log("Webhook [wid] ready.") + log_world("Webhook [wid] ready.") else - to_world_log("Failed to set up webhook [wid].") + log_world("Failed to set up webhook [wid].") /datum/controller/subsystem/webhooks/proc/send(var/wid, var/wdata) var/decl/webhook/webhook = webhook_decls[wid] if(webhook) if(webhook.send(wdata)) - to_world_log("Sent webhook [webhook.id].") - log_debug("Webhook sent: [webhook.id].") + log_world("Sent webhook [webhook.id].") + // to_chat(world, "Webhook sent: [webhook.id].") else - to_world_log("Failed to send webhook [webhook.id].") - log_debug("Webhook failed to send: [webhook.id].") + log_world("Failed to send webhook [webhook.id].") + // to_chat(world, "Webhook failed to send: [webhook.id].") /client/proc/reload_webhooks() set name = "Reload Webhooks" @@ -69,7 +69,7 @@ SUBSYSTEM_DEF(webhooks) to_chat(usr, span_warning("Let the webhook subsystem initialize before trying to reload it.")) return - to_world_log("[usr.key] has reloaded webhooks.") + log_world("[usr.key] has reloaded webhooks.") log_and_message_admins("has reloaded webhooks.") SSwebhooks.load_webhooks() @@ -88,7 +88,7 @@ SUBSYSTEM_DEF(webhooks) if(choice && SSwebhooks.webhook_decls[choice]) var/decl/webhook/webhook = SSwebhooks.webhook_decls[choice] log_and_message_admins("has pinged webhook [choice].", usr) - to_world_log("[usr.key] has pinged webhook [choice].") + log_world("[usr.key] has pinged webhook [choice].") webhook.send() /hook/roundstart/proc/run_webhook() diff --git a/code/datums/api.dm b/code/datums/api.dm index fd3aea4fa9..98f0fbe27b 100644 --- a/code/datums/api.dm +++ b/code/datums/api.dm @@ -47,13 +47,13 @@ var/list/topic_commands_names = list() var/list/param = params[key] if(queryparams[key] == null) if(param["req"] == 0) - log_debug("API: The following parameter is OPTIONAL and missing: [param["name"]] - [param["desc"]]") + log_world("API: The following parameter is OPTIONAL and missing: [param["name"]] - [param["desc"]]") else - log_debug("API: The following parameter is REQUIRED but missing: [param["name"]] - [param["desc"]]") + log_world("API: The following parameter is REQUIRED but missing: [param["name"]] - [param["desc"]]") errorcount ++ missing_params += param["name"] if(errorcount) - log_debug("API: Request aborted. Required parameters missing") + log_world("API: Request aborted. Required parameters missing") statuscode = 400 response = "Required params missing" data = missing_params diff --git a/code/datums/autolathe/autolathe.dm b/code/datums/autolathe/autolathe.dm index 6684c9404d..d24e49f291 100644 --- a/code/datums/autolathe/autolathe.dm +++ b/code/datums/autolathe/autolathe.dm @@ -5,7 +5,7 @@ I = new path() if(!isitem(I)) // Something has gone horribly wrong, or right. - log_debug("[name] created an Autolathe design without an assigned path or illegal item. Item = [I]") + log_runtime("[name] created an Autolathe design without an assigned path or illegal item. Item = [I]") return if(I.matter && !resources) diff --git a/code/datums/components/antags/changeling/changeling.dm b/code/datums/components/antags/changeling/changeling.dm index 8ade0ecd92..1fd9b870bf 100644 --- a/code/datums/components/antags/changeling/changeling.dm +++ b/code/datums/components/antags/changeling/changeling.dm @@ -228,7 +228,7 @@ var/list/datum/power/changeling/powerinstances = list() var/datum/component/antag/changeling/comp = is_changeling(src) if(!comp) - to_world_log("[src] used a changeling verb but is not a changeling.") + log_world("[src] used a changeling verb but is not a changeling.") return if(src.stat > max_stat) diff --git a/code/datums/components/recursive_move.dm b/code/datums/components/recursive_move.dm index a3e1b70d44..e76a0cdc4f 100644 --- a/code/datums/components/recursive_move.dm +++ b/code/datums/components/recursive_move.dm @@ -25,11 +25,11 @@ var/recursion = 0 // safety check - max iterations while(istype(cur_parent) && (recursion < 64)) if(cur_parent == cur_parent.loc) //safety check incase a thing is somehow inside itself, cancel - log_debug("RECURSIVE_MOVE: Parent is inside itself. ([holder]) ([holder.type])") + log_runtime("RECURSIVE_MOVE: Parent is inside itself. ([holder]) ([holder.type])") reset_parents() break if(cur_parent in parents) //safety check incase of circular contents. (A inside B, B inside C, C inside A), cancel - log_debug("RECURSIVE_MOVE: Parent is inside a circular inventory. ([holder]) ([holder.type])") + log_runtime("RECURSIVE_MOVE: Parent is inside a circular inventory. ([holder]) ([holder.type])") reset_parents() break recursion++ @@ -40,7 +40,7 @@ cur_parent = cur_parent.loc if(recursion >= 64) // If we escaped due to iteration limit, cancel - log_debug("RECURSIVE_MOVE: Parent hit recursion limit. ([holder]) ([holder.type])") + log_runtime("RECURSIVE_MOVE: Parent hit recursion limit. ([holder]) ([holder.type])") reset_parents() parents.Cut() @@ -109,15 +109,15 @@ parents.Cut() //the banana peel of testing stays -/obj/item/bananapeel/testing +/obj/item/bananapeel/test name = "banana peel of testing" desc = "spams world log with debugging information" -/obj/item/bananapeel/testing/proc/shmove(var/atom/source, var/atom/old_loc, var/atom/new_loc) +/obj/item/bananapeel/test/proc/shmove(var/atom/source, var/atom/old_loc, var/atom/new_loc) SIGNAL_HANDLER world.log << "the [source] moved from [old_loc]([old_loc.x],[old_loc.y],[old_loc.z]) to [new_loc]([new_loc.x],[new_loc.y],[new_loc.z])" -/obj/item/bananapeel/testing/Initialize(mapload) +/obj/item/bananapeel/test/Initialize(mapload) . = ..() AddComponent(/datum/component/recursive_move) RegisterSignal(src, COMSIG_OBSERVER_MOVED, PROC_REF(shmove)) diff --git a/code/datums/components/species/shadekin/powers/phase_shift.dm b/code/datums/components/species/shadekin/powers/phase_shift.dm index f7f2966818..8c96379bd0 100644 --- a/code/datums/components/species/shadekin/powers/phase_shift.dm +++ b/code/datums/components/species/shadekin/powers/phase_shift.dm @@ -76,7 +76,7 @@ ability_cost = ability_cost + ( 15 * watcher ) /* if(!(SK.in_phase)) - log_debug("[src] attempted to shift with [watcher] visible Carbons with a cost of [ability_cost] in a darkness level of [darkness]") + to_chat(world, "[src] attempted to shift with [watcher] visible Carbons with a cost of [ability_cost] in a darkness level of [darkness]") */ if(SK.doing_phase) diff --git a/code/datums/datacore.dm b/code/datums/datacore.dm index a66d8e175a..6d11727d79 100644 --- a/code/datums/datacore.dm +++ b/code/datums/datacore.dm @@ -439,7 +439,7 @@ GLOBAL_LIST_EMPTY(PDA_Manifest) return /proc/generate_record_id() - return add_zero(num2hex(rand(1, 65535)), 4) //no point generating higher numbers because of the limitations of num2hex + return add_zero(num2hex(rand(1, 65535), 5), 4) //no point generating higher numbers because of the limitations of num2hex /datum/datacore/proc/CreateGeneralRecord(var/mob/living/carbon/human/H, var/id, var/hidden) ResetPDAManifest() @@ -454,7 +454,7 @@ GLOBAL_LIST_EMPTY(PDA_Manifest) side = icon('html/images/no_image32.png') if(!id) - id = text("[]", add_zero(num2hex(rand(1, 65536)), 4)) + id = text("[]", add_zero(num2hex(rand(1, 65536), 5), 4)) var/datum/data/record/G = new /datum/data/record() G.name = "Employee Record #[id]" G.fields["name"] = "New Record" diff --git a/code/datums/datum.dm b/code/datums/datum.dm index 334502de2d..8a2f0d7b72 100644 --- a/code/datums/datum.dm +++ b/code/datums/datum.dm @@ -168,6 +168,16 @@ for(var/target in _signal_procs) UnregisterSignal(target, _signal_procs[target]) +/// Return a list of data which can be used to investigate the datum, also ensure that you set the semver in the options list +/datum/proc/serialize_list(list/options, list/semvers) + SHOULD_CALL_PARENT(TRUE) + + . = list() + .["tag"] = tag + + SET_SERIALIZATION_SEMVER(semvers, "1.0.0") + return . + /** * Callback called by a timer to end an associative-list-indexed cooldown. * diff --git a/code/datums/elements/turf_transparency.dm b/code/datums/elements/turf_transparency.dm index 8b2ac8f918..bb105080c3 100644 --- a/code/datums/elements/turf_transparency.dm +++ b/code/datums/elements/turf_transparency.dm @@ -73,7 +73,7 @@ if(!ispath(path)) path = text2path(path) if(!ispath(path)) - warning("Z-level [our_turf] has invalid baseturf '[get_base_turf_by_area(our_turf)]' in area '[get_area(our_turf)]'") + WARNING("Z-level [our_turf] has invalid baseturf '[get_base_turf_by_area(our_turf)]' in area '[get_area(our_turf)]'") path = /turf/space var/do_plane = ispath(path, /turf/space) ? SPACE_PLANE : null diff --git a/code/datums/helper_datums/getrev.dm b/code/datums/helper_datums/getrev.dm index 1ecd7da806..51da2c6e56 100644 --- a/code/datums/helper_datums/getrev.dm +++ b/code/datums/helper_datums/getrev.dm @@ -23,7 +23,7 @@ /datum/getrev/proc/get_log_message() var/list/msg = list() - msg += "Running /tg/ revision: [date]" + msg += "Running VOREStation revision: [date]" if(originmastercommit) msg += "origin/master: [originmastercommit]" diff --git a/code/datums/mind.dm b/code/datums/mind.dm index 4b7939478d..072de4d747 100644 --- a/code/datums/mind.dm +++ b/code/datums/mind.dm @@ -76,7 +76,7 @@ /datum/mind/proc/transfer_to(mob/living/new_character, force = FALSE) if(!istype(new_character)) - to_world_log("## DEBUG: transfer_to(): Some idiot has tried to transfer_to() a non mob/living mob. Please inform Carn") + log_world("## DEBUG: transfer_to(): Some idiot has tried to transfer_to() a non mob/living mob. Please inform Carn") var/datum/component/antag/changeling/comp if(current) comp = is_changeling(current) //remove ourself from our old body's mind variable @@ -512,7 +512,7 @@ if(SSticker) SSticker.minds += mind else - to_world_log("## DEBUG: mind_initialize(): No ticker ready yet! Please inform Carn") + log_world("## DEBUG: mind_initialize(): No ticker ready yet! Please inform Carn") if(!mind.name) mind.name = real_name mind.current = src if(player_is_antag(mind)) diff --git a/code/datums/repositories/unique.dm b/code/datums/repositories/unique.dm index a53111cb24..bd7b58cb8b 100644 --- a/code/datums/repositories/unique.dm +++ b/code/datums/repositories/unique.dm @@ -51,7 +51,7 @@ var/repository/unique/uniqueness_repository = new() ids_by_key[key] = ids if(ids.len >= (max - min) + 1) - error("Random ID limit reached for key [key].") + log_world("## ERROR Random ID limit reached for key [key].") ids.Cut() if(ids.len >= 0.6 * ((max-min) + 1)) // if more than 60% of possible ids used diff --git a/code/defines/procs/announce.dm b/code/defines/procs/announce.dm index 9974955b8d..9bcc37b213 100644 --- a/code/defines/procs/announce.dm +++ b/code/defines/procs/announce.dm @@ -62,14 +62,14 @@ // You'll need to update these to_world usages if you want to make these z-level specific ~Aro /datum/announcement/minor/Message(message as text, message_title as text) - to_world(span_bold("[message]")) + to_chat(world, span_bold("[message]")) /datum/announcement/priority/Message(message as text, message_title as text) - to_world("

[message_title]

") - to_world(span_alert("[message]")) + to_chat(world, "

[message_title]

") + to_chat(world, span_alert("[message]")) if(announcer) - to_world(span_alert(" -[html_encode(announcer)]")) - to_world(span_alert("
")) + to_chat(world, span_alert(" -[html_encode(announcer)]")) + to_chat(world, span_alert("
")) /datum/announcement/priority/command/Message(message as text, message_title as text, var/list/zlevels) var/command diff --git a/code/game/antagonist/antagonist.dm b/code/game/antagonist/antagonist.dm index 493a127c14..43f1301f18 100644 --- a/code/game/antagonist/antagonist.dm +++ b/code/game/antagonist/antagonist.dm @@ -111,22 +111,22 @@ for(var/datum/mind/player in candidates) if(ghosts_only && !isobserver(player.current)) candidates -= player - log_debug("[key_name(player)] is not eligible to become a [role_text]: Only ghosts may join as this role! They have been removed from the draft.") + log_game("[key_name(player)] is not eligible to become a [role_text]: Only ghosts may join as this role! They have been removed from the draft.") else if(CONFIG_GET(flag/use_age_restriction_for_antags) && player.current.client.player_age < minimum_player_age) candidates -= player - log_debug("[key_name(player)] is not eligible to become a [role_text]: Is only [player.current.client.player_age] day\s old, has to be [minimum_player_age] day\s!") + log_game("[key_name(player)] is not eligible to become a [role_text]: Is only [player.current.client.player_age] day\s old, has to be [minimum_player_age] day\s!") else if(player.special_role) candidates -= player - log_debug("[key_name(player)] is not eligible to become a [role_text]: They already have a special role ([player.special_role])! They have been removed from the draft.") + log_game("[key_name(player)] is not eligible to become a [role_text]: They already have a special role ([player.special_role])! They have been removed from the draft.") else if (player in pending_antagonists) candidates -= player - log_debug("[key_name(player)] is not eligible to become a [role_text]: They have already been selected for this role! They have been removed from the draft.") + log_game("[key_name(player)] is not eligible to become a [role_text]: They have already been selected for this role! They have been removed from the draft.") else if(!can_become_antag(player)) candidates -= player - log_debug("[key_name(player)] is not eligible to become a [role_text]: They are blacklisted for this role! They have been removed from the draft.") + log_game("[key_name(player)] is not eligible to become a [role_text]: They are blacklisted for this role! They have been removed from the draft.") else if(player_is_antag(player)) candidates -= player - log_debug("[key_name(player)] is not eligible to become a [role_text]: They are already an antagonist! They have been removed from the draft.") + log_game("[key_name(player)] is not eligible to become a [role_text]: They are already an antagonist! They have been removed from the draft.") return candidates @@ -180,17 +180,17 @@ /datum/antagonist/proc/draft_antagonist(var/datum/mind/player) //Check if the player can join in this antag role, or if the player has already been given an antag role. if(!can_become_antag(player) || (player.assigned_role in roundstart_restricted)) - log_debug("[player.key] was selected for [role_text] by lottery, but is not allowed to be that role.") + log_game("[player.key] was selected for [role_text] by lottery, but is not allowed to be that role.") return 0 if(player.special_role) - log_debug("[player.key] was selected for [role_text] by lottery, but they already have a special role.") + log_game("[player.key] was selected for [role_text] by lottery, but they already have a special role.") return 0 if(!(flags & ANTAG_OVERRIDE_JOB) && (!player.current || isnewplayer(player.current))) - log_debug("[player.key] was selected for [role_text] by lottery, but they have not joined the game.") + log_game("[player.key] was selected for [role_text] by lottery, but they have not joined the game.") return 0 pending_antagonists |= player - log_debug("[player.key] has been selected for [role_text] by lottery.") + log_game("[player.key] has been selected for [role_text] by lottery.") //Ensure that antags with ANTAG_OVERRIDE_JOB do not occupy job slots. if(flags & ANTAG_OVERRIDE_JOB) diff --git a/code/game/antagonist/antagonist_objectives.dm b/code/game/antagonist/antagonist_objectives.dm index 2926fcde42..cda117daa4 100644 --- a/code/game/antagonist/antagonist_objectives.dm +++ b/code/game/antagonist/antagonist_objectives.dm @@ -24,10 +24,10 @@ if(!O.completed && !O.check_completion()) result = 0 if(result && victory_text) - to_world(span_boldannounce(span_large("[victory_text]"))) + to_chat(world, span_boldannounce(span_large("[victory_text]"))) if(victory_feedback_tag) feedback_set_details("round_end_result","[victory_feedback_tag]") else if(loss_text) - to_world(span_boldannounce(span_large("[loss_text]"))) + to_chat(world, span_boldannounce(span_large("[loss_text]"))) if(loss_feedback_tag) feedback_set_details("round_end_result","[loss_feedback_tag]") /mob/living/proc/write_ambition() diff --git a/code/game/antagonist/antagonist_print.dm b/code/game/antagonist/antagonist_print.dm index c8d6493bc8..fbd01206c1 100644 --- a/code/game/antagonist/antagonist_print.dm +++ b/code/game/antagonist/antagonist_print.dm @@ -38,7 +38,7 @@ num++ // Display the results. - to_world(text) + to_chat(world, text) /datum/antagonist/proc/print_objective(var/datum/objective/O, var/num, var/append_success) var/text = "
" + span_bold("Objective [num]:") + " [O.explanation_text] " diff --git a/code/game/antagonist/outsider/raider.dm b/code/game/antagonist/outsider/raider.dm index 691b22f852..90dfd821f8 100644 --- a/code/game/antagonist/outsider/raider.dm +++ b/code/game/antagonist/outsider/raider.dm @@ -187,8 +187,8 @@ var/datum/antagonist/raider/raiders else win_msg += span_bold("The Raiders were repelled!") - to_world(span_boldannounce(span_large("[win_type] [win_group] victory!"))) - to_world(span_filter_system("[win_msg]")) + to_chat(world, span_boldannounce(span_large("[win_type] [win_group] victory!"))) + to_chat(world, span_filter_system("[win_msg]")) feedback_set_details("round_end_result","heist - [win_type] [win_group]") /datum/antagonist/raider/proc/is_raider_crew_safe() diff --git a/code/game/antagonist/outsider/technomancer.dm b/code/game/antagonist/outsider/technomancer.dm index 38083baa65..7a6b88bbb3 100644 --- a/code/game/antagonist/outsider/technomancer.dm +++ b/code/game/antagonist/outsider/technomancer.dm @@ -78,7 +78,7 @@ var/datum/antagonist/technomancer/technomancers break if(!survivor) feedback_set_details("round_end_result","loss - technomancer killed") - to_world(span_boldannounce(span_large("The [(current_antagonists.len>1)?"[role_text_plural] have":"[role_text] has"] been killed!"))) + to_chat(world, span_boldannounce(span_large("The [(current_antagonists.len>1)?"[role_text_plural] have":"[role_text] has"] been killed!"))) /datum/antagonist/technomancer/print_player_summary() ..() @@ -87,7 +87,7 @@ var/datum/antagonist/technomancer/technomancers continue // Only want abandoned cores. if(!core.spells.len) continue // Cores containing spells only. - to_world(span_filter_system("Abandoned [core] had [english_list(core.spells)].
")) + to_chat(world, span_filter_system("Abandoned [core] had [english_list(core.spells)].
")) /datum/antagonist/technomancer/print_player_full(var/datum/mind/player) var/text = print_player_lite(player) diff --git a/code/game/antagonist/outsider/wizard.dm b/code/game/antagonist/outsider/wizard.dm index 0543ac718b..88668f403a 100644 --- a/code/game/antagonist/outsider/wizard.dm +++ b/code/game/antagonist/outsider/wizard.dm @@ -99,7 +99,7 @@ var/datum/antagonist/wizard/wizards break if(!survivor) feedback_set_details("round_end_result","loss - wizard killed") - to_world(span_boldannounce(span_large("The [(current_antagonists.len>1)?"[role_text_plural] have":"[role_text] has"] been killed by the crew!"))) + to_chat(world, span_boldannounce(span_large("The [(current_antagonists.len>1)?"[role_text_plural] have":"[role_text] has"] been killed by the crew!"))) // Removing antag should remove spells /datum/antagonist/wizard/remove_antagonist(datum/mind/player, show_message, implanted) diff --git a/code/game/antagonist/station/rogue_ai.dm b/code/game/antagonist/station/rogue_ai.dm index 2521943c26..5632c4c3a1 100644 --- a/code/game/antagonist/station/rogue_ai.dm +++ b/code/game/antagonist/station/rogue_ai.dm @@ -52,8 +52,8 @@ var/datum/antagonist/rogue_ai/malf var/mob/living/silicon/ai/A = player.current if(!istype(A)) - error("Non-AI mob designated malf AI! Report this.") - to_world(span_filter_system("##ERROR: Non-AI mob designated malf AI! Report this.")) + log_world("## ERROR Non-AI mob designated malf AI! Report this.") + to_chat(world, span_filter_system("##ERROR: Non-AI mob designated malf AI! Report this.")) return A.setup_for_malf() diff --git a/code/game/area/Away Mission areas.dm b/code/game/area/Away Mission areas.dm index 3d57984241..c203fc5751 100644 --- a/code/game/area/Away Mission areas.dm +++ b/code/game/area/Away Mission areas.dm @@ -39,7 +39,7 @@ /area/proc/spawn_mob_on_turf() if(!valid_mobs.len) - to_world_log("[src] does not have a set valid mobs list!") + log_mapping("[src] does not have a set valid mobs list!") return TRUE var/mob/M @@ -87,7 +87,7 @@ /area/proc/spawn_flora_on_turf() if(!valid_flora.len) - to_world_log("[src] does not have a set valid flora list!") + log_mapping("[src] does not have a set valid flora list!") return TRUE var/obj/F diff --git a/code/game/area/Space Station 13 areas_vr.dm b/code/game/area/Space Station 13 areas_vr.dm index 97a8f77e85..b684394e84 100644 --- a/code/game/area/Space Station 13 areas_vr.dm +++ b/code/game/area/Space Station 13 areas_vr.dm @@ -161,7 +161,7 @@ name = "\improper Research Outpost Gas Heating" icon_state = "toxmix" -/area/rnd/outpost/testing +/area/rnd/outpost/toxtest name = "\improper Research Outpost Testing" icon_state = "toxtest" diff --git a/code/game/gamemodes/calamity/calamity.dm b/code/game/gamemodes/calamity/calamity.dm index 2295d07ebd..987eda3214 100644 --- a/code/game/gamemodes/calamity/calamity.dm +++ b/code/game/gamemodes/calamity/calamity.dm @@ -23,6 +23,6 @@ ..() /datum/game_mode/calamity/check_victory() - to_world(span_world(span_large("This terrible, terrible day has finally ended!"))) + to_chat(world, span_world(span_large("This terrible, terrible day has finally ended!"))) #undef ANTAG_TYPE_RATIO diff --git a/code/game/gamemodes/cult/narsie.dm b/code/game/gamemodes/cult/narsie.dm index 3d4b1c629e..23b4cd91dc 100644 --- a/code/game/gamemodes/cult/narsie.dm +++ b/code/game/gamemodes/cult/narsie.dm @@ -42,8 +42,8 @@ var/global/narsie_cometh = 0 /obj/singularity/narsie/large/Initialize(mapload) . = ..() if(announce) - to_world(span_world(span_narsie(span_red("[uppertext(name)] HAS RISEN")))) - world << sound('sound/effects/weather/old_wind/wind_5_1.ogg') + to_chat(world, span_world(span_narsie(span_red("[uppertext(name)] HAS RISEN")))) + world << sound('sound/effects/weather/old_wind/wind_5_1.ogg') // CHOMPEdit - For some reason different wind sound path narsie_spawn_animation() diff --git a/code/game/gamemodes/cult/runes.dm b/code/game/gamemodes/cult/runes.dm index 5c206c658f..73e3ae8aaa 100644 --- a/code/game/gamemodes/cult/runes.dm +++ b/code/game/gamemodes/cult/runes.dm @@ -197,8 +197,8 @@ var/list/sacrificed = list() cultists.Add(M) if(cultists.len >= 9) if(!narsie_cometh)//so we don't initiate Hell more than one time. - to_world(span_narsie(span_red(span_bold("THE VEIL HAS BEEN SHATTERED!")))) - world << sound('sound/effects/weather/old_wind/wind_5_1.ogg') + to_chat(world, span_world(span_narsie(span_red("THE VEIL HAS BEEN SHATTERED!")))) + world << sound('sound/effects/weather/old_wind/wind_5_1.ogg') // CHOMPEdit - No idea why this wind is here now SetUniversalState(/datum/universal_state/hell) narsie_cometh = 1 diff --git a/code/game/gamemodes/endgame/supermatter_cascade/universe.dm b/code/game/gamemodes/endgame/supermatter_cascade/universe.dm index 923066ed7d..8872dc8565 100644 --- a/code/game/gamemodes/endgame/supermatter_cascade/universe.dm +++ b/code/game/gamemodes/endgame/supermatter_cascade/universe.dm @@ -37,7 +37,7 @@ GLOBAL_VAR_INIT(universe_has_ended, 0) // Apply changes when entering state /datum/universal_state/supermatter_cascade/OnEnter() set background = 1 - to_world(span_sinister(span_cascade("You are blinded by a brilliant flash of energy."))) + to_chat(world, span_sinister(span_cascade("You are blinded by a brilliant flash of energy."))) world << sound('sound/effects/cascade.ogg') diff --git a/code/game/gamemodes/events.dm b/code/game/gamemodes/events.dm index 7868fd9802..473508468c 100644 --- a/code/game/gamemodes/events.dm +++ b/code/game/gamemodes/events.dm @@ -202,7 +202,7 @@ GLOBAL_VAR_INIT(hadevent, 0) sleep(150) command_announcement.Announce("Gr3y.T1d3 virus detected in [station_name()] imprisonment subroutines. Recommend station AI involvement.", "Security Alert") else - to_world_log("ERROR: Could not initate grey-tide. Unable find prison or brig area.") + log_world("ERROR: Could not initate grey-tide. Unable find prison or brig area.") /proc/carp_migration() // -- Darem for(var/obj/effect/landmark/C in GLOB.landmarks_list) diff --git a/code/game/gamemodes/events/holidays/Holidays.dm b/code/game/gamemodes/events/holidays/Holidays.dm index 5ed72ed191..5c90cf0397 100644 --- a/code/game/gamemodes/events/holidays/Holidays.dm +++ b/code/game/gamemodes/events/holidays/Holidays.dm @@ -260,11 +260,11 @@ GLOBAL_LIST_EMPTY(Holiday) //Holidays are lists now, so we can have more than on holidays.Add(p) holiday_blurbs.Add("[GLOB.Holiday[p]]") var/holidays_string = english_list(holidays, nothing_text = "nothing", and_text = " and ", comma_text = ", ", final_comma_text = "" ) - to_world(span_filter_system(span_blue("and..."))) - to_world(span_filter_system("

Happy [holidays_string] Everybody!

")) + to_chat(world, span_filter_system(span_blue("and..."))) + to_chat(world, span_filter_system("

Happy [holidays_string] Everybody!

")) if(holiday_blurbs.len != 0) for(var/blurb in holiday_blurbs) - to_world(span_filter_system(span_blue("
[blurb]
"))) + to_chat(world, span_filter_system(span_blue("
[blurb]
"))) switch(GLOB.Holiday) //special holidays //if("Easter") //do easter stuff diff --git a/code/game/gamemodes/game_mode.dm b/code/game/gamemodes/game_mode.dm index dc4601e534..50a86cac66 100644 --- a/code/game/gamemodes/game_mode.dm +++ b/code/game/gamemodes/game_mode.dm @@ -117,11 +117,11 @@ GLOBAL_LIST_EMPTY(additional_antag_types) return /datum/game_mode/proc/announce() //to be called when round starts - to_world(span_world("The current game mode is [capitalize(name)]!")) + to_chat(world, span_world("The current game mode is [capitalize(name)]!")) if(round_description) - to_world(span_filter_system("[round_description]")) + to_chat(world, span_filter_system("[round_description]")) if(round_autoantag) - to_world(span_filter_system("Antagonists will be added to the round automagically as needed.")) + to_chat(world, span_filter_system("Antagonists will be added to the round automagically as needed.")) if(antag_templates && antag_templates.len) var/antag_summary = span_bold("Possible antagonist types:") + " " var/i = 1 @@ -135,7 +135,7 @@ GLOBAL_LIST_EMPTY(additional_antag_types) i++ antag_summary += "." if(antag_templates.len > 1 && GLOB.master_mode != "secret") - to_world(span_filter_system("[antag_summary]")) + to_chat(world, span_filter_system("[antag_summary]")) else message_admins("[antag_summary]") @@ -366,7 +366,7 @@ GLOBAL_LIST_EMPTY(additional_antag_types) text += ".
" else text += "There were " + span_bold("no survivors") + " (" + span_bold("[ghosts] ghosts") + ")." - to_world(span_filter_system(text)) + to_chat(world, span_filter_system(text)) if(clients > 0) feedback_set("round_end_clients",clients) @@ -433,7 +433,7 @@ GLOBAL_LIST_EMPTY(additional_antag_types) if(isobserver(player) && !ghosts_only) continue if(!role || (player.client.prefs.be_special & role)) - log_debug("[player.key] had [antag_id] enabled, so we are drafting them.") + log_game("[player.key] had [antag_id] enabled, so we are drafting them.") candidates |= player.mind else // Assemble a list of active players without jobbans. @@ -444,7 +444,7 @@ GLOBAL_LIST_EMPTY(additional_antag_types) // Get a list of all the people who want to be the antagonist for this round for(var/mob/new_player/player in players) if(!role || (player.client.prefs.be_special & role)) - log_debug("[player.key] had [antag_id] enabled, so we are drafting them.") + log_game("[player.key] had [antag_id] enabled, so we are drafting them.") candidates += player.mind players -= player @@ -454,7 +454,7 @@ GLOBAL_LIST_EMPTY(additional_antag_types) if(candidates.len < required_enemies) for(var/mob/new_player/player in players) if(player.ckey in round_voters) - log_debug("[player.key] voted for this round, so we are drafting them.") + log_game("[player.key] voted for this round, so we are drafting them.") candidates += player.mind players -= player break diff --git a/code/game/gamemodes/malfunction/newmalf_ability_trees/HELPERS.dm b/code/game/gamemodes/malfunction/newmalf_ability_trees/HELPERS.dm index 4b11c18204..64361ec1b1 100644 --- a/code/game/gamemodes/malfunction/newmalf_ability_trees/HELPERS.dm +++ b/code/game/gamemodes/malfunction/newmalf_ability_trees/HELPERS.dm @@ -43,7 +43,7 @@ if(!note) - error("Hardware without description: [C]") + log_world("## ERROR Hardware without description: [C]") return var/confirmation = tgui_alert(user, "[note] - Is this what you want?", "Hardware selection", list("Yes", "No")) diff --git a/code/game/gamemodes/meteor/meteor.dm b/code/game/gamemodes/meteor/meteor.dm index e9668895c1..2ca52158e3 100644 --- a/code/game/gamemodes/meteor/meteor.dm +++ b/code/game/gamemodes/meteor/meteor.dm @@ -35,9 +35,9 @@ survivors++ if(survivors) - to_world(span_world("The following survived the meteor storm") + ":[text]") + to_chat(world, span_world("The following survived the meteor storm") + ":[text]") else - to_world(span_boldannounce("Nobody survived the meteor storm!")) + to_chat(world, span_boldannounce("Nobody survived the meteor storm!")) feedback_set_details("round_end_result","end - evacuation") feedback_set("round_end_result",survivors) diff --git a/code/game/gamemodes/meteor/meteors.dm b/code/game/gamemodes/meteor/meteors.dm index 5ebde0347e..ce920e2d19 100644 --- a/code/game/gamemodes/meteor/meteors.dm +++ b/code/game/gamemodes/meteor/meteors.dm @@ -38,7 +38,7 @@ GLOBAL_VAR_INIT(meteor_wave_delay, 625) //minimum wait between waves in tenths o /////////////////////////////// /proc/spawn_meteors(var/number = 10, var/list/meteortypes, var/startSide, var/zlevel) - log_debug("Spawning [number] meteors on the [dir2text(startSide)] of [zlevel]") + log_game("Spawning [number] meteors on the [dir2text(startSide)] of [zlevel]") for(var/i = 0; i < number; i++) spawn_meteor(meteortypes, startSide, zlevel) diff --git a/code/game/gamemodes/nuclear/nuclear.dm b/code/game/gamemodes/nuclear/nuclear.dm index 33ab06034d..bf13630dbe 100644 --- a/code/game/gamemodes/nuclear/nuclear.dm +++ b/code/game/gamemodes/nuclear/nuclear.dm @@ -45,47 +45,47 @@ GLOBAL_LIST_EMPTY(nuke_disks) if(!disk_rescued && station_was_nuked && !syndies_didnt_escape) feedback_set_details("round_end_result","win - syndicate nuke") - to_world(span_filter_system(span_large(span_bold("Mercenary Major Victory!")))) - to_world(span_filter_system(span_bold("[syndicate_name()] operatives have destroyed [station_name()]!"))) + to_chat(world, span_filter_system(span_large(span_bold("Mercenary Major Victory!")))) + to_chat(world, span_filter_system(span_bold("[syndicate_name()] operatives have destroyed [station_name()]!"))) else if (!disk_rescued && station_was_nuked && syndies_didnt_escape) feedback_set_details("round_end_result","halfwin - syndicate nuke - did not evacuate in time") - to_world(span_filter_system(span_large(span_bold("Total Annihilation")))) - to_world(span_filter_system(span_bold("[syndicate_name()] operatives destroyed [station_name()] but did not leave the area in time and got caught in the explosion.") + " Next time, don't lose the disk!")) + to_chat(world, span_filter_system(span_large(span_bold("Total Annihilation")))) + to_chat(world, span_filter_system(span_bold("[syndicate_name()] operatives destroyed [station_name()] but did not leave the area in time and got caught in the explosion.") + " Next time, don't lose the disk!")) else if (!disk_rescued && !station_was_nuked && nuke_off_station && !syndies_didnt_escape) feedback_set_details("round_end_result","halfwin - blew wrong station") - to_world(span_filter_system(span_large(span_bold("Crew Minor Victory")))) - to_world(span_filter_system(span_bold("[syndicate_name()] operatives secured the authentication disk but blew up something that wasn't [station_name()].") + " Next time, don't lose the disk!")) + to_chat(world, span_filter_system(span_large(span_bold("Crew Minor Victory")))) + to_chat(world, span_filter_system(span_bold("[syndicate_name()] operatives secured the authentication disk but blew up something that wasn't [station_name()].") + " Next time, don't lose the disk!")) else if (!disk_rescued && !station_was_nuked && nuke_off_station && syndies_didnt_escape) feedback_set_details("round_end_result","halfwin - blew wrong station - did not evacuate in time") - to_world(span_filter_system(span_large(span_bold("[syndicate_name()] operatives have earned Darwin Award!")))) - to_world(span_filter_system(span_bold("[syndicate_name()] operatives blew up something that wasn't [station_name()] and got caught in the explosion.") + " Next time, don't lose the disk!")) + to_chat(world, span_filter_system(span_large(span_bold("[syndicate_name()] operatives have earned Darwin Award!")))) + to_chat(world, span_filter_system(span_bold("[syndicate_name()] operatives blew up something that wasn't [station_name()] and got caught in the explosion.") + " Next time, don't lose the disk!")) else if (disk_rescued && mercs.antags_are_dead()) feedback_set_details("round_end_result","loss - evacuation - disk secured - syndi team dead") - to_world(span_filter_system(span_large(span_bold("Crew Major Victory!")))) - to_world(span_filter_system(span_bold("The Research Staff has saved the disc and killed the [syndicate_name()] Operatives"))) + to_chat(world, span_filter_system(span_large(span_bold("Crew Major Victory!")))) + to_chat(world, span_filter_system(span_bold("The Research Staff has saved the disc and killed the [syndicate_name()] Operatives"))) else if ( disk_rescued ) feedback_set_details("round_end_result","loss - evacuation - disk secured") - to_world(span_filter_system(span_large(span_bold("Crew Major Victory")))) - to_world(span_filter_system(span_bold("The Research Staff has saved the disc and stopped the [syndicate_name()] Operatives!"))) + to_chat(world, span_filter_system(span_large(span_bold("Crew Major Victory")))) + to_chat(world, span_filter_system(span_bold("The Research Staff has saved the disc and stopped the [syndicate_name()] Operatives!"))) else if (!disk_rescued && mercs.antags_are_dead()) feedback_set_details("round_end_result","loss - evacuation - disk not secured") - to_world(span_filter_system(span_large(span_bold("Mercenary Minor Victory!")))) - to_world(span_filter_system(span_bold("The Research Staff failed to secure the authentication disk but did manage to kill most of the [syndicate_name()] Operatives!"))) + to_chat(world, span_filter_system(span_large(span_bold("Mercenary Minor Victory!")))) + to_chat(world, span_filter_system(span_bold("The Research Staff failed to secure the authentication disk but did manage to kill most of the [syndicate_name()] Operatives!"))) else if (!disk_rescued && crew_evacuated) feedback_set_details("round_end_result","halfwin - detonation averted") - to_world(span_filter_system(span_large(span_bold("Mercenary Minor Victory!")))) - to_world(span_filter_system(span_bold("[syndicate_name()] operatives recovered the abandoned authentication disk but detonation of [station_name()] was averted.") + " Next time, don't lose the disk!")) + to_chat(world, span_filter_system(span_large(span_bold("Mercenary Minor Victory!")))) + to_chat(world, span_filter_system(span_bold("[syndicate_name()] operatives recovered the abandoned authentication disk but detonation of [station_name()] was averted.") + " Next time, don't lose the disk!")) else if (!disk_rescued && !crew_evacuated) feedback_set_details("round_end_result","halfwin - interrupted") - to_world(span_filter_system(span_large(span_bold("Neutral Victory")))) - to_world(span_filter_system(span_bold("Round was mysteriously interrupted!"))) + to_chat(world, span_filter_system(span_large(span_bold("Neutral Victory")))) + to_chat(world, span_filter_system(span_bold("Round was mysteriously interrupted!"))) return ..() diff --git a/code/game/gamemodes/setupgame.dm b/code/game/gamemodes/setupgame.dm index 45c4bfe29c..5e3293703a 100644 --- a/code/game/gamemodes/setupgame.dm +++ b/code/game/gamemodes/setupgame.dm @@ -39,7 +39,7 @@ GLOB.dna_genes_good.Add(G) log_world("DNA2: Created traitgenes with [blocks_remaining.len] remaining blocks. Used [DNA_SE_LENGTH - blocks_remaining.len] out of [DNA_SE_LENGTH] ") if(blocks_remaining.len < 10) - warning("DNA2: Blocks remaining is less than 10. The DNA_SE_LENGTH should be raised in dna.dm.") + WARNING("DNA2: Blocks remaining is less than 10. The DNA_SE_LENGTH should be raised in dna.dm.") // Run conflict-o-tron on each traitgene all other traits... Lets setup an initial database of conflicts. log_world("DNA2: Checking trait gene conflicts") for(var/datum/gene/trait/gene in GLOB.dna_genes) diff --git a/code/game/jobs/job_controller.dm b/code/game/jobs/job_controller.dm index 0e3b3d1c92..6bcc004a0c 100644 --- a/code/game/jobs/job_controller.dm +++ b/code/game/jobs/job_controller.dm @@ -15,7 +15,7 @@ var/global/datum/controller/occupations/job_master //var/list/all_jobs = typesof(/datum/job) var/list/all_jobs = list(/datum/job/assistant) | using_map.allowed_jobs if(!all_jobs.len) - to_world(span_boldannounce("Error setting up jobs, no job datums found!")) + to_chat(world, span_boldannounce("Error setting up jobs, no job datums found!")) return 0 for(var/J in all_jobs) var/datum/job/job = new J() @@ -607,7 +607,7 @@ var/global/datum/controller/occupations/job_master if(!CONFIG_GET(flag/load_jobs_from_txt)) return 0 - var/list/jobEntries = file2list(jobsfile) + var/list/jobEntries = world.file2list(jobsfile) for(var/job in jobEntries) if(!job) diff --git a/code/game/jobs/whitelist.dm b/code/game/jobs/whitelist.dm index ec2b6221ab..847f0c080d 100644 --- a/code/game/jobs/whitelist.dm +++ b/code/game/jobs/whitelist.dm @@ -8,7 +8,7 @@ GLOBAL_LIST_EMPTY(whitelist) return 1 /proc/load_whitelist() - GLOB.whitelist = file2list(WHITELISTFILE) + GLOB.whitelist = world.file2list(WHITELISTFILE) if(!GLOB.whitelist.len) GLOB.whitelist = null /proc/check_whitelist(mob/M /*, var/rank*/) @@ -30,17 +30,17 @@ GLOBAL_LIST_EMPTY(alien_whitelist) /proc/load_alienwhitelist() var/text = file2text("config/alienwhitelist.txt") if (!text) - log_misc("Failed to load config/alienwhitelist.txt") + log_world("Failed to load config/alienwhitelist.txt") else var/lines = splittext(text, "\n") // Now we've got a bunch of "ckey = something" strings in a list for(var/line in lines) var/list/left_and_right = splittext(line, " - ") // Split it on the dash into left and right if(LAZYLEN(left_and_right) != 2) - warning("Alien whitelist entry is invalid: [line]") // If we didn't end up with a left and right, the line is bad + WARNING("Alien whitelist entry is invalid: [line]") // If we didn't end up with a left and right, the line is bad continue var/key = left_and_right[1] if(key != ckey(key)) - warning("Alien whitelist entry appears to have key, not ckey: [line]") // The key contains invalid ckey characters + WARNING("Alien whitelist entry appears to have key, not ckey: [line]") // The key contains invalid ckey characters continue var/list/our_whitelists = GLOB.alien_whitelist[key] // Try to see if we have one already and add to it if(!our_whitelists) // Guess this is their first/only whitelist entry diff --git a/code/game/jobs/whitelist_vr.dm b/code/game/jobs/whitelist_vr.dm index 1dc196a393..1dff822a82 100644 --- a/code/game/jobs/whitelist_vr.dm +++ b/code/game/jobs/whitelist_vr.dm @@ -8,7 +8,7 @@ GLOBAL_LIST_EMPTY(job_whitelist) /proc/load_jobwhitelist() var/text = file2text("config/jobwhitelist.txt") if (!text) - log_misc("Failed to load config/jobwhitelist.txt") + log_world("Failed to load config/jobwhitelist.txt") else GLOB.job_whitelist = splittext(text, "\n") diff --git a/code/game/machinery/atm_ret_field.dm b/code/game/machinery/atm_ret_field.dm index 88159a5fac..83f40627f7 100644 --- a/code/game/machinery/atm_ret_field.dm +++ b/code/game/machinery/atm_ret_field.dm @@ -164,7 +164,7 @@ //Delete ourselves if we find extra mapped in arfgs for(var/obj/machinery/atmospheric_field_generator/F in loc) if(F != src) - log_debug("Duplicate ARFGS at [x],[y],[z]") + log_mapping("Duplicate ARFGS at [x],[y],[z]") return INITIALIZE_HINT_QDEL var/area/A = get_area(src) diff --git a/code/game/machinery/camera/camera.dm b/code/game/machinery/camera/camera.dm index 83ac93e166..1978f96986 100644 --- a/code/game/machinery/camera/camera.dm +++ b/code/game/machinery/camera/camera.dm @@ -54,9 +54,9 @@ */ if(!src.network || src.network.len < 1) if(loc) - error("[src.name] in [get_area(src)] (x:[src.x] y:[src.y] z:[src.z] has errored. [src.network?"Empty network list":"Null network list"]") + log_world("## ERROR [src.name] in [get_area(src)] (x:[src.x] y:[src.y] z:[src.z] has errored. [src.network?"Empty network list":"Null network list"]") else - error("[src.name] in [get_area(src)]has errored. [src.network?"Empty network list":"Null network list"]") + log_world("## ERROR [src.name] in [get_area(src)]has errored. [src.network?"Empty network list":"Null network list"]") ASSERT(src.network) ASSERT(src.network.len > 0) // VOREStation Edit Start - Make mapping with cameras easier diff --git a/code/game/machinery/camera/motion.dm b/code/game/machinery/camera/motion.dm index a4486af8ea..d89c123b4d 100644 --- a/code/game/machinery/camera/motion.dm +++ b/code/game/machinery/camera/motion.dm @@ -59,7 +59,7 @@ return var/atom/movable/AM = WF.resolve() if(isnull(AM)) - log_debug("DEBUG: HasProximity called without reference on [src].") + log_runtime("DEBUG: HasProximity called without reference on [src].") return // Motion cameras outside of an "ai monitored" area will use this to detect stuff. if (!area_motion) diff --git a/code/game/machinery/computer/guestpass.dm b/code/game/machinery/computer/guestpass.dm index be7f702f20..e3a38eeb41 100644 --- a/code/game/machinery/computer/guestpass.dm +++ b/code/game/machinery/computer/guestpass.dm @@ -216,7 +216,7 @@ accesses.Add(A) else to_chat(ui.user, span_warning("Invalid selection, please consult technical support if there are any issues.")) - log_debug("[key_name_admin(ui.user)] tried selecting an invalid guest pass terminal option.") + log_admin("[key_name_admin(ui.user)] tried selecting an invalid guest pass terminal option.") if("id") if(giver) if(ishuman(ui.user)) diff --git a/code/game/machinery/computer/shuttle.dm b/code/game/machinery/computer/shuttle.dm index 4fe8d40881..a48dfc100c 100644 --- a/code/game/machinery/computer/shuttle.dm +++ b/code/game/machinery/computer/shuttle.dm @@ -38,11 +38,11 @@ if (src.auth_need - src.authorized.len > 0) message_admins("[key_name_admin(user)] has authorized early shuttle launch") log_game("[user.ckey] has authorized early shuttle launch") - to_world(span_boldnotice("Alert: [src.auth_need - src.authorized.len] authorizations needed until shuttle is launched early")) + to_chat(world, span_boldnotice("Alert: [src.auth_need - src.authorized.len] authorizations needed until shuttle is launched early")) else message_admins("[key_name_admin(user)] has launched the shuttle") log_game("[user.ckey] has launched the shuttle early") - to_world(span_boldnotice("Alert: Shuttle launch time shortened to 10 seconds!")) + to_chat(world, span_boldnotice("Alert: Shuttle launch time shortened to 10 seconds!")) emergency_shuttle.set_launch_countdown(10) //src.authorized = null qdel(src.authorized) @@ -50,10 +50,10 @@ if("Repeal") src.authorized -= W:registered_name - to_world(span_boldnotice("Alert: [src.auth_need - src.authorized.len] authorizations needed until shuttle is launched early")) + to_chat(world, span_boldnotice("Alert: [src.auth_need - src.authorized.len] authorizations needed until shuttle is launched early")) if("Abort") - to_world(span_boldnotice("All authorizations to shortening time for shuttle launch have been revoked!")) + to_chat(world, span_boldnotice("All authorizations to shortening time for shuttle launch have been revoked!")) src.authorized.len = 0 src.authorized = list( ) @@ -63,7 +63,7 @@ if(!emagged && !emergency_shuttle.location() && user.get_active_hand() == W) switch(choice) if("Launch") - to_world(span_boldnotice("Alert: Shuttle launch time shortened to 10 seconds!")) + to_chat(world, span_boldnotice("Alert: Shuttle launch time shortened to 10 seconds!")) emergency_shuttle.set_launch_countdown(10) emagged = 1 if("Cancel") diff --git a/code/game/machinery/doors/firedoor.dm b/code/game/machinery/doors/firedoor.dm index f6d9c8cdc2..151e2dcc66 100644 --- a/code/game/machinery/doors/firedoor.dm +++ b/code/game/machinery/doors/firedoor.dm @@ -56,7 +56,7 @@ //Delete ourselves if we find extra mapped in firedoors for(var/obj/machinery/door/firedoor/F in loc) if(F != src) - log_debug("Duplicate firedoors at [x],[y],[z]") + log_mapping("Duplicate firedoors at [x],[y],[z]") return INITIALIZE_HINT_QDEL var/area/A = get_area(src) diff --git a/code/game/machinery/embedded_controller/docking_program.dm b/code/game/machinery/embedded_controller/docking_program.dm index 78dadca5e9..c5885e2727 100644 --- a/code/game/machinery/embedded_controller/docking_program.dm +++ b/code/game/machinery/embedded_controller/docking_program.dm @@ -117,7 +117,7 @@ if(docking_codes) var/code = signal.data["code"] if(code != docking_codes) - log_debug("Controller [id_tag] got request_dock but code:[code] != docking_codes:[docking_codes]") + // to_chat(world, "Controller [id_tag] got request_dock but code:[code] != docking_codes:[docking_codes]") return control_mode = MODE_SERVER diff --git a/code/game/machinery/embedded_controller/mapping_helpers.dm b/code/game/machinery/embedded_controller/mapping_helpers.dm index 4b84fc513d..fcb46fe786 100644 --- a/code/game/machinery/embedded_controller/mapping_helpers.dm +++ b/code/game/machinery/embedded_controller/mapping_helpers.dm @@ -26,11 +26,14 @@ Any frequency works, it's self-setting, but it seems like people have decided AU my_controller = get_controller(get_area(src)) my_device = locate(my_device_type) in get_turf(src) if(!my_device) - to_world(span_world("[span_red("WARNING:")][span_black("Airlock helper '[name]' couldn't find what it wanted at: X:[x] Y:[y] Z:[z]")]")) + to_chat(world, span_world("[span_red("WARNING:")][span_black("Airlock helper '[name]' couldn't find what it wanted at: X:[x] Y:[y] Z:[z]")]")) + log_mapping("WARNING: Airlock helper '[name]' couldn't find what it wanted at: X:[x] Y:[y] Z:[z]") else if(!my_controller) - to_world(span_world("[span_red("WARNING:")][span_black("Airlock helper '[name]' couldn't find a controller at: X:[x] Y:[y] Z:[z]")]")) + to_chat(world, span_world("[span_red("WARNING:")][span_black("Airlock helper '[name]' couldn't find a controller at: X:[x] Y:[y] Z:[z]")]")) + log_mapping("WARNING: Airlock helper '[name]' couldn't find a controller at: X:[x] Y:[y] Z:[z]") else if(!my_controller.id_tag) - to_world(span_world("[span_red("WARNING:")][span_black("Airlock helper '[name]' found a controller without an 'id_tag' set: X:[x] Y:[y] Z:[z]")]")) + to_chat(world, span_world("[span_red("WARNING:")][span_black("Airlock helper '[name]' found a controller without an 'id_tag' set: X:[x] Y:[y] Z:[z]")]")) + log_mapping("WARNING: Airlock helper '[name]' found a controller without an 'id_tag' set: X:[x] Y:[y] Z:[z]") else setup() return INITIALIZE_HINT_QDEL diff --git a/code/game/machinery/flasher.dm b/code/game/machinery/flasher.dm index 61b4a3b0c8..d32200af96 100644 --- a/code/game/machinery/flasher.dm +++ b/code/game/machinery/flasher.dm @@ -113,7 +113,7 @@ var/atom/movable/AM = WF.resolve() if(isnull(AM)) - log_debug("DEBUG: HasProximity called without reference on [src].") + log_runtime("DEBUG: HasProximity called without reference on [src].") return if(disable || !anchored || (last_flash && world.time < last_flash + 150)) return diff --git a/code/game/machinery/gear_dispenser.dm b/code/game/machinery/gear_dispenser.dm index 13d9a94690..e6b0f4d316 100644 --- a/code/game/machinery/gear_dispenser.dm +++ b/code/game/machinery/gear_dispenser.dm @@ -64,13 +64,13 @@ GLOBAL_LIST_EMPTY(dispenser_presets) ASSERT(voidsuit_type) . = ..() if(voidsuit_type && !ispath(voidsuit_type, /obj/item/clothing/suit/space/void)) - error("[src] can't spawn type [voidsuit_type] as a voidsuit") + log_world("## ERROR [src] can't spawn type [voidsuit_type] as a voidsuit") return if(voidhelmet_type && !ispath(voidhelmet_type, /obj/item/clothing/head/helmet/space/void)) - error("[src] can't spawn type [voidsuit_type] as a voidhelmet") + log_world("## ERROR [src] can't spawn type [voidsuit_type] as a voidhelmet") return if(magboots_type && !ispath(magboots_type, /obj/item/clothing/shoes/magboots)) - error("[src] can't spawn type [magboots_type] as magboots") + log_world("## ERROR [src] can't spawn type [magboots_type] as magboots") return var/obj/item/clothing/suit/space/void/voidsuit @@ -86,7 +86,7 @@ GLOBAL_LIST_EMPTY(dispenser_presets) if(voidhelmet_type) // The coder may not have realized this type spawns its own helmet if(voidsuit.hood) - error("[src] created a voidsuit [voidsuit] and wants to add a helmet but it already has one") + log_world("## ERROR [src] created a voidsuit [voidsuit] and wants to add a helmet but it already has one") else voidhelmet = new voidhelmet_type() voidsuit.attach_helmet(voidhelmet) @@ -94,7 +94,7 @@ GLOBAL_LIST_EMPTY(dispenser_presets) if(magboots_type) // The coder may not have realized thist ype spawns its own boots if(voidsuit.boots) - error("[src] created a voidsuit [voidsuit] and wants to add a helmet but it already has one") + log_world("## ERROR [src] created a voidsuit [voidsuit] and wants to add a helmet but it already has one") else magboots = new magboots_type(voidsuit) voidsuit.boots = magboots @@ -105,13 +105,13 @@ GLOBAL_LIST_EMPTY(dispenser_presets) if(life_support) if(user.isSynthetic()) if(voidsuit.cooler) - error("[src] created a voidsuit [voidsuit] and wants to add a suit cooler but it already has one") + log_world("## ERROR [src] created a voidsuit [voidsuit] and wants to add a suit cooler but it already has one") else var/obj/item/life_support = new /obj/item/suit_cooling_unit(voidsuit) voidsuit.cooler = life_support else if(user.species?.breath_type) if(voidsuit.tank) - error("[src] created a voidsuit [voidsuit] and wants to add a tank but it already has one") + log_world("## ERROR [src] created a voidsuit [voidsuit] and wants to add a tank but it already has one") else //Create a tank (if such a thing exists for this species) var/tanktext = "/obj/item/tank/" + "[user.species?.breath_type]" diff --git a/code/game/machinery/machinery.dm b/code/game/machinery/machinery.dm index 5b4c8aee6c..99a3df5eba 100644 --- a/code/game/machinery/machinery.dm +++ b/code/game/machinery/machinery.dm @@ -146,7 +146,7 @@ Class Procs: if(A.loc == src) // If the components are inside the machine, delete them. qdel(A) else // Otherwise we assume they were dropped to the ground during deconstruction, and were not removed from the component_parts list by deconstruction code. - warning("[A] was still in [src]'s component_parts when it was Destroy()'d") + WARNING("[A] was still in [src]'s component_parts when it was Destroy()'d") component_parts.Cut() component_parts = null if(contents) // The same for contents. diff --git a/code/game/machinery/navbeacon.dm b/code/game/machinery/navbeacon.dm index 3dbec11300..a630429127 100644 --- a/code/game/machinery/navbeacon.dm +++ b/code/game/machinery/navbeacon.dm @@ -22,7 +22,7 @@ GLOBAL_LIST_EMPTY(navbeacons) // no I don't like putting this in, but it will do . = ..() set_codes_from_txt(codes_txt) if(freq) - warning("[src] at [x],[y],[z] has deprecated var freq=[freq]. Replace it with proper type.") + WARNING("[src] at [x],[y],[z] has deprecated var freq=[freq]. Replace it with proper type.") var/turf/T = loc hide(!T.is_plating()) @@ -35,7 +35,7 @@ GLOBAL_LIST_EMPTY(navbeacons) // no I don't like putting this in, but it will do /obj/machinery/navbeacon/proc/set_codes_from_txt() if(!codes_txt) return - warning("[src] at [x],[y],[z] in [get_area(src)] is using the deprecated 'codes_txt' mapping method. Replace it with proper type.") + WARNING("[src] at [x],[y],[z] in [get_area(src)] is using the deprecated 'codes_txt' mapping method. Replace it with proper type.") codes = list() var/list/entries = splittext(codes_txt, ";") // entries are separated by semicolons diff --git a/code/game/machinery/nuclear_bomb.dm b/code/game/machinery/nuclear_bomb.dm index 6f8553c262..63ec125250 100644 --- a/code/game/machinery/nuclear_bomb.dm +++ b/code/game/machinery/nuclear_bomb.dm @@ -424,13 +424,13 @@ GLOBAL_VAR(bomb_set) if(SSticker.mode) SSticker.mode.explosion_in_progress = 0 - to_world(span_boldannounce("The station was destoyed by the nuclear blast!")) + to_chat(world, span_boldannounce("The station was destoyed by the nuclear blast!")) SSticker.mode.station_was_nuked = (off_station<2) //offstation==1 is a draw. the station becomes irradiated and needs to be evacuated. //kinda shit but I couldn't get permission to do what I wanted to do. if(!SSticker.mode.check_finished())//If the mode does not deal with the nuke going off so just reboot because everyone is stuck as is - to_world(span_boldannounce("Resetting in 30 seconds!")) + to_chat(world, span_boldannounce("Resetting in 30 seconds!")) feedback_set_details("end_error","nuke - unhandled ending") diff --git a/code/game/machinery/pointdefense.dm b/code/game/machinery/pointdefense.dm index 8ac509b3de..e1704b43d6 100644 --- a/code/game/machinery/pointdefense.dm +++ b/code/game/machinery/pointdefense.dm @@ -27,7 +27,7 @@ GLOBAL_LIST_BOILERPLATE(pointdefense_turrets, /obj/machinery/pointdefense) //No more than 1 controller please. for(var/obj/machinery/pointdefense_control/PC as anything in GLOB.pointdefense_controllers) if(PC != src && PC.id_tag == id_tag) - warning("Two [src] with the same id_tag of [id_tag]") + WARNING("Two [src] with the same id_tag of [id_tag]") id_tag = null default_apply_parts() diff --git a/code/game/machinery/telecomms/telecomunications.dm b/code/game/machinery/telecomms/telecomunications.dm index 0fa80cd2fa..44751feebe 100644 --- a/code/game/machinery/telecomms/telecomunications.dm +++ b/code/game/machinery/telecomms/telecomunications.dm @@ -701,7 +701,7 @@ //Generic telecomm connectivity test proc /proc/can_telecomm(var/atom/A, var/atom/B, var/ad_hoc = FALSE) if(!A || !B) - log_debug("can_telecomm(): Undefined endpoints!") + log_mapping("can_telecomm(): Undefined endpoints!") return FALSE //Can't in this case, obviously! diff --git a/code/game/machinery/virtual_reality/vr_procs.dm b/code/game/machinery/virtual_reality/vr_procs.dm index 59d0631f1f..aacd8fd3cb 100644 --- a/code/game/machinery/virtual_reality/vr_procs.dm +++ b/code/game/machinery/virtual_reality/vr_procs.dm @@ -1,12 +1,12 @@ // Gross proc which is called on Life() to check for escaped VR mobs. Tried to do this with Exited() on area/vr but ended up being too heavy. /mob/living/proc/handle_vr_derez() if(virtual_reality_mob && !istype(get_area(src), /area/vr)) - log_debug("[src] escaped virtual reality") + log_admin("[src] escaped virtual reality") visible_message("[src] blinks out of existence.") return_from_vr() for(var/obj/belly/B in vore_organs) // Assume anybody inside an escaped VR mob is also an escaped VR mob. for(var/mob/living/L in B) - log_debug("[L] was inside an escaped VR mob and has been deleted.") + log_vore("[L] was inside an escaped VR mob ([src]) and has been deleted.") L.handle_vr_derez() //Recursive! Let's get EVERYONE properly out of here! if(!QDELETED(L)) //This is so we don't double qdel() things when we're doing recursive removal. qdel(L) diff --git a/code/game/mecha/equipment/mecha_equipment.dm b/code/game/mecha/equipment/mecha_equipment.dm index 27003d8ee0..9e6272078d 100644 --- a/code/game/mecha/equipment/mecha_equipment.dm +++ b/code/game/mecha/equipment/mecha_equipment.dm @@ -106,7 +106,7 @@ /obj/item/mecha_parts/mecha_equipment/proc/critfail() if(chassis) - log_message("Critical failure",1) + src.mecha_log_message("Critical failure",1) return /obj/item/mecha_parts/mecha_equipment/proc/get_equip_info() @@ -209,7 +209,7 @@ if(enable_special_checks(M)) enable_special = TRUE - M.log_message("[src] initialized.") + M.mecha_log_message("[src] initialized.") if(!M.selected) M.selected = src src.update_chassis_page() @@ -245,7 +245,7 @@ if(chassis.selected == src) chassis.selected = null update_chassis_page() - chassis.log_message("[src] removed from equipment.") + chassis.mecha_log_message("[src] removed from equipment.") chassis = null set_ready_state(TRUE) enable_special = FALSE @@ -267,9 +267,9 @@ chassis.occupant_message("[icon2html(src, chassis.occupant.client)] [message]") return -/obj/item/mecha_parts/mecha_equipment/proc/log_message(message) +/obj/item/mecha_parts/mecha_equipment/proc/mecha_log_message(message) if(chassis) - chassis.log_message("[src]: [message]") + chassis.mecha_log_message("[src]: [message]") return /obj/item/mecha_parts/mecha_equipment/proc/MoveAction() //Allows mech equipment to do an action upon the mech moving diff --git a/code/game/mecha/equipment/tools/cable_layer.dm b/code/game/mecha/equipment/tools/cable_layer.dm index ec7c869a85..0b1ad624c3 100644 --- a/code/game/mecha/equipment/tools/cable_layer.dm +++ b/code/game/mecha/equipment/tools/cable_layer.dm @@ -34,7 +34,7 @@ if(href_list["toggle"]) set_ready_state(!equip_ready) occupant_message("[src] [equip_ready?"dea":"a"]ctivated.") - log_message("[equip_ready?"Dea":"A"]ctivated.") + src.mecha_log_message("[equip_ready?"Dea":"A"]ctivated.") return if(href_list["cut"]) if(cable && cable.get_amount()) @@ -73,7 +73,7 @@ if(!cable || cable.get_amount() < 1) set_ready_state(TRUE) occupant_message("Cable depleted, [src] deactivated.") - log_message("Cable depleted, [src] deactivated.") + src.mecha_log_message("Cable depleted, [src] deactivated.") return if(cable.get_amount() < amount) occupant_message("No enough cable to finish the task.") diff --git a/code/game/mecha/equipment/tools/clamp.dm b/code/game/mecha/equipment/tools/clamp.dm index 8c7e16ec97..1385797445 100644 --- a/code/game/mecha/equipment/tools/clamp.dm +++ b/code/game/mecha/equipment/tools/clamp.dm @@ -86,7 +86,7 @@ O.loc = chassis O.anchored = FALSE occupant_message(span_notice("[target] succesfully loaded.")) - log_message("Loaded [O]. Cargo compartment capacity: [cargo_holder.cargo_capacity - cargo_holder.cargo.len]") + src.mecha_log_message("Loaded [O]. Cargo compartment capacity: [cargo_holder.cargo_capacity - cargo_holder.cargo.len]") else occupant_message(span_warning("You must hold still while handling objects.")) O.anchored = initial(O.anchored) @@ -147,7 +147,7 @@ O.loc = chassis O.anchored = FALSE chassis.occupant_message(span_notice("[target] succesfully loaded.")) - chassis.log_message("Loaded [O]. Cargo compartment capacity: [cargo_holder.cargo_capacity - cargo_holder.cargo.len]") + chassis.mecha_log_message("Loaded [O]. Cargo compartment capacity: [cargo_holder.cargo_capacity - cargo_holder.cargo.len]") else chassis.occupant_message(span_warning("You must hold still while handling objects.")) O.anchored = initial(O.anchored) diff --git a/code/game/mecha/equipment/tools/cloak.dm b/code/game/mecha/equipment/tools/cloak.dm index 44f32ac3a9..9a71de318d 100644 --- a/code/game/mecha/equipment/tools/cloak.dm +++ b/code/game/mecha/equipment/tools/cloak.dm @@ -36,7 +36,7 @@ /obj/item/mecha_parts/mecha_equipment/cloak/proc/start_cloak() if(chassis) chassis.cloak() - log_message("Activated.") + src.mecha_log_message("Activated.") START_PROCESSING(SSobj, src) set_ready_state(FALSE) playsound(src, 'sound/effects/EMPulse.ogg', 100, 1) @@ -44,7 +44,7 @@ /obj/item/mecha_parts/mecha_equipment/cloak/proc/stop_cloak() if(chassis) chassis.uncloak() - log_message("Deactivated.") + src.mecha_log_message("Deactivated.") STOP_PROCESSING(SSobj, src) set_ready_state(TRUE) playsound(src, 'sound/effects/EMPulse.ogg', 100, 1) diff --git a/code/game/mecha/equipment/tools/drill.dm b/code/game/mecha/equipment/tools/drill.dm index c2cdb0955e..3838583a92 100644 --- a/code/game/mecha/equipment/tools/drill.dm +++ b/code/game/mecha/equipment/tools/drill.dm @@ -28,10 +28,10 @@ return else if((W.reinf_material && advanced) || do_after_cooldown(target))//R wall with good drill - log_message("Drilled through [target]") + src.mecha_log_message("Drilled through [target]") target.ex_act(3) else - log_message("Drilled through [target]") + src.mecha_log_message("Drilled through [target]") target.ex_act(2) else if(ismineralturf(target)) @@ -42,7 +42,7 @@ else var/turf/simulated/mineral/M1 = target M1.GetDrilled() - log_message("Drilled through [target]") + src.mecha_log_message("Drilled through [target]") if(locate(/obj/item/mecha_parts/mecha_equipment/tool/hydraulic_clamp) in chassis.equipment) var/obj/structure/ore_box/ore_box = locate(/obj/structure/ore_box) in chassis:cargo if(ore_box) @@ -54,7 +54,7 @@ drill_mob(target, chassis.occupant) return 1 else if(target.loc == C) - log_message("Drilled through [target]") + src.mecha_log_message("Drilled through [target]") target.ex_act(2) return 1 @@ -114,16 +114,16 @@ if(W.reinf_material) occupant_message(span_warning("[target] is too durable to bore through.")) else - log_message("Bored through [target]") + src.mecha_log_message("Bored through [target]") target.ex_act(2) else if(ismineralturf(target)) var/turf/simulated/mineral/M = target if(enable_special && !M.density) M.ex_act(2) - log_message("Bored into [target]") + src.mecha_log_message("Bored into [target]") else M.GetDrilled() - log_message("Bored through [target]") + src.mecha_log_message("Bored through [target]") if(locate(/obj/item/mecha_parts/mecha_equipment/tool/hydraulic_clamp) in chassis.equipment) var/obj/structure/ore_box/ore_box = locate(/obj/structure/ore_box) in chassis:cargo if(ore_box) @@ -131,6 +131,6 @@ if(get_dir(chassis,ore)&chassis.dir) ore.forceMove(ore_box) else if(target.loc == C) - log_message("Drilled through [target]") + src.mecha_log_message("Drilled through [target]") target.ex_act(2) return 1 diff --git a/code/game/mecha/equipment/tools/energy_relay.dm b/code/game/mecha/equipment/tools/energy_relay.dm index 0f64531983..44b848a2ab 100644 --- a/code/game/mecha/equipment/tools/energy_relay.dm +++ b/code/game/mecha/equipment/tools/energy_relay.dm @@ -83,11 +83,11 @@ if(datum_flags & DF_ISPROCESSING) STOP_PROCESSING(SSfastprocess, src) set_ready_state(TRUE) - log_message("Deactivated.") + src.mecha_log_message("Deactivated.") else START_PROCESSING(SSfastprocess, src) set_ready_state(FALSE) - log_message("Activated.") + src.mecha_log_message("Activated.") return /obj/item/mecha_parts/mecha_equipment/tesla_energy_relay/get_equip_info() diff --git a/code/game/mecha/equipment/tools/generator.dm b/code/game/mecha/equipment/tools/generator.dm index 0cb0246fee..24c0504b49 100644 --- a/code/game/mecha/equipment/tools/generator.dm +++ b/code/game/mecha/equipment/tools/generator.dm @@ -29,15 +29,15 @@ if(!chassis) set_ready_state(TRUE) return PROCESS_KILL - if(fuel_amount <= 0) - log_message("Deactivated - no fuel.") + if(fuel_amount <= 0) // CHOMPEdit - Spam fix + src.mecha_log_message("Deactivated - no fuel.") set_ready_state(TRUE) return PROCESS_KILL var/cur_charge = chassis.get_charge() if(isnull(cur_charge)) set_ready_state(TRUE) occupant_message("No powercell detected.") - log_message("Deactivated.") + src.mecha_log_message("Deactivated.") return PROCESS_KILL var/use_fuel = fuel_per_cycle_idle if(cur_charge= reagents.maximum_volume || !chassis.has_charge(energy_drain)) occupant_message(span_warning("Reagent processing stopped.")) - log_message("Reagent processing stopped.") + src.mecha_log_message("Reagent processing stopped.") return PROCESS_KILL var/amount = synth_speed / processed_reagents.len for(var/reagent in processed_reagents) @@ -331,7 +331,7 @@ shut_down() if(chassis && chassis.occupant) to_chat(chassis.occupant, span_notice("\The [chassis] shudders as something jams!")) - log_message("[src.name] has malfunctioned. Maintenance required.") + src.mecha_log_message("[src.name] has malfunctioned. Maintenance required.") /obj/item/mecha_parts/mecha_equipment/crisis_drone/process() // Will continually try to find the nearest person above the threshold that is a valid target, and try to heal them. if(chassis && enabled && chassis.has_charge(energy_drain) && (chassis.occupant || enable_special)) @@ -455,10 +455,10 @@ enabled = !enabled if(enabled) set_ready_state(FALSE) - log_message("Activated.") + src.mecha_log_message("Activated.") else set_ready_state(TRUE) - log_message("Deactivated.") + src.mecha_log_message("Deactivated.") /obj/item/mecha_parts/mecha_equipment/crisis_drone/add_equip_overlay(obj/mecha/M as obj) ..() diff --git a/code/game/mecha/equipment/weapons/ballistic/ballistic.dm b/code/game/mecha/equipment/weapons/ballistic/ballistic.dm index 83b23bd98e..e1773adc48 100644 --- a/code/game/mecha/equipment/weapons/ballistic/ballistic.dm +++ b/code/game/mecha/equipment/weapons/ballistic/ballistic.dm @@ -13,7 +13,7 @@ projectiles_to_add-- chassis.use_power(projectile_energy_cost) send_byjax(chassis.occupant,"exosuit.browser","\ref[src]",src.get_equip_info()) - log_message("Rearmed [src.name].") + src.mecha_log_message("Rearmed [src.name].") return /obj/item/mecha_parts/mecha_equipment/weapon/ballistic/Topic(href, href_list) diff --git a/code/game/mecha/equipment/weapons/honk.dm b/code/game/mecha/equipment/weapons/honk.dm index ee2c4e14c9..91787e848b 100644 --- a/code/game/mecha/equipment/weapons/honk.dm +++ b/code/game/mecha/equipment/weapons/honk.dm @@ -33,6 +33,6 @@ M.Weaken(3) M.Stun(5) chassis.use_power(energy_drain) - log_message("Used a sound emission device.") + src.mecha_log_message("Used a sound emission device.") do_after_cooldown() return diff --git a/code/game/mecha/equipment/weapons/weapons.dm b/code/game/mecha/equipment/weapons/weapons.dm index faf33c1bf6..3e215d516e 100644 --- a/code/game/mecha/equipment/weapons/weapons.dm +++ b/code/game/mecha/equipment/weapons/weapons.dm @@ -32,7 +32,7 @@ chassis.use_power(energy_drain) chassis.visible_message(span_warning("[chassis] fires [src]!")) occupant_message(span_warning("You fire [src]!")) - log_message("Fired from [src], targeting [target].") + src.mecha_log_message("Fired from [src], targeting [target].") var/target_for_log = "unknown" if(ismob(target)) target_for_log = target diff --git a/code/game/mecha/mecha.dm b/code/game/mecha/mecha.dm index 4a08902218..9c07014acf 100644 --- a/code/game/mecha/mecha.dm +++ b/code/game/mecha/mecha.dm @@ -233,7 +233,7 @@ add_cell() removeVerb(/obj/mecha/verb/disconnect_from_port) - log_message("[src.name] created.") + src.mecha_log_message("[src.name] created.") loc.Entered(src) GLOB.mechas_list += src //global mech list @@ -583,7 +583,7 @@ if("Toggle Airtank") use_internal_tank = !use_internal_tank occupant_message("Now taking air from [use_internal_tank?"internal airtank":"environment"].") - log_message("Now taking air from [use_internal_tank?"internal airtank":"environment"].") + src.mecha_log_message("Now taking air from [use_internal_tank?"internal airtank":"environment"].") if("Toggle Light") lights = !lights if(lights) @@ -591,7 +591,7 @@ else set_light(light_range - lights_power) occupant_message("Toggled lights [lights?"on":"off"].") - log_message("Toggled lights [lights?"on":"off"].") + src.mecha_log_message("Toggled lights [lights?"on":"off"].") playsound(src, 'sound/mecha/heavylightswitch.ogg', 50, 1) if("View Stats") occupant << browse(src.get_stats_html(), "window=exosuit") @@ -661,7 +661,7 @@ /obj/mecha/proc/interface_action(obj/machinery/target) if(istype(target, /obj/machinery/access_button)) src.occupant_message(span_notice("Interfacing with [target].")) - src.log_message("Interfaced with [target].") + src.mecha_log_message("Interfaced with [target].") target.attack_hand(src.occupant) return 1 if(istype(target, /obj/machinery/embedded_controller)) @@ -677,7 +677,7 @@ return STATUS_INTERACTIVE if(src.Adjacent(src_object)) src.occupant_message(span_notice("Interfacing with [src_object]...")) - src.log_message("Interfaced with [src_object].") + src.mecha_log_message("Interfaced with [src_object].") return STATUS_INTERACTIVE if(src_object in view(2, src)) return STATUS_UPDATE //if they're close enough, allow the occupant to see the screen through the viewport or whatever. @@ -872,7 +872,7 @@ if(!src.check_for_support()) float_direction = direction start_process(MECHA_PROC_MOVEMENT) - src.log_message(span_warning("Movement control lost. Inertial movement started.")) + src.mecha_log_message(span_warning("Movement control lost. Inertial movement started.")) if(do_after_action(get_step_delay())) can_move = 1 return 1 @@ -1071,7 +1071,7 @@ return user.setClickCooldown(user.get_attack_speed()) - src.log_message("Attack by hand/paw. Attacker - [user].",1) + src.mecha_log_message("Attack by hand/paw. Attacker - [user].",1) var/obj/item/mecha_parts/component/armor/ArmC = internal_components[MECH_ARMOR] @@ -1115,8 +1115,9 @@ /obj/mecha/hitby(atom/movable/source) //wrapper ..() - src.log_message("Hit by [source].",1) //CHOMPEdit - Don't have JSON logging yet. - call((proc_res["dynhitby"]||src), "dynhitby")(source) //CHOMPEdit - Don't have JSON logging yet. + src.mecha_log_message("Hit by [source].",1) + call((proc_res["dynhitby"]||src), "dynhitby")(source) + return //I think this is relative to throws. /obj/mecha/proc/dynhitby(atom/movable/A) @@ -1187,7 +1188,7 @@ Test.hit |= occupant // Register a hit on the occupant, for things like turrets, or in simple-mob cases stopping friendly fire in firing line mode. return - src.log_message("Hit by projectile. Type: [Proj.name]([Proj.check_armour]).",1) + src.mecha_log_message("Hit by projectile. Type: [Proj.name]([Proj.check_armour]).",1) call((proc_res["dynbulletdamage"]||src), "dynbulletdamage")(Proj) //calls equipment ..() return @@ -1287,7 +1288,7 @@ else temp_deflect_chance = round(ArmC.get_efficiency() * ArmC.deflect_chance + (defence_mode ? 25 : 0)) - src.log_message("Affected by explosion of severity: [severity].",1) + src.mecha_log_message("Affected by explosion of severity: [severity].",1) if(prob(temp_deflect_chance)) severity++ src.log_append_to_last("Armor saved, changing severity to [severity].") @@ -1310,7 +1311,7 @@ /*Will fix later -Sieve /obj/mecha/attack_blob(mob/user as mob) - src.log_message("Attack by blob. Attacker - [user].",1) + src.mecha_log_message("Attack by blob. Attacker - [user].",1) if(!prob(src.deflect_chance)) src.take_damage(6) src.check_for_internal_damage(list(MECHA_INT_TEMP_CONTROL,MECHA_INT_TANK_BREACH,MECHA_INT_CONTROL_LOST)) @@ -1334,21 +1335,21 @@ if(get_charge()) use_power((cell.charge/2)/severity) take_damage(50 / severity,"energy") - src.log_message("EMP detected",1) + src.mecha_log_message("EMP detected",1) if(prob(80)) check_for_internal_damage(list(MECHA_INT_FIRE,MECHA_INT_TEMP_CONTROL,MECHA_INT_CONTROL_LOST,MECHA_INT_SHORT_CIRCUIT),1) return /obj/mecha/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume) if(exposed_temperature>src.max_temperature) - src.log_message("Exposed to dangerous temperature.",1) + src.mecha_log_message("Exposed to dangerous temperature.",1) src.take_damage(5,"fire") //The take_damage() proc handles armor values src.check_for_internal_damage(list(MECHA_INT_FIRE, MECHA_INT_TEMP_CONTROL)) return /obj/mecha/proc/dynattackby(obj/item/W as obj, mob/user as mob) user.setClickCooldown(user.get_attack_speed(W)) - src.log_message("Attacked by [W]. Attacker - [user]") + src.mecha_log_message("Attacked by [W]. Attacker - [user]") var/pass_damage_reduc_mod //Modifer for failing to bring AP. var/obj/item/mecha_parts/component/armor/ArmC = internal_components[MECH_ARMOR] @@ -1506,7 +1507,7 @@ src.cell = null state = MECHA_CELL_OUT to_chat(user, "You unscrew and pry out the powercell.") - src.log_message("Powercell removed") + src.mecha_log_message("Powercell removed") else if(state==MECHA_CELL_OUT && src.cell) state=MECHA_CELL_OPEN to_chat(user, "You screw the cell in place") @@ -1517,11 +1518,11 @@ to_chat(user, "You attempt to eject the pilot using the maintenance controls.") if(src.occupant.stat) src.go_out() - src.log_message("[src.occupant] was ejected using the maintenance controls.") + src.mecha_log_message("[src.occupant] was ejected using the maintenance controls.") else to_chat(user, span_warning("Your attempt is rejected.")) src.occupant_message(span_warning("An attempt to eject you was made using the maintenance controls.")) - src.log_message("Eject attempt made using maintenance controls - rejected.") + src.mecha_log_message("Eject attempt made using maintenance controls - rejected.") return else if(istype(W, /obj/item/cell)) @@ -1531,7 +1532,7 @@ user.drop_item() W.forceMove(src) src.cell = W - src.log_message("Powercell installed") + src.mecha_log_message("Powercell installed") else to_chat(user, "There's already a powercell installed.") return @@ -1607,7 +1608,7 @@ else call((proc_res["dynattackby"]||src), "dynattackby")(W,user) /* - src.log_message("Attacked by [W]. Attacker - [user]") + src.mecha_log_message("Attacked by [W]. Attacker - [user]") if(prob(src.deflect_chance)) to_chat(user, span_warning("\The [W] bounces off [src.name] armor.")) src.log_append_to_last("Armor saved.") @@ -1693,7 +1694,7 @@ src.Move(src.loc) update_icon() set_dir(dir_in) - src.log_message("[mmi_as_oc] moved in as pilot.") + src.mecha_log_message("[mmi_as_oc] moved in as pilot.") if(!hasInternalDamage()) src.occupant << sound('sound/mecha/nominal.ogg',volume=50) update_icon() @@ -1769,7 +1770,7 @@ network.gases += internal_tank.return_air() network.update = 1 playsound(src, 'sound/mecha/gasconnected.ogg', 50, 1) - log_message("Connected to gas port.") + src.mecha_log_message("Connected to gas port.") return 1 /obj/mecha/proc/disconnect() @@ -1783,7 +1784,7 @@ connected_port.connected_device = null connected_port = null playsound(src, 'sound/mecha/gasdisconnected.ogg', 50, 1) - src.log_message("Disconnected from gas port.") + src.mecha_log_message("Disconnected from gas port.") return 1 @@ -1855,7 +1856,7 @@ if(lights) set_light(light_range + lights_power) else set_light(light_range - lights_power) src.occupant_message("Toggled lights [lights?"on":"off"].") - log_message("Toggled lights [lights?"on":"off"].") + src.mecha_log_message("Toggled lights [lights?"on":"off"].") playsound(src, 'sound/mecha/heavylightswitch.ogg', 50, 1) return @@ -1882,7 +1883,7 @@ use_internal_tank = !use_internal_tank src.occupant_message("Now taking air from [use_internal_tank?"internal airtank":"environment"].") - src.log_message("Now taking air from [use_internal_tank?"internal airtank":"environment"].") + src.mecha_log_message("Now taking air from [use_internal_tank?"internal airtank":"environment"].") playsound(src, 'sound/mecha/gasdisconnected.ogg', 30, 1) return @@ -1899,7 +1900,7 @@ return strafing = !strafing src.occupant_message("Toggled strafing mode [strafing?"on":"off"].") - src.log_message("Toggled strafing mode [strafing?"on":"off"].") + src.mecha_log_message("Toggled strafing mode [strafing?"on":"off"].") return /obj/mecha/MouseDrop_T(mob/O, mob/user) @@ -1935,7 +1936,7 @@ to_chat(user, span_warning("You can't climb into the exosuit while buckled!")) return - src.log_message("[user] tries to move in.") + src.mecha_log_message("[user] tries to move in.") if(iscarbon(user)) var/mob/living/carbon/C = user if(C.handcuffed) @@ -2104,7 +2105,7 @@ else return if(mob_container.forceMove(src.loc))//ejecting mob container - log_message("[mob_container] moved out.") + src.mecha_log_message("[mob_container] moved out.") occupant.reset_view() occupant << browse(null, "window=exosuit") if(occupant.client && cloaked_selfimage) @@ -2452,7 +2453,7 @@ to_chat(src.occupant, "[icon2html(src, src.occupant.client)] [message]") return -/obj/mecha/proc/log_message(message as text,red=null) +/obj/mecha/proc/mecha_log_message(message as text,red=null) log.len++ if(red) message = span_red(message) @@ -2623,7 +2624,7 @@ user.visible_message(span_infoplain(span_bold("\The [user]") + " opens the hatch on \the [P] and removes [occupant]!"), span_notice("You open the hatch on \the [P] and remove [occupant]!")) P.go_out() - P.log_message("[occupant] was removed.") + P.mecha_log_message("[occupant] was removed.") return if(href_list["add_req_access"] && add_req_access && top_filter.getObj("id_card")) if(!in_range(src, usr)) return @@ -2656,16 +2657,16 @@ if(href_list["repair_int_control_lost"]) if(usr != src.occupant) return src.occupant_message("Recalibrating coordination system.") - src.log_message("Recalibration of coordination system started.") + src.mecha_log_message("Recalibration of coordination system started.") var/T = src.loc if(do_after_action(100)) if(T == src.loc) src.clearInternalDamage(MECHA_INT_CONTROL_LOST) src.occupant_message(span_blue("Recalibration successful.")) - src.log_message("Recalibration of coordination system finished with 0 errors.") + src.mecha_log_message("Recalibration of coordination system finished with 0 errors.") else src.occupant_message(span_red("Recalibration failed.")) - src.log_message("Recalibration of coordination system failed with 1 error.",1) + src.mecha_log_message("Recalibration of coordination system failed with 1 error.",1) if(href_list["drop_from_cargo"]) var/obj/O = locate(href_list["drop_from_cargo"]) if(O && (O in src.cargo)) @@ -2675,7 +2676,7 @@ var/turf/T = get_turf(O) if(T) T.Entered(O) - src.log_message("Unloaded [O]. Cargo compartment capacity: [cargo_capacity - src.cargo.len]") + src.mecha_log_message("Unloaded [O]. Cargo compartment capacity: [cargo_capacity - src.cargo.len]") return //debug @@ -2802,7 +2803,7 @@ if(!damage) return 0 - src.log_message("Attacked. Attacker - [user].",1) + src.mecha_log_message("Attacked. Attacker - [user].",1) user.do_attack_animation(src) if(prob(temp_deflect_chance))//Deflected diff --git a/code/game/mecha/micro/micro_equipment.dm b/code/game/mecha/micro/micro_equipment.dm index 7b6a7476f2..c6793b9e58 100644 --- a/code/game/mecha/micro/micro_equipment.dm +++ b/code/game/mecha/micro/micro_equipment.dm @@ -130,13 +130,13 @@ if(W.reinf_material) occupant_message(span_warning("[target] is too durable to drill through.")) else - log_message("Drilled through [target]") + src.mecha_log_message("Drilled through [target]") target.ex_act(2) else if(ismineralturf(target)) for(var/turf/simulated/mineral/M in range(chassis,1)) if(get_dir(chassis,M)&chassis.dir) M.GetDrilled() - log_message("Drilled through [target]") + src.mecha_log_message("Drilled through [target]") var/obj/item/mecha_parts/mecha_equipment/tool/micro/orescoop/ore_box = (locate(/obj/item/mecha_parts/mecha_equipment/tool/micro/orescoop) in chassis.equipment) if(ore_box) for(var/obj/item/ore/ore in range(chassis,1)) @@ -147,7 +147,7 @@ else ore.forceMove(ore_box) else if(target.loc == C) - log_message("Drilled through [target]") + src.mecha_log_message("Drilled through [target]") target.ex_act(2) return 1 diff --git a/code/game/memory_profiler_ch.dm b/code/game/memory_profiler_ch.dm index fb2c4afd28..00131992ce 100644 --- a/code/game/memory_profiler_ch.dm +++ b/code/game/memory_profiler_ch.dm @@ -65,7 +65,7 @@ if(mem_count[type] < 10000) mem_count -= type world.log << "[display_bytes(accounted_for)] of memory accounted for" world.log << "Sorting and exporting data" - to_world(span_alert("Memory profiler is exporting data. Expect server to freeze for 10-30 seconds.")) + to_chat(world, span_alert("Memory profiler is exporting data. Expect server to freeze for 10-30 seconds.")) sortTim(types_count, /proc/cmp_numeric_desc, TRUE) var/output = "" for(var/type in types_count) diff --git a/code/game/objects/effects/chem/chemsmoke.dm b/code/game/objects/effects/chem/chemsmoke.dm index 47920bacb3..129715635e 100644 --- a/code/game/objects/effects/chem/chemsmoke.dm +++ b/code/game/objects/effects/chem/chemsmoke.dm @@ -99,11 +99,11 @@ var/more = "" if(M) more = "(?)" - message_admins("A chemical smoke reaction has taken place in ([whereLink])[contained]. Last associated key is [print_name][more].", 0, 1) - log_game("A chemical smoke reaction has taken place in ([where])[contained]. Last associated key is [print_name].") + message_admins("A chemical smoke reaction has taken place in ([whereLink]) [contained]. Last associated key is [print_name][more].", 0, 1) + log_game("A chemical smoke reaction has taken place in ([where]) [contained]. Last associated key is [print_name].") else message_admins("A chemical smoke reaction has taken place in ([whereLink]). No associated key.", 0, 1) - log_game("A chemical smoke reaction has taken place in ([where])[contained]. No associated key.") + log_game("A chemical smoke reaction has taken place in ([where]) [contained]. No associated key.") //Runs the chem smoke effect // Spawns damage over time loop for each reagent held in the cloud. diff --git a/code/game/objects/effects/gibs.dm b/code/game/objects/effects/gibs.dm index 8021ef414b..9d138f851b 100644 --- a/code/game/objects/effects/gibs.dm +++ b/code/game/objects/effects/gibs.dm @@ -22,7 +22,8 @@ /obj/effect/gibspawner/proc/Gib(atom/location, var/datum/dna/MobDNA = null) if(gibtypes.len != gibamounts.len || gibamounts.len != gibdirections.len) - to_world(span_filter_system(span_warning("Gib list length mismatch!"))) + to_chat(world, span_filter_system(span_warning("Gib list length mismatch!"))) + log_world("Gib list length mismatch!") return var/obj/effect/decal/cleanable/blood/gibs/gib = null diff --git a/code/game/objects/effects/landmarks.dm b/code/game/objects/effects/landmarks.dm index a39ebe00fb..a97e9073f9 100644 --- a/code/game/objects/effects/landmarks.dm +++ b/code/game/objects/effects/landmarks.dm @@ -117,7 +117,7 @@ if(using_map) using_map.secret_levels |= z else - log_error("[type] mapped in but no using_map") + log_mapping("[type] mapped in but no using_map") /obj/effect/landmark/hidden_level delete_me = TRUE @@ -127,7 +127,7 @@ if(using_map) using_map.hidden_levels |= z else - log_error("[type] mapped in but no using_map") + log_mapping("[type] mapped in but no using_map") /obj/effect/landmark/virtual_reality diff --git a/code/game/objects/effects/map_effects/beam_point.dm b/code/game/objects/effects/map_effects/beam_point.dm index dff889889d..37e43011f7 100644 --- a/code/game/objects/effects/map_effects/beam_point.dm +++ b/code/game/objects/effects/map_effects/beam_point.dm @@ -90,7 +90,7 @@ GLOBAL_LIST_EMPTY(all_beam_points) /obj/effect/map_effect/beam_point/proc/build_beam(var/atom/beam_target) if(!beam_target) - log_debug("[src] ([src.type] \[[x],[y],[z]\]) failed to build its beam due to not having a target.") + log_mapping("[src] ([src.type] \[[x],[y],[z]\]) failed to build its beam due to not having a target.") return FALSE var/datum/beam/new_beam = Beam(beam_target, beam_icon_state, beam_icon, beam_time, beam_max_distance, beam_type, beam_sleep_time) @@ -102,11 +102,11 @@ GLOBAL_LIST_EMPTY(all_beam_points) /obj/effect/map_effect/beam_point/proc/destroy_beam(var/datum/beam/B) if(!B) - log_debug("[src] ([src.type] \[[x],[y],[z]\]) was asked to destroy a beam that does not exist.") + log_mapping("[src] ([src.type] \[[x],[y],[z]\]) was asked to destroy a beam that does not exist.") return FALSE if(!(B in my_beams)) - log_debug("[src] ([src.type] \[[x],[y],[z]\]) was asked to destroy a beam it did not own.") + log_mapping("[src] ([src.type] \[[x],[y],[z]\]) was asked to destroy a beam it did not own.") return FALSE my_beams -= B diff --git a/code/game/objects/effects/prop/columnblast.dm b/code/game/objects/effects/prop/columnblast.dm index daae3610a5..e0698006d5 100644 --- a/code/game/objects/effects/prop/columnblast.dm +++ b/code/game/objects/effects/prop/columnblast.dm @@ -23,7 +23,7 @@ flick("[icon_state]_erupt",src) return TRUE -/obj/effect/temporary_effect/eruption/testing/on_eruption(var/turf/Target) +/obj/effect/temporary_effect/eruption/test/on_eruption(var/turf/Target) flick("[icon_state]_erupt",src) if(Target) new /obj/effect/explosion(Target) diff --git a/code/game/objects/effects/prop/snake.dm b/code/game/objects/effects/prop/snake.dm index 057e3d5ba4..670b573c2e 100644 --- a/code/game/objects/effects/prop/snake.dm +++ b/code/game/objects/effects/prop/snake.dm @@ -93,18 +93,18 @@ /obj/effect/temporary_effect/pulse/snake/proc/on_enter_turf(var/turf/T) -/obj/effect/temporary_effect/pulse/snake/testing/on_leave_turf(var/turf/T) +/obj/effect/temporary_effect/pulse/snake/test/on_leave_turf(var/turf/T) if(T) - new /obj/effect/temporary_effect/eruption/testing(T, 3 SECONDS, "#ff0000") + new /obj/effect/temporary_effect/eruption/test(T, 3 SECONDS, "#ff0000") -/obj/effect/temporary_effect/pulse/snake/testing/on_enter_turf(var/turf/T) +/obj/effect/temporary_effect/pulse/snake/test/on_enter_turf(var/turf/T) if(T) T.color = "#00ff00" spawn(3 SECONDS) T.color = initial(T.color) -/obj/effect/temporary_effect/pulse/snake/testing/hunter/pulse_loop() +/obj/effect/temporary_effect/pulse/snake/test/hunter/pulse_loop() hunting = locate(/mob/living) in range(7, src) ..() diff --git a/code/game/objects/items/blueprints_vr.dm b/code/game/objects/items/blueprints_vr.dm index 9a22a83ff3..a5a02e172a 100644 --- a/code/game/objects/items/blueprints_vr.dm +++ b/code/game/objects/items/blueprints_vr.dm @@ -452,7 +452,7 @@ //I personally think adding walls to an area is a big deal, so this is commented out. //BEGIN ESOTERIC BULLSHIT - //log_debug("Origin: [origin.c_airblock(checkT)] SourceT: [sourceT.c_airblock(checkT)] 0=NB 1=AB 2=ZB, 3=B") + //to_chat(world, "Origin: [origin.c_airblock(checkT)] SourceT: [sourceT.c_airblock(checkT)] 0=NB 1=AB 2=ZB, 3=B") /* if(origin.c_airblock(checkT)) //If everything breaks and it doesn't want to work, turn on the above debug and check this line. C.L. 0 = not blocked. continue diff --git a/code/game/objects/items/devices/communicator/UI_tgui.dm b/code/game/objects/items/devices/communicator/UI_tgui.dm index da5fea69cd..eb9ae055b4 100644 --- a/code/game/objects/items/devices/communicator/UI_tgui.dm +++ b/code/game/objects/items/devices/communicator/UI_tgui.dm @@ -381,7 +381,7 @@ if(text) exonet.send_message(their_address, "text", text) im_list += list(list("address" = exonet.address, "to_address" = their_address, "im" = text)) - log_pda("(COMM: [src]) sent \"[text]\" to [exonet.get_atom_from_address(their_address)]", ui.user) + ui.user.log_talk("(COMM: [src]) sent \"[text]\" to [exonet.get_atom_from_address(their_address)]", LOG_PDA) var/obj/item/communicator/comm = exonet.get_atom_from_address(their_address) to_chat(ui.user, span_notice("[icon2html(src, ui.user.client)] Sent message to [istype(comm, /obj/item/communicator) ? comm.owner : comm.name], \"[text]\" (Reply)")) for(var/mob/M in GLOB.player_list) diff --git a/code/game/objects/items/devices/communicator/messaging.dm b/code/game/objects/items/devices/communicator/messaging.dm index e2b459cb26..af5aad2cac 100644 --- a/code/game/objects/items/devices/communicator/messaging.dm +++ b/code/game/objects/items/devices/communicator/messaging.dm @@ -107,7 +107,7 @@ if(message) exonet.send_message(comm.exonet.address, "text", message) im_list += list(list("address" = exonet.address, "to_address" = comm.exonet.address, "im" = message)) - log_pda("(COMM: [src]) sent \"[message]\" to [exonet.get_atom_from_address(comm.exonet.address)]", usr) + usr.client.mob.log_talk("(COMM: [src]) sent \"[message]\" to [exonet.get_atom_from_address(comm.exonet.address)]", LOG_PDA) to_chat(usr, span_notice("[icon2html(src,usr.client)] Sent message to [istype(comm, /obj/item/communicator) ? comm.owner : comm.name], \"[message]\" (Reply)")) // Verb: text_communicator() @@ -159,7 +159,7 @@ to_chat(src, span_notice("You have sent '[text_message]' to [chosen_communicator].")) exonet_messages.Add(span_bold("To [chosen_communicator]:") + "
[text_message]") - log_pda("(DCOMM: [src]) sent \"[text_message]\" to [chosen_communicator]", src) + log_talk("(DCOMM: [src]) sent \"[text_message]\" to [chosen_communicator]", LOG_PDA) for(var/mob/M in GLOB.player_list) if(M.stat == DEAD && M.client?.prefs?.read_preference(/datum/preference/toggle/ghost_ears)) if(isnewplayer(M) || M.forbid_seeing_deadchat) diff --git a/code/game/objects/items/devices/radio/encryptionkey.dm b/code/game/objects/items/devices/radio/encryptionkey.dm index 6824ed275a..9b8010e209 100644 --- a/code/game/objects/items/devices/radio/encryptionkey.dm +++ b/code/game/objects/items/devices/radio/encryptionkey.dm @@ -133,3 +133,58 @@ /obj/item/encryptionkey/ent name = "entertainment encryption key" channels = list(CHANNEL_ENTERTAINMENT = 1) + +/obj/item/encryptionkey/heads/hop + name = "head of personnel's encryption key" + icon_state = "hop_cypherkey" + channels = list(CHANNEL_SUPPLY = 1, CHANNEL_SERVICE = 1, CHANNEL_COMMAND = 1, CHANNEL_SECURITY = 1, CHANNEL_EXPLORATION = 1) + +/obj/item/encryptionkey/heads/ai_integrated + name = "ai integrated encryption key" + desc = "Integrated encryption key" + icon_state = "cap_cypherkey" + channels = list(CHANNEL_COMMAND = 1, CHANNEL_SECURITY = 1, CHANNEL_ENGINEERING = 1, CHANNEL_SCIENCE = 1, CHANNEL_MEDICAL = 1, CHANNEL_SUPPLY = 1, CHANNEL_SERVICE = 1, CHANNEL_AI_PRIVATE = 1, CHANNEL_EXPLORATION = 1) + +/obj/item/encryptionkey/heads/captain + name = "site manager's encryption key" + icon_state = "cap_cypherkey" + channels = list(CHANNEL_COMMAND = 1, CHANNEL_SECURITY = 1, CHANNEL_ENGINEERING = 1, CHANNEL_SCIENCE = 1, CHANNEL_MEDICAL = 1, CHANNEL_SUPPLY = 1, CHANNEL_SERVICE = 1, CHANNEL_EXPLORATION = 1) + +/obj/item/encryptionkey/heads/rd + name = "research director's encryption key" + icon_state = "rd_cypherkey" + channels = list(CHANNEL_COMMAND = 1, CHANNEL_SCIENCE = 1) + +/obj/item/encryptionkey/ert + channels = list(CHANNEL_RESPONSE_TEAM = 1, CHANNEL_SCIENCE = 1, CHANNEL_COMMAND = 1, CHANNEL_MEDICAL = 1, CHANNEL_ENGINEERING = 1, CHANNEL_SECURITY = 1, CHANNEL_SUPPLY = 1, CHANNEL_SERVICE = 1, CHANNEL_EXPLORATION = 1) + +/obj/item/encryptionkey/omni //Literally only for the admin intercoms + channels = list(CHANNEL_MERCENARY = 1, CHANNEL_RAIDER = 1, CHANNEL_RESPONSE_TEAM = 1, CHANNEL_SCIENCE = 1, CHANNEL_COMMAND = 1, CHANNEL_MEDICAL = 1, CHANNEL_ENGINEERING = 1, CHANNEL_SECURITY = 1, CHANNEL_SUPPLY = 1, CHANNEL_SERVICE = 1, CHANNEL_EXPLORATION = 1) + +/obj/item/encryptionkey/pathfinder + name = "pathfinder's encryption key" + icon_state = "com_cypherkey" + channels = list(CHANNEL_COMMAND = 1, CHANNEL_EXPLORATION = 1) + +/obj/item/encryptionkey/qm + name = "quartermaster's encryption key" + icon_state = "qm_cypherkey" + channels = list(CHANNEL_COMMAND = 1, CHANNEL_SUPPLY = 1) + +/obj/item/encryptionkey/pilot + name = "pilot's encryption key" + icon_state = "cypherkey" + channels = list(CHANNEL_EXPLORATION = 1) + +/obj/item/encryptionkey/explorer + name = "away team's encryption key" + icon_state = "rob_cypherkey" + channels = list(CHANNEL_EXPLORATION = 1) + +/obj/item/encryptionkey/sar + name = "fm's encryption key" + icon_state = "med_cypherkey" + channels = list(CHANNEL_MEDICAL = 1, CHANNEL_EXPLORATION = 1) + +/obj/item/encryptionkey/talon + channels = list(CHANNEL_TALON = 1) diff --git a/code/game/objects/items/devices/radio/jammer.dm b/code/game/objects/items/devices/radio/jammer.dm index c20b97b1a6..639eff8a0b 100644 --- a/code/game/objects/items/devices/radio/jammer.dm +++ b/code/game/objects/items/devices/radio/jammer.dm @@ -119,3 +119,18 @@ GLOBAL_LIST_EMPTY(active_radio_jammers) cut_overlays() add_overlay("jammer_overlay_[overlay_percent]") last_overlay_percent = overlay_percent + +//Unlimited use, unlimited range jammer for admins. Turn it on, drop it somewhere, it works. +/obj/item/radio_jammer/admin + jam_range = 255 + tick_cost = 0 + +/proc/is_vore_jammed(var/obj/radio) + var/atom/current = radio + while(current.loc) + if(isbelly(current.loc)) + var/obj/belly/B = current.loc + if(B.mode_flags & DM_FLAG_JAMSENSORS) + return TRUE + current = current.loc + return FALSE diff --git a/code/game/objects/items/devices/radio/jammer_vr.dm b/code/game/objects/items/devices/radio/jammer_vr.dm deleted file mode 100644 index 2633ddfe28..0000000000 --- a/code/game/objects/items/devices/radio/jammer_vr.dm +++ /dev/null @@ -1,14 +0,0 @@ -//Unlimited use, unlimited range jammer for admins. Turn it on, drop it somewhere, it works. -/obj/item/radio_jammer/admin - jam_range = 255 - tick_cost = 0 - -/proc/is_vore_jammed(var/obj/radio) - var/atom/current = radio - while(current.loc) - if(isbelly(current.loc)) - var/obj/belly/B = current.loc - if(B.mode_flags & DM_FLAG_JAMSENSORS) - return TRUE - current = current.loc - return FALSE diff --git a/code/game/objects/items/devices/radio/radio.dm b/code/game/objects/items/devices/radio/radio.dm index 351d23ecdb..a0e6d7f80c 100644 --- a/code/game/objects/items/devices/radio/radio.dm +++ b/code/game/objects/items/devices/radio/radio.dm @@ -82,7 +82,7 @@ AIO.link_radio(src) break if(!bs_tx_weakref) - testing("A radio [src] at [x],[y],[z] specified bluespace prelink IDs, but the machines with corresponding IDs ([bs_tx_preload_id], [bs_rx_preload_id]) couldn't be found.") + log_mapping("A radio [src] at [x],[y],[z] specified bluespace prelink IDs, but the machines with corresponding IDs ([bs_tx_preload_id], [bs_rx_preload_id]) couldn't be found.") if(bs_rx_preload_id) var/found = 0 @@ -100,7 +100,7 @@ found = 1 break if(!found) - testing("A radio [src] at [x],[y],[z] specified bluespace prelink IDs, but the machines with corresponding IDs ([bs_tx_preload_id], [bs_rx_preload_id]) couldn't be found.") + log_mapping("A radio [src] at [x],[y],[z] specified bluespace prelink IDs, but the machines with corresponding IDs ([bs_tx_preload_id], [bs_rx_preload_id]) couldn't be found.") /obj/item/radio/Destroy() qdel(wires) @@ -821,3 +821,35 @@ GLOBAL_DATUM(autospeaker, /mob/living/silicon/ai/announcer) bs_rx_preload_id = "Broadcaster A" //Recveive from a transmitter #undef CANBROADCAST_INNERBOX + +/obj/item/radio/phone + subspace_transmission = TRUE + canhear_range = 0 + adhoc_fallback = TRUE + +/obj/item/radio/emergency + name = "Medbay Emergency Radio Link" + icon_state = "med_walkietalkie" + frequency = MED_I_FREQ + subspace_transmission = TRUE + adhoc_fallback = TRUE + +/obj/item/radio/emergency/Initialize(mapload) + . = ..() + internal_channels = GLOB.default_medbay_channels.Copy() + +/obj/item/bluespaceradio/tether_prelinked + name = "bluespace radio (tether)" + handset = /obj/item/radio/bluespacehandset/linked/tether_prelinked + +/obj/item/radio/bluespacehandset/linked/tether_prelinked + bs_tx_preload_id = "tether_rx" //Transmit to a receiver + bs_rx_preload_id = "tether_tx" //Recveive from a transmitter + +/obj/item/bluespaceradio/talon_prelinked + name = "bluespace radio (talon)" + handset = /obj/item/radio/bluespacehandset/linked/talon_prelinked + +/obj/item/radio/bluespacehandset/linked/talon_prelinked + bs_tx_preload_id = "talon_aio" //Transmit to a receiver + bs_rx_preload_id = "talon_aio" //Recveive from a transmitter diff --git a/code/game/objects/items/devices/radio/radio_vr.dm b/code/game/objects/items/devices/radio/radio_vr.dm deleted file mode 100644 index c7143a600c..0000000000 --- a/code/game/objects/items/devices/radio/radio_vr.dm +++ /dev/null @@ -1,33 +0,0 @@ -/obj/item/radio/phone - subspace_transmission = TRUE - canhear_range = 0 - adhoc_fallback = TRUE - -/obj/item/radio/emergency - name = "Medbay Emergency Radio Link" - icon_state = "med_walkietalkie" - frequency = MED_I_FREQ - subspace_transmission = TRUE - adhoc_fallback = TRUE - -/obj/item/radio/emergency/Initialize(mapload) - . = ..() - internal_channels = GLOB.default_medbay_channels.Copy() - - - -/obj/item/bluespaceradio/tether_prelinked - name = "bluespace radio (tether)" - handset = /obj/item/radio/bluespacehandset/linked/tether_prelinked - -/obj/item/radio/bluespacehandset/linked/tether_prelinked - bs_tx_preload_id = "tether_rx" //Transmit to a receiver - bs_rx_preload_id = "tether_tx" //Recveive from a transmitter - -/obj/item/bluespaceradio/talon_prelinked - name = "bluespace radio (talon)" - handset = /obj/item/radio/bluespacehandset/linked/talon_prelinked - -/obj/item/radio/bluespacehandset/linked/talon_prelinked - bs_tx_preload_id = "talon_aio" //Transmit to a receiver - bs_rx_preload_id = "talon_aio" //Recveive from a transmitter diff --git a/code/game/objects/items/devices/transfer_valve.dm b/code/game/objects/items/devices/transfer_valve.dm index 4dcbbb1deb..6c3e6a2c61 100644 --- a/code/game/objects/items/devices/transfer_valve.dm +++ b/code/game/objects/items/devices/transfer_valve.dm @@ -60,7 +60,7 @@ return var/atom/movable/AM = WF.resolve() if(isnull(AM)) - log_debug("DEBUG: HasProximity called without reference on [src].") + log_runtime("DEBUG: HasProximity called without reference on [src].") attached_device?.HasProximity(T, WF, old_loc) /obj/item/transfer_valve/Moved(old_loc, direction, forced) diff --git a/code/game/objects/items/devices/uplink_random_lists.dm b/code/game/objects/items/devices/uplink_random_lists.dm index bb1ee97d77..c0221585dc 100644 --- a/code/game/objects/items/devices/uplink_random_lists.dm +++ b/code/game/objects/items/devices/uplink_random_lists.dm @@ -114,5 +114,5 @@ var/datum/uplink_random_selection/all_uplink_selection = new/datum/uplink_random /proc/debug_uplink_item_assoc_list() for(var/key in uplink.items_assoc) - to_world("[key] - [uplink.items_assoc[key]]") + to_chat(world, "[key] - [uplink.items_assoc[key]]") #endif diff --git a/code/game/objects/items/weapons/grenades/anti_photon_grenade.dm b/code/game/objects/items/weapons/grenades/anti_photon_grenade.dm index a103e859f2..7658e69e27 100644 --- a/code/game/objects/items/weapons/grenades/anti_photon_grenade.dm +++ b/code/game/objects/items/weapons/grenades/anti_photon_grenade.dm @@ -22,7 +22,7 @@ PRIVATE_PROC(TRUE) SHOULD_NOT_OVERRIDE(TRUE) if(prob(10+extra_delay)) - set_light(10, 10, "#[num2hex(rand(64,255))][num2hex(rand(64,255))][num2hex(rand(64,255))]") + set_light(10, 10, "#[num2hex(rand(64,255), 2)][num2hex(rand(64,255), 2)][num2hex(rand(64,255), 2)]") addtimer(CALLBACK(src, PROC_REF(grenade_blast)), 10, TIMER_DELETE_ME) /obj/item/grenade/anti_photon/proc/grenade_blast() diff --git a/code/game/objects/items/weapons/tanks/tanks.dm b/code/game/objects/items/weapons/tanks/tanks.dm index 9da5ebb6a9..99fc3c4408 100644 --- a/code/game/objects/items/weapons/tanks/tanks.dm +++ b/code/game/objects/items/weapons/tanks/tanks.dm @@ -444,7 +444,7 @@ var/list/global/tank_gauge_cache = list() else if(pressure > TANK_RUPTURE_PRESSURE) #ifdef FIREDBG - log_debug(span_warning("[x],[y] tank is rupturing: [pressure] kPa, integrity [integrity]")) + log_world(span_warning("[x],[y] tank is rupturing: [pressure] kPa, integrity [integrity]")) #endif air_contents.react() @@ -504,7 +504,7 @@ var/list/global/tank_gauge_cache = list() playsound(src, 'sound/effects/spray.ogg', 10, 1, -3) leaking = 1 #ifdef FIREDBG - log_debug(span_warning("[x],[y] tank is leaking: [pressure] kPa, integrity [integrity]")) + log_world(span_warning("[x],[y] tank is leaking: [pressure] kPa, integrity [integrity]")) #endif @@ -662,7 +662,7 @@ var/list/global/tank_gauge_cache = list() return var/atom/movable/AM = WF.resolve() if(isnull(AM)) - log_debug("DEBUG: HasProximity called without reference on [src].") + log_runtime("DEBUG: HasProximity called without reference on [src].") return assembly?.HasProximity(T, WF, old_loc) diff --git a/code/game/objects/structures/artstuff.dm b/code/game/objects/structures/artstuff.dm index 5122169fbe..df21220768 100644 --- a/code/game/objects/structures/artstuff.dm +++ b/code/game/objects/structures/artstuff.dm @@ -517,7 +517,7 @@ break if(!new_canvas) - warning("Couldn't find a canvas to match [w]x[h] of painting") + WARNING("Couldn't find a canvas to match [w]x[h] of painting") return new_canvas.fill_grid_from_icon(I) @@ -559,7 +559,7 @@ return 0 if(!fexists("data/persistent/paintings/[persistence_id]/[painting["md5"]].png")) to_chat(usr, span_warning("Chosen painting could not be loaded! Incident was logged, but no action taken at this time")) - log_debug("[usr] tried to spawn painting of list id [which_painting] in all_paintings list and associated file could not be found. \n \ + log_runtime("[usr] tried to spawn painting of list id [which_painting] in all_paintings list and associated file could not be found. \n \ Painting was titled [title] by [author_ckey] of [persistence_id]") return 0 @@ -574,7 +574,7 @@ break if(!new_canvas) - warning("Couldn't find a canvas to match [w]x[h] of painting") + WARNING("Couldn't find a canvas to match [w]x[h] of painting") return 0 new_canvas.fill_grid_from_icon(I) @@ -597,7 +597,7 @@ Proceed? It will likely have over 500 entries", "Generate list?", list("Proceed!", "Cancel")) != "Proceed!") return - log_debug("[usr] generated list of paintings from SSPersistence") + // to_chat(world, "[usr] generated list of paintings from SSPersistence") var/list/paintings = list() var/current = 1 for(var/entry in SSpersistence.all_paintings) diff --git a/code/game/objects/structures/catwalk.dm b/code/game/objects/structures/catwalk.dm index 4b5cdc69fa..98dff9edb3 100644 --- a/code/game/objects/structures/catwalk.dm +++ b/code/game/objects/structures/catwalk.dm @@ -174,7 +174,7 @@ if(activated) return if(locate(/obj/structure/catwalk) in loc) - warning("Frame Spawner: A catwalk already exists at [loc.x]-[loc.y]-[loc.z]") + WARNING("Frame Spawner: A catwalk already exists at [loc.x]-[loc.y]-[loc.z]") else var/obj/structure/catwalk/C = new /obj/structure/catwalk(loc) C.plated_tile = tile diff --git a/code/game/objects/structures/droppod.dm b/code/game/objects/structures/droppod.dm index 27f1a8f114..81ac86d3ea 100644 --- a/code/game/objects/structures/droppod.dm +++ b/code/game/objects/structures/droppod.dm @@ -27,7 +27,7 @@ /obj/structure/drop_pod/proc/podfall(auto_open) var/turf/T = get_turf(src) if(!T) - warning("Drop pod wasn't spawned on a turf") + WARNING("Drop pod wasn't spawned on a turf") return moveToNullspace() diff --git a/code/game/objects/structures/lattice.dm b/code/game/objects/structures/lattice.dm index 3251dd9cd4..24be51724c 100644 --- a/code/game/objects/structures/lattice.dm +++ b/code/game/objects/structures/lattice.dm @@ -16,7 +16,7 @@ for(var/obj/structure/lattice/LAT in src.loc) if(LAT != src) - log_debug("Found multiple lattices at '[log_info_line(loc)]'") //VOREStation Edit, why was this a runtime, it's harmless + log_mapping("Found multiple lattices at '[log_info_line(loc)]'") //VOREStation Edit, why was this a runtime, it's harmless return INITIALIZE_HINT_QDEL icon = 'icons/obj/smoothlattice.dmi' icon_state = "latticeblank" diff --git a/code/game/objects/structures/low_wall.dm b/code/game/objects/structures/low_wall.dm index 9669acc504..a2ff142a65 100644 --- a/code/game/objects/structures/low_wall.dm +++ b/code/game/objects/structures/low_wall.dm @@ -32,7 +32,7 @@ icon_state = "blank" var/turf/T = loc if(!isturf(T) || T.density || T.opacity) - warning("[src] on invalid turf [T] at [x],[y],[z]") + WARNING("[src] on invalid turf [T] at [x],[y],[z]") return INITIALIZE_HINT_QDEL if(!materialtype) @@ -575,7 +575,7 @@ /obj/effect/low_wall_spawner/Initialize(mapload) . = ..() if(locate(/obj/effect/low_wall_spawner) in oview(0, src)) - warning("Duplicate low wall spawners in [x],[y],[z]!") + WARNING("Duplicate low wall spawners in [x],[y],[z]!") return INITIALIZE_HINT_QDEL if(low_wall_type) diff --git a/code/game/turfs/simulated/fancy_shuttles.dm b/code/game/turfs/simulated/fancy_shuttles.dm index aa0b47b23a..39dedfe0cb 100644 --- a/code/game/turfs/simulated/fancy_shuttles.dm +++ b/code/game/turfs/simulated/fancy_shuttles.dm @@ -29,7 +29,7 @@ INITIALIZE_IMMEDIATE(/obj/effect/fancy_shuttle) /obj/effect/fancy_shuttle/Initialize(mapload) // has to be very early so others can grab it . = ..() if(!fancy_shuttle_tag) - error("Fancy shuttle with no tag at [x],[y],[z]! Type is: [type]") + log_mapping("## ERROR Fancy shuttle with no tag at [x],[y],[z]! Type is: [type]") return INITIALIZE_HINT_QDEL split_icon = icon(split_file, null, dir) GLOB.fancy_shuttles[fancy_shuttle_tag] = src @@ -134,7 +134,7 @@ INITIALIZE_IMMEDIATE(/obj/effect/fancy_shuttle) if(fancy_shuttle_tag) // after a shuttle jump it won't be set anymore, but the shuttle jump proc will set our icon and state var/obj/effect/fancy_shuttle/F = GLOB.fancy_shuttles[fancy_shuttle_tag] if(!F) - warning("Fancy shuttle wall at [x],[y],[z] couldn't locate a helper with tag [fancy_shuttle_tag]") + WARNING("Fancy shuttle wall at [x],[y],[z] couldn't locate a helper with tag [fancy_shuttle_tag]") return icon = F.split_icon icon_state = "walls [x - F.x],[y - F.y]" @@ -168,7 +168,7 @@ INITIALIZE_IMMEDIATE(/obj/effect/fancy_shuttle) /obj/effect/floor_decal/fancy_shuttle/Initialize(mapload) var/obj/effect/fancy_shuttle/F = GLOB.fancy_shuttles[fancy_shuttle_tag] if(!F) - warning("Fancy shuttle floor decal at [x],[y],[z] couldn't locate a helper with tag [fancy_shuttle_tag]") + WARNING("Fancy shuttle floor decal at [x],[y],[z] couldn't locate a helper with tag [fancy_shuttle_tag]") return INITIALIZE_HINT_QDEL icon = F.split_icon icon_file = F.split_file @@ -211,7 +211,7 @@ INITIALIZE_IMMEDIATE(/obj/effect/fancy_shuttle) if(fancy_shuttle_tag) // after a shuttle jump it won't be set anymore, but the shuttle jump proc will set our icon and state var/obj/effect/fancy_shuttle/F = GLOB.fancy_shuttles[fancy_shuttle_tag] if(!F) - warning("Fancy shuttle wall at [x],[y],[z] couldn't locate a helper with tag [fancy_shuttle_tag]") + WARNING("Fancy shuttle wall at [x],[y],[z] couldn't locate a helper with tag [fancy_shuttle_tag]") return icon = F.split_icon icon_state = "walls [x - F.x],[y - F.y]" diff --git a/code/game/turfs/simulated/wall_types.dm b/code/game/turfs/simulated/wall_types.dm index 2bcaf05b56..af85beba11 100644 --- a/code/game/turfs/simulated/wall_types.dm +++ b/code/game/turfs/simulated/wall_types.dm @@ -382,7 +382,7 @@ break if(!T) - warning("Hull corner at [x],[y] not placed adjacent to a hull it can find.") + WARNING("Hull corner at [x],[y] not placed adjacent to a hull it can find.") /obj/structure/hull_corner/long_vert icon = 'icons/turf/wall_masks32x64.dmi' diff --git a/code/game/turfs/unsimulated/sky_vr.dm b/code/game/turfs/unsimulated/sky_vr.dm index 6249efb101..6127168178 100644 --- a/code/game/turfs/unsimulated/sky_vr.dm +++ b/code/game/turfs/unsimulated/sky_vr.dm @@ -14,7 +14,7 @@ /turf/unsimulated/floor/sky/Initialize(mapload) . = ..() if(does_skyfall && !LAZYLEN(skyfall_levels)) - error("[x],[y],[z], [get_area(src)] doesn't have skyfall_levels defined! Can't skyfall!") + log_mapping("## ERROR [x],[y],[z], [get_area(src)] doesn't have skyfall_levels defined! Can't skyfall!") if(locate(/turf/simulated) in orange(src,1)) set_light(2, 2, color) diff --git a/code/game/vehicles/vehicle.dm b/code/game/vehicles/vehicle.dm index 69a4716f47..13c366bf8b 100644 --- a/code/game/vehicles/vehicle.dm +++ b/code/game/vehicles/vehicle.dm @@ -63,7 +63,7 @@ spark_system.attach(src) add_cell() removeVerb(/atom/movable/verb/pull) - log_message("[src.name]'s functions initialised. Work protocols active - Entering IDLE mode.") + src.mecha_log_message("[src.name]'s functions initialised. Work protocols active - Entering IDLE mode.") //################ Helpers ########################################################### @@ -98,7 +98,7 @@ //################ Logs and messages ############################################ -/obj/vehicle/proc/log_message(message as text,red=null) +/obj/vehicle/proc/mecha_log_message(message as text,red=null) log.len++ log[log.len] = list("time"=world.timeofday,"message"="[red?span_red("[message]"):[message]]") return log.len diff --git a/code/game/world.dm b/code/game/world.dm index ac968e4feb..775fae95fd 100644 --- a/code/game/world.dm +++ b/code/game/world.dm @@ -87,9 +87,15 @@ GLOBAL_VAR(restart_counter) Profile(PROFILE_RESTART) Profile(PROFILE_RESTART, type = "sendmaps") + // Write everything to this log file until we get to SetupLogs() later + _initialize_log_files("data/logs/config_error.[GUID()].log") + // Init the debugger first so we can debug Master Debugger = new + // Create the logger + logger = new + // THAT'S IT, WE'RE DONE, THE. FUCKING. END. Master = new @@ -124,25 +130,6 @@ GLOBAL_VAR(restart_counter) world_startup_time = world.timeofday rollover_safety_date = world.realtime - world.timeofday // 00:00 today (ish, since floating point error with world.realtime) of today - to_world_log("Map Loading Complete") - //logs - //VOREStation Edit Start - - var/override_dir = params[OVERRIDE_LOG_DIRECTORY_PARAMETER] - if(override_dir) - GLOB.log_directory = "data/logs/[override_dir]" - else - GLOB.log_directory += time2text(world.realtime, "YYYY/MM-Month/DD-Day/round-hh-mm-ss") - GLOB.diary = start_log("[GLOB.log_directory].log") - GLOB.href_logfile = start_log("[GLOB.log_directory]-hrefs.htm") - GLOB.error_log = start_log("[GLOB.log_directory]-error.log") - GLOB.sql_error_log = start_log("[GLOB.log_directory]-sql-error.log") - GLOB.query_debug_log = start_log("[GLOB.log_directory]-query-debug.log") - GLOB.debug_log = start_log("[GLOB.log_directory]-debug.log") - - var/latest_changelog = file("[global.config.directory]/../html/changelogs_ch/archive/" + time2text(world.timeofday, "YYYY-MM") + ".yml") // CHOMPEdit - changelogs_ch - GLOB.changelog_hash = fexists(latest_changelog) ? md5(latest_changelog) : "" //for telling if the changelog has changed recently - to_world_log("Changelog Hash: '[GLOB.changelog_hash]' ([latest_changelog])") //ChompADD Start - Newsfile var/savefile/F = new(NEWSFILE) @@ -155,7 +142,6 @@ GLOBAL_VAR(restart_counter) GLOB.servernews_hash = md5("[title]" + "[body]") //ChompADD End - // First possible sleep() InitTgs() config.Load(params[OVERRIDE_CONFIG_DIRECTORY_PARAMETER]) @@ -188,8 +174,8 @@ GLOBAL_VAR(restart_counter) setup_season() //VOREStation Addition #ifdef UNIT_TESTS - log_unit_test("Unit Tests Enabled. This will destroy the world when testing is complete.") - log_unit_test("If you did not intend to enable this please check code/__defines/unit_testing.dm") + log_test("Unit Tests Enabled. This will destroy the world when testing is complete.") + log_test("If you did not intend to enable this please check code/__defines/unit_testing.dm") #endif // This is kinda important. Set up details of what the hell things are made of. @@ -232,6 +218,8 @@ GLOBAL_VAR(restart_counter) // Try to set round ID SSdbcore.InitializeRound() + SetupLogs() + load_admins(initial = TRUE) //apply a default value to config.python_path, if needed @@ -277,6 +265,46 @@ GLOBAL_VAR(restart_counter) data["timestamp"] = rustg_unix_timestamp() return data +/world/proc/SetupLogs() + var/override_dir = params[OVERRIDE_LOG_DIRECTORY_PARAMETER] + if(!override_dir) + var/realtime = world.realtime + var/texttime = time2text(realtime, "YYYY/MM/DD", TIMEZONE_UTC) + GLOB.log_directory = "data/logs/[texttime]/round-" + if(GLOB.round_id) + GLOB.log_directory += "[GLOB.round_id]" + //GLOB.picture_logging_prefix += "R_[GLOB.round_id]_" + //GLOB.picture_log_directory += "[GLOB.round_id]" + else + var/timestamp = replacetext(time_stamp(), ":", ".") + GLOB.log_directory += "[timestamp]" + //GLOB.picture_log_directory += "[timestamp]" + //GLOB.picture_logging_prefix += "T_[timestamp]_" + else + GLOB.log_directory = "data/logs/[override_dir]" + //GLOB.picture_logging_prefix = "O_[override_dir]_" + //GLOB.picture_log_directory = "data/picture_logs/[override_dir]" + + logger.init_logging() + + var/latest_changelog = file("[global.config.directory]/../html/changelogs_ch/archive/" + time2text(world.timeofday, "YYYY-MM", TIMEZONE_UTC) + ".yml") // CHOMPEdit - changelogs_ch + GLOB.changelog_hash = fexists(latest_changelog) ? md5(latest_changelog) : 0 //for telling if the changelog has changed recently + + if(GLOB.round_id) + log_game("Round ID: [GLOB.round_id]") + + // This was printed early in startup to the world log and config_error.log, + // but those are both private, so let's put the commit info in the runtime + // log which is ultimately public. + log_runtime(GLOB.revdata.get_log_message()) + +#ifndef USE_CUSTOM_ERROR_HANDLER + world.log = file("[GLOB.log_directory]/dd.log") +#else + if (TgsAvailable()) // why + world.log = file("[GLOB.log_directory]/dd.log") //not all runtimes trigger world/Error, so this is the only way to ensure we can see all of them. +#endif + var/world_topic_spam_protect_ip = "0.0.0.0" var/world_topic_spam_protect_time = world.timeofday @@ -538,9 +566,10 @@ var/world_topic_spam_protect_time = world.timeofday if (usr) log_admin("[key_name(usr)] Has requested an immediate world restart via client side debugging tools") message_admins("[key_name_admin(usr)] Has requested an immediate world restart via client side debugging tools") - to_world(span_boldannounce("[key_name_admin(usr)] has requested an immediate world restart via client side debugging tools")) + to_chat(world, span_boldannounce("[key_name_admin(usr)] has requested an immediate world restart via client side debugging tools")) + else - to_world(span_boldannounce("Rebooting world immediately due to host request")) + to_chat(world, span_boldannounce("Rebooting world immediately due to host request")) else Master.Shutdown() //run SS shutdowns for(var/client/C in GLOB.clients) @@ -553,19 +582,19 @@ var/world_topic_spam_protect_time = world.timeofday #else if(check_hard_reboot()) log_world("World hard rebooted at [time_stamp()]") - //shutdown_logging() // See comment below. + shutdown_logging() // See comment below. //QDEL_NULL(Tracy) //QDEL_NULL(Debugger) TgsEndProcess() return ..() - TgsReboot() log_world("World rebooted at [time_stamp()]") + shutdown_logging() // Past this point, no logging procs can be used, at risk of data loss. QDEL_NULL(Tracy) QDEL_NULL(Debugger) - TgsReboot() + TgsReboot() // TGS can decide to kill us right here, so it's important to do it last ..() #endif @@ -588,7 +617,7 @@ var/world_topic_spam_protect_time = world.timeofday if(Lines.len) if(Lines[1]) GLOB.master_mode = Lines[1] - log_misc("Saved mode is '[GLOB.master_mode]'") + log_world("## MISC Saved mode is '[GLOB.master_mode]'") /world/proc/save_mode(var/the_mode) var/F = file("data/mode.txt") @@ -603,7 +632,7 @@ var/world_topic_spam_protect_time = world.timeofday if(CONFIG_GET(flag/admin_legacy_system)) var/text = file2text("config/moderators.txt") if (!text) - error("Failed to load config/mods.txt") + log_world("Failed to load config/mods.txt") else var/list/lines = splittext(text, "\n") for(var/line in lines) @@ -684,29 +713,11 @@ var/failed_old_db_connections = 0 /hook/startup/proc/connectDB() if(!CONFIG_GET(flag/sql_enabled)) - to_world_log("SQL connection disabled in config.") + log_sql("SQL connection disabled in config.") else if(!setup_database_connection()) - to_world_log("Your server failed to establish a connection with the feedback database.") + log_sql("Your server failed to establish a connection with the feedback database.") else - to_world_log("Feedback database connection established.") - // CHOMPEdit Begin - Truncating the temporary dialog/attacklog tables - var/datum/db_query/query_truncate = SSdbcore.NewQuery("TRUNCATE erro_dialog") - var/num_tries = 0 - while(!query_truncate.Execute() && num_tries<5) - num_tries++ - - if(num_tries==5) - log_admin("ERROR TRYING TO CLEAR erro_dialog") - qdel(query_truncate) - var/datum/db_query/query_truncate2 = SSdbcore.NewQuery("TRUNCATE erro_attacklog") - num_tries = 0 - while(!query_truncate2.Execute() && num_tries<5) - num_tries++ - - if(num_tries==5) - log_admin("ERROR TRYING TO CLEAR erro_attacklog") - qdel(query_truncate2) - // CHOMPEdit End + log_sql("Feedback database connection established.") return 1 /proc/setup_database_connection() @@ -730,7 +741,7 @@ var/failed_old_db_connections = 0 failed_db_connections = 0 //If this connection succeeded, reset the failed connections counter. else failed_db_connections++ //If it failed, increase the failed connections counter. - to_world_log(SSdbcore.ErrorMsg()) + log_sql(SSdbcore.ErrorMsg()) return . @@ -765,7 +776,7 @@ var/failed_old_db_connections = 0 results += "FAIL: failed to connect to the database with setup_database_connection()" results += "-- DB Reset End --" - to_world_log(results.Join("\n")) + log_sql(results.Join("\n")) // Things to do when a new z-level was just made. /world/proc/max_z_changed() diff --git a/code/js/view_variables.js b/code/js/view_variables.js index 1b29528706..44f827f8da 100644 --- a/code/js/view_variables.js +++ b/code/js/view_variables.js @@ -1,30 +1,30 @@ function updateSearch() { - var filter_text = document.getElementById("filter"); - var filter = filter_text.value.toLowerCase(); + const filter_text = document.getElementById('filter'); + const filter = filter_text.value.toLowerCase(); - var vars_ol = document.getElementById("vars"); - var lis = vars_ol.children; + const vars_ol = document.getElementById('vars'); + const lis = vars_ol.children; // the above line can be changed to vars_ol.getElementsByTagName("li") to filter child lists too // potential todo: implement a per-admin toggle for this - for (var i = 0; i < lis.length; i++) { - var li = lis[i]; - if (filter == "" || li.innerText.toLowerCase().indexOf(filter) != -1) { - li.style.display = "block"; + for (let i = 0; i < lis.length; i++) { + const li = lis[i]; + if (filter === '' || li.innerText.toLowerCase().indexOf(filter) !== -1) { + li.style.display = 'block'; } else { - li.style.display = "none"; + li.style.display = 'none'; } } } function selectTextField() { - var filter_text = document.getElementById("filter"); + const filter_text = document.getElementById('filter'); filter_text.focus(); filter_text.select(); } function loadPage(list) { - if (list.options[list.selectedIndex].value == "") { + if (list.options[list.selectedIndex].value === '') { return; } diff --git a/code/modules/admin/IsBanned.dm b/code/modules/admin/IsBanned.dm index 6acbf36fc2..0d4cc98d02 100644 --- a/code/modules/admin/IsBanned.dm +++ b/code/modules/admin/IsBanned.dm @@ -1,18 +1,24 @@ #ifndef OVERRIDE_BAN_SYSTEM //Blocks an attempt to connect before even creating our client datum thing. -/world/IsBanned(key,address,computer_id) +/world/IsBanned(key, address, computer_id, type, real_bans_only=FALSE) + if (!key || (!real_bans_only && (!address || !computer_id))) + if(real_bans_only) + return FALSE + log_access("Failed Login (invalid data): [key] [address]-[computer_id]") + return list("reason"="invalid login data", "desc"="Error: Could not check ban status, Please try again. Error message: Your computer provided invalid or blank information to the server on connection (byond username, IP, and Computer ID.) Provided information for reference: Username:'[key]' IP:'[address]' Computer ID:'[computer_id]'. (If you continue to get this error, please restart byond or contact byond support.)") + if(ckey(key) in GLOB.admin_datums) return ..() //Guest Checking if(!CONFIG_GET(flag/guests_allowed) && IsGuestKey(key)) - log_adminwarn("Failed Login: [key] - Guests not allowed") + log_access("Failed Login: [key] - Guests not allowed") message_admins(span_blue("Failed Login: [key] - Guests not allowed")) return list("reason"="guest", "desc"="\nReason: Guests not allowed. Please sign in with a byond account.") //check if the IP address is a known TOR node if(config && CONFIG_GET(flag/ToRban) && ToRban_isbanned(address)) - log_adminwarn("Failed Login: [src] - Banned: ToR") + log_access("Failed Login: [src] - Banned: ToR") message_admins(span_blue("Failed Login: [src] - Banned: ToR")) //ban their computer_id and ckey for posterity AddBan(ckey(key), computer_id, "Use of ToR", "Automated Ban", 0, 0) @@ -24,7 +30,7 @@ //Ban Checking . = CheckBan( ckey(key), computer_id, address ) if(.) - log_adminwarn("Failed Login: [key] [computer_id] [address] - Banned [.["reason"]]") + log_suspicious_login("Failed Login: [key] [computer_id] [address] - Banned [.["reason"]]") message_admins(span_blue("Failed Login: [key] id:[computer_id] ip:[address] - Banned [.["reason"]]")) return . @@ -35,8 +41,9 @@ var/ckeytext = ckey(key) if(!establish_db_connection()) - error("Ban database connection failure. Key [ckeytext] not checked") - log_misc("Ban database connection failure. Key [ckeytext] not checked") + var/msg = "Ban database connection failure. Key [ckeytext] not checked" + log_world(msg) + message_admins(msg) return var/failedcid = 1 @@ -53,7 +60,7 @@ if(isnum(text2num(computer_id))) cidquery = " OR computerid = '[computer_id]' " else - log_misc("Key [ckeytext] cid not checked. Non-Numeric: [computer_id]") + log_world("Key [ckeytext] cid not checked. Non-Numeric: [computer_id]") failedcid = 1 var/datum/db_query/query = SSdbcore.NewQuery("SELECT ckey, ip, computerid, a_ckey, reason, expiration_time, duration, bantime, bantype FROM erro_ban WHERE (ckey = '[ckeytext]' [ipquery] [cidquery]) AND (bantype = 'PERMABAN' OR (bantype = 'TEMPBAN' AND expiration_time > Now())) AND isnull(unbanned)") diff --git a/code/modules/admin/ToRban.dm b/code/modules/admin/ToRban.dm index 8cdae64876..11cb9c5440 100644 --- a/code/modules/admin/ToRban.dm +++ b/code/modules/admin/ToRban.dm @@ -22,10 +22,10 @@ /proc/ToRban_update() spawn(0) - log_misc("Downloading updated ToR data...") + log_world("Downloading updated ToR data...") var/http[] = world.Export("https://check.torproject.org/exit-addresses") - var/list/rawlist = file2list(http["CONTENT"]) + var/list/rawlist = world.file2list(http["CONTENT"]) if(rawlist.len) fdel(TORFILE) var/savefile/F = new(TORFILE) @@ -36,11 +36,11 @@ if(!cleaned) continue F[cleaned] << 1 F["last_update"] << world.realtime - log_misc("ToR data updated!") + log_world("ToR data updated!") if(usr) to_chat(usr, span_filter_adminlog("ToRban updated.")) return - log_misc("ToR data update aborted: no data.") + log_world("ToR data update aborted: no data.") return /client/proc/ToRban(task in list("update","toggle","show","remove","remove all","find")) diff --git a/code/modules/admin/admin.dm b/code/modules/admin/admin.dm index 7111267822..c0aa2cde1d 100644 --- a/code/modules/admin/admin.dm +++ b/code/modules/admin/admin.dm @@ -4,7 +4,7 @@ GLOBAL_VAR_INIT(floorIsLava, 0) //////////////////////////////// /proc/message_admins(var/msg) msg = span_filter_adminlog(span_log_message(span_prefix("ADMIN LOG:") + span_message("[msg]"))) - //log_adminwarn(msg) //log_and_message_admins is for this + //log_admin_private(msg) //log_and_message_admins is for this for(var/client/C in GLOB.admins) if(check_rights_for(C, (R_ADMIN|R_MOD|R_SERVER))) @@ -542,8 +542,8 @@ ADMIN_VERB_ONLY_CONTEXT_MENU(show_player_panel, R_HOLDER, "Show Player Panel", m else dat+="I'm sorry to break your immersion. This shit's bugged. Report this bug to Agouri, polyxenitopalidou@gmail.com" - //to_world("Channelname: [src.admincaster_feed_channel.channel_name] [src.admincaster_feed_channel.author]") - //to_world("Msg: [src.admincaster_feed_message.author] [src.admincaster_feed_message.body]") + //to_chat(world, "Channelname: [src.admincaster_feed_channel.channel_name] [src.admincaster_feed_channel.author]") + //to_chat(world, "Msg: [src.admincaster_feed_message.author] [src.admincaster_feed_message.body]") var/datum/browser/popup = new(owner, "admincaster_main", "Admin Newscaster", 400, 600) popup.add_head_content("Admin Newscaster") @@ -830,9 +830,9 @@ var/datum/announcement/minor/admin_min_announcer = new CONFIG_SET(flag/ooc_allowed, !CONFIG_GET(flag/ooc_allowed)) if (CONFIG_GET(flag/ooc_allowed)) - to_world(span_world("The OOC channel has been globally enabled!")) + to_chat(world, span_world("The OOC channel has been globally enabled!")) else - to_world(span_world("The OOC channel has been globally disabled!")) + to_chat(world, span_world("The OOC channel has been globally disabled!")) log_and_message_admins("toggled OOC.") feedback_add_details("admin_verb","TOOC") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! @@ -846,9 +846,9 @@ var/datum/announcement/minor/admin_min_announcer = new CONFIG_SET(flag/looc_allowed, !CONFIG_GET(flag/looc_allowed)) if (CONFIG_GET(flag/looc_allowed)) - to_world(span_world("The LOOC channel has been globally enabled!")) + to_chat(world, span_world("The LOOC channel has been globally enabled!")) else - to_world(span_world("The LOOC channel has been globally disabled!")) + to_chat(world, span_world("The LOOC channel has been globally disabled!")) log_and_message_admins("toggled LOOC.") feedback_add_details("admin_verb","TLOOC") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! @@ -863,9 +863,9 @@ var/datum/announcement/minor/admin_min_announcer = new CONFIG_SET(flag/dsay_allowed, !CONFIG_GET(flag/dsay_allowed)) if (CONFIG_GET(flag/dsay_allowed)) - to_world(span_world("Deadchat has been globally enabled!")) + to_chat(world, span_world("Deadchat has been globally enabled!")) else - to_world(span_world("Deadchat has been globally disabled!")) + to_chat(world, span_world("Deadchat has been globally disabled!")) log_admin("[key_name(usr)] toggled deadchat.") message_admins("[key_name_admin(usr)] toggled deadchat.", 1) feedback_add_details("admin_verb","TDSAY") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc @@ -925,7 +925,7 @@ var/datum/announcement/minor/admin_min_announcer = new feedback_add_details("admin_verb","SN") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! else SSticker.start_immediately = FALSE - to_world(span_filter_system(span_blue("Immediate game start canceled. Normal startup resumed."))) + to_chat(world, span_filter_system(span_blue("Immediate game start canceled. Normal startup resumed."))) log_and_message_admins("cancelled immediate game start.") /datum/admins/proc/toggleenter() @@ -934,9 +934,9 @@ var/datum/announcement/minor/admin_min_announcer = new set name="Toggle Entering" CONFIG_SET(flag/enter_allowed, !CONFIG_GET(flag/enter_allowed)) if (!CONFIG_GET(flag/enter_allowed)) - to_world(span_world("New players may no longer enter the game.")) + to_chat(world, span_world("New players may no longer enter the game.")) else - to_world(span_world("New players may now enter the game.")) + to_chat(world, span_world("New players may now enter the game.")) log_admin("[key_name(usr)] toggled new player game entering.") message_admins(span_blue("[key_name_admin(usr)] toggled new player game entering."), 1) world.update_status() @@ -948,9 +948,9 @@ var/datum/announcement/minor/admin_min_announcer = new set name="Toggle AI" CONFIG_SET(flag/allow_ai, !CONFIG_GET(flag/allow_ai)) if (!CONFIG_GET(flag/allow_ai)) - to_world(span_world("The AI job is no longer chooseable.")) + to_chat(world, span_world("The AI job is no longer chooseable.")) else - to_world(span_world("The AI job is chooseable now.")) + to_chat(world, span_world("The AI job is chooseable now.")) log_admin("[key_name(usr)] toggled AI allowed.") world.update_status() feedback_add_details("admin_verb","TAI") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! @@ -961,9 +961,9 @@ var/datum/announcement/minor/admin_min_announcer = new set name="Toggle Respawn" CONFIG_SET(flag/abandon_allowed, !CONFIG_GET(flag/abandon_allowed)) if(CONFIG_GET(flag/abandon_allowed)) - to_world(span_world("You may now respawn.")) + to_chat(world, span_world("You may now respawn.")) else - to_world(span_world("You may no longer respawn :(")) + to_chat(world, span_world("You may no longer respawn :(")) message_admins(span_blue("[key_name_admin(usr)] toggled respawn to [CONFIG_GET(flag/abandon_allowed) ? "On" : "Off"]."), 1) log_admin("[key_name(usr)] toggled respawn to [CONFIG_GET(flag/abandon_allowed) ? "On" : "Off"].") world.update_status() @@ -985,9 +985,9 @@ var/datum/announcement/minor/admin_min_announcer = new set name="Toggle Mapload Persistent Data" CONFIG_SET(flag/persistence_ignore_mapload, !CONFIG_GET(flag/persistence_ignore_mapload)) if(!CONFIG_GET(flag/persistence_ignore_mapload)) - to_world(span_world("Persistence is now enabled.")) + to_chat(world, span_world("Persistence is now enabled.")) else - to_world(span_world("Persistence is no longer enabled.")) + to_chat(world, span_world("Persistence is no longer enabled.")) message_admins(span_blue("[key_name_admin(usr)] toggled persistence to [CONFIG_GET(flag/persistence_ignore_mapload) ? "Off" : "On"]."), 1) log_admin("[key_name(usr)] toggled persistence to [CONFIG_GET(flag/persistence_ignore_mapload) ? "Off" : "On"].") world.update_status() @@ -1024,10 +1024,10 @@ var/datum/announcement/minor/admin_min_announcer = new return GLOB.round_progressing = !GLOB.round_progressing if (!GLOB.round_progressing) - to_world(span_world("The game start has been delayed.")) + to_chat(world, span_world("The game start has been delayed.")) log_admin("[key_name(usr)] delayed the game.") else - to_world(span_world("The game will start soon.")) + to_chat(world, span_world("The game will start soon.")) log_admin("[key_name(usr)] removed the delay.") feedback_add_details("admin_verb","DELAY") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! @@ -1294,9 +1294,9 @@ var/datum/announcement/minor/admin_min_announcer = new set name="Toggle tinted welding helmets." CONFIG_SET(flag/welder_vision, !CONFIG_GET(flag/welder_vision)) if (CONFIG_GET(flag/welder_vision)) - to_world(span_world("Reduced welder vision has been enabled!")) + to_chat(world, span_world("Reduced welder vision has been enabled!")) else - to_world(span_world("Reduced welder vision has been disabled!")) + to_chat(world, span_world("Reduced welder vision has been disabled!")) log_admin("[key_name(usr)] toggled welder vision.") message_admins("[key_name_admin(usr)] toggled welder vision.", 1) feedback_add_details("admin_verb","TTWH") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! @@ -1307,9 +1307,9 @@ var/datum/announcement/minor/admin_min_announcer = new set name="Toggle guests" CONFIG_SET(flag/guests_allowed, !CONFIG_GET(flag/guests_allowed)) if (!CONFIG_GET(flag/guests_allowed)) - to_world(span_world("Guests may no longer enter the game.")) + to_chat(world, span_world("Guests may no longer enter the game.")) else - to_world(span_world("Guests may now enter the game.")) + to_chat(world, span_world("Guests may now enter the game.")) log_admin("[key_name(usr)] toggled guests game entering [CONFIG_GET(flag/guests_allowed)?"":"dis"]allowed.") message_admins(span_blue("[key_name_admin(usr)] toggled guests game entering [CONFIG_GET(flag/guests_allowed)?"":"dis"]allowed."), 1) feedback_add_details("admin_verb","TGU") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! diff --git a/code/modules/admin/admin_tools.dm b/code/modules/admin/admin_tools.dm index 27ed63aa24..61aa8dbaba 100644 --- a/code/modules/admin/admin_tools.dm +++ b/code/modules/admin/admin_tools.dm @@ -2,7 +2,6 @@ set category = "Admin.Logs" set name = "Check Player Attack Logs" set desc = "Check a player's attack logs." - show_cmd_admin_check_player_logs(M) show_cmd_admin_check_player_logs(M) @@ -13,25 +12,17 @@ if(M.mind) dat += span_bold("Current Antag?:") + " [(M.mind.special_role)?"Yes":"No"]
" dat += "
" + span_bold("Note:") + " This is arranged from earliest to latest.

" - //CHOMPEdit Begin - /*for(var/d in M.dialogue_log) - dat += "[d]
"*/ - var/datum/db_query/query = SSdbcore.NewQuery("SELECT id,time,ckey,mob,message from erro_attacklog WHERE ckey = :t_ckey", list("t_ckey" = M.ckey)) - if(!query.Execute()) - dat += span_italics("Database query error") - else - var/messages = "" - while(query.NextRow()) - messages += "([query.item[2]]) (ckey:[query.item[3]] real_name:[query.item[4]]) [query.item[5]]
" - if(messages=="") - dat+= span_italics("Query returned nothing.") - else - dat += "
" - dat += messages - dat += "
" - qdel(query) - //CHOMPEdit End + + if(!isemptylist(M.attack_log)) + dat += "
" + for(var/l in M.attack_log) + dat += "[l]
" + + dat += "
" + + else + dat += span_italics("No attack logs found for [M].") var/datum/browser/popup = new(usr, "admin_attack_log", "[src]", 650, 650, src) popup.set_content(jointext(dat,null)) @@ -55,26 +46,15 @@ dat += span_bold("Current Antag?:") + " [(M.mind.special_role)?"Yes":"No"]
" dat += "
" + span_bold("Note:") + " This is arranged from earliest to latest.

" + if(!isemptylist(M.dialogue_log)) + dat += "
" - //CHOMPEdit Begin - /*for(var/d in M.dialogue_log) - dat += "[d]
"*/ - var/datum/db_query/query = SSdbcore.NewQuery("SELECT mid,time,ckey,mob,type,message from erro_dialog WHERE ckey = :t_ckey", list("t_ckey" = M.ckey)) - if(!query.Execute()) - dat += span_italics("Database query error") + for(var/d in M.dialogue_log) + dat += "[d]
" + + dat += "
" else - var/messages = "" - while(query.NextRow()) - messages += "([query.item[2]]) (ckey:[query.item[3]] real_name:[query.item[4]] type:[query.item[5]]) [query.item[6]]
" - - if(messages=="") - dat+=span_italics("Query returned nothing.") - else - dat += "
" - dat += messages - dat += "
" - qdel(query) - //CHOMPEdit End + dat += span_italics("No dialogue logs found for [M].") var/datum/browser/popup = new(usr, "admin_dialogue_log", "[src]", 650, 650, src) popup.set_content(jointext(dat,null)) popup.open() diff --git a/code/modules/admin/admin_verb_lists_vr.dm b/code/modules/admin/admin_verb_lists_vr.dm index c119208cc1..013318d42a 100644 --- a/code/modules/admin/admin_verb_lists_vr.dm +++ b/code/modules/admin/admin_verb_lists_vr.dm @@ -211,7 +211,6 @@ var/list/admin_verbs_debug = list( /client/proc/hide_verbs, //hides all our adminverbs, /client/proc/hide_most_verbs, //hides all our hideable adminverbs, /client/proc/cmd_check_new_players, //allows us to see every new player, - /datum/admins/proc/view_runtimes, // /client/proc/show_gm_status, //We don't use SSgame_master yet. /datum/admins/proc/set_uplink, /datum/admins/proc/change_weather, diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index 18082280ee..1e906aee2a 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -193,6 +193,10 @@ ADMIN_VERB(game_panel, R_ADMIN|R_SERVER|R_FUN, "Game Panel", "Look at the state user.holder.Game() feedback_add_details("admin_verb","GP") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! +/// Returns this client's stealthed ckey +/client/proc/getStealthKey() + return GLOB.stealthminID[ckey] + /client/proc/findStealthKey(txt) if(txt) for(var/P in GLOB.stealthminID) diff --git a/code/modules/admin/banjob.dm b/code/modules/admin/banjob.dm index 815d3e42ec..ad56f56516 100644 --- a/code/modules/admin/banjob.dm +++ b/code/modules/admin/banjob.dm @@ -70,8 +70,7 @@ DEBUG log_admin("jobban_keylist was empty") else if(!establish_db_connection()) - error("Database connection failed. Reverting to the legacy ban system.") - log_misc("Database connection failed. Reverting to the legacy ban system.") + log_sql("Database connection failed. Reverting to the legacy ban system.") CONFIG_SET(flag/ban_legacy_system, TRUE) jobban_loadbanfile() return diff --git a/code/modules/admin/holder2.dm b/code/modules/admin/holder2.dm index f2ac1eeb14..b7a7f997f7 100644 --- a/code/modules/admin/holder2.dm +++ b/code/modules/admin/holder2.dm @@ -268,7 +268,7 @@ you will have to do something like if(client.rights & R_ADMIN) yourself. var/client/C = usr.client if(!C) // CRASH("No client for HrefToken()!") //Chomp EDIT - this seems be to encountered and we don't want this to crash - log_debug("Attempted to retrieve a HrefToken of an entity with no client.") //Chomp EDIT + log_runtime("Attempted to retrieve a HrefToken of an entity with no client.") //Chomp EDIT return 0 //Chomp EDIT var/datum/admins/holder = C.holder if(holder) diff --git a/code/modules/admin/player_panel.dm b/code/modules/admin/player_panel.dm index 0f2efe3283..aa1e81145b 100644 --- a/code/modules/admin/player_panel.dm +++ b/code/modules/admin/player_panel.dm @@ -79,7 +79,7 @@ body += "PP - " body += "N - " - body += "VV - " + body += "VV - " body += "TP - " body += "PM - " body += "SM - " diff --git a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm index 68fd75f5a4..b4aad3630d 100644 --- a/code/modules/admin/topic.dm +++ b/code/modules/admin/topic.dm @@ -6,11 +6,13 @@ var/msg = !auth ? "no" : "a bad" message_admins("[key_name_admin(usr)] clicked an href with [msg] authorization key!") + /* Debug code in case one needs to dig missing token HREFS var/debug_admin_hrefs = TRUE // Remove once everything is converted over if(debug_admin_hrefs) message_admins("Debug mode enabled, call not blocked. Please ask your coders to review this round's logs.") log_world("UAH: [href]") return TRUE + */ log_admin("[key_name(usr)] clicked an href with [msg] authorization key! [href]") @@ -865,7 +867,7 @@ GLOB.master_mode = href_list["c_mode2"] log_admin("[key_name(usr)] set the mode as [config.mode_names[GLOB.master_mode]].") message_admins(span_blue("[key_name_admin(usr)] set the mode as [config.mode_names[GLOB.master_mode]]."), 1) - to_world(span_world(span_blue("The mode is now: [config.mode_names[GLOB.master_mode]]"))) + to_chat(world, span_world(span_blue("The mode is now: [config.mode_names[GLOB.master_mode]]"))) Game() // updates the main game menu world.save_mode(GLOB.master_mode) .(href, list("c_mode"=1)) diff --git a/code/modules/admin/verbs/BrokenInhands.dm b/code/modules/admin/verbs/BrokenInhands.dm index a3aa4454c3..b708783ee8 100644 --- a/code/modules/admin/verbs/BrokenInhands.dm +++ b/code/modules/admin/verbs/BrokenInhands.dm @@ -31,4 +31,4 @@ var/F = file("broken_icons.txt") fdel(F) F << text - to_world(span_filter_system("Completeled successfully and written to [F]")) + to_chat(world, span_filter_system("Completeled successfully and written to [F]")) diff --git a/code/modules/admin/verbs/adminsay.dm b/code/modules/admin/verbs/adminsay.dm index af647db526..5fd82db286 100644 --- a/code/modules/admin/verbs/adminsay.dm +++ b/code/modules/admin/verbs/adminsay.dm @@ -3,7 +3,7 @@ ADMIN_VERB(cmd_admin_say, R_ADMIN, "ASay", "Send a message to other admins", "Ad if(!msg) return - log_adminsay(msg, user) + user.mob.log_talk(message, LOG_ASAY) for(var/client/C in GLOB.admins) if(check_rights_for(C, R_ADMIN)) @@ -13,7 +13,7 @@ ADMIN_VERB(cmd_admin_say, R_ADMIN, "ASay", "Send a message to other admins", "Ad ADMIN_VERB(cmd_mod_say, (R_ADMIN|R_MOD|R_SERVER), "Msay", "Send a message to other mod", "Admin.Chat", message as text) var/msg = sanitize(message) - log_modsay(msg, user) + log_modsay(msg, list("speaker" = user)) if (!msg) return @@ -29,7 +29,7 @@ ADMIN_VERB(cmd_mod_say, (R_ADMIN|R_MOD|R_SERVER), "Msay", "Send a message to oth ADMIN_VERB(cmd_event_say, (R_ADMIN|R_MOD|R_EVENT|R_SERVER), "Esay", "Send a message to other event manager", "Admin.Chat", message as text) var/msg = sanitize(message) - log_eventsay(msg, user) + log_eventsay(msg, list("speaker" = user)) if (!msg) return diff --git a/code/modules/admin/verbs/antag-ooc.dm b/code/modules/admin/verbs/antag-ooc.dm index 89cb037d17..2405d5e6d8 100644 --- a/code/modules/admin/verbs/antag-ooc.dm +++ b/code/modules/admin/verbs/antag-ooc.dm @@ -39,4 +39,4 @@ if((M.mind && M.mind.special_role && A && A.can_hear_aooc) || isobserver(M)) // Antags must have their type be allowed to AOOC to see AOOC. This prevents, say, ERT from seeing AOOC. to_chat(M, span_ooc(span_aooc("[create_text_tag("aooc", "Antag-OOC:", M.client)] [player_display]: " + span_message("[msg]")))) - log_aooc(msg,src) + src.mob.log_talk("(AOOC) [msg]", LOG_OOC) diff --git a/code/modules/admin/verbs/cinematic.dm b/code/modules/admin/verbs/cinematic.dm index c0a5095f55..557d74c825 100644 --- a/code/modules/admin/verbs/cinematic.dm +++ b/code/modules/admin/verbs/cinematic.dm @@ -1,4 +1,4 @@ -ADMIN_VERB(cinematic, R_FUN, "Cinematic", "Show a cinematic to all players.", ADMIN_CATEGORY_FUN) +ADMIN_VERB(cinematic, R_FUN, "Cinematic", "Show a cinematic to all players.", "Fun.Do Not") var/datum/cinematic/choice = tgui_input_list( user, "Chose a cinematic to play to everyone in the server.", diff --git a/code/modules/admin/verbs/custom_event.dm b/code/modules/admin/verbs/custom_event.dm index 8cb6d62b15..1c0d242ea7 100644 --- a/code/modules/admin/verbs/custom_event.dm +++ b/code/modules/admin/verbs/custom_event.dm @@ -19,10 +19,10 @@ GLOB.custom_event_msg = input - to_world(span_filter_system("

[span_alert("Custom Event")]

")) - to_world(span_filter_system("

[span_alert("A custom event is starting. OOC Info:")]

")) - to_world(span_filter_system(span_alert("[GLOB.custom_event_msg]"))) - to_world(span_filter_system("
")) + to_chat(world, span_filter_system("

[span_alert("Custom Event")]

")) + to_chat(world, span_filter_system("

[span_alert("A custom event is starting. OOC Info:")]

")) + to_chat(world, span_filter_system(span_alert("[GLOB.custom_event_msg]"))) + to_chat(world, span_filter_system("
")) SSwebhooks.send( WEBHOOK_CUSTOM_EVENT, diff --git a/code/modules/admin/verbs/debug.dm b/code/modules/admin/verbs/debug.dm index 45b5b52d2a..137ab997e8 100644 --- a/code/modules/admin/verbs/debug.dm +++ b/code/modules/admin/verbs/debug.dm @@ -393,33 +393,33 @@ ADMIN_VERB(cmd_assume_direct_control, (R_DEBUG|R_ADMIN|R_EVENT), "Assume Direct var/list/areas_without_intercom = areas_all - areas_with_intercom var/list/areas_without_camera = areas_all - areas_with_camera - to_world(span_bold("AREAS WITHOUT AN APC:")) + to_chat(world, span_bold("AREAS WITHOUT AN APC:")) for(var/areatype in areas_without_APC) - to_world("* [areatype]") + to_chat(world, "* [areatype]") - to_world(span_bold("AREAS WITHOUT AN AIR ALARM:")) + to_chat(world, span_bold("AREAS WITHOUT AN AIR ALARM:")) for(var/areatype in areas_without_air_alarm) - to_world("* [areatype]") + to_chat(world, "* [areatype]") - to_world(span_bold("AREAS WITHOUT A REQUEST CONSOLE:")) + to_chat(world, span_bold("AREAS WITHOUT A REQUEST CONSOLE:")) for(var/areatype in areas_without_RC) - to_world("* [areatype]") + to_chat(world, "* [areatype]") - to_world(span_bold("AREAS WITHOUT ANY LIGHTS:")) + to_chat(world, span_bold("AREAS WITHOUT ANY LIGHTS:")) for(var/areatype in areas_without_light) - to_world("* [areatype]") + to_chat(world, "* [areatype]") - to_world(span_bold("AREAS WITHOUT A LIGHT SWITCH:")) + to_chat(world, span_bold("AREAS WITHOUT A LIGHT SWITCH:")) for(var/areatype in areas_without_LS) - to_world("* [areatype]") + to_chat(world, "* [areatype]") - to_world(span_bold("AREAS WITHOUT ANY INTERCOMS:")) + to_chat(world, span_bold("AREAS WITHOUT ANY INTERCOMS:")) for(var/areatype in areas_without_intercom) - to_world("* [areatype]") + to_chat(world, "* [areatype]") - to_world(span_bold("AREAS WITHOUT ANY CAMERAS:")) + to_chat(world, span_bold("AREAS WITHOUT ANY CAMERAS:")) for(var/areatype in areas_without_camera) - to_world("* [areatype]") + to_chat(world, "* [areatype]") /datum/admins/proc/cmd_admin_dress(input in getmobs()) set category = "Fun.Event Kit" @@ -624,15 +624,17 @@ ADMIN_VERB(cmd_assume_direct_control, (R_DEBUG|R_ADMIN|R_EVENT), "Assume Direct else tgui_alert_async(usr, "Invalid mob") -/datum/admins/proc/view_runtimes() - set category = "Debug.Investigate" - set name = "View Runtimes" - set desc = "Open the Runtime Viewer" +ADMIN_VERB(view_runtimes, R_DEBUG, "View Runtimes", "Opens the runtime viewer.", ADMIN_CATEGORY_DEBUG) + GLOB.error_cache.show_to(user) - if(!check_rights(R_DEBUG)) - return - - error_cache.showTo(usr) + // The runtime viewer has the potential to crash the server if there's a LOT of runtimes + // this has happened before, multiple times, so we'll just leave an alert on it + if(GLOB.total_runtimes >= 50000) // arbitrary number, I don't know when exactly it happens + var/warning = "There are a lot of runtimes, clicking any button (especially \"linear\") can have the potential to lag or crash the server" + if(GLOB.total_runtimes >= 100000) + warning = "There are a TON of runtimes, clicking any button (especially \"linear\") WILL LIKELY crash the server" + // Not using TGUI alert, because it's view runtimes, stuff is probably broken + tgui_alert(user, "[warning]. Proceed with caution. If you really need to see the runtimes, download the runtime log and view it in a text editor.", "HEED THIS WARNING CAREFULLY MORTAL") /datum/admins/proc/change_weather() set category = "Debug.Events" diff --git a/code/modules/admin/verbs/dice.dm b/code/modules/admin/verbs/dice.dm index 09e171eafd..d9860ac4c8 100644 --- a/code/modules/admin/verbs/dice.dm +++ b/code/modules/admin/verbs/dice.dm @@ -14,11 +14,11 @@ var/dice = num2text(sum) + "d" + num2text(side) if(tgui_alert(usr, "Do you want to inform the world about your game?","Show world?",list("Yes", "No")) == "Yes") - to_world("

The dice have been rolled by Gods!

") + to_chat(world, "

The dice have been rolled by Gods!

") var/result = roll(dice) if(tgui_alert(usr, "Do you want to inform the world about the result?","Show world?",list("Yes", "No")) == "Yes") - to_world("

Gods rolled [dice], result is [result]

") + to_chat(world, "

Gods rolled [dice], result is [result]

") message_admins("[key_name_admin(src)] rolled dice [dice], result is [result]", 1) diff --git a/code/modules/admin/verbs/grief_fixers.dm b/code/modules/admin/verbs/grief_fixers.dm index 72b66d36a5..38681da7cb 100644 --- a/code/modules/admin/verbs/grief_fixers.dm +++ b/code/modules/admin/verbs/grief_fixers.dm @@ -5,7 +5,7 @@ ADMIN_VERB(fix_atmos, (R_ADMIN|R_DEBUG|R_EVENT), "Fix Atmospherics Grief", "View feedback_add_details("admin_verb","FA") log_and_message_admins("Full atmosphere reset initiated by [user].") - to_world(span_danger("Initiating restart of atmosphere. The server may lag a bit.")) + to_chat(world, span_danger("Initiating restart of atmosphere. The server may lag a bit.")) sleep(10) var/current_time = world.timeofday @@ -43,4 +43,4 @@ ADMIN_VERB(fix_atmos, (R_ADMIN|R_DEBUG|R_EVENT), "Fix Atmospherics Grief", "View SSair.RebootZAS() to_chat(user, "\[5/5\] - ZAS Rebooted") - to_world(span_danger("Atmosphere restart completed in " + span_bold("[(world.timeofday - current_time)/10]") + " seconds.")) + to_chat(world, span_danger("Atmosphere restart completed in " + span_bold("[(world.timeofday - current_time)/10]") + " seconds.")) diff --git a/code/modules/admin/verbs/mapping.dm b/code/modules/admin/verbs/mapping.dm index 82aedfe622..1fcd7d6e76 100644 --- a/code/modules/admin/verbs/mapping.dm +++ b/code/modules/admin/verbs/mapping.dm @@ -310,9 +310,9 @@ var/list/debug_verbs = list ( if(i*10+j <= atom_list.len) temp_atom = atom_list[i*10+j] line += " no.[i+10+j]@\[[temp_atom.x], [temp_atom.y], [temp_atom.z]\]; " - to_world(line)*/ + to_chat(world, line)*/ - to_world("There are [count] objects of type [type_path] on z-level [num_level]") + to_chat(world, "There are [count] objects of type [type_path] on z-level [num_level]") feedback_add_details("admin_verb","mOBJZ") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! /client/proc/count_objects_all() @@ -337,7 +337,7 @@ var/list/debug_verbs = list ( if(i*10+j <= atom_list.len) temp_atom = atom_list[i*10+j] line += " no.[i+10+j]@\[[temp_atom.x], [temp_atom.y], [temp_atom.z]\]; " - to_world(line)*/ + to_chat(world, line)*/ - to_world("There are [count] objects of type [type_path] in the game world") + to_chat(world, "There are [count] objects of type [type_path] in the game world") feedback_add_details("admin_verb","mOBJ") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! diff --git a/code/modules/admin/verbs/playsound.dm b/code/modules/admin/verbs/playsound.dm index 7dcd38bb86..be85b7d2c4 100644 --- a/code/modules/admin/verbs/playsound.dm +++ b/code/modules/admin/verbs/playsound.dm @@ -103,7 +103,7 @@ var/list/sounds_cache = list() if(!check_rights(R_SOUNDS)) return - var/list/sounds = file2list("sound/serversound_list.txt"); + var/list/sounds = world.file2list("sound/serversound_list.txt"); sounds += "--CANCEL--" sounds += sounds_cache diff --git a/code/modules/admin/verbs/pray.dm b/code/modules/admin/verbs/pray.dm index 53f6a05723..e277de372d 100644 --- a/code/modules/admin/verbs/pray.dm +++ b/code/modules/admin/verbs/pray.dm @@ -24,7 +24,7 @@ to_chat(src, "Your prayers have been received by the gods.", confidential = TRUE) feedback_add_details("admin_verb","PR") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! - log_pray(raw_msg, src) + log_prayer("[src.key]/([src.name]): [raw_msg]") /proc/CentCom_announce(var/msg, var/mob/Sender, var/iamessage) msg = span_blue(span_bold(span_orange("[uppertext(using_map.boss_short)]M[iamessage ? " IA" : ""]:") + "[key_name(Sender, 1)] [ADMIN_PP(Sender)] [ADMIN_VV(Sender)] [ADMIN_SM(Sender)] ([admin_jump_link(Sender)]) [ADMIN_CA(Sender)] [ADMIN_BSA(Sender)] [ADMIN_CENTCOM_REPLY(Sender)]:") + " [msg]") diff --git a/code/modules/admin/verbs/randomverbs.dm b/code/modules/admin/verbs/randomverbs.dm index 9f65339359..5894942fe1 100644 --- a/code/modules/admin/verbs/randomverbs.dm +++ b/code/modules/admin/verbs/randomverbs.dm @@ -124,7 +124,7 @@ ADMIN_VERB(drop_everything, R_ADMIN, "Drop Everything", ADMIN_VERB_NO_DESCRIPTIO if (!msg) // We check both before and after, just in case sanitization ended us up with empty message. return - to_world("[msg]") + to_chat(world, "[msg]") log_admin("GlobalNarrate: [key_name(usr)] : [msg]") message_admins(span_blue(span_bold(" GlobalNarrate: [key_name_admin(usr)] : [msg]
")), 1) feedback_add_details("admin_verb","GLN") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! @@ -710,7 +710,7 @@ ADMIN_VERB(respawn_character, (R_ADMIN|R_REJUVINATE), "Spawn Character", "(Re)Sp if(confirm == "Yes") command_announcement.Announce(input, customname, new_sound = 'sound/AI/commandreport.ogg', msg_sanitized = 1); else - to_world(span_red("New [using_map.company_name] Update available at all communication consoles.")) + to_chat(world, span_red("New [using_map.company_name] Update available at all communication consoles.")) world << sound('sound/AI/commandreport.ogg') log_admin("[key_name(src)] has created a command report: [input]") @@ -964,7 +964,7 @@ ADMIN_VERB(respawn_character, (R_ADMIN|R_REJUVINATE), "Spawn Character", "(Re)Sp message_admins("Admin [key_name_admin(usr)] has forced the players to have random appearances.", 1) if(notifyplayers == "Yes") - to_world(span_boldannounce(span_blue("Admin [usr.key] has forced the players to have completely random identities!"))) + to_chat(world, span_boldannounce(span_blue("Admin [usr.key] has forced the players to have completely random identities!"))) to_chat(usr, "Remember: you can always disable the randomness by using the verb again, assuming the round hasn't started yet.") diff --git a/code/modules/admin/verbs/striketeam.dm b/code/modules/admin/verbs/striketeam.dm index 3d2511ddfe..6dfb95b709 100644 --- a/code/modules/admin/verbs/striketeam.dm +++ b/code/modules/admin/verbs/striketeam.dm @@ -200,7 +200,7 @@ GLOBAL_VAR(ert_loaded) GLOB.ert_loaded = TRUE var/datum/map_template/MT = SSmapping.map_templates["Special Area - ERT"] if(!istype(MT)) - error("ERT Area is not a valid map template!") + log_mapping("ERT Area is not a valid map template!") else MT.load_new_z(centered = TRUE) log_and_message_admins("Loaded the ERT shuttle just now.") diff --git a/code/modules/admin/verbs/trader.dm b/code/modules/admin/verbs/trader.dm index 08a63b4bd8..3b5a2c70ee 100644 --- a/code/modules/admin/verbs/trader.dm +++ b/code/modules/admin/verbs/trader.dm @@ -75,7 +75,7 @@ GLOBAL_VAR(trader_loaded) GLOB.trader_loaded = TRUE var/datum/map_template/MT = SSmapping.map_templates["Special Area - Salamander Trader"] //was: "Special Area - Trader" if(!istype(MT)) - error("Trader is not a valid map template!") + log_mapping("Trader is not a valid map template!") else MT.load_new_z(centered = TRUE) log_and_message_admins("Loaded the trade shuttle just now.") diff --git a/code/modules/ai/ai_holder.dm b/code/modules/ai/ai_holder.dm index 352475061c..594d82cf3a 100644 --- a/code/modules/ai/ai_holder.dm +++ b/code/modules/ai/ai_holder.dm @@ -38,7 +38,7 @@ if(ai_holder_type) ai_holder = new ai_holder_type(src) if(!ai_holder) - log_debug("[src] could not initialize ai_holder of type [ai_holder_type]") + log_runtime("[src] could not initialize ai_holder of type [ai_holder_type]") return if(ishuman(src)) var/mob/living/carbon/human/H = src diff --git a/code/modules/ai/ai_holder_debug.dm b/code/modules/ai/ai_holder_debug.dm index b70771d3cd..553a54955d 100644 --- a/code/modules/ai/ai_holder_debug.dm +++ b/code/modules/ai/ai_holder_debug.dm @@ -12,7 +12,7 @@ var/stance_coloring = FALSE // Colors the mob depending on its stance. - var/debug_ai = AI_LOG_OFF // The level of debugging information to display to people who can see log_debug(). + var/debug_ai = AI_LOG_OFF // The level of debugging information to display to people who can see log_world(). /datum/ai_holder/New() ..() @@ -41,7 +41,7 @@ if(AI_LOG_TRACE) span_type = "debug_trace" if(ver <= debug_ai) - log_debug("AI: ([holder]:\ref[holder] | [holder.x],[holder.y],[holder.z])(@[world.time]): [msg] ") + log_world("AI: ([holder]:\ref[holder] | [holder.x],[holder.y],[holder.z])(@[world.time]): [msg] ") // Colors the mob based on stance, to visually tell what stance it is for debugging. // Probably not something you want for regular use. diff --git a/code/modules/assembly/holder.dm b/code/modules/assembly/holder.dm index fb2ee2359c..8e40773b2c 100644 --- a/code/modules/assembly/holder.dm +++ b/code/modules/assembly/holder.dm @@ -75,7 +75,7 @@ return var/atom/movable/AM = WF.resolve() if(isnull(AM)) - log_debug("DEBUG: HasProximity called without reference on [src].") + log_runtime("DEBUG: HasProximity called without reference on [src].") return if(a_left) a_left.HasProximity(T, WF, old_loc) diff --git a/code/modules/assembly/proximity.dm b/code/modules/assembly/proximity.dm index 9abb889371..bdf2c43ca1 100644 --- a/code/modules/assembly/proximity.dm +++ b/code/modules/assembly/proximity.dm @@ -37,7 +37,7 @@ return var/atom/movable/AM = WF.resolve() if(isnull(AM)) - log_debug("DEBUG: HasProximity called without reference on [src].") + log_runtime("DEBUG: HasProximity called without reference on [src].") return if (istype(AM, /obj/effect/beam)) return diff --git a/code/modules/asset_cache/asset_cache_item.dm b/code/modules/asset_cache/asset_cache_item.dm index dbee71b525..9576bfc3d0 100644 --- a/code/modules/asset_cache/asset_cache_item.dm +++ b/code/modules/asset_cache/asset_cache_item.dm @@ -46,7 +46,7 @@ hash = md5(fcopy_rsc(file)) if (!hash) CRASH("invalid asset sent to asset cache") - log_debug("asset cache unexpected success of second fcopy_rsc") + log_runtime("asset cache unexpected success of second fcopy_rsc") src.name = name var/extstart = findlasttext(name, ".") if(extstart) diff --git a/code/modules/awaymissions/gateway.dm b/code/modules/awaymissions/gateway.dm index fa8c1762d2..a781669456 100644 --- a/code/modules/awaymissions/gateway.dm +++ b/code/modules/awaymissions/gateway.dm @@ -38,7 +38,7 @@ GLOBAL_DATUM(gateway_station, /obj/machinery/gateway/centerstation) /obj/machinery/gateway/centerstation/Initialize(mapload) if(GLOB.gateway_station) - warning("[src] at [x],[y],[z] appears to be an additional station-gateway") + WARNING("[src] at [x],[y],[z] appears to be an additional station-gateway") else GLOB.gateway_station = src @@ -256,7 +256,7 @@ GLOBAL_DATUM(gateway_away, /obj/machinery/gateway/centeraway) /obj/machinery/gateway/centeraway/Initialize(mapload) if(GLOB.gateway_away) - warning("[src] at [x],[y],[z] appears to be an additional away-gateway") + WARNING("[src] at [x],[y],[z] appears to be an additional away-gateway") else GLOB.gateway_away = src diff --git a/code/modules/awaymissions/gateway_vr.dm b/code/modules/awaymissions/gateway_vr.dm index 816d2c06e8..5840afb189 100644 --- a/code/modules/awaymissions/gateway_vr.dm +++ b/code/modules/awaymissions/gateway_vr.dm @@ -56,7 +56,7 @@ destination = CL if(!destination) - warning("A gateway is trying to spawn it's mcguffin but there are no mapped in spawner landmarks") + WARNING("A gateway is trying to spawn it's mcguffin but there are no mapped in spawner landmarks") destination = get_turf(src) key = new mcguffin_type(destination) diff --git a/code/modules/awaymissions/overmap_renamer/overmap_renamer.dm b/code/modules/awaymissions/overmap_renamer/overmap_renamer.dm index 1fae96eea5..13e205f4c0 100644 --- a/code/modules/awaymissions/overmap_renamer/overmap_renamer.dm +++ b/code/modules/awaymissions/overmap_renamer/overmap_renamer.dm @@ -7,7 +7,7 @@ possible_descriptors are populated by subtypes of /obj/effect/landmark/overmap_r */ /obj/effect/overmap/visitable/proc/modify_descriptors() if(!possible_descriptors || !islist(possible_descriptors) || possible_descriptors == list() || !length(possible_descriptors)) - error("List of possible descriptors for [name] was empty!") + log_mapping("## ERROR List of possible descriptors for [name] was empty!") return var/list/chosen_descriptor = pick(possible_descriptors) @@ -22,7 +22,7 @@ possible_descriptors are populated by subtypes of /obj/effect/landmark/overmap_r // testing("Defaulting to default!") //Uncomment when adding a new landmark to confirm it works OK, but recomment before commiting return if(breakWhile > 10 || length(possible_descriptors) < 1) - error("No valid descriptors could be found for [name]!") //Checking default separately for sake of error messages + log_mapping("## ERROR No valid descriptors could be found for [name]!") //Checking default separately for sake of error messages return //Using real_name to ensure get_scan_data() does not override the renamed code @@ -48,9 +48,9 @@ possible_descriptors are populated by subtypes of /obj/effect/landmark/overmap_r /obj/effect/landmark/overmap_renamer/Initialize(mapload) // testing("Loading renamer landmark: [name]") //Uncomment when adding a new POI/Landmark for testing aid. if(LAZYLEN(descriptors) != 3) - error("POI [name] renamer landmark is invalid! Make sure its descriptors var is a list of 3 elements!") + log_mapping("## ERROR POI [name] renamer landmark is invalid! Make sure its descriptors var is a list of 3 elements!") return if(!istext(descriptors[1]) || !istext(descriptors[2]) || !istext(descriptors[3])) - error("POI [name] renamer landmark is invalid! One of the elements is NOT a string!") + log_mapping("## ERROR POI [name] renamer landmark is invalid! One of the elements is NOT a string!") return . = ..() diff --git a/code/modules/awaymissions/zlevel.dm b/code/modules/awaymissions/zlevel.dm index 75e76c2923..3468ba601e 100644 --- a/code/modules/awaymissions/zlevel.dm +++ b/code/modules/awaymissions/zlevel.dm @@ -7,7 +7,7 @@ var/list/potentialRandomZlevels = list() admin_notice(span_red(span_bold(" Searching for away missions...")), R_DEBUG) - var/list/Lines = file2list("maps/RandomZLevels/fileList.txt") + var/list/Lines = world.file2list("maps/RandomZLevels/fileList.txt") if(!Lines.len) return for (var/t in Lines) if (!t) @@ -41,12 +41,12 @@ admin_notice(span_red(span_bold("Loading away mission...")), R_DEBUG) var/map = pick(potentialRandomZlevels) - to_world_log("Away mission picked: [map]") //VOREStation Add for debugging + log_mapping("Away mission picked: [map]") //VOREStation Add for debugging var/file = file(map) if(isfile(file)) var/datum/map_template/template = new(file, "away mission") template.load_new_z() - to_world_log("away mission loaded: [map]") + log_mapping("away mission loaded: [map]") /* VOREStation Removal - We do this in the special landmark init instead. for(var/obj/effect/landmark/L in GLOB.landmarks_list) if (L.name != "awaystart") diff --git a/code/modules/blob2/overmind/overmind.dm b/code/modules/blob2/overmind/overmind.dm index 7c9c67d65d..930c99a439 100644 --- a/code/modules/blob2/overmind/overmind.dm +++ b/code/modules/blob2/overmind/overmind.dm @@ -162,5 +162,5 @@ var/list/overminds = list() if(dst <= world.view) O.hear_talk(src, message_pieces, "conveys") - log_say(message, src) + log_talk(message, LOG_SAY) return 1 diff --git a/code/modules/client/client defines.dm b/code/modules/client/client defines.dm index 6086afa9d3..bbb584a0d9 100644 --- a/code/modules/client/client defines.dm +++ b/code/modules/client/client defines.dm @@ -86,6 +86,9 @@ ///Used for limiting the rate of clicks sends by the client to avoid abuse var/list/clicklimiter + ///these persist between logins/logouts during the same round. + var/datum/persistent_client/persistent_client + //////////////////////////////////// //things that require the database// //////////////////////////////////// diff --git a/code/modules/client/client procs.dm b/code/modules/client/client procs.dm index b993a7e0bf..054f3b918a 100644 --- a/code/modules/client/client procs.dm +++ b/code/modules/client/client procs.dm @@ -1,6 +1,11 @@ //////////// //SECURITY// //////////// + +GLOBAL_LIST_INIT(blacklisted_builds, list( + "1622" = "Bug breaking rendering can lead to wallhacks.", + )) + #define UPLOAD_LIMIT 10485760 //Restricts client uploads to the server to 10MB //Boosted this thing. What's the worst that can happen? #define MIN_CLIENT_VERSION 0 //Just an ambiguously low version for now, I don't want to suddenly stop people playing. //I would just like the code ready should it ever need to be used. @@ -68,7 +73,8 @@ if (minute != topiclimiter[ADMINSWARNED_AT]) //only one admin message per-minute. (if they spam the admins can just boot/ban them) topiclimiter[ADMINSWARNED_AT] = minute msg += " Administrators have been informed." - log_and_message_admins("[key_name(src)] Has hit the per-minute topic limit of [mtl] topic calls in a given game minute", src) + log_game("[key_name(src)] Has hit the per-minute topic limit of [mtl] topic calls in a given game minute") + message_admins("[ADMIN_LOOKUPFLW(usr)] [ADMIN_KICK(usr)] Has hit the per-minute topic limit of [mtl] topic calls in a given game minute") to_chat(src, span_danger("[msg]")) return @@ -87,7 +93,7 @@ //search the href for script injection if( findtext(href," || [hsrc ? "[hsrc] " : ""][href]") + log_href("[src] (usr:[usr]\[[COORD(usr)]\]) : [hsrc ? "[hsrc] " : ""][href]") //byond bug ID:2256651 if (asset_cache_job && (asset_cache_job in completed_asset_jobs)) @@ -226,9 +231,12 @@ //CONNECT// /////////// /client/New(TopicData) - winset(src, null, "browser-options=[DEFAULT_CLIENT_BROWSER_OPTIONS]") + TopicData = null //Prevent calls to client.Topic from connect - TopicData = null //Prevent calls to client.Topic from connect + if(connection != "seeker" && connection != "web")//Invalid connection type. + return null + + winset(src, null, "browser-options=[DEFAULT_CLIENT_BROWSER_OPTIONS]") if(!(connection in list("seeker", "web"))) //Invalid connection type. return null @@ -247,6 +255,14 @@ GLOB.clients += src GLOB.directory[ckey] = src + //var/reconnecting = FALSE we are not using this var yet + if(GLOB.persistent_clients_by_ckey[ckey]) + //reconnecting = TRUE + persistent_client = GLOB.persistent_clients_by_ckey[ckey] + else + persistent_client = new(ckey) + persistent_client.set_client(src) + if (CONFIG_GET(flag/chatlog_database_backend)) chatlog_token = vchatlog_generate_token(ckey, GLOB.round_id) @@ -262,12 +278,6 @@ GLOB.tickets.ClientLogin(src) - //Admin Authorisation - holder = GLOB.admin_datums[ckey] - if(holder) - GLOB.admins += src - holder.owner = src - //preferences datum - also holds some persistant data for the client (because we may as well keep these datums to a minimum) prefs = preferences_datums[ckey] if(prefs) @@ -280,9 +290,42 @@ prefs.last_ip = address //these are gonna be used for banning prefs.last_id = computer_id //these are gonna be used for banning + var/full_version = "[byond_version].[byond_build ? byond_build : "xxx"]" + log_access("Login: [key_name(src)] from [address ? address : "localhost"]-[computer_id] || BYOND v[full_version]") + prefs_vr = new/datum/vore_preferences(src) . = ..() //calls mob.Login() + + // Admin Verbs need the client's mob to exist. Must be after ..() + var/connecting_admin = FALSE //because de-admined admins connecting should be treated like admins. + //Admin Authorisation + var/datum/admins/admin_datum = GLOB.admin_datums[ckey] + if (!isnull(admin_datum)) + admin_datum.associate(src) + connecting_admin = TRUE + else if(GLOB.deadmins[ckey]) + add_verb(src, /client/proc/readmin) + connecting_admin = TRUE + + if (byond_version >= 512) + if (!byond_build || byond_build < 1386) + message_admins(span_adminnotice("[key_name(src)] has been detected as spoofing their byond version. Connection rejected.")) + //add_system_note("Spoofed-Byond-Version", "Detected as using a spoofed byond version.") + log_suspicious_login("Failed Login: [key] - Spoofed byond version") + qdel(src) + + if (num2text(byond_build) in GLOB.blacklisted_builds) + log_access("Failed login: [key] - blacklisted byond version") + to_chat_immediate(src, span_userdanger("Your version of byond is blacklisted.")) + to_chat_immediate(src, span_danger("Byond build [byond_build] ([byond_version].[byond_build]) has been blacklisted for the following reason: [GLOB.blacklisted_builds[num2text(byond_build)]].")) + to_chat_immediate(src, span_danger("Please download a new version of byond. If [byond_build] is the latest, you can go to BYOND's website to download other versions.")) + if(connecting_admin) + to_chat_immediate(src, "As an admin, you are being allowed to continue using this version, but please consider changing byond versions") + else + qdel(src) + return + prefs.sanitize_preferences() if(prefs) prefs.selecting_slots = FALSE @@ -371,8 +414,6 @@ if (!QDELING(src)) stack_trace("Client does not purport to be QDELING, this is going to cause bugs in other places!") - GLOB.tickets.ClientLogout(src) - // Yes this is the same as what's found in qdel(). Yes it does need to be here // Get off my back SEND_SIGNAL(src, COMSIG_QDELETING, TRUE) @@ -380,11 +421,15 @@ return ..() /client/Destroy() + GLOB.directory -= ckey + GLOB.clients -= src + persistent_client.set_client(null) + + log_access("Logout: [key_name(src)]") + GLOB.tickets.ClientLogout(src) if(holder) holder.owner = null GLOB.admins -= src - GLOB.directory -= ckey - GLOB.clients -= src QDEL_NULL(loot_panel) ..() @@ -475,7 +520,7 @@ //Panic bunker code if (isnum(player_age) && player_age == 0) //first connection if (CONFIG_GET(flag/panic_bunker) && !holder && !GLOB.deadmins[key]) - log_adminwarn("Failed Login: [key] - New account attempting to connect during panic bunker") + log_admin_private("Failed Login: [key] - New account attempting to connect during panic bunker") message_admins(span_adminnotice("Failed Login: [key] - New account attempting to connect during panic bunker")) disconnect_with_message("Sorry but the server is currently not accepting connections from never before seen players.") return 0 @@ -503,7 +548,6 @@ else log_admin("Couldn't perform IP check on [key] with [address]") - // VOREStation Edit Start - Department Hours var/datum/db_query/query_hours = SSdbcore.NewQuery("SELECT department, hours, total_hours FROM vr_player_hours WHERE ckey = '[sql_ckey]'") if(query_hours.Execute()) while(query_hours.NextRow()) @@ -511,9 +555,8 @@ play_hours[query_hours.item[1]] = text2num(query_hours.item[3]) else var/error_message = query_hours.ErrorMsg() // Need this out here since the spawn below will split the stack and who knows what'll happen by the time it runs - log_debug("Error loading play hours for [ckey]: [error_message]") + log_sql("Error loading play hours for [ckey]: [error_message]") tgui_alert_async(src, "The query to load your existing playtime failed. Screenshot this, give the screenshot to a developer, and reconnect, otherwise you may lose any recorded play hours (which may limit access to jobs). ERROR: [error_message]", "PROBLEMS!!") - // VOREStation Edit End - Department Hours qdel(query_hours) if(sql_id) //Player already identified previously, we need to just update the 'lastseen', 'ip' and 'computer_id' variables diff --git a/code/modules/client/persistent_client.dm b/code/modules/client/persistent_client.dm new file mode 100644 index 0000000000..99f4e2f1ed --- /dev/null +++ b/code/modules/client/persistent_client.dm @@ -0,0 +1,107 @@ + +///assoc list of ckey -> /datum/persistent_client +GLOBAL_LIST_EMPTY_TYPED(persistent_clients_by_ckey, /datum/persistent_client) +/// A flat list of all persistent clients, for her looping pleasure. +GLOBAL_LIST_EMPTY_TYPED(persistent_clients, /datum/persistent_client) + +/// Tracks information about a client between log in and log outs +/datum/persistent_client + /// The true client + var/client/client + /// The mob this persistent client is currently bound to. + var/mob/mob + + /// Major version of BYOND this client was last using. + var/byond_version + /// Build number of BYOND this client was last using. + var/byond_build + + /// Action datums assigned to this player + var/list/datum/action/player_actions = list() + /// Tracks client action logging + var/list/logging = list() + + /// Callbacks invoked when this client logs in again + var/list/post_login_callbacks = list() + /// Callbacks invoked when this client logs out + var/list/post_logout_callbacks = list() + + /// List of names this key played under this round + /// assoc list of name -> mob tag + var/list/played_names = list() + /// Lazylist of preference slots this client has joined the round under + /// Numbers are stored as strings + var/list/joined_as_slots + + /// Tracks achievements they have earned + //var/datum/achievement_data/achievements + + /// World.time this player last died + var/time_of_death = 0 + +/datum/persistent_client/New(ckey) + //achievements = new(ckey) + GLOB.persistent_clients_by_ckey[ckey] = src + GLOB.persistent_clients += src + +/datum/persistent_client/Destroy(force) + SHOULD_CALL_PARENT(FALSE) + . = QDEL_HINT_LETMELIVE + CRASH("Who the FUCK tried to delete a persistent client? Get your head checked you leadskull.") + +/// Setter for the client var, updates any vars we have that might be dependent on client state +/datum/persistent_client/proc/set_client(client/new_client) + if(client == new_client) + return + + if(client) + client.persistent_client = null + client = new_client + if(client) + client.persistent_client = src + byond_build = client.byond_build + byond_version = client.byond_version + +/// Setter for the mob var, handles both references. +/datum/persistent_client/proc/set_mob(mob/new_mob) + if(mob == new_mob) + return + + mob?.persistent_client = null + new_mob?.persistent_client?.set_mob(null) + + mob = new_mob + new_mob?.persistent_client = src + +/// Writes all of the `played_names` into an HTML-escaped string. +/datum/persistent_client/proc/get_played_names() + var/list/previous_names = list() + for(var/previous_name in played_names) + previous_names += html_encode("[previous_name] ([played_names[previous_name]])") + return previous_names.Join("; ") + +/// Returns the full version string (i.e 515.1642) of the BYOND version and build. +/datum/persistent_client/proc/full_byond_version() + if(!byond_version) + return "Unknown" + return "[byond_version].[byond_build || "xxx"]" + +/// Adds the new names to the player's played_names list on their /datum/persistent_client for use of admins. +/// `ckey` should be their ckey, and `data` should be an associative list with the keys being the names they played under and the values being the unique mob ID tied to that name. +/proc/log_played_names(ckey, data) + if(!ckey) + return + + var/datum/persistent_client/writable = GLOB.persistent_clients_by_ckey[ckey] + if(isnull(writable)) + return + + for(var/name in data) + if(!name) + continue + var/mob_tag = data[name] + var/encoded_name = html_encode(name) + if(writable.played_names.Find("[encoded_name]")) + continue + + writable.played_names += list("[encoded_name]" = mob_tag) diff --git a/code/modules/client/preference_setup/general/12_traits.dm b/code/modules/client/preference_setup/general/12_traits.dm index f44f57569f..9f18725d7e 100644 --- a/code/modules/client/preference_setup/general/12_traits.dm +++ b/code/modules/client/preference_setup/general/12_traits.dm @@ -131,16 +131,16 @@ //Neutral traits for(var/datum/trait/path as anything in pref.neu_traits) if(!(path in GLOB.neutral_traits)) - to_world_log("removing [path] for not being in neutral_traits") + log_world("removing [path] for not being in neutral_traits") pref.neu_traits -= path continue if(!(pref.species == SPECIES_CUSTOM) && !(path in GLOB.everyone_traits_neutral)) - to_world_log("removing [path] for not being a custom species") + log_world("removing [path] for not being a custom species") pref.neu_traits -= path continue var/take_flags = initial(path.can_take) if((pref.dirty_synth && !(take_flags & SYNTHETICS)) || (pref.gross_meatbag && !(take_flags & ORGANICS))) - to_world_log("removing [path] for being a dirty synth") + log_world("removing [path] for being a dirty synth") pref.neu_traits -= path //Negative traits for(var/datum/trait/path as anything in pref.neg_traits) diff --git a/code/modules/client/preference_setup/loadout/02_loadout.dm b/code/modules/client/preference_setup/loadout/02_loadout.dm index 0e455abd68..7338988ae1 100644 --- a/code/modules/client/preference_setup/loadout/02_loadout.dm +++ b/code/modules/client/preference_setup/loadout/02_loadout.dm @@ -19,13 +19,13 @@ var/list/gear_datums = list() var/use_category = initial(G.sort_category) if(!use_name) - error("Loadout - Missing display name: [G]") + log_world("## ERROR Loadout - Missing display name: [G]") continue if(isnull(initial(G.cost))) - error("Loadout - Missing cost: [G]") + log_world("## ERROR Loadout - Missing cost: [G]") continue if(!initial(G.path)) - error("Loadout - Missing path definition: [G]") + log_world("## ERROR Loadout - Missing path definition: [G]") continue if(!loadout_categories[use_category]) diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index 215926dd5b..a4d53d0a27 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -355,7 +355,7 @@ var/list/preferences_datums = list() var/slotnum = charlist[choice] if(!slotnum) - error("Player picked [choice] slot to load, but that wasn't one we sent.") + log_world("## ERROR Player picked [choice] slot to load, but that wasn't one we sent.") return load_preferences(TRUE) @@ -396,7 +396,7 @@ var/list/preferences_datums = list() var/slotnum = charlist[choice] if(!slotnum) - error("Player picked [choice] slot to copy to, but that wasn't one we sent.") + log_world("## ERROR Player picked [choice] slot to copy to, but that wasn't one we sent.") return if(tgui_alert(user, "Are you sure you want to override slot [slotnum], [choice]'s savedata?", "Confirm Override", list("No", "Yes")) == "Yes") diff --git a/code/modules/client/preferences_savefile.dm b/code/modules/client/preferences_savefile.dm index 29ff3733d1..9f4ad779fc 100644 --- a/code/modules/client/preferences_savefile.dm +++ b/code/modules/client/preferences_savefile.dm @@ -41,62 +41,62 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car // Migration for client preferences if(current_version < 13) - log_debug("[client_ckey] preferences migrating from [current_version] to v13....") + log_world("[client_ckey] preferences migrating from [current_version] to v13....") to_chat(client, span_danger("Migrating savefile from version [current_version] to v13...")) migration_13_preferences(S) - log_debug("[client_ckey] preferences successfully migrated from [current_version] to v13.") + log_world("[client_ckey] preferences successfully migrated from [current_version] to v13.") to_chat(client, span_danger("v13 savefile migration complete.")) // Migration for nifs if(current_version < 14) - log_debug("[client_ckey] preferences migrating from [current_version] to v14....") + log_world("[client_ckey] preferences migrating from [current_version] to v14....") to_chat(client, span_danger("Migrating savefile from version [current_version] to v14...")) migration_14_nifs(S) - log_debug("[client_ckey] preferences successfully migrated from [current_version] to v14.") + log_world("[client_ckey] preferences successfully migrated from [current_version] to v14.") to_chat(client, span_danger("v14 savefile migration complete.")) // Migration for nifs, again, to get rid of the /device path if(current_version < 15) - log_debug("[client_ckey] preferences migrating from [current_version] to v15....") + log_world("[client_ckey] preferences migrating from [current_version] to v15....") to_chat(client, span_danger("Migrating savefile from version [current_version] to v15...")) migration_15_nif_path(S) - log_debug("[client_ckey] preferences successfully migrated from [current_version] to v15.") + log_world("[client_ckey] preferences successfully migrated from [current_version] to v15.") to_chat(client, span_danger("v15 savefile migration complete.")) // Migration for colors if(current_version < 16) - log_debug("[client_ckey] preferences migrating from [current_version] to v16....") + log_world("[client_ckey] preferences migrating from [current_version] to v16....") to_chat(client, span_danger("Migrating savefile from version [current_version] to v16...")) migration_16_colors(S) - log_debug("[client_ckey] preferences successfully migrated from [current_version] to v16.") + log_world("[client_ckey] preferences successfully migrated from [current_version] to v16.") to_chat(client, span_danger("v16 savefile migration complete.")) // Migration for old named tails so downstream doesn't have their savefiles borked if(current_version < 17) - log_debug("[client_ckey] preferences migrating from [current_version] to v17....") + log_world("[client_ckey] preferences migrating from [current_version] to v17....") to_chat(client, span_danger("Migrating savefile from version [current_version] to v17...")) migration_17_tails(S) - log_debug("[client_ckey] preferences successfully migrated from [current_version] to v17.") + log_world("[client_ckey] preferences successfully migrated from [current_version] to v17.") to_chat(client, span_danger("v17 savefile migration complete.")) // Migration for jukebox volume from 0-1 to 0-100 if(current_version < 18) - log_debug("[client_ckey] preferences migrating from [current_version] to v18....") + log_world("[client_ckey] preferences migrating from [current_version] to v18....") to_chat(client, span_danger("Migrating savefile from version [current_version] to v18...")) migration_18_jukebox(S) - log_debug("[client_ckey] preferences successfully migrated from [current_version] to v18.") + log_world("[client_ckey] preferences successfully migrated from [current_version] to v18.") to_chat(client, span_danger("v18 savefile migration complete.")) /datum/preferences/proc/update_character(current_version, list/save_data) // Migration from BYOND savefiles to JSON: Important milemark. @@ -106,7 +106,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car /// Migrates from byond savefile to json savefile /datum/preferences/proc/try_savefile_type_migration() - log_debug("[client_ckey] preferences migrating from savefile to JSON...") + log_world("[client_ckey] preferences migrating from savefile to JSON...") to_chat(client, span_danger("Savefile migration to JSON in progress...")) load_path(client.ckey, "preferences.sav") // old save file @@ -118,7 +118,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car json_savefile.import_byond_savefile(new /savefile(old_path)) json_savefile.save() - log_debug("[client_ckey] preferences successfully migrated from savefile to JSON.") + log_world("[client_ckey] preferences successfully migrated from savefile to JSON.") to_chat(client, span_danger("Savefile migration to JSON is complete.")) return TRUE diff --git a/code/modules/client/shock.dm b/code/modules/client/shock.dm index 21152d10f4..251036b58d 100644 --- a/code/modules/client/shock.dm +++ b/code/modules/client/shock.dm @@ -82,7 +82,7 @@ connected = FALSE else if(type == "error") connected = FALSE - log_debug("WebSocket Error [json_encode(payload)]") + log_runtime("WebSocket Error [json_encode(payload)]") else if(type == "incomingMessage") if(payload["lastCall"] == "get_devices") available_devices = json_decode(payload["data"]) diff --git a/code/modules/client/verbs/ooc.dm b/code/modules/client/verbs/ooc.dm index 8e55fda987..a8be59f005 100644 --- a/code/modules/client/verbs/ooc.dm +++ b/code/modules/client/verbs/ooc.dm @@ -42,7 +42,7 @@ message_admins("[key_name_admin(src)] has attempted to post a link in OOC: [msg]") return - log_ooc(msg, src) + src.mob.log_talk(msg, LOG_OOC) if(msg) handle_spam_prevention(MUTE_OOC) @@ -125,7 +125,7 @@ message_admins("[key_name_admin(src)] has attempted to post a link in OOC: [msg]") return - log_looc(msg,src) + src.mob.log_message(msg, LOG_LOOC) if(msg) handle_spam_prevention(MUTE_LOOC) diff --git a/code/modules/clothing/clothing.dm b/code/modules/clothing/clothing.dm index f2814ca3cf..764d011c37 100644 --- a/code/modules/clothing/clothing.dm +++ b/code/modules/clothing/clothing.dm @@ -1180,7 +1180,7 @@ if(5) sensor_mode = pick(0,1,2,3) //Select a random setting else sensor_mode = pick(0,1,2,3) - log_debug("Invalid switch for suit sensors, defaulting to random. [sensorpref] chosen") + log_runtime("Invalid switch for suit sensors, defaulting to random. [sensorpref] chosen") /obj/item/clothing/under/proc/update_rolldown_status() var/mob/living/carbon/human/H diff --git a/code/modules/customitems/item_spawning.dm b/code/modules/customitems/item_spawning.dm index 66fc766f1f..b18a661ceb 100644 --- a/code/modules/customitems/item_spawning.dm +++ b/code/modules/customitems/item_spawning.dm @@ -185,14 +185,14 @@ // Check for requisite ckey and character name. if((lowertext(citem.assoc_key) != lowertext(M.ckey)) || (lowertext(citem.character_name) != lowertext(M.real_name))) - log_debug("Custom Item: [key_name(M)] Ckey or Char name does not match.") + // to_chat(world, "Custom Item: [key_name(M)] Ckey or Char name does not match.") continue // Check for required access. var/obj/item/card/id/current_id = M.wear_id if(citem.req_access && citem.req_access > 0) // These are numbers, not lists if(!(istype(current_id) && (citem.req_access in current_id.GetAccess()))) - log_debug("Custom Item: [key_name(M)] Does not have required access.") + // to_chat(world, "Custom Item: [key_name(M)] Does not have required access.") continue // Check for required job title. @@ -204,7 +204,7 @@ has_title = 1 break if(!has_title) - log_debug("Custom Item: [key_name(M)] Does not have required job.") + // to_chat(world, "Custom Item: [key_name(M)] Does not have required job.") continue // ID cards and PDAs are applied directly to the existing object rather than spawned fresh. diff --git a/code/modules/emotes/custom_emote.dm b/code/modules/emotes/custom_emote.dm index 252710aca4..0262dcdf03 100644 --- a/code/modules/emotes/custom_emote.dm +++ b/code/modules/emotes/custom_emote.dm @@ -59,7 +59,7 @@ build_the_emote(m_type, message, input, range, runemessage) /mob/proc/log_the_emote(m_type, message, input, range, runemessage) - log_emote(message,src) //Log before we add junk + log_message(message, LOG_EMOTE) //Log before we add junk build_the_emote(m_type, message, input, range, runemessage) /mob/proc/build_the_emote(m_type, message, input, range, runemessage) diff --git a/code/modules/error_handler/_defines.dm b/code/modules/error_handler/_defines.dm deleted file mode 100644 index 0c98f4a9b9..0000000000 --- a/code/modules/error_handler/_defines.dm +++ /dev/null @@ -1,9 +0,0 @@ -// Settings for the error handler and error viewer - -#define ERROR_COOLDOWN 600 // The "cooldown" time for each occurrence of a unique error -#define ERROR_LIMIT 9 // How many occurrences before the next will silence them -#define ERROR_MAX_COOLDOWN (ERROR_COOLDOWN * ERROR_LIMIT) -#define ERROR_SILENCE_TIME 6000 // How long a unique error will be silenced for - -// How long to wait between messaging admins about occurrences of a unique error -#define ERROR_MSG_DELAY 50 diff --git a/code/modules/error_handler/error_handler.dm b/code/modules/error_handler/error_handler.dm index d6785a8028..d0edf77f4a 100644 --- a/code/modules/error_handler/error_handler.dm +++ b/code/modules/error_handler/error_handler.dm @@ -1,135 +1,156 @@ -// error_cooldown items will either be positive (cooldown time) or negative (silenced error) -// If negative, starts at -1, and goes down by 1 each time that error gets skipped -GLOBAL_VAR_INIT(total_runtimes, 0) +GLOBAL_VAR_INIT(total_runtimes, GLOB.total_runtimes || 0) GLOBAL_VAR_INIT(total_runtimes_skipped, 0) +#ifdef USE_CUSTOM_ERROR_HANDLER +#define ERROR_USEFUL_LEN 2 -// The ifdef needs to be down here, since the error viewer references total_runtimes -#ifdef DEBUG -/world/Error(var/exception/e, var/datum/e_src) - GLOB.total_runtimes++ //CHOMPEdit just moving this here to start counting right away - if(!istype(e)) // Something threw an unusual exception - log_error("\[[time_stamp()]] Uncaught exception: [e]") +/world/Error(exception/E, datum/e_src) + GLOB.total_runtimes++ + + if(!istype(E)) //Something threw an unusual exception + log_world("uncaught runtime error: [E]") return ..() - //CHOMP Edit Stealing this bit from TGStation to try to record OOM issues. //this is snowflake because of a byond bug (ID:2306577), do not attempt to call non-builtin procs in this if - if(copytext(e.name,1,32) == "Maximum recursion level reached") + if(copytext(E.name, 1, 32) == "Maximum recursion level reached")//32 == length() of that string + 1 //log to world while intentionally triggering the byond bug. - log_world("runtime error: [e.name]\n[e.desc]") + log_world("runtime error: [E.name]\n[E.desc]") //if we got to here without silently ending, the byond bug has been fixed. log_world("The bug with recursion runtimes has been fixed. Please remove the snowflake check from world/Error in [__FILE__]:[__LINE__]") return //this will never happen. - else if(copytext(e.name,1,18) == "Out of resources!") - log_world("BYOND out of memory.") - log_game("BYOND out of memory.") - return ..() - //CHOMP Edit end + else if(copytext(E.name, 1, 18) == "Out of resources!")//18 == length() of that string + 1 + log_world("BYOND out of memory. Restarting ([E?.file]:[E?.line])") + TgsEndProcess() + . = ..() + Reboot(reason = 1) + return - if(!GLOB.error_last_seen) // A runtime is occurring too early in start-up initialization + var/static/regex/stack_workaround + if(isnull(stack_workaround)) + stack_workaround = regex("[WORKAROUND_IDENTIFIER](.+?)[WORKAROUND_IDENTIFIER]") + var/static/list/error_last_seen = list() + var/static/list/error_cooldown = list() /* Error_cooldown items will either be positive(cooldown time) or negative(silenced error) + If negative, starts at -1, and goes down by 1 each time that error gets skipped*/ + + if(!error_last_seen) // A runtime is occurring too early in start-up initialization return ..() + if(stack_workaround.Find(E.name)) + var/list/data = json_decode(stack_workaround.group[1]) + E.file = data[1] + E.line = data[2] + E.name = stack_workaround.Replace(E.name, "") - var/erroruid = "[e.file][e.line]" - var/last_seen = GLOB.error_last_seen[erroruid] - var/cooldown = GLOB.error_cooldown[erroruid] || 0 - if(last_seen == null) // A new error! - GLOB.error_last_seen[erroruid] = world.time + var/erroruid = "[E.file][E.line]" + var/last_seen = error_last_seen[erroruid] + var/cooldown = error_cooldown[erroruid] || 0 + + if(last_seen == null) + error_last_seen[erroruid] = world.time last_seen = world.time - if(cooldown < 0) - GLOB.error_cooldown[erroruid]-- // Used to keep track of skip count for this error - GLOB.total_runtimes_skipped++ - return // Error is currently silenced, skip handling it - // Handle cooldowns and silencing spammy errors - var/silencing = 0 - // Each occurrence of a unique error adds to its "cooldown" time... - cooldown = max(0, cooldown - (world.time - last_seen)) + ERROR_COOLDOWN + if(cooldown < 0) + error_cooldown[erroruid]-- //Used to keep track of skip count for this error + GLOB.total_runtimes_skipped++ + return //Error is currently silenced, skip handling it + //Handle cooldowns and silencing spammy errors + var/silencing = FALSE + + // We can runtime before config is initialized because BYOND initialize objs/map before a bunch of other stuff happens. + // This is a bunch of workaround code for that. Hooray! + var/configured_error_cooldown + var/configured_error_limit + var/configured_error_silence_time + if(config?.entries) + configured_error_cooldown = CONFIG_GET(number/error_cooldown) + configured_error_limit = CONFIG_GET(number/error_limit) + configured_error_silence_time = CONFIG_GET(number/error_silence_time) + else + var/datum/config_entry/CE = /datum/config_entry/number/error_cooldown + configured_error_cooldown = initial(CE.default) + CE = /datum/config_entry/number/error_limit + configured_error_limit = initial(CE.default) + CE = /datum/config_entry/number/error_silence_time + configured_error_silence_time = initial(CE.default) + + + //Each occurence of a unique error adds to its cooldown time... + cooldown = max(0, cooldown - (world.time - last_seen)) + configured_error_cooldown // ... which is used to silence an error if it occurs too often, too fast - if(cooldown > ERROR_MAX_COOLDOWN) + if(cooldown > configured_error_cooldown * configured_error_limit) cooldown = -1 - silencing = 1 + silencing = TRUE spawn(0) usr = null - sleep(ERROR_SILENCE_TIME) - var/skipcount = abs(GLOB.error_cooldown[erroruid]) - 1 - GLOB.error_cooldown[erroruid] = 0 + sleep(configured_error_silence_time) + var/skipcount = abs(error_cooldown[erroruid]) - 1 + error_cooldown[erroruid] = 0 if(skipcount > 0) - log_error("\[[time_stamp()]] Skipped [skipcount] runtimes in [e.file],[e.line].") - error_cache.logError(e, skipCount = skipcount) - GLOB.error_last_seen[erroruid] = world.time - GLOB.error_cooldown[erroruid] = cooldown + SEND_TEXT(world.log, "\[[time_stamp()]] Skipped [skipcount] runtimes in [E.file],[E.line].") + GLOB.error_cache.log_error(E, skip_count = skipcount) + + error_last_seen[erroruid] = world.time + error_cooldown[erroruid] = cooldown - // The detailed error info needs some tweaking to make it look nice - var/list/srcinfo = null var/list/usrinfo = null var/locinfo - // First, try to make better src/usr info lines - if(istype(e_src)) - srcinfo = list(" src: [log_info_line(e_src)]") - var/atom/atom_e_src = e_src - if(istype(atom_e_src)) - srcinfo += " src.loc: [log_info_line(atom_e_src.loc)]" if(istype(usr)) - usrinfo = list(" usr: [log_info_line(usr)]") - locinfo = log_info_line(usr.loc) + usrinfo = list(" usr: [key_name(usr)]") + locinfo = loc_name(usr) if(locinfo) usrinfo += " usr.loc: [locinfo]" // The proceeding mess will almost definitely break if error messages are ever changed - // I apologize in advance - var/list/splitlines = splittext(e.desc, "\n") + var/list/splitlines = splittext(E.desc, "\n") var/list/desclines = list() - if(splitlines.len > 2) // If there aren't at least three lines, there's no info +#ifndef DISABLE_DREAMLUAU + var/list/state_stack = GLOB.lua_state_stack + var/is_lua_call = length(state_stack) + var/list/lua_stacks = list() + if(is_lua_call) + for(var/level in 1 to state_stack.len) + lua_stacks += list(splittext(DREAMLUAU_GET_TRACEBACK(level), "\n")) +#endif + if(LAZYLEN(splitlines) > ERROR_USEFUL_LEN) // If there aren't at least three lines, there's no info for(var/line in splitlines) - if(length(line) < 3) - continue // Blank line, skip it - if(findtext(line, "source file:")) - continue // Redundant, skip it - if(findtext(line, "usr.loc:")) - continue // Our usr.loc is better, skip it + if(LAZYLEN(line) < 3 || findtext(line, "source file:") || findtext(line, "usr.loc:")) + continue if(findtext(line, "usr:")) if(usrinfo) desclines.Add(usrinfo) usrinfo = null continue // Our usr info is better, replace it - if(srcinfo) - if(findtext(line, "src.loc:")) - continue - if(findtext(line, "src:")) - desclines.Add(srcinfo) - srcinfo = null - continue - if(copytext(line, 1, 3) != " ") + if(copytext(line, 1, 3) != " ")//3 == length(" ") + 1 desclines += (" " + line) // Pad any unpadded lines, so they look pretty else desclines += line - if(srcinfo) // If these aren't null, they haven't been added yet - desclines.Add(srcinfo) - if(usrinfo) + if(usrinfo) //If this info isn't null, it hasn't been added yet desclines.Add(usrinfo) +#ifndef DISABLE_DREAMLUAU + if(is_lua_call) + SSlua.log_involved_runtime(E, desclines, lua_stacks) +#endif if(silencing) - desclines += " (This error will now be silenced for [ERROR_SILENCE_TIME / 600] minutes)" + desclines += " (This error will now be silenced for [DisplayTimeText(configured_error_silence_time)])" + if(GLOB.error_cache) + GLOB.error_cache.log_error(E, desclines) - // Now to actually output the error info... - log_error("\[[time_stamp()]] Runtime in [e.file],[e.line]: [e]") + var/main_line = "\[[time_stamp()]] Runtime in [E.file],[E.line]: [E]" + SEND_TEXT(world.log, main_line) for(var/line in desclines) - log_error(line) - if(error_cache) - error_cache.logError(e, desclines, e_src = e_src) + SEND_TEXT(world.log, line) +#ifdef UNIT_TESTS + if(GLOB.current_test) + //good day, sir + GLOB.current_test.Fail("[main_line]\n[desclines.Join("\n")]", file = E.file, line = E.line) #endif -/proc/log_runtime(exception/e, datum/e_src, extra_info) - if(!istype(e)) - world.Error(e, e_src) - return + //if(Debugger?.enabled) + // to_chat(world, span_alertwarning("[main_line]"), type = MESSAGE_TYPE_DEBUG) - if(extra_info) - // Adding extra info adds two newlines, because parsing runtimes is funky - if(islist(extra_info)) - e.desc = " [jointext(extra_info, "\n ")]\n\n" + e.desc - else - e.desc = " [extra_info]\n\n" + e.desc + // This writes the regular format (unwrapping newlines and inserting timestamps as needed). + log_runtime("runtime error: [E.name]\n[E.desc]") +#endif - world.Error(e, e_src) +#undef ERROR_USEFUL_LEN diff --git a/code/modules/error_handler/error_viewer.dm b/code/modules/error_handler/error_viewer.dm index 0bcfa37bf6..45771405e3 100644 --- a/code/modules/error_handler/error_viewer.dm +++ b/code/modules/error_handler/error_viewer.dm @@ -3,205 +3,193 @@ // There are 3 different types used here: // -// - ErrorCache keeps track of all error sources, as well as all individually +// - error_cache keeps track of all error sources, as well as all individually // logged errors. Only one instance of this datum should ever exist, and it's // right here: -#ifdef DEBUG -var/global/datum/ErrorViewer/ErrorCache/error_cache = new() +#ifdef USE_CUSTOM_ERROR_HANDLER +GLOBAL_DATUM_INIT(error_cache, /datum/error_viewer/error_cache, new) #else // If debugging is disabled, there's nothing useful to log, so don't bother. -var/global/datum/ErrorViewer/ErrorCache/error_cache = null +GLOBAL_DATUM(error_cache, /datum/error_viewer/error_cache) #endif -// - ErrorSource datums exist for each line (of code) that generates an error, +// - error_source datums exist for each line (of code) that generates an error, // and keep track of all errors generated by that line. // -// - ErrorEntry datums exist for each logged error, and keep track of all +// - error_entry datums exist for each logged error, and keep track of all // relevant info about that error. -// Common vars and procs are kept at the ErrorViewer level -/datum/ErrorViewer/ +// Common vars and procs are kept at the error_viewer level +/datum/error_viewer var/name = "" -/datum/ErrorViewer/proc/browseTo(var/user, var/html) - if(user) - var/datum/browser/popup = new(user, "error_viewer", "Runtime Viewer", 900, 500) - popup.add_head_content({""}) - popup.set_content(html) - popup.open(0) +/datum/error_viewer/proc/browse_to(client/user, html) + var/datum/browser/browser = new(user.mob, "error_viewer", null, 600, 400) + browser.set_content(html) + browser.set_head_content({" + + "}) + browser.open() -/datum/ErrorViewer/proc/buildHeader(var/datum/ErrorViewer/back_to, var/linear, var/refreshable) - // Common starter HTML for showTo - var/html = "" +/datum/error_viewer/proc/build_header(datum/error_viewer/back_to, linear) + // Common starter HTML for show_to - if(istype(back_to)) - html += "[back_to.makeLink("<<<", null, linear)] " - if(refreshable) - html += "[makeLink("Refresh", null, linear)]" - if(html) - html += "

" - return html + . = "" -/datum/ErrorViewer/proc/showTo(var/user, var/datum/ErrorViewer/back_to, var/linear) + if (istype(back_to)) + . += back_to.make_link("<<<", null, linear) + + . += "[make_link("Refresh")]

" + +/datum/error_viewer/proc/show_to(user, datum/error_viewer/back_to, linear) // Specific to each child type return -/datum/ErrorViewer/proc/makeLink(var/linktext, var/datum/ErrorViewer/back_to, var/linear) +/datum/error_viewer/proc/make_link(linktext, datum/error_viewer/back_to, linear) var/back_to_param = "" - if(!linktext) + if (!linktext) linktext = name - if(istype(back_to)) - back_to_param = ";viewruntime_backto=\ref[back_to]" - if(linear) + + if (istype(back_to)) + back_to_param = ";viewruntime_backto=[REF(back_to)]" + + if (linear) back_to_param += ";viewruntime_linear=1" - return "[html_encode(linktext)]" -/datum/ErrorViewer/Topic(href, href_list) - if(..()) - return 1 - if(href_list["viewruntime_backto"]) - showTo(usr, locate(href_list["viewruntime_backto"]), href_list["viewruntime_linear"]) - else - showTo(usr, null, href_list["viewruntime_linear"]) + return "[linktext]" -/datum/ErrorViewer/ErrorCache +/datum/error_viewer/error_cache var/list/errors = list() var/list/error_sources = list() var/list/errors_silenced = list() -/datum/ErrorViewer/ErrorCache/showTo(var/user, var/datum/ErrorViewer/back_to, var/linear) - var/html = buildHeader(null, linear, refreshable=1) - html += "[GLOB.total_runtimes] runtimes, [GLOB.total_runtimes_skipped] skipped

" - if(!linear) - html += "organized | [makeLink("linear", null, 1)]
" - var/datum/ErrorViewer/ErrorSource/error_source - for(var/erroruid in error_sources) +/datum/error_viewer/error_cache/show_to(user, datum/error_viewer/back_to, linear) + var/html = build_header() + html += "[GLOB.total_runtimes] runtimes, [GLOB.total_runtimes_skipped] skipped

" + if (!linear) + html += "organized | [make_link("linear", null, 1)]
" + var/datum/error_viewer/error_source/error_source + for (var/erroruid in error_sources) error_source = error_sources[erroruid] - html += "

[error_source.makeLink(null, src)]

" - else - html += "[makeLink("organized", null)] | linear
" - for(var/datum/ErrorViewer/ErrorEntry/error_entry in errors) - html += "

[error_entry.makeLink(null, src, 1)]

" - browseTo(user, html) + html += "[error_source.make_link(null, src)]
" -/datum/ErrorViewer/ErrorCache/proc/logError(var/exception/e, var/list/desclines, var/skipCount, var/datum/e_src) - if(!istype(e)) + else + html += "[make_link("organized", null)] | linear
" + for (var/datum/error_viewer/error_entry/error_entry in errors) + html += "[error_entry.make_link(null, src, 1)]
" + + browse_to(user, html) + +/datum/error_viewer/error_cache/proc/log_error(exception/e, list/desclines, skip_count) + if (!istype(e)) return // Abnormal exception, don't even bother var/erroruid = "[e.file][e.line]" - var/datum/ErrorViewer/ErrorSource/error_source = error_sources[erroruid] - if(!error_source) + var/datum/error_viewer/error_source/error_source = error_sources[erroruid] + if (!error_source) error_source = new(e) error_sources[erroruid] = error_source - var/datum/ErrorViewer/ErrorEntry/error_entry = new(e, desclines, skipCount, e_src) + var/datum/error_viewer/error_entry/error_entry = new(e, desclines, skip_count) error_entry.error_source = error_source errors += error_entry error_source.errors += error_entry - if(skipCount) - return // Skip notifying admins about skipped errors + if (skip_count) + return // Skip notifying admins about skipped errors. // Show the error to admins with debug messages turned on, but only if one // from the same source hasn't been shown too recently - // (Also, make sure config is initialized, or log_debug will runtime) - if(config && error_source.next_message_at <= world.time) + if (error_source.next_message_at <= world.time) var/const/viewtext = "\[view]" // Nesting these in other brackets went poorly - log_debug("Runtime in [e.file],[e.line]: [html_encode(e.name)] [error_entry.makeLink(viewtext)]") - error_source.next_message_at = world.time + ERROR_MSG_DELAY + //to_chat(world, "Runtime in [e.file], line [e.line]: [html_encode(e.name)] [error_entry.make_link(viewtext)]") + var/err_msg_delay + if(config?.loaded) + err_msg_delay = CONFIG_GET(number/error_msg_delay) + else + var/datum/config_entry/CE = /datum/config_entry/number/error_msg_delay + err_msg_delay = initial(CE.default) + error_source.next_message_at = world.time + err_msg_delay -/datum/ErrorViewer/ErrorSource +/datum/error_viewer/error_source var/list/errors = list() var/next_message_at = 0 -/datum/ErrorViewer/ErrorSource/New(var/exception/e) - if(!istype(e)) +/datum/error_viewer/error_source/New(exception/e) + if (!istype(e)) name = "\[[time_stamp()]] Uncaught exceptions" return - name = "\[[time_stamp()]] Runtime in [e.file],[e.line]: [e]" -/datum/ErrorViewer/ErrorSource/showTo(var/user, var/datum/ErrorViewer/back_to, var/linear) - if(!istype(back_to)) - back_to = error_cache - var/html = buildHeader(back_to, refreshable=1) - for(var/datum/ErrorViewer/ErrorEntry/error_entry in errors) - html += "

[error_entry.makeLink(null, src)]

" - browseTo(user, html) + name = "\[[time_stamp()]] Runtime in [e.file], line [e.line]: [html_encode(e.name)]" -/datum/ErrorViewer/ErrorEntry - var/datum/ErrorViewer/ErrorSource/error_source +/datum/error_viewer/error_source/show_to(user, datum/error_viewer/back_to, linear) + if (!istype(back_to)) + back_to = GLOB.error_cache + + var/html = build_header(back_to) + for (var/datum/error_viewer/error_entry/error_entry in errors) + html += "[error_entry.make_link(null, src)]
" + + browse_to(user, html) + +/datum/error_viewer/error_entry + var/datum/error_viewer/error_source/error_source var/exception/exc var/desc = "" - var/srcRef - var/srcType - var/turf/srcLoc - var/usrRef - var/turf/usrLoc - var/isSkipCount + var/usr_ref + var/turf/usr_loc + var/is_skip_count -/datum/ErrorViewer/ErrorEntry/New(var/exception/e, var/list/desclines, var/skipCount, var/datum/e_src) - if(!istype(e)) - name = "\[[time_stamp()]] Uncaught exception: [e]" +/datum/error_viewer/error_entry/New(exception/e, list/desclines, skip_count) + if (!istype(e)) + name = "\[[time_stamp()]] Uncaught exception: [html_encode(e.name)]" return - if(skipCount) - name = "\[[time_stamp()]] Skipped [skipCount] runtimes in [e.file],[e.line]." - isSkipCount = TRUE + + if(skip_count) + name = "\[[time_stamp()]] Skipped [skip_count] runtimes in [e.file],[e.line]." + is_skip_count = TRUE return - name = "\[[time_stamp()]] Runtime in [e.file],[e.line]: [e]" + + name = "\[[time_stamp()]] Runtime in [e.file], line [e.line]: [html_encode(e.name)]" exc = e - if(istype(desclines)) - for(var/line in desclines) + if (istype(desclines)) + for (var/line in desclines) // There's probably a better way to do this than non-breaking spaces... - desc += "  " + html_encode(line) + "
" - if(istype(e_src)) - srcRef = "\ref[e_src]" - srcType = e_src.type - srcLoc = get_turf(e_src) - if(usr) - usrRef = "\ref[usr]" - usrLoc = get_turf(usr) + desc += "[html_encode(line)]
" -/datum/ErrorViewer/ErrorEntry/showTo(var/user, var/datum/ErrorViewer/back_to, var/linear) - if(!istype(back_to)) + if (usr) + usr_ref = "[REF(usr)]" + usr_loc = get_turf(usr) + +/datum/error_viewer/error_entry/show_to(user, datum/error_viewer/back_to, linear) + if (!istype(back_to)) back_to = error_source - var/html = buildHeader(back_to, linear) - html += "
[html_encode(name)]
[desc]
" - if(srcRef) - html += "
src: VV" - if(ispath(srcType, /mob)) - html += " PP" - html += " Follow" - if(istype(srcLoc)) - html += "
src.loc: VV" - html += " JMP" - if(usrRef) - html += "
usr: VV" - html += " PP" - html += " Follow" - if(istype(usrLoc)) - html += "
usr.loc: VV" - html += " JMP" - browseTo(user, html) -/datum/ErrorViewer/ErrorEntry/makeLink(var/linktext, var/datum/ErrorViewer/back_to, var/linear) - if(isSkipCount) - return html_encode(name) - else - return ..() + var/html = build_header(back_to, linear) + html += "[name]
[desc]
" + if (usr_ref) + html += "
usr: VV" + html += " PP" + html += " Follow" + if (istype(usr_loc)) + html += "
usr.loc: VV" + html += " JMP" + + browse_to(user, html) + +/datum/error_viewer/error_entry/make_link(linktext, datum/error_viewer/back_to, linear) + return is_skip_count ? name : ..() diff --git a/code/modules/error_handler/~defines.dm b/code/modules/error_handler/~defines.dm deleted file mode 100644 index 98712eaa09..0000000000 --- a/code/modules/error_handler/~defines.dm +++ /dev/null @@ -1,6 +0,0 @@ -// Settings for the error handler and error viewer -#undef ERROR_COOLDOWN -#undef ERROR_LIMIT -#undef ERROR_MAX_COOLDOWN -#undef ERROR_SILENCE_TIME -#undef ERROR_MSG_DELAY diff --git a/code/modules/events/atmos_leak.dm b/code/modules/events/atmos_leak.dm index 21246f4d0e..b264b0f782 100644 --- a/code/modules/events/atmos_leak.dm +++ b/code/modules/events/atmos_leak.dm @@ -72,7 +72,7 @@ for(var/i in 1 to 10) var/area/A = pick(grand_list_of_areas) if(is_area_occupied(A)) - log_debug("atmos_leak event: Rejected [A] because it is occupied.") + log_game("atmos_leak event: Rejected [A] because it is occupied.") continue // A good area, great! Lets try and pick a turf var/list/turfs = list() @@ -80,14 +80,14 @@ if(turf_clear(F)) turfs += F if(turfs.len == 0) - log_debug("atmos_leak event: Rejected [A] because it has no clear turfs.") + log_game("atmos_leak event: Rejected [A] because it has no clear turfs.") continue target_area = A target_turf = pick(turfs) // If we can't find a good target, give up if(!target_area) - log_debug("atmos_leak event: Giving up after too many failures to pick target area") + log_game("atmos_leak event: Giving up after too many failures to pick target area") kill() return diff --git a/code/modules/events/canister_leak.dm b/code/modules/events/canister_leak.dm index 63f897cdb5..22c54a7153 100644 --- a/code/modules/events/canister_leak.dm +++ b/code/modules/events/canister_leak.dm @@ -13,18 +13,18 @@ for(var/i in 1 to 10) var/obj/machinery/portable_atmospherics/canister/C = pick(all_canisters) if(severity <= EVENT_LEVEL_MUNDANE && area_is_occupied(get_area(C))) - log_debug("canister_leak event: Rejecting canister [C] ([C.x],[C.y],[C.z]) because area is occupied") + log_game("canister_leak event: Rejecting canister [C] ([C.x],[C.y],[C.z]) because area is occupied") continue // Okay lets break it break_canister(C) return // If we got to here we failed to find it - log_debug("canister_leak event: Giving up after too many failures to pick target canister") + log_game("canister_leak event: Giving up after too many failures to pick target canister") kill() return /datum/event/canister_leak/proc/break_canister(var/obj/machinery/portable_atmospherics/canister/C) - log_debug("canister_leak event: Canister [C] ([C.x],[C.y],[C.z]) destroyed.") + log_game("canister_leak event: Canister [C] ([C.x],[C.y],[C.z]) destroyed.") C.health = 0 C.healthcheck() diff --git a/code/modules/events/carp_migration.dm b/code/modules/events/carp_migration.dm index 549462cd48..4d797697d6 100644 --- a/code/modules/events/carp_migration.dm +++ b/code/modules/events/carp_migration.dm @@ -7,7 +7,7 @@ /datum/event/carp_migration/setup() if(prob(50)) - log_debug("Carp migration failed successfully.") + log_game("carp migration: event setup prob() failed, killing") kill() return announceWhen = rand(30, 60) // 1 to 2 minutes diff --git a/code/modules/events/electrical_storm.dm b/code/modules/events/electrical_storm.dm index e124d51bb2..35635b920e 100644 --- a/code/modules/events/electrical_storm.dm +++ b/code/modules/events/electrical_storm.dm @@ -46,7 +46,7 @@ if(shield_gen.deal_shield_damage(30 * severity, SHIELD_DAMTYPE_EM) <= SHIELD_BREACHED_MINOR) return if(!valid_apcs.len) - // log_debug("No valid APCs found for electrical storm event ship=[victim]!") // Let's not spam poor people with debug logs on (me) + // log_game("No valid APCs found for electrical storm event ship=[victim]!") // Let's not spam poor people with debug logs on (me) return var/list/picked_apcs = list() for(var/i=0, i< severity * 2, i++) // up to 2/4/6 APCs per tick depending on severity diff --git a/code/modules/events/event_container.dm b/code/modules/events/event_container.dm index 7397d6467c..2eb3994ddf 100644 --- a/code/modules/events/event_container.dm +++ b/code/modules/events/event_container.dm @@ -36,7 +36,7 @@ new next_event.event_type(next_event) // Events are added and removed from the processing queue in their New/kill procs - log_debug("Starting event '[next_event.name]' of severity [GLOB.severity_to_string[severity]].") + log_game("Starting event '[next_event.name]' of severity [GLOB.severity_to_string[severity]].") next_event = null // When set to null, a random event will be selected next time else // If not, wait for one minute, instead of one tick, before checking again. @@ -114,7 +114,7 @@ var/event_delay = rand(CONFIG_GET(number_list/event_delay_lower)[severity] MINUTES, CONFIG_GET(number_list/event_delay_upper)[severity] MINUTES) * playercount_modifier next_event_time = world.time + event_delay - log_debug("Next event of severity [GLOB.severity_to_string[severity]] in [(next_event_time - world.time)/600] minutes.") + log_game("Next event of severity [GLOB.severity_to_string[severity]] in [(next_event_time - world.time)/600] minutes.") /datum/event_container/proc/SelectEvent() var/datum/event_meta/EM = tgui_input_list(usr, "Select an event to queue up.", "Event Selection", available_events) diff --git a/code/modules/events/event_dynamic.dm b/code/modules/events/event_dynamic.dm index 6d3b588b05..9d88ec3b55 100644 --- a/code/modules/events/event_dynamic.dm +++ b/code/modules/events/event_dynamic.dm @@ -102,7 +102,7 @@ GLOBAL_LIST_EMPTY(event_last_fired) for(var/V in possibleEvents) debug_message += "[V]:[possibleEvents[V]]" debug_message += "|||Picked:[picked_event]" - log_debug(debug_message) + // to_chat(world, debug_message) if(!picked_event) return diff --git a/code/modules/events/prison_break.dm b/code/modules/events/prison_break.dm index feeb1ab915..6b9acf43e5 100644 --- a/code/modules/events/prison_break.dm +++ b/code/modules/events/prison_break.dm @@ -54,7 +54,7 @@ to_chat(A, span_danger("Malicious program detected in the [english_list(areaName)] lighting and airlock control systems by [my_department].")) else - to_world_log("ERROR: Could not initate grey-tide. Unable to find suitable containment area.") + log_world("ERROR: Could not initate grey-tide. Unable to find suitable containment area.") kill() diff --git a/code/modules/events/spacefish_migration.dm b/code/modules/events/spacefish_migration.dm index dfd7b51419..5cf3290931 100644 --- a/code/modules/events/spacefish_migration.dm +++ b/code/modules/events/spacefish_migration.dm @@ -20,7 +20,7 @@ /datum/event/spacefish_migration/setup() //CHOMP Add start if(prob(15) || fired == TRUE) - log_debug("Random spacefish migration failed successfully.") + log_game("random spacefish migration: event setup prob() failed, killing") kill() return fired = TRUE diff --git a/code/modules/events/supply_demand_vr.dm b/code/modules/events/supply_demand_vr.dm index 204f04318b..d4205a4527 100644 --- a/code/modules/events/supply_demand_vr.dm +++ b/code/modules/events/supply_demand_vr.dm @@ -166,7 +166,7 @@ src.type_path = type_path src.name = initial(type_path.name) if(!name) - log_debug("supply_demand event: Order for thing [type_path] has no name.") + log_game("supply_demand event: Order for thing [type_path] has no name.") /datum/supply_demand_order/thing/match_item(var/atom/I) if(istype(I, type_path)) @@ -207,7 +207,7 @@ qty_need = CEILING((qty_need - amount_to_take), 1) return 1 else - log_debug("supply_demand event: not taking reagent '[reagent_id]': [amount_to_take]") + log_game("supply_demand event: not taking reagent '[reagent_id]': [amount_to_take]") return // @@ -233,14 +233,14 @@ if(!canmix || canmix.total_moles <= 0) return if(canmix.return_pressure() < mixture.return_pressure()) - log_debug("supply_demand event: canister fails to match [canmix.return_pressure()] kPa < [mixture.return_pressure()] kPa") + log_game("supply_demand event: canister fails to match [canmix.return_pressure()] kPa < [mixture.return_pressure()] kPa") return // Make sure ratios are equal for(var/gas in mixture.gas) var/targetPercent = round((mixture.gas[gas] / mixture.total_moles) * 100) var/canPercent = round((canmix.gas[gas] / canmix.total_moles) * 100) if(abs(targetPercent-canPercent) > 1) - log_debug("supply_demand event: canister fails to match because '[gas]': [canPercent] != [targetPercent]") + log_game("supply_demand event: canister fails to match because '[gas]': [canPercent] != [targetPercent]") return // Fail! // Huh, it actually matches! qty_need -= 1 diff --git a/code/modules/food/kitchen/gibber.dm b/code/modules/food/kitchen/gibber.dm index e6e8bed632..6cf36285c7 100644 --- a/code/modules/food/kitchen/gibber.dm +++ b/code/modules/food/kitchen/gibber.dm @@ -35,7 +35,7 @@ break if(!input_plate) - log_misc("a [src] didn't find an input plate.") + log_world("## MISC a [src] didn't find an input plate.") /obj/machinery/gibber/Destroy() occupant = null diff --git a/code/modules/gamemaster/event2/events/command/manifest_malfunction.dm b/code/modules/gamemaster/event2/events/command/manifest_malfunction.dm index d8fbce19b2..9e9a54f191 100644 --- a/code/modules/gamemaster/event2/events/command/manifest_malfunction.dm +++ b/code/modules/gamemaster/event2/events/command/manifest_malfunction.dm @@ -57,5 +57,5 @@ R = safepick(GLOB.data_core.medical) if(R) - log_debug("Manifest malfunction event is now deleting [R.fields["name"]]'s [record_class_to_delete] record.") + log_game("Manifest malfunction event is now deleting [R.fields["name"]]'s [record_class_to_delete] record.") qdel(R) diff --git a/code/modules/gamemaster/event2/events/command/money_hacker.dm b/code/modules/gamemaster/event2/events/command/money_hacker.dm index a83f34d056..6c8e497317 100644 --- a/code/modules/gamemaster/event2/events/command/money_hacker.dm +++ b/code/modules/gamemaster/event2/events/command/money_hacker.dm @@ -24,7 +24,7 @@ targeted_account = pick(GLOB.all_money_accounts) if(!targeted_account) - log_debug("Money hacker event could not find an account to hack. Aborting.") + log_game("Money hacker event could not find an account to hack. Aborting.") abort() return @@ -47,11 +47,11 @@ if(targeted_account && !targeted_account.suspended) // Hacker wins. message = "The hack attempt has succeeded." hack_account(targeted_account) - log_debug("Money hacker event managed to hack the targeted account.") + log_game("Money hacker event managed to hack the targeted account.") else // Crew wins. message = "The attack has ceased, the affected accounts can now be brought online." - log_debug("Money hacker event failed to hack the targeted account due to intervention by the crew.") + log_game("Money hacker event failed to hack the targeted account due to intervention by the crew.") var/my_department = "[location_name()] Firewall Subroutines" diff --git a/code/modules/gamemaster/event2/events/command/raise_funds.dm b/code/modules/gamemaster/event2/events/command/raise_funds.dm index e45b226f6b..3e5d537144 100644 --- a/code/modules/gamemaster/event2/events/command/raise_funds.dm +++ b/code/modules/gamemaster/event2/events/command/raise_funds.dm @@ -31,11 +31,11 @@ // taking out loads of money before the event, then depositing it back in after the event fires, feel free to make this check for // roundstart money instead. money_at_start = count_money() - log_debug("Funding Drive event logged a sum of [money_at_start] thalers in all station accounts at the start of the event.") + log_game("Funding Drive event logged a sum of [money_at_start] thalers in all station accounts at the start of the event.") /datum/event2/event/raise_funds/end() var/money_at_end = count_money() - log_debug("Funding Drive event logged a sum of [money_at_end] thalers in all station accounts at the end of the event, compared \ + log_game("Funding Drive event logged a sum of [money_at_end] thalers in all station accounts at the end of the event, compared \ to [money_at_start] thalers. A difference of [money_at_end / money_at_start] was calculated.") // A number above 1 indicates money was made, while below 1 does the opposite. @@ -50,20 +50,20 @@ discussion regarding your future employment prospects will occur.

\ Your facility's current balance of requisition tokens has been revoked." SSsupply.points = 0 - log_debug("Funding Drive event ended with an abyssmal response, and the loss of all cargo points.") + log_game("Funding Drive event ended with an abyssmal response, and the loss of all cargo points.") if(0.02 to 0.98) // Bad response. message = "We're very disappointed that \the [location_name()] has ran a deficit since our request. \ As such, we will be taking away some requisition tokens to cover the cost of operating your facility." var/points_lost = round(SSsupply.points * rand(0.5, 0.8)) SSsupply.points -= points_lost - log_debug("Funding Drive event ended with a bad response, and [points_lost] cargo points was taken away.") + log_game("Funding Drive event ended with a bad response, and [points_lost] cargo points was taken away.") if(0.98 to 1.02) // Neutral response. message = "It is unfortunate that \the [location_name()]'s finances remain at a standstill, however \ that is still preferred over having a decicit. We hope that in the future, your facility will be able to be \ more profitable." - log_debug("Funding Drive event ended with a neutral response.") + log_game("Funding Drive event ended with a neutral response.") if(1.02 to INFINITY) // Good response. message = "We appreciate the efforts made by \the [location_name()] to run at a surplus. \ @@ -75,7 +75,7 @@ // Otherwise it would be weird for centcom to go 'thanks for not spending money, your reward is money to spend'. var/point_reward = rand(100, 200) SSsupply.points += point_reward - log_debug("Funding Drive event ended with a good response and a bonus of [point_reward] cargo points.") + log_game("Funding Drive event ended with a good response and a bonus of [point_reward] cargo points.") send_command_report("Budget Followup", message) @@ -92,5 +92,5 @@ /datum/event2/event/raise_funds/proc/send_command_report(title, message) post_comm_message(title, message) - to_world(span_danger("New [using_map.company_name] Update available at all communication consoles.")) + to_chat(world, span_danger("New [using_map.company_name] Update available at all communication consoles.")) SEND_SOUND(world, 'sound/AI/commandreport.ogg') diff --git a/code/modules/gamemaster/event2/events/engineering/airlock_failure.dm b/code/modules/gamemaster/event2/events/engineering/airlock_failure.dm index e03fa10026..b4f837840a 100644 --- a/code/modules/gamemaster/event2/events/engineering/airlock_failure.dm +++ b/code/modules/gamemaster/event2/events/engineering/airlock_failure.dm @@ -60,7 +60,7 @@ /datum/event2/event/airlock_failure/start() var/list/areas = find_random_areas() if(!LAZYLEN(areas)) - log_debug("Airlock Failure event could not find any areas. Aborting.") + log_game("Airlock Failure event could not find any areas. Aborting.") abort() return @@ -73,7 +73,7 @@ addtimer(CALLBACK(src, PROC_REF(break_door), door), 1) // Emagging proc is actually a blocking proc and that's bad for the ticker. door.visible_message(span_danger("\The [door]'s panel sparks!")) playsound(door, "sparks", 50, 1) - log_debug("Airlock Failure event has broken \the [door] airlock in [area].") + log_game("Airlock Failure event has broken \the [door] airlock in [area].") affected_areas |= area doors_to_break-- diff --git a/code/modules/gamemaster/event2/events/engineering/blob.dm b/code/modules/gamemaster/event2/events/engineering/blob.dm index 8be63dc8fc..87f1c03979 100644 --- a/code/modules/gamemaster/event2/events/engineering/blob.dm +++ b/code/modules/gamemaster/event2/events/engineering/blob.dm @@ -99,7 +99,7 @@ open_turfs = find_random_turfs(5 + number_of_blobs) if(!open_turfs.len) - log_debug("Blob infestation event: Giving up after failure to find blob spots.") + log_game("Blob infestation event: Giving up after failure to find blob spots.") abort() /datum/event2/event/blob/start() @@ -108,7 +108,7 @@ var/obj/structure/blob/core/new_blob = new spawn_blob_type(T) blobs += WEAKREF(new_blob) open_turfs -= T // So we can't put two cores on the same tile if doing multiblob. - log_debug("Spawned [new_blob.overmind.blob_type.name] blob at [get_area(new_blob)].") + log_game("Spawned [new_blob.overmind.blob_type.name] blob at [get_area(new_blob)].") /datum/event2/event/blob/should_end() for(var/datum/weakref/weakref as anything in blobs) diff --git a/code/modules/gamemaster/event2/events/engineering/brand_intelligence.dm b/code/modules/gamemaster/event2/events/engineering/brand_intelligence.dm index cfdc32fca5..3acee05543 100644 --- a/code/modules/gamemaster/event2/events/engineering/brand_intelligence.dm +++ b/code/modules/gamemaster/event2/events/engineering/brand_intelligence.dm @@ -25,7 +25,7 @@ vending_machines += V if(!vending_machines.len) - log_debug("Could not find any vending machines on station Z levels. Aborting.") + log_game("Brand intelligence event: Could not find any vending machines on station Z levels. Aborting.") abort() return diff --git a/code/modules/gamemaster/event2/events/engineering/canister_leak.dm b/code/modules/gamemaster/event2/events/engineering/canister_leak.dm index d25f4d9827..cc22f8ea8f 100644 --- a/code/modules/gamemaster/event2/events/engineering/canister_leak.dm +++ b/code/modules/gamemaster/event2/events/engineering/canister_leak.dm @@ -20,6 +20,6 @@ if(!C.destroyed && (C.z in using_map.station_levels) && C.air_contents.total_moles >= MOLES_CELLSTANDARD) all_canisters += C var/obj/machinery/portable_atmospherics/canister/C = pick(all_canisters) - log_debug("canister_leak event: Canister [C] ([C.x],[C.y],[C.z]) destroyed.") + log_game("canister_leak event: Canister [C] ([C.x],[C.y],[C.z]) destroyed.") C.health = 0 C.healthcheck() diff --git a/code/modules/gamemaster/event2/events/engineering/gas_leak.dm b/code/modules/gamemaster/event2/events/engineering/gas_leak.dm index 0429111518..7e70a9e5a7 100644 --- a/code/modules/gamemaster/event2/events/engineering/gas_leak.dm +++ b/code/modules/gamemaster/event2/events/engineering/gas_leak.dm @@ -24,7 +24,7 @@ var/list/turfs = find_random_turfs() if(!turfs.len) - log_debug("Gas Leak event failed to find any available turfs to leak into. Aborting.") + log_game("Gas Leak event failed to find any available turfs to leak into. Aborting.") abort() return chosen_turf = pick(turfs) diff --git a/code/modules/gamemaster/event2/events/engineering/wallrot.dm b/code/modules/gamemaster/event2/events/engineering/wallrot.dm index 79c7eb0afc..4462cff158 100644 --- a/code/modules/gamemaster/event2/events/engineering/wallrot.dm +++ b/code/modules/gamemaster/event2/events/engineering/wallrot.dm @@ -18,10 +18,10 @@ var/turf/candidate = locate(rand(1, world.maxx), rand(1, world.maxy), pick(get_location_z_levels()) ) if(istype(candidate, /turf/simulated/wall)) origin = candidate - log_debug("Wall-rot event has chosen \the [origin] ([origin.loc]) as the origin for the wallrot infestation.") + log_game("Wall-rot event has chosen \the [origin] ([origin.loc]) as the origin for the wallrot infestation.") return - log_debug("Wall-rot event failed to find a valid wall after one hundred tries. Aborting.") + log_game("Wall-rot event failed to find a valid wall after one hundred tries. Aborting.") abort() /datum/event2/event/wallrot/announce() diff --git a/code/modules/gamemaster/event2/events/engineering/window_break.dm b/code/modules/gamemaster/event2/events/engineering/window_break.dm index e101b96233..76e9bc31a4 100644 --- a/code/modules/gamemaster/event2/events/engineering/window_break.dm +++ b/code/modules/gamemaster/event2/events/engineering/window_break.dm @@ -27,7 +27,7 @@ /datum/event2/event/window_break/set_up() var/list/areas = find_random_areas() if(!LAZYLEN(areas)) - log_debug("Window Break event could not find any areas. Aborting.") + log_game("Window Break event could not find any areas. Aborting.") abort() return @@ -43,11 +43,11 @@ break // Break out of the inner loop. if(chosen_turf_with_windows) - log_debug("Window Break event has chosen turf '[chosen_turf_with_windows.name]' in [chosen_turf_with_windows.loc].") + log_game("Window Break event has chosen turf '[chosen_turf_with_windows.name]' in [chosen_turf_with_windows.loc].") break // Then the outer loop. if(!chosen_turf_with_windows) - log_debug("Window Break event could not find a turf with valid windows to break. Aborting.") + log_game("Window Break event could not find a turf with valid windows to break. Aborting.") abort() return @@ -91,7 +91,7 @@ /datum/event2/event/window_break/end() // If someone fixed the window, then everything is fine. if(chosen_window && chosen_window.anchored && chosen_window.health == chosen_window.maxhealth) - log_debug("Window Break event ended with window repaired.") + log_game("Window Break event ended with window repaired.") return // Otherwise a bunch of windows shatter. @@ -102,7 +102,7 @@ var/obj/structure/window/W = collateral_windows[i] W?.shatter() - log_debug("Window Break event ended with [windows_to_shatter] shattered windows and a breach.") + log_game("Window Break event ended with [windows_to_shatter] shattered windows and a breach.") // Checks if a window is adjacent to a space tile, and also that the opposite direction is open. // This is done to avoid getting caught in corner parts of windows. diff --git a/code/modules/gamemaster/event2/events/everyone/comms_blackout.dm b/code/modules/gamemaster/event2/events/everyone/comms_blackout.dm index 8f3899b77d..6932fea2e7 100644 --- a/code/modules/gamemaster/event2/events/everyone/comms_blackout.dm +++ b/code/modules/gamemaster/event2/events/everyone/comms_blackout.dm @@ -29,12 +29,12 @@ /datum/event2/event/comms_blackout/start() if(prob(50)) // One in two chance for the radios to turn i%t# t&_)#%, which can be more alarming than radio silence. - log_debug("Doing partial outage of telecomms.") + log_game("Doing partial outage of telecomms.") for(var/obj/machinery/telecomms/processor/P in telecomms_list) P.emp_act(1) else // Otherwise just shut everything down, madagascar style. - log_debug("Doing complete outage of telecomms.") + log_game("Doing complete outage of telecomms.") for(var/obj/machinery/telecomms/T in telecomms_list) T.emp_act(1) diff --git a/code/modules/gamemaster/event2/events/everyone/electrical_fault.dm b/code/modules/gamemaster/event2/events/everyone/electrical_fault.dm index f60dd6f49f..5aad4f0bda 100644 --- a/code/modules/gamemaster/event2/events/everyone/electrical_fault.dm +++ b/code/modules/gamemaster/event2/events/everyone/electrical_fault.dm @@ -47,7 +47,7 @@ /datum/event2/event/electrical_fault/event_tick() if(!valid_apcs.len) - log_debug("ELECTRICAL EVENT: No valid APCs found for electrical fault event. Aborting.") + log_game("ELECTRICAL EVENT: No valid APCs found for electrical fault event. Aborting.") abort() return @@ -60,7 +60,7 @@ /datum/event2/event/electrical_fault/end() command_announcement.Announce("The irregular electrical conditions inside \the [location_name()] power grid has ceased.", "[location_name()] Power Grid Monitoring") - log_debug("Electrical Fault event caused [apcs_disabled] APC\s to shut off, \ + log_game("Electrical Fault event caused [apcs_disabled] APC\s to shut off, \ [apcs_overloaded] APC\s to overload lighting, and [apcs_emagged] APC\s to be emagged.") /datum/event2/event/electrical_fault/proc/affect_apc(obj/machinery/power/apc/A) @@ -77,7 +77,7 @@ // This will actually protect it from further damage. if(prob(25)) A.energy_fail(rand(60, 120)) -// log_debug("ELECTRICAL EVENT: Disabled \the [A]'s power for a temporary amount of time.") +// log_game("ELECTRICAL EVENT: Disabled \the [A]'s power for a temporary amount of time.") playsound(A, 'sound/machines/defib_success.ogg', 50, 1) apcs_disabled++ return @@ -85,7 +85,7 @@ // Decent chance to overload lighting circuit. if(prob(30)) A.overload_lighting() -// log_debug("ELECTRICAL EVENT: Overloaded \the [A]'s lighting.") +// log_game("ELECTRICAL EVENT: Overloaded \the [A]'s lighting.") playsound(A, 'sound/effects/lightningshock.ogg', 50, 1) apcs_overloaded++ @@ -93,6 +93,6 @@ if(prob(5)) A.emagged = TRUE A.update_icon() -// log_debug("ELECTRICAL EVENT: Emagged \the [A].") +// log_game("ELECTRICAL EVENT: Emagged \the [A].") playsound(A, 'sound/machines/chime.ogg', 50, 1) apcs_emagged++ diff --git a/code/modules/gamemaster/event2/events/everyone/infestation.dm b/code/modules/gamemaster/event2/events/everyone/infestation.dm index de5d9740bb..7d04a8b5ea 100644 --- a/code/modules/gamemaster/event2/events/everyone/infestation.dm +++ b/code/modules/gamemaster/event2/events/everyone/infestation.dm @@ -58,7 +58,7 @@ /datum/event2/event/infestation/set_up() turfs = find_random_turfs(max_vermin) if(!turfs.len) - log_debug("Infestation event failed to find any valid turfs. Aborting.") + log_game("Infestation event failed to find any valid turfs. Aborting.") abort() return diff --git a/code/modules/gamemaster/event2/events/everyone/pda_spam.dm b/code/modules/gamemaster/event2/events/everyone/pda_spam.dm index 65186bffb6..533c57a76e 100644 --- a/code/modules/gamemaster/event2/events/everyone/pda_spam.dm +++ b/code/modules/gamemaster/event2/events/everyone/pda_spam.dm @@ -10,7 +10,7 @@ /datum/event2/event/pda_spam length_lower_bound = 30 MINUTES length_upper_bound = 1 HOUR - var/spam_debug = FALSE // If true, notices of the event sending spam go to `log_debug()`. + var/spam_debug = FALSE // If true, notices of the event sending spam go to `log_game()`. var/last_spam_time = null // world.time of most recent spam. var/next_spam_attempt_time = 0 // world.time of next attempt to try to spam. var/give_up_after = 5 MINUTES @@ -60,7 +60,7 @@ if(!.) // Give up if nobody was reachable for five minutes. if(last_spam_time + give_up_after < world.time) - log_debug("PDA Spam event giving up after not being able to spam for awhile.") + log_game("PDA Spam event giving up after not being able to spam for awhile.") return TRUE /datum/event2/event/pda_spam/proc/can_spam() @@ -134,7 +134,7 @@ var/datum/data/pda/app/messenger/PM = P.find_program(/datum/data/pda/app/messenger) PM.notify(span_bold("Message from [sender] (Unknown / spam?), ") + "\"[message]\" (Unable to Reply)", 0) if(spam_debug) - log_debug("PDA Spam event sent spam to \the [P].") + log_game("PDA Spam event sent spam to \the [P].") /datum/event2/event/pda_spam/proc/pick_message_server() diff --git a/code/modules/gamemaster/event2/events/everyone/sudden_weather_shift.dm b/code/modules/gamemaster/event2/events/everyone/sudden_weather_shift.dm index 34d4ace746..faeead87e3 100644 --- a/code/modules/gamemaster/event2/events/everyone/sudden_weather_shift.dm +++ b/code/modules/gamemaster/event2/events/everyone/sudden_weather_shift.dm @@ -15,7 +15,7 @@ /datum/event2/event/sudden_weather_shift/set_up() if(!LAZYLEN(SSplanets.planets)) - log_debug("Weather shift event was ran when no planets exist. Aborting.") + log_game("Weather shift event was ran when no planets exist. Aborting.") abort() return @@ -41,5 +41,5 @@ // Now choose a new weather. var/new_weather = pickweight(new_weather_weights) - log_debug("Sudden weather shift event is now changing [chosen_planet.name]'s weather to [new_weather].") + log_game("Sudden weather shift event is now changing [chosen_planet.name]'s weather to [new_weather].") chosen_planet.weather_holder.change_weather(new_weather) diff --git a/code/modules/gamemaster/event2/events/ghost_pod_spawner.dm b/code/modules/gamemaster/event2/events/ghost_pod_spawner.dm index c4909387b2..83bd21bb81 100644 --- a/code/modules/gamemaster/event2/events/ghost_pod_spawner.dm +++ b/code/modules/gamemaster/event2/events/ghost_pod_spawner.dm @@ -9,7 +9,7 @@ free_turfs = find_random_turfs(5, desired_turf_areas) if(!free_turfs.len) - log_debug("Ghost Pod Spawning event failed to find a place to spawn. Aborting.") + log_game("Ghost Pod Spawning event failed to find a place to spawn. Aborting.") abort() return diff --git a/code/modules/gamemaster/event2/events/medical/appendicitis.dm b/code/modules/gamemaster/event2/events/medical/appendicitis.dm index 0d900cf5a3..d1c09ebc65 100644 --- a/code/modules/gamemaster/event2/events/medical/appendicitis.dm +++ b/code/modules/gamemaster/event2/events/medical/appendicitis.dm @@ -31,6 +31,6 @@ continue if(H.appendicitis()) - log_debug("Appendicitis event gave appendicitis to \the [H].") + log_game("Appendicitis event gave appendicitis to \the [H].") return - log_debug("Appendicitis event could not find a valid victim.") + log_game("Appendicitis event could not find a valid victim.") diff --git a/code/modules/gamemaster/event2/events/security/prison_break.dm b/code/modules/gamemaster/event2/events/security/prison_break.dm index 06ec57cf97..1b9d20e5f8 100644 --- a/code/modules/gamemaster/event2/events/security/prison_break.dm +++ b/code/modules/gamemaster/event2/events/security/prison_break.dm @@ -183,7 +183,7 @@ areas_to_break += A if(!areas_to_break.len) - log_debug("Prison Break event failed to find any areas to break. Aborting.") + log_game("Prison Break event failed to find any areas to break. Aborting.") abort() return diff --git a/code/modules/gamemaster/event2/events/security/security_advisement.dm b/code/modules/gamemaster/event2/events/security/security_advisement.dm index 14dd7b0251..00af5d8916 100644 --- a/code/modules/gamemaster/event2/events/security/security_advisement.dm +++ b/code/modules/gamemaster/event2/events/security/security_advisement.dm @@ -83,7 +83,7 @@ end_weights -= victim_chosen if(!victim) - log_debug("Security Screening event failed to find anyone to screen. Aborting.") + log_game("Security Screening event failed to find anyone to screen. Aborting.") abort() return diff --git a/code/modules/gamemaster/event2/events/security/spider_infestation.dm b/code/modules/gamemaster/event2/events/security/spider_infestation.dm index bc2bd45f0d..94b26ad874 100644 --- a/code/modules/gamemaster/event2/events/security/spider_infestation.dm +++ b/code/modules/gamemaster/event2/events/security/spider_infestation.dm @@ -44,6 +44,6 @@ while((spiders_to_spawn >= 1) && vents.len) var/obj/vent = pick(vents) new spiderling_to_spawn(vent.loc) - log_debug("Spider infestation event spawned a spiderling at [get_area(vent)].") + log_game("Spider infestation event spawned a spiderling at [get_area(vent)].") vents -= vent spiders_to_spawn-- diff --git a/code/modules/gamemaster/event2/events/security/surprise_carp.dm b/code/modules/gamemaster/event2/events/security/surprise_carp.dm index 9a2d0a7e2e..2fba6529df 100644 --- a/code/modules/gamemaster/event2/events/security/surprise_carp.dm +++ b/code/modules/gamemaster/event2/events/security/surprise_carp.dm @@ -29,12 +29,12 @@ /datum/event2/event/surprise_carp/start() if(!victim) - log_debug("Failed to find a target for surprise carp attack. Aborting.") + log_game("Failed to find a target for surprise carp attack. Aborting.") abort() return var/number_of_carp = rand(1, 2) - log_debug("Sending [number_of_carp] carp\s after \the [victim].") + log_game("Sending [number_of_carp] carp\s after \the [victim].") // Getting off screen tiles is kind of tricky due to potential edge cases that could arise. // The method we're gonna do is make a big square around the victim, then // subtract a smaller square in the middle for the default vision range. @@ -54,7 +54,7 @@ // Ask carp to swim onto the victim's screen. The AI will then switch to hostile and try to eat them. C.ai_holder?.give_destination(get_turf(victim)) else - log_debug("Surprise carp attack failed to find any space turfs offscreen to the victim.") + log_game("Surprise carp attack failed to find any space turfs offscreen to the victim.") // Gets suitable spots for carp to spawn, without risk of going off the edge of the map. // If there is demand for this proc, then it can easily be made independant and moved into one of the helper files. diff --git a/code/modules/holodeck/HolodeckControl.dm b/code/modules/holodeck/HolodeckControl.dm index 68eff0cbbe..7f14203ac8 100644 --- a/code/modules/holodeck/HolodeckControl.dm +++ b/code/modules/holodeck/HolodeckControl.dm @@ -185,7 +185,7 @@ current_program = powerdown_program linkedholodeck = locate(projection_area) if(!linkedholodeck) - to_world(span_danger("Holodeck computer at [x],[y],[z] failed to locate projection area.")) + to_chat(world, span_danger("Holodeck computer at [x],[y],[z] failed to locate projection area.")) //This could all be done better, but it works for now. /obj/machinery/computer/HolodeckControl/Destroy() diff --git a/code/modules/holomap/mapper.dm b/code/modules/holomap/mapper.dm index 1675b94680..8739ca4ab1 100644 --- a/code/modules/holomap/mapper.dm +++ b/code/modules/holomap/mapper.dm @@ -213,7 +213,7 @@ return if(!hud_item || !hud_datum) - log_error("Mapping device tried to update with missing hud_item or hud_datum") + log_runtime("Mapping device tried to update with missing hud_item or hud_datum") stop_updates() last_run() return diff --git a/code/modules/hydroponics/grown.dm b/code/modules/hydroponics/grown.dm index 6c80474ff7..69158e8492 100644 --- a/code/modules/hydroponics/grown.dm +++ b/code/modules/hydroponics/grown.dm @@ -28,13 +28,13 @@ plantname = planttype if(!plantname) - log_debug("Plantname not provided and and [src] requires it at [x],[y],[z]") + log_runtime("Plantname not provided and [src] requires it at [x],[y],[z]") return INITIALIZE_HINT_QDEL seed = SSplants.seeds[plantname] if(!seed) - log_debug("Plant name '[plantname]' does not exist and [src] requires it at [x],[y],[z]") + log_runtime("Plant name '[plantname]' does not exist and [src] requires it at [x],[y],[z]") return INITIALIZE_HINT_QDEL name = "[seed.seed_name]" diff --git a/code/modules/hydroponics/seed_gene_mut.dm b/code/modules/hydroponics/seed_gene_mut.dm index 54e513c233..d3d6bffc24 100644 --- a/code/modules/hydroponics/seed_gene_mut.dm +++ b/code/modules/hydroponics/seed_gene_mut.dm @@ -1,6 +1,6 @@ /datum/seed/proc/diverge_mutate_gene(var/decl/plantgene/G, var/turf/T) if(!istype(G)) - log_debug("Attempted to mutate [src] with a non-plantgene var.") + log_runtime("Attempted to mutate [src] with a non-plantgene var.") return src var/datum/seed/S = diverge() //Let's not modify all of the seeds. diff --git a/code/modules/hydroponics/spreading/spreading.dm b/code/modules/hydroponics/spreading/spreading.dm index 102842975b..bd11857fa2 100644 --- a/code/modules/hydroponics/spreading/spreading.dm +++ b/code/modules/hydroponics/spreading/spreading.dm @@ -96,7 +96,7 @@ parent = newparent if(!SSplants) - to_world(span_danger("Plant controller does not exist and [src] requires it. Aborting.")) + to_chat(world, span_danger("Plant controller does not exist and [src] requires it. Aborting.")) return INITIALIZE_HINT_QDEL if(!istype(newseed)) diff --git a/code/modules/hydroponics/spreading/spreading_response.dm b/code/modules/hydroponics/spreading/spreading_response.dm index 33ae116a98..5daae6c25e 100644 --- a/code/modules/hydroponics/spreading/spreading_response.dm +++ b/code/modules/hydroponics/spreading/spreading_response.dm @@ -3,7 +3,7 @@ return var/atom/movable/AM = WF.resolve() if(isnull(AM)) - log_debug("DEBUG: HasProximity called without reference on [src].") + log_runtime("DEBUG: HasProximity called without reference on [src].") return if(!is_mature() || seed.get_trait(TRAIT_SPREAD) != 2) return diff --git a/code/modules/hydroponics/trays/tray_update_icons.dm b/code/modules/hydroponics/trays/tray_update_icons.dm index 1706a3570d..4dc1b3c04b 100644 --- a/code/modules/hydroponics/trays/tray_update_icons.dm +++ b/code/modules/hydroponics/trays/tray_update_icons.dm @@ -44,7 +44,7 @@ if(!seed.growth_stages) seed.update_growth_stages() if(!seed.growth_stages) - log_debug(span_danger("Seed type [seed.get_trait(TRAIT_PLANT_ICON)] cannot find a growth stage value.")) //CHOMPEdit + to_chat(world, span_danger("Seed type [seed.get_trait(TRAIT_PLANT_ICON)] cannot find a growth stage value.")) return var/overlay_stage = 1 if(age >= seed.get_trait(TRAIT_MATURATION)) diff --git a/code/modules/keybindings/bindings_movekeys.dm b/code/modules/keybindings/bindings_movekeys.dm index 8888cdfc4f..abd7d1cbaf 100644 --- a/code/modules/keybindings/bindings_movekeys.dm +++ b/code/modules/keybindings/bindings_movekeys.dm @@ -42,7 +42,7 @@ // Validate input. Must be one (and only one) of the key codes) if(isnull(movekey) || (movekey & ~0xFFF) || (movekey & (movekey - 1))) - // log_debug("Client [ckey] sent an illegal movement key up: [movekeyName] ([movekey])") // We forward tgui keys nowadays + // log_tgui("Client [ckey] sent an illegal movement key up: [movekeyName] ([movekey])") // We forward tgui keys nowadays return // Clear bit indicating we were holding the key diff --git a/code/modules/lighting/lighting_fake_sun_vr.dm b/code/modules/lighting/lighting_fake_sun_vr.dm index b05aff2bba..26261f60e4 100644 --- a/code/modules/lighting/lighting_fake_sun_vr.dm +++ b/code/modules/lighting/lighting_fake_sun_vr.dm @@ -152,7 +152,7 @@ var/static/list/fake_sunlight_zs = list() turfs_to_use += T if(!turfs_to_use.len) - warning("Fake sun placed on a level where it can't find any outdoor turfs to color at [x],[y],[z].") + WARNING("Fake sun placed on a level where it can't find any outdoor turfs to color at [x],[y],[z].") return sun = new(null) diff --git a/code/modules/logging/categories/log_category_admin.dm b/code/modules/logging/categories/log_category_admin.dm new file mode 100644 index 0000000000..3bc5868e52 --- /dev/null +++ b/code/modules/logging/categories/log_category_admin.dm @@ -0,0 +1,33 @@ +/datum/log_category/admin + category = LOG_CATEGORY_ADMIN + config_flag = /datum/config_entry/flag/log_admin + +/datum/log_category/admin_dsay + category = LOG_CATEGORY_ADMIN_DSAY + master_category = /datum/log_category/admin + config_flag = /datum/config_entry/flag/log_admin + +// private categories // + +/datum/log_category/admin_private + category = LOG_CATEGORY_ADMIN_PRIVATE + config_flag = /datum/config_entry/flag/log_admin + secret = TRUE + +/datum/log_category/admin_asay + category = LOG_CATEGORY_ADMIN_PRIVATE_ASAY + master_category = /datum/log_category/admin_private + config_flag = /datum/config_entry/flag/log_adminchat + secret = TRUE + +/datum/log_category/admin_msay + category = LOG_CATEGORY_ADMIN_PRIVATE_MSAY + master_category = /datum/log_category/admin_private + config_flag = /datum/config_entry/flag/log_adminchat + secret = TRUE + +/datum/log_category/admin_esay + category = LOG_CATEGORY_ADMIN_PRIVATE_ESAY + master_category = /datum/log_category/admin_private + config_flag = /datum/config_entry/flag/log_eventchat + secret = TRUE diff --git a/code/modules/logging/categories/log_category_compats.dm b/code/modules/logging/categories/log_category_compats.dm new file mode 100644 index 0000000000..2cf7343f01 --- /dev/null +++ b/code/modules/logging/categories/log_category_compats.dm @@ -0,0 +1,7 @@ +/datum/log_category/game_compat + category = LOG_CATEGORY_COMPAT_GAME + master_category = /datum/log_category/game + config_flag = /datum/config_entry/flag/logging_compat_adminprivate + +/datum/config_entry/flag/logging_compat_adminprivate + default = FALSE diff --git a/code/modules/logging/categories/log_category_debug.dm b/code/modules/logging/categories/log_category_debug.dm new file mode 100644 index 0000000000..2a03c74a27 --- /dev/null +++ b/code/modules/logging/categories/log_category_debug.dm @@ -0,0 +1,23 @@ +/datum/log_category/debug + category = LOG_CATEGORY_DEBUG + +/datum/log_category/debug_sql + category = LOG_CATEGORY_DEBUG_SQL + master_category = /datum/log_category/debug + +// This is not in the debug master category on purpose, do not add it +/datum/log_category/debug_runtime + category = LOG_CATEGORY_RUNTIME + +/datum/log_category/debug_mapping + category = LOG_CATEGORY_DEBUG_MAPPING + master_category = /datum/log_category/debug + +/datum/log_category/debug_mobtag + category = LOG_CATEGORY_DEBUG_MOBTAG + master_category = /datum/log_category/debug + +/datum/log_category/debug_asset + category = LOG_CATEGORY_DEBUG_ASSET + config_flag = /datum/config_entry/flag/log_asset + master_category = /datum/log_category/debug diff --git a/code/modules/logging/categories/log_category_game.dm b/code/modules/logging/categories/log_category_game.dm new file mode 100644 index 0000000000..281093bcbd --- /dev/null +++ b/code/modules/logging/categories/log_category_game.dm @@ -0,0 +1,48 @@ +/datum/log_category/game + category = LOG_CATEGORY_GAME + config_flag = /datum/config_entry/flag/log_game + +/datum/log_category/game_vote + category = LOG_CATEGORY_GAME_VOTE + config_flag = /datum/config_entry/flag/log_vote + master_category = /datum/log_category/game + +/datum/log_category/game_emote + category = LOG_CATEGORY_GAME_EMOTE + config_flag = /datum/config_entry/flag/log_emote + master_category = /datum/log_category/game + +/datum/log_category/game_topic + category = LOG_CATEGORY_GAME_TOPIC + config_flag = /datum/config_entry/flag/log_world_topic + master_category = /datum/log_category/game + +/datum/log_category/game_say + category = LOG_CATEGORY_GAME_SAY + config_flag = /datum/config_entry/flag/log_say + master_category = /datum/log_category/game + +/datum/log_category/game_whisper + category = LOG_CATEGORY_GAME_WHISPER + config_flag = /datum/config_entry/flag/log_whisper + master_category = /datum/log_category/game + +/datum/log_category/game_ooc + category = LOG_CATEGORY_GAME_OOC + config_flag = /datum/config_entry/flag/log_ooc + master_category = /datum/log_category/game + +/datum/log_category/game_looc + category = LOG_CATEGORY_GAME_LOOC + config_flag = /datum/config_entry/flag/log_looc + master_category = /datum/log_category/game + +/datum/log_category/game_prayer + category = LOG_CATEGORY_GAME_PRAYER + config_flag = /datum/config_entry/flag/log_prayer + master_category = /datum/log_category/game + +/datum/log_category/game_access + category = LOG_CATEGORY_GAME_ACCESS + config_flag = /datum/config_entry/flag/log_access + master_category = /datum/log_category/game diff --git a/code/modules/logging/categories/log_category_href.dm b/code/modules/logging/categories/log_category_href.dm new file mode 100644 index 0000000000..cd1fdd877a --- /dev/null +++ b/code/modules/logging/categories/log_category_href.dm @@ -0,0 +1,6 @@ +/datum/log_category/href + category = LOG_CATEGORY_HREF + +/datum/log_category/href_tgui + category = LOG_CATEGORY_HREF_TGUI + master_category = /datum/log_category/href diff --git a/code/modules/logging/categories/log_category_internal.dm b/code/modules/logging/categories/log_category_internal.dm new file mode 100644 index 0000000000..d0b363e636 --- /dev/null +++ b/code/modules/logging/categories/log_category_internal.dm @@ -0,0 +1,6 @@ +/datum/log_category/internal + category = LOG_CATEGORY_INTERNAL_ERROR + +/datum/log_category/internal_unknown_category + category = LOG_CATEGORY_INTERNAL_CATEGORY_NOT_FOUND + master_category = /datum/log_category/internal diff --git a/code/modules/logging/categories/log_category_misc.dm b/code/modules/logging/categories/log_category_misc.dm new file mode 100644 index 0000000000..706e6096d4 --- /dev/null +++ b/code/modules/logging/categories/log_category_misc.dm @@ -0,0 +1,20 @@ +/datum/log_category/attack + category = LOG_CATEGORY_ATTACK + config_flag = /datum/config_entry/flag/log_attack + +/datum/log_category/supicious_login + category = LOG_CATEGORY_SUSPICIOUS_LOGIN + config_flag = /datum/config_entry/flag/log_suspicious_login + +/datum/log_category/config + category = LOG_CATEGORY_CONFIG + +// Logs seperately, printed into on server shutdown to store hard deletes and such +/datum/log_category/qdel + category = LOG_CATEGORY_QDEL + // We want this human readable so it's easy to see at a glance + entry_flags = ENTRY_USE_DATA_W_READABLE + +/datum/log_category/vore + category = LOG_CATEGORY_VORE + config_flag = /datum/config_entry/flag/log_vore diff --git a/code/modules/logging/categories/log_category_pda.dm b/code/modules/logging/categories/log_category_pda.dm new file mode 100644 index 0000000000..6a926c24a2 --- /dev/null +++ b/code/modules/logging/categories/log_category_pda.dm @@ -0,0 +1,3 @@ +/datum/log_category/pda + category = LOG_CATEGORY_PDA + config_flag = /datum/config_entry/flag/log_pda diff --git a/code/modules/logging/log_category.dm b/code/modules/logging/log_category.dm new file mode 100644 index 0000000000..363fb5ad0b --- /dev/null +++ b/code/modules/logging/log_category.dm @@ -0,0 +1,70 @@ +/// The main datum that contains all log entries for a category +/datum/log_category + /// The category name + var/category + + /// The schema version of this log category. + /// Expected format of "Major.Minor.Patch" + var/schema_version = LOG_CATEGORY_SCHEMA_VERSION_NOT_SET + + /// The master category that contains this category + var/datum/log_category/master_category + + /// Flags to apply to our /datum/log_entry's + /// See code/__DEFINES/logging/dm + var/entry_flags = NONE + + /// If set this config flag is checked to enable this log category + var/config_flag + + /// Whether or not this log should not be publically visible + var/secret = FALSE + + /// The list of header information for this category. Used for log file re-initialization + var/list/category_header + + /// Whether the readable version of the log message is formatted internally instead of by rustg + /// IF YOU CHANGE THIS VERIFY LOGS ARE STILL PARSED CORRECTLY + var/internal_formatting = FALSE + + /// List of log entries for this category + var/list/entries = list() + + /// Total number of entries this round so far + var/entry_count = 0 + +GENERAL_PROTECT_DATUM(/datum/log_category) + +/// Add an entry to this category. It is very important that any data you provide doesn't hold references to anything! +/datum/log_category/proc/create_entry(message, list/data, list/semver_store) + var/datum/log_entry/entry = new( + // world state contains raw timestamp + timestamp = logger.human_readable_timestamp(), + category = category, + message = message, + flags = entry_flags, + data = data, + semver_store = semver_store, + ) + + write_entry(entry) + entry_count += 1 + if(entry_count <= CONFIG_MAX_CACHED_LOG_ENTRIES) + entries += entry + +/// Allows for category specific file splitting. Needs to accept a null entry for the default file. +/// If master_category it will always return the output of master_category.get_output_file(entry) +/datum/log_category/proc/get_output_file(list/entry, extension = "log.json") + if(master_category) + return master_category.get_output_file(entry, extension) + if(secret) + return "[GLOB.log_directory]/secret/[category].[extension]" + return "[GLOB.log_directory]/[category].[extension]" + +/// Writes an entry to the output file(s) for the category +/datum/log_category/proc/write_entry(datum/log_entry/entry) + // config isn't loaded? assume we want human readable logs + if(isnull(config) || CONFIG_GET(flag/log_as_human_readable)) + entry.write_readable_entry_to_file(get_output_file(entry, "log"), format_internally = internal_formatting) + + entry.write_entry_to_file(get_output_file(entry)) diff --git a/code/modules/logging/log_entry.dm b/code/modules/logging/log_entry.dm new file mode 100644 index 0000000000..8c9f6bd2cf --- /dev/null +++ b/code/modules/logging/log_entry.dm @@ -0,0 +1,127 @@ + +// Schema version must always be the very last element in the array. + +// Current Schema: 1.0.0 +// [timestamp, category, message, data, world_state, semver_store, id, schema_version] + +/// A datum which contains log information. +/datum/log_entry + /// Next id to assign to a log entry. + var/static/next_id = 0 + + /// Unique id of the log entry. + var/id + + /// Schema version of the log entry. + var/schema_version = "1.0.0" + + /// Unix timestamp of the log entry. + var/timestamp + + /// Category of the log entry. + var/category + + /// Message of the log entry. + var/message + + /// Bitfield that describes how exactly to log stuff exactly + /// See code/__DEFINES/logging/dm + var/flags = NONE + + /// Data of the log entry; optional. + var/list/data + + /// Semver store of the log entry, used to store the schema of data entries + var/list/semver_store + +GENERAL_PROTECT_DATUM(/datum/log_entry) + +/datum/log_entry/New(timestamp, category, message, flags, list/data, list/semver_store) + ..() + + src.id = next_id++ + src.timestamp = timestamp + src.category = category + src.flags = flags + src.message = message + with_data(data) + with_semver_store(semver_store) + +/datum/log_entry/proc/with_data(list/data) + if(!isnull(data)) + if(!islist(data)) + src.data = list("data" = data) + stack_trace("Log entry data was not a list, it was [data.type].") + else + src.data = data + return src + +/datum/log_entry/proc/with_semver_store(list/semver_store) + if(isnull(semver_store)) + return + if(!islist(semver_store)) + stack_trace("Log entry semver store was not a list, it was [semver_store.type]. We cannot reliably convert it to a list.") + else + src.semver_store = semver_store + return src + +/// Converts the log entry to a human-readable string. +/datum/log_entry/proc/to_readable_text(format = TRUE) + var/output = "" + if(format) + output += "\[[timestamp]\] [uppertext(category)]: [message]" + else + output += "[uppertext(category)]: [message]" + + if(flags & ENTRY_USE_DATA_W_READABLE) + output += json_encode(data, JSON_PRETTY_PRINT) + return output + +#define MANUAL_JSON_ENTRY(list, key, value) list.Add("\"[key]\":[(!isnull(value)) ? json_encode(value) : "null"]") + +/// Converts the log entry to a JSON string. +/datum/log_entry/proc/to_json_text() + // I do not trust byond's json encoder, and need to ensure the order doesn't change. + var/list/json_entries = list() + MANUAL_JSON_ENTRY(json_entries, LOG_ENTRY_KEY_TIMESTAMP, timestamp) + MANUAL_JSON_ENTRY(json_entries, LOG_ENTRY_KEY_CATEGORY, category) + MANUAL_JSON_ENTRY(json_entries, LOG_ENTRY_KEY_MESSAGE, message) + MANUAL_JSON_ENTRY(json_entries, LOG_ENTRY_KEY_DATA, data) + MANUAL_JSON_ENTRY(json_entries, LOG_ENTRY_KEY_WORLD_STATE, world.get_world_state_for_logging()) + MANUAL_JSON_ENTRY(json_entries, LOG_ENTRY_KEY_SEMVER_STORE, semver_store) + MANUAL_JSON_ENTRY(json_entries, LOG_ENTRY_KEY_ID, id) + MANUAL_JSON_ENTRY(json_entries, LOG_ENTRY_KEY_SCHEMA_VERSION, schema_version) + return "{[json_entries.Join(",")]}" + +#undef MANUAL_JSON_ENTRY + +#define CHECK_AND_TRY_FILE_ERROR_RECOVERY(file) \ + var/static/in_error_recovery = FALSE; \ + if(!fexists(##file)) { \ + if(in_error_recovery) { \ + in_error_recovery = FALSE; \ + CRASH("Failed to error recover log file: [file]"); \ + }; \ + in_error_recovery = TRUE; \ + logger.Log(LOG_CATEGORY_INTERNAL_ERROR, "attempting to perform file error recovery: [file]"); \ + logger.init_category_file(logger.log_categories[category]); \ + call(src, __PROC__)(arglist(args)); \ + return; \ + }; \ + in_error_recovery = FALSE; + +/// Writes the log entry to a file. +/datum/log_entry/proc/write_entry_to_file(file) + CHECK_AND_TRY_FILE_ERROR_RECOVERY(file) + WRITE_LOG_NO_FORMAT(file, "[to_json_text()]\n") + +/// Writes the log entry to a file as a human-readable string. +/datum/log_entry/proc/write_readable_entry_to_file(file, format_internally = TRUE) + CHECK_AND_TRY_FILE_ERROR_RECOVERY(file) + // If it's being formatted internally we need to manually add a newline + if(format_internally) + WRITE_LOG_NO_FORMAT(file, "[to_readable_text(format = TRUE)]\n") + else + WRITE_LOG(file, "[to_readable_text(format = FALSE)]") + +#undef CHECK_AND_TRY_FILE_ERROR_RECOVERY diff --git a/code/modules/logging/log_holder.dm b/code/modules/logging/log_holder.dm new file mode 100644 index 0000000000..c357c34759 --- /dev/null +++ b/code/modules/logging/log_holder.dm @@ -0,0 +1,356 @@ +GLOBAL_REAL(logger, /datum/log_holder) +/** + * Main datum to manage logging actions + */ +/datum/log_holder + /// Round ID, if set, that logging is initialized for + var/round_id + /// When the log_holder first initialized + var/logging_start_timestamp + + /// Associative: category -> datum + var/list/datum/log_category/log_categories + /// typecache list for categories that exist but are disabled + var/list/disabled_categories + /// category nesting tree for ui purposes + var/list/category_group_tree + + /// list of Log args waiting for processing pending log initialization + var/list/waiting_log_calls + + /// Whether or not logging as human readable text is enabled + var/human_readable_enabled = FALSE + + /// Cached ui_data + var/list/data_cache = list() + + /// Last time the ui_data was updated + var/last_data_update = 0 + + var/initialized = FALSE + var/shutdown = FALSE + +GENERAL_PROTECT_DATUM(/datum/log_holder) + +ADMIN_VERB(log_viewer_new, R_ADMIN|R_DEBUG, "View Round Logs", "View the rounds logs.", ADMIN_CATEGORY_LOGS) + logger.tgui_interact(user.mob) + +/datum/log_holder/tgui_interact(mob/user, datum/tgui/ui) + if(!check_rights_for(user.client, R_ADMIN)) + return + + ui = SStgui.try_update_ui(user, src, ui) + if(isnull(ui)) + ui = new(user, src, "LogViewer", "Log Viewer") + ui.set_autoupdate(FALSE) + ui.open() + +/datum/log_holder/tgui_state(mob/user) + return ADMIN_STATE(R_ADMIN | R_DEBUG) + +/datum/log_holder/tgui_static_data(mob/user) + var/list/data = list( + "round_id" = GLOB.round_id, + "logging_start_timestamp" = logging_start_timestamp, + ) + + var/list/tree = list() + data["tree"] = tree + var/list/enabled_categories = list() + for(var/enabled in log_categories) + enabled_categories += enabled + tree["enabled"] = enabled_categories + + var/list/disabled_categories = list() + for(var/disabled in src.disabled_categories) + disabled_categories += disabled + tree["disabled"] = disabled_categories + + return data + +/datum/log_holder/tgui_data(mob/user) + if(!last_data_update || (world.time - last_data_update) > LOG_UPDATE_TIMEOUT) + cache_ui_data() + return data_cache + +/datum/log_holder/proc/cache_ui_data() + var/list/category_map = list() + for(var/datum/log_category/category as anything in log_categories) + category = log_categories[category] + var/list/category_data = list() + + var/list/entries = list() + for(var/datum/log_entry/entry as anything in category.entries) + entries += list(list( + "id" = entry.id, + "message" = entry.message, + "timestamp" = entry.timestamp, + "data" = entry.data, + "semver" = entry.semver_store, + )) + category_data["entries"] = entries + category_data["entry_count"] = category.entry_count + + category_map[category.category] = category_data + + data_cache.Cut() + last_data_update = world.time + + data_cache["categories"] = category_map + data_cache["last_data_update"] = last_data_update + +/datum/log_holder/tgui_act(action, list/params, datum/tgui/ui, datum/tgui_state/state) + . = ..() + if(.) + return + + switch(action) + if("refresh") + cache_ui_data() + SStgui.update_uis(src) + return TRUE + else + stack_trace("unknown ui_act action [action] for [type]") + +/// Assembles basic information for logging, creating the log category datums and checking for config flags as required +/datum/log_holder/proc/init_logging() + if(initialized) + CRASH("Attempted to call init_logging twice!") + + round_id = GLOB.round_id + logging_start_timestamp = rustg_unix_timestamp() + log_categories = list() + disabled_categories = list() + + human_readable_enabled = CONFIG_GET(flag/log_as_human_readable) + + category_group_tree = assemble_log_category_tree() + var/config_flag + for(var/datum/log_category/master_category as anything in category_group_tree) + var/list/sub_categories = category_group_tree[master_category] + sub_categories = sub_categories.Copy() + for(var/datum/log_category/sub_category as anything in sub_categories) + config_flag = initial(sub_category.config_flag) + if(config_flag && !config.Get(config_flag)) + disabled_categories[initial(sub_category.category)] = TRUE + sub_categories -= sub_category + continue + + config_flag = initial(master_category.config_flag) + if(config_flag && !config.Get(config_flag)) + disabled_categories[initial(master_category.category)] = TRUE + if(!length(sub_categories)) + continue + // enabled, or any of the sub categories are enabled + init_log_category(master_category, sub_categories) + + initialized = TRUE + + // process any waiting log calls and then cut the list + for(var/list/arg_list as anything in waiting_log_calls) + Log(arglist(arg_list)) + waiting_log_calls?.Cut() + + if(fexists(GLOB.config_error_log)) + fcopy(GLOB.config_error_log, "[GLOB.log_directory]/config_error.log") + fdel(GLOB.config_error_log) + + world._initialize_log_files() + +/// Tells the log_holder to not allow any more logging to be done, and dumps all categories to their json file +/datum/log_holder/proc/shutdown_logging() + if(shutdown) + CRASH("Attempted to call shutdown_logging twice!") + shutdown = TRUE + +/// Iterates over all log category types to assemble them into a tree of main category -> (sub category)[] while also checking for loops and sanity errors +/datum/log_holder/proc/assemble_log_category_tree() + var/static/list/category_tree + if(category_tree) + return category_tree + + category_tree = list() + var/list/all_types = subtypesof(/datum/log_category) + var/list/known_categories = list() + var/list/sub_categories = list() + + // Assemble the master categories + for(var/datum/log_category/category_type as anything in all_types) + var/category = initial(category_type.category) + if(category in known_categories) + stack_trace("log category type '[category_type]' has duplicate category '[category]', skipping") + continue + + if(!initial(category_type.schema_version)) + stack_trace("log category type '[category_type]' does not have a valid schema version, skipping") + continue + + var/master_category = initial(category_type.master_category) + if(master_category) + sub_categories[master_category] += list(category_type) + continue + category_tree[category_type] = list() + + // Sort the sub categories + for(var/datum/log_category/master as anything in sub_categories) + if(!(master in category_tree)) + stack_trace("log category [master] is an invalid master category as it's a sub category") + continue + for(var/datum/log_category/sub_category as anything in sub_categories[master]) + if(initial(sub_category.secret) != initial(master.secret)) + stack_trace("log category [sub_category] has a secret status that differs from its master category [master]") + category_tree[master] += list(sub_category) + + return category_tree + +/// Log entry header used to mark a file is being reset +#define LOG_CATEGORY_RESET_FILE_MARKER "{\"LOG FILE RESET -- THIS IS AN ERROR\"}" +#define LOG_CATEGORY_RESET_FILE_MARKER_READABLE "LOG FILE RESET -- THIS IS AN ERROR" +/// Gets a recovery file for the given path. Caches the last known recovery path for each path. +/datum/log_holder/proc/get_recovery_file_for(path) + var/static/cache + if(isnull(cache)) + cache = list() + + var/count = cache[path] || 0 + while(fexists("[path].rec[count]")) + count++ + cache[path] = count + + return "[path].rec[count]" + +/// Sets up the given category's file and header. +/datum/log_holder/proc/init_category_file(datum/log_category/category) + var/file_path = category.get_output_file(null) + if(fexists(file_path)) // already exists? implant a reset marker + rustg_file_append(LOG_CATEGORY_RESET_FILE_MARKER, file_path) + fcopy(file_path, get_recovery_file_for(file_path)) + rustg_file_write("[json_encode(category.category_header)]\n", file_path) + + if(!human_readable_enabled) + return + + file_path = category.get_output_file(null, "log") + if(fexists(file_path)) + rustg_file_append(LOG_CATEGORY_RESET_FILE_MARKER_READABLE, file_path) + fcopy(file_path, get_recovery_file_for(file_path)) + rustg_file_write("\[[human_readable_timestamp()]\] Starting up round ID [round_id].\n - -------------------------\n", file_path) + +#undef LOG_CATEGORY_RESET_FILE_MARKER +#undef LOG_CATEGORY_RESET_FILE_MARKER_READABLE + +/// Initializes the given log category and populates the list of contained categories based on the sub category list +/datum/log_holder/proc/init_log_category(datum/log_category/category_type, list/datum/log_category/sub_categories) + var/datum/log_category/category_instance = new category_type + + var/list/contained_categories = list() + for(var/datum/log_category/sub_category as anything in sub_categories) + sub_category = new sub_category + var/sub_category_actual = sub_category.category + sub_category.master_category = category_instance + log_categories[sub_category_actual] = sub_category + + if(!semver_to_list(sub_category.schema_version)) + stack_trace("log category [sub_category_actual] has an invalid schema version '[sub_category.schema_version]'") + sub_category.schema_version = LOG_CATEGORY_SCHEMA_VERSION_NOT_SET + + contained_categories += sub_category_actual + + log_categories[category_instance.category] = category_instance + + if(!semver_to_list(category_instance.schema_version)) + stack_trace("log category [category_instance.category] has an invalid schema version '[category_instance.schema_version]'") + category_instance.schema_version = LOG_CATEGORY_SCHEMA_VERSION_NOT_SET + + contained_categories += category_instance.category + + var/list/category_header = list( + LOG_HEADER_INIT_TIMESTAMP = logging_start_timestamp, + LOG_HEADER_ROUND_ID = GLOB.round_id, + LOG_HEADER_SECRET = category_instance.secret, + LOG_HEADER_CATEGORY_LIST = contained_categories, + LOG_HEADER_CATEGORY = category_instance.category, + ) + + category_instance.category_header = category_header + init_category_file(category_instance, category_header) + +/datum/log_holder/proc/human_readable_timestamp() + return rustg_formatted_timestamp("%Y-%m-%d %H:%M:%S%.3f") + +/// Adds an entry to the given category, if the category is disabled it will not be logged. +/// If the category does not exist, we will CRASH and log to the error category. +/// the data list is optional and will be recursively json serialized. +/datum/log_holder/proc/Log(category, message, list/data) + // This is Log because log is a byond internal proc + + // do not include the message because these go into the runtime log and we might be secret! + if(!istext(message)) + message = "[message]" + stack_trace("Logging with a non-text message") + + if(!category) + category = LOG_CATEGORY_INTERNAL_CATEGORY_NOT_FOUND + stack_trace("Logging with a null or empty category") + + if(data && !islist(data)) + data = list("data" = data) + stack_trace("Logging with data this is not a list, it will be converted to a list with a single key 'data'") + + if(!initialized) // we are initialized during /world/proc/SetupLogging which is called in /world/New + waiting_log_calls += list(list(category, message, data)) + return + + if(disabled_categories[category]) + return + + var/datum/log_category/log_category = log_categories[category] + if(!log_category) + Log(LOG_CATEGORY_INTERNAL_CATEGORY_NOT_FOUND, message, data) + CRASH("Attempted to log to a category that doesn't exist! [category]") + + var/list/semver_store = null + if(length(data)) + semver_store = list() + data = recursive_jsonify(data, semver_store) + log_category.create_entry(message, data, semver_store) + +/// Recursively converts an associative list of datums into their jsonified(list) form +/datum/log_holder/proc/recursive_jsonify(list/data_list, list/semvers) + if(isnull(data_list)) + return null + + var/list/jsonified_list = list() + for(var/key in data_list) + var/datum/data = data_list[key] + + if(isnull(data)) + pass() // nulls are allowed + + else if(islist(data)) + data = recursive_jsonify(data, semvers) + + else if(isdatum(data)) + var/list/options_list = list( + SCHEMA_VERSION = LOG_CATEGORY_SCHEMA_VERSION_NOT_SET, + ) + + var/list/serialization_data = data.serialize_list(options_list, semvers) + var/current_semver = semvers[data.type] + if(!semver_to_list(current_semver)) + stack_trace("serialization of data had an invalid semver") + semvers[data.type] = LOG_CATEGORY_SCHEMA_VERSION_NOT_SET + + if(!length(serialization_data)) // serialize_list wasn't implemented, and errored + stack_trace("serialization data was empty") + continue + + data = recursive_jsonify(serialization_data, semvers) + + if(islist(data) && !length(data)) + stack_trace("recursive_jsonify got an empty list after serialization") + continue + + jsonified_list[key] = data + + return jsonified_list diff --git a/code/modules/looking_glass/lg_area.dm b/code/modules/looking_glass/lg_area.dm index 2000c35609..5a1ac8f145 100644 --- a/code/modules/looking_glass/lg_area.dm +++ b/code/modules/looking_glass/lg_area.dm @@ -13,7 +13,7 @@ . = ..() our_landmark = locate() in src if(!our_landmark) - testing("Looking glass area [name] couldn't find a landmark") + log_mapping("Looking glass area [name] couldn't find a landmark") for(var/turf/simulated/floor/looking_glass/lgt in src) our_turfs += lgt if(lgt.optional) diff --git a/code/modules/looking_glass/lg_console.dm b/code/modules/looking_glass/lg_console.dm index e3eaca9256..c45ef0de28 100644 --- a/code/modules/looking_glass/lg_console.dm +++ b/code/modules/looking_glass/lg_console.dm @@ -26,7 +26,7 @@ my_area = lga break if(!istype(my_area)) - testing("Looking glass console [x],[y],[x] not in a looking glass area.") + log_mapping("Looking glass console [x],[y],[x] not in a looking glass area.") if(!supported_programs.len) supported_programs["Off"] = null supported_programs["Diagnostics"] = image(icon = 'icons/skybox/skybox.dmi', icon_state = "diagnostic") diff --git a/code/modules/looking_glass/lg_imageholder.dm b/code/modules/looking_glass/lg_imageholder.dm index 0f6f8bec8e..74db27c48d 100644 --- a/code/modules/looking_glass/lg_imageholder.dm +++ b/code/modules/looking_glass/lg_imageholder.dm @@ -15,14 +15,14 @@ /obj/effect/landmark/looking_glass/proc/gain_viewer(var/client/C) if(C in viewers) - testing("Looking Glass [x],[y],[z] tried to add a duplicate viewer.") + log_mapping("Looking Glass [x],[y],[z] tried to add a duplicate viewer.") viewers |= C if(holding) show_to(C) /obj/effect/landmark/looking_glass/proc/lose_viewer(var/client/C) if(!(C in viewers)) - testing("Looking Glass [x],[y],[z] tried to remove a viewer it didn't have") + log_mapping("Looking Glass [x],[y],[z] tried to remove a viewer it didn't have") viewers -= C if(holding) unshow_to(C) diff --git a/code/modules/lore_codex/codex_tree.dm b/code/modules/lore_codex/codex_tree.dm index c1d0f73818..b067a79b9a 100644 --- a/code/modules/lore_codex/codex_tree.dm +++ b/code/modules/lore_codex/codex_tree.dm @@ -100,7 +100,7 @@ current_page["[user]"] = home D = current_page["[user]"] if(!istype(D)) - log_debug("Codex_tree failed to failed to load for [user].") + log_runtime("Codex_tree failed to failed to load for [user].") return var/list/H_init = list() H_init.Add(home) diff --git a/code/modules/maps/bapi-dmm/bapi_dmm_reader.dm b/code/modules/maps/bapi-dmm/bapi_dmm_reader.dm index abed813ec3..20c5beedb9 100644 --- a/code/modules/maps/bapi-dmm/bapi_dmm_reader.dm +++ b/code/modules/maps/bapi-dmm/bapi_dmm_reader.dm @@ -123,7 +123,7 @@ GLOBAL_LIST_EMPTY(_preloader_attributes) new_z = FALSE, ) if(isfile(dmm_file)) - log_debug("bapi-dmm was passed a file instead of a path string: [dmm_file]") + log_mapping("bapi-dmm was passed a file instead of a path string: [dmm_file]") var/name = sanitize_filename("[dmm_file]") var/path = "data/baked_dmm_files/[name]" if(!fexists(path)) diff --git a/code/modules/materials/materials/_materials.dm b/code/modules/materials/materials/_materials.dm index d4de8e8ff7..9f8fc8e474 100644 --- a/code/modules/materials/materials/_materials.dm +++ b/code/modules/materials/materials/_materials.dm @@ -143,7 +143,7 @@ var/list/name_to_material if(istext(key)) // text ID . = name_to_material[key] if(!.) - warning("Attempted to fetch material ref with invalid text id '[key]'") + WARNING("Attempted to fetch material ref with invalid text id '[key]'") return if(!ispath(key, /datum/material)) @@ -152,7 +152,7 @@ var/list/name_to_material key = GetIdFromArguments(arguments) . = name_to_material[key] if(!.) - warning("Attempted to fetch nonexistent material with key [key]") + WARNING("Attempted to fetch nonexistent material with key [key]") /** I'm not going to lie, this was swiped from [SSdcs][/datum/controller/subsystem/processing/dcs]. * Credit does to ninjanomnom diff --git a/code/modules/media/juke_remote.dm b/code/modules/media/juke_remote.dm index 00ad87bff8..f49d9d7580 100644 --- a/code/modules/media/juke_remote.dm +++ b/code/modules/media/juke_remote.dm @@ -85,7 +85,7 @@ /obj/item/juke_remote/proc/attach_area() var/area/A = get_area(src) if(!A || !paired_juke) - error("Jukebox remote at [x],[y],[z] without paired juke tried to bind to an area.") + log_mapping("## ERROR Jukebox remote at [x],[y],[z] without paired juke tried to bind to an area.") return FALSE if(A.media_source) return FALSE // Already has a media source, won't overpower it with porta speaker diff --git a/code/modules/media/mediamanager.dm b/code/modules/media/mediamanager.dm index cf51eeb7c7..a1dad12fa5 100644 --- a/code/modules/media/mediamanager.dm +++ b/code/modules/media/mediamanager.dm @@ -25,7 +25,7 @@ // Stop media when the round ends. I guess so it doesn't play forever or something (for some reason?) /hook/roundend/proc/stop_all_media() - log_debug("Stopping all playing media...") + log_world("Stopping all playing media...") // Stop all music. for(var/mob/M in GLOB.mob_list) if(M && M.client) diff --git a/code/modules/metric/activity.dm b/code/modules/metric/activity.dm index 21772f1862..602f9cdfdf 100644 --- a/code/modules/metric/activity.dm +++ b/code/modules/metric/activity.dm @@ -40,13 +40,13 @@ var/list/activity = list() for(var/department in departments) activity[department] = assess_department(department) -// log_debug("Assessing department [department]. They have activity of [activity[department]].") +// to_chat(world, "Assessing department [department]. They have activity of [activity[department]].") var/list/most_active_departments = list() // List of winners. var/highest_activity = null // Department who is leading in activity, if one exists. var/highest_number = 0 // Activity score needed to beat to be the most active department. for(var/i = 1, i <= cutoff_number, i++) -// log_debug("Doing [i]\th round of counting.") +// to_chat(world, "Doing [i]\th round of counting.") for(var/department in activity) if(department in department_blacklist) // Blacklisted? continue @@ -57,7 +57,7 @@ if(highest_activity) // Someone's a winner. most_active_departments.Add(highest_activity) // Add to the list of most active. activity.Remove(highest_activity) // Remove them from the other list so they don't win more than once. -// log_debug("[highest_activity] has won the [i]\th round of activity counting.") +// to_chat(world, "[highest_activity] has won the [i]\th round of activity counting.") highest_activity = null // Now reset for the next round. highest_number = 0 //todo: finish diff --git a/code/modules/mining/machinery/machine_processing.dm b/code/modules/mining/machinery/machine_processing.dm index b93f801f10..393db9ab58 100644 --- a/code/modules/mining/machinery/machine_processing.dm +++ b/code/modules/mining/machinery/machine_processing.dm @@ -23,7 +23,7 @@ if (machine) machine.console = src else - log_debug("Ore processing machine console at [src.x], [src.y], [src.z] could not find its machine!") + log_mapping("Ore processing machine console at [src.x], [src.y], [src.z] could not find its machine!") qdel(src) /obj/machinery/mineral/processing_unit_console/Destroy() diff --git a/code/modules/mining/mineral_effect.dm b/code/modules/mining/mineral_effect.dm index 2c44fa599f..edb349e400 100644 --- a/code/modules/mining/mineral_effect.dm +++ b/code/modules/mining/mineral_effect.dm @@ -28,5 +28,5 @@ if(O) scanner_image = image(icon, loc = get_turf(src), icon_state = (O.scan_icon ? O.scan_icon : icon_state)) else - to_world("No ore data for [src]!") + to_chat(world, "No ore data for [src]!") return scanner_image diff --git a/code/modules/mining/resonator_vr.dm b/code/modules/mining/resonator_vr.dm index 4cf08eeaa5..5dc9b564cf 100644 --- a/code/modules/mining/resonator_vr.dm +++ b/code/modules/mining/resonator_vr.dm @@ -37,12 +37,10 @@ to_chat(creator, span_warning("You've exceeded the field limit! Wait for them to dissipate.")) return if(spreadmode) - //log_debug("Starting cascade...") cascading = TRUE var/depth = 0 var/fields = 0 if(depth == 0) - //log_debug("Creating resonance at the target spot.") playsound(src,'sound/weapons/resonator_fire.ogg',50,1) new /obj/effect/resonance(T, WEAKREF(creator), burst_time) fields++ @@ -51,9 +49,7 @@ var/dir while(fields < fieldlimit) for(var/i=0, i<=2, i++) - //log_debug("Fields are [fields], doing [i] iteration of subloop") if(fields >= fieldlimit) - //log_debug("[fields] exceeded fieldlimit, exiting procedure.") sleep(burst_time) cascading = FALSE return @@ -66,7 +62,6 @@ dir = turn(origin_dir, -90) var/turf/newT = T for(var/step = 1, step<=depth, step++) - //log_debug("Taking a step until [depth] steps taken.") var/turf/oldT = newT newT = get_step(oldT, dir) if(step == depth) diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index 8e038c209d..cda16e5446 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -907,7 +907,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp return 0 var/msg = tgui_input_text(src, "Message:", "Spectral Whisper", "", MAX_MESSAGE_LEN) if(msg) - log_say("(SPECWHISP to [key_name(M)]): [msg]", src) + log_talk("(SPECWHISP to [key_name(M)]): [msg]", LOG_WHISPER) to_chat(M, span_warning(" You hear a strange, unidentifiable voice in your head... [span_purple("[msg]")]")) to_chat(src, span_warning(" You said: '[msg]' to [M].")) else diff --git a/code/modules/mob/dead/observer/say.dm b/code/modules/mob/dead/observer/say.dm index 0f0a2efaf9..b6459fe641 100644 --- a/code/modules/mob/dead/observer/say.dm +++ b/code/modules/mob/dead/observer/say.dm @@ -4,7 +4,7 @@ if(!message) return - log_ghostsay(message, src) + log_talk("(GHOST SAY) [message]", LOG_SAY) if (client) if(message) @@ -20,7 +20,7 @@ if(!message) return - log_ghostemote(message, src) + log_message("(GHOST EMOTE) [message]", LOG_EMOTE) if(client) if(message) diff --git a/code/modules/mob/emote.dm b/code/modules/mob/emote.dm index 4595ec5c20..96c298eb89 100644 --- a/code/modules/mob/emote.dm +++ b/code/modules/mob/emote.dm @@ -30,7 +30,7 @@ input = encode_html_emphasis(input) if(input) - log_ghostemote(input, src) + log_message("(GHOST EMOTE) [input]", LOG_EMOTE) if(!invisibility) //If the ghost is made visible by admins or cult. And to see if the ghost has toggled its own visibility, as well. -Mech visible_message(span_deadsay(span_bold("[src]") + " [input]")) else diff --git a/code/modules/mob/language/generic.dm b/code/modules/mob/language/generic.dm index f2171bbcb2..f05da2c101 100644 --- a/code/modules/mob/language/generic.dm +++ b/code/modules/mob/language/generic.dm @@ -144,7 +144,7 @@ // But in practice, it's just a way for a language to override all other languages and bypass hear_say // which is exactly what sign language does. /datum/language/sign/broadcast(var/mob/living/speaker, var/message, var/speaker_mask) - log_say("(SIGN) [message]", speaker) + speaker.log_talk("(SIGN) [message]", LOG_SAY) var/verb_to_use = pick(signlang_verb) speaker.say_signlang(message, verb_to_use, verb_to_use, src) diff --git a/code/modules/mob/language/language.dm b/code/modules/mob/language/language.dm index 97ee9c75fd..8e3927e7ad 100644 --- a/code/modules/mob/language/language.dm +++ b/code/modules/mob/language/language.dm @@ -130,7 +130,7 @@ return (copytext(message, length(message)) == "!") ? 2 : 1 /datum/language/proc/broadcast(var/mob/living/speaker,var/message,var/speaker_mask) - INVOKE_ASYNC(GLOBAL_PROC, GLOBAL_PROC_REF(log_say), "(HIVE) [message]", speaker) //CHOMP EDIT - TODO: FIX ME (selis logging pr) + speaker.log_talk("(HIVE) [message]", LOG_SAY) add_verb(speaker, /mob/proc/adjust_hive_range) @@ -228,7 +228,7 @@ /mob/proc/can_speak(datum/language/speaking) //Prevents someone from speaking a null language. if(!speaking) - log_debug("[src] attempted to speak a null language.") + log_runtime("[src] attempted to speak a null language.") return 0 if(speaking == GLOB.all_languages["Noise"]) diff --git a/code/modules/mob/language/station.dm b/code/modules/mob/language/station.dm index 0a8d24d1b6..1793f5acdf 100644 --- a/code/modules/mob/language/station.dm +++ b/code/modules/mob/language/station.dm @@ -96,7 +96,7 @@ flags = WHITELISTED | SIGNLANG | NO_STUTTER //nonverbal define was not needed here, and i need to use it ~Layne /datum/language/tajsign/broadcast(var/mob/living/speaker, var/message, var/speaker_mask) - log_say("(SIGN) [message]", speaker) + speaker.log_talk("(SIGN) [message]", LOG_SAY) var/verb_to_use = pick(signlang_verb) speaker.say_signlang(message, verb_to_use, verb_to_use, src) @@ -127,8 +127,8 @@ syllables = list("qr","qrr","xuq","qil","quum","xuqm","vol","xrim","zaoo","qu-uu","qix","qoo","zix") /datum/language/skrell/get_random_name(var/gender) - var/list/first_names = file2list('strings/names/first_name_skrell.txt') - var/list/last_names = file2list('strings/names/last_name_skrell.txt') + var/list/first_names = world.file2list('strings/names/first_name_skrell.txt') + var/list/last_names = world.file2list('strings/names/last_name_skrell.txt') return "[pick(first_names)] [pick(last_names)]" /datum/language/human diff --git a/code/modules/mob/language/station_vr.dm b/code/modules/mob/language/station_vr.dm index c92407b7e3..5e8d06fb3a 100644 --- a/code/modules/mob/language/station_vr.dm +++ b/code/modules/mob/language/station_vr.dm @@ -197,7 +197,7 @@ flags = WHITELISTED /datum/language/echosong/broadcast(var/mob/living/speaker, var/message, var/speaker_mask) - log_say("(INAUDIBLE) [message]", speaker) + speaker.log_talk("(INAUDIBLE) [message]", LOG_SAY) speaker.say_signlang(format_message(message), pick(signlang_verb), pick(signlang_verb_understood), src, 2) /datum/language/unathi diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index e9411d3863..62cf2755a9 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -983,7 +983,7 @@ else target.show_message(span_filter_say("[span_blue("You hear a voice that seems to echo around the room: [say]")]")) src.show_message(span_filter_say("[span_blue("You project your mind into [target.real_name]: [say]")]")) - log_say("(TPATH to [key_name(target)]) [say]",src) + log_talk("(TPATH to [key_name(target)]) [say]", LOG_SAY) for(var/mob/observer/dead/G in GLOB.mob_list) G.show_message(span_filter_say(span_italics("Telepathic message from " + span_bold("[src]") + " to " + span_bold("[target]") + ": [say]"))) diff --git a/code/modules/mob/living/carbon/human/human_damage.dm b/code/modules/mob/living/carbon/human/human_damage.dm index 406929560e..3ad8412e0d 100644 --- a/code/modules/mob/living/carbon/human/human_damage.dm +++ b/code/modules/mob/living/carbon/human/human_damage.dm @@ -538,7 +538,7 @@ This function restores all organs. /mob/living/carbon/human/apply_damage(var/damage = 0, var/damagetype = BRUTE, var/def_zone = null, var/blocked = 0, var/soaked = 0, var/sharp = FALSE, var/edge = FALSE, var/obj/used_weapon = null, var/projectile = FALSE) SEND_SIGNAL(src, COMSIG_MOB_APPLY_DAMAGE, damage, damagetype, def_zone, blocked, soaked, sharp, edge, used_weapon, projectile) if(GLOB.Debug2) - to_world_log("## DEBUG: human/apply_damage() was called on [src], with [damage] damage, an armor value of [blocked], and a soak value of [soaked].") + log_world("## DEBUG: human/apply_damage() was called on [src], with [damage] damage, an armor value of [blocked], and a soak value of [soaked].") var/obj/item/organ/external/organ = null if(isorgan(def_zone)) organ = def_zone @@ -621,7 +621,7 @@ This function restores all organs. damage -= soaked if(GLOB.Debug2) - to_world_log("## DEBUG: [src] was hit for [damage].") + log_world("## DEBUG: [src] was hit for [damage].") switch(damagetype) if(BRUTE) diff --git a/code/modules/mob/living/carbon/human/human_powers.dm b/code/modules/mob/living/carbon/human/human_powers.dm index 15ceba1171..165491a783 100644 --- a/code/modules/mob/living/carbon/human/human_powers.dm +++ b/code/modules/mob/living/carbon/human/human_powers.dm @@ -104,7 +104,7 @@ to_chat(src, span_filter_notice("Not even a [src.species.name] can speak to the dead.")) return - log_say("(COMMUNE to [key_name(M)]) [text]",src) + log_talk("(COMMUNE to [key_name(M)]) [text]", LOG_SAY) to_chat(M, span_filter_say("[span_blue("Like lead slabs crashing into the ocean, alien thoughts drop into your mind: [text]")]")) if(ishuman(M)) @@ -121,7 +121,7 @@ var/msg = tgui_input_text(src, "Message:", "Psychic Whisper", "", MAX_MESSAGE_LEN) if(msg) - log_say("(PWHISPER to [key_name(M)]) [msg]", src) + log_talk("(PWHISPER to [key_name(M)]) [msg]", LOG_WHISPER) to_chat(M, span_filter_say("[span_green("You hear a strange, alien voice in your head... [msg]")]")) to_chat(src, span_filter_say("[span_green("You said: \"[msg]\" to [M]")]")) return diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index fdd2910da7..4d364b1b57 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -1077,18 +1077,15 @@ adjust_nutrition(-2) var/recovery_amt = max((body_temperature_difference / BODYTEMP_AUTORECOVERY_DIVISOR), BODYTEMP_AUTORECOVERY_MINIMUM) //to_world("Cold. Difference = [body_temperature_difference]. Recovering [recovery_amt]") -// log_debug("Cold. Difference = [body_temperature_difference]. Recovering [recovery_amt]") bodytemperature += recovery_amt else if(species.cold_level_1 <= bodytemperature && bodytemperature <= species.heat_level_1) var/recovery_amt = body_temperature_difference / BODYTEMP_AUTORECOVERY_DIVISOR //to_world("Norm. Difference = [body_temperature_difference]. Recovering [recovery_amt]") -// log_debug("Norm. Difference = [body_temperature_difference]. Recovering [recovery_amt]") bodytemperature += recovery_amt else if(bodytemperature > species.heat_level_1) //360.15 is 310.15 + 50, the temperature where you start to feel effects. //We totally need a sweat system cause it totally makes sense...~ var/recovery_amt = min((body_temperature_difference / BODYTEMP_AUTORECOVERY_DIVISOR), -BODYTEMP_AUTORECOVERY_MINIMUM) //We're dealing with negative numbers //to_world("Hot. Difference = [body_temperature_difference]. Recovering [recovery_amt]") -// log_debug("Hot. Difference = [body_temperature_difference]. Recovering [recovery_amt]") bodytemperature += recovery_amt //This proc returns a number made up of the flags for body parts which you are protected on. (such as HEAD, UPPER_TORSO, LOWER_TORSO, etc. See setup.dm for the full list) diff --git a/code/modules/mob/living/carbon/human/species/lleill/lleill_abilities.dm b/code/modules/mob/living/carbon/human/species/lleill/lleill_abilities.dm index 8a22fffffc..e37aa58831 100644 --- a/code/modules/mob/living/carbon/human/species/lleill/lleill_abilities.dm +++ b/code/modules/mob/living/carbon/human/species/lleill/lleill_abilities.dm @@ -441,18 +441,14 @@ return var/mob/living/M = src - log_debug("polymorph start") if(!istype(M)) - log_debug("polymorph istype") return if(M.stat) //We can let it undo the TF, because the person will be dead, but otherwise things get weird. - log_debug("polymorph stat") to_chat(src, span_warning("You can't do that in your condition.")) return if(M.health <= 10) //We can let it undo the TF, because the person will be dead, but otherwise things get weird. - log_debug("polymorph injured") to_chat(src, span_warning("You are too injured to transform into a beast.")) return @@ -467,15 +463,12 @@ spawn(10) src.overlays -= coolanimation - log_debug("polymorph not dead") var/mob/living/new_mob = spawn_beast_mob(beast_options[chosen_beast]) new_mob.faction = M.faction if(new_mob && isliving(new_mob)) species.lleill_energy -= energy_cost - log_debug("polymorph new_mob") for(var/obj/belly/B as anything in new_mob.vore_organs) - log_debug("polymorph new_mob belly") new_mob.vore_organs -= B qdel(B) new_mob.vore_organs = list() @@ -489,18 +482,14 @@ M.copy_vore_prefs_to_mob(new_mob) new_mob.vore_selected = M.vore_selected if(ishuman(M)) - log_debug("polymorph ishuman part2") var/mob/living/carbon/human/H = M if(ishuman(new_mob)) - log_debug("polymorph ishuman(newmob)") var/mob/living/carbon/human/N = new_mob N.gender = H.gender N.identifying_gender = H.identifying_gender else - log_debug("polymorph gender else") new_mob.gender = H.gender else - log_debug("polymorph gender else 2") new_mob.gender = M.gender if(ishuman(new_mob)) var/mob/living/carbon/human/N = new_mob @@ -528,13 +517,9 @@ /mob/living/carbon/human/proc/spawn_beast_mob(var/chosen_beast) - log_debug("polymorph proc spawn mob") var/tf_type = chosen_beast - log_debug("polymorph [tf_type]") if(!ispath(tf_type)) - log_debug("polymorph tf_type fail") return - log_debug("polymorph tf_type pass") var/new_mob = new tf_type(src.loc) return new_mob @@ -650,18 +635,14 @@ return var/mob/living/M = src - log_debug("polymorph start") if(!istype(M)) - log_debug("polymorph istype") return if(M.stat) //We can let it undo the TF, because the person will be dead, but otherwise things get weird. - log_debug("polymorph stat") to_chat(src, span_warning("You can't do that in your condition.")) return if(M.health <= 10) //We can let it undo the TF, because the person will be dead, but otherwise things get weird. - log_debug("polymorph injured") to_chat(src, span_warning("You are too injured to transform into a beast.")) return @@ -676,15 +657,12 @@ spawn(10) src.overlays -= coolanimation - log_debug("polymorph not dead") var/mob/living/simple_mob/new_mob = spawn_beast_mob(beast_options[chosen_beast]) new_mob.faction = M.faction if(new_mob && isliving(new_mob)) species.lleill_energy -= energy_cost - log_debug("polymorph new_mob") for(var/obj/belly/B as anything in new_mob.vore_organs) - log_debug("polymorph new_mob belly") new_mob.vore_organs -= B qdel(B) new_mob.vore_organs = list() @@ -701,18 +679,14 @@ M.copy_vore_prefs_to_mob(new_mob) new_mob.vore_selected = M.vore_selected if(ishuman(M)) - log_debug("polymorph ishuman part2") var/mob/living/carbon/human/H = M if(ishuman(new_mob)) - log_debug("polymorph ishuman(newmob)") var/mob/living/carbon/human/N = new_mob N.gender = H.gender N.identifying_gender = H.identifying_gender else - log_debug("polymorph gender else") new_mob.gender = H.gender else - log_debug("polymorph gender else 2") new_mob.gender = M.gender if(ishuman(new_mob)) var/mob/living/carbon/human/N = new_mob diff --git a/code/modules/mob/living/carbon/human/species/species.dm b/code/modules/mob/living/carbon/human/species/species.dm index 8fe9aad65f..97865fd296 100644 --- a/code/modules/mob/living/carbon/human/species/species.dm +++ b/code/modules/mob/living/carbon/human/species/species.dm @@ -490,7 +490,7 @@ var/organ_type = has_organ[organ_tag] var/obj/item/organ/O = new organ_type(H,1) if(organ_tag != O.organ_tag) - warning("[O.type] has a default organ tag \"[O.organ_tag]\" that differs from the species' organ tag \"[organ_tag]\". Updating organ_tag to match.") + WARNING("[O.type] has a default organ tag \"[O.organ_tag]\" that differs from the species' organ tag \"[organ_tag]\". Updating organ_tag to match.") O.organ_tag = organ_tag H.internal_organs_by_name[organ_tag] = O diff --git a/code/modules/mob/living/carbon/human/species/station/prommie_blob.dm b/code/modules/mob/living/carbon/human/species/station/prommie_blob.dm index 139748df58..1720651b73 100644 --- a/code/modules/mob/living/carbon/human/species/station/prommie_blob.dm +++ b/code/modules/mob/living/carbon/human/species/station/prommie_blob.dm @@ -97,7 +97,7 @@ update_icon() if(!humanform) // If we somehow have a blob with no human, lets just clean up. - log_debug("Cleaning up blob with no prommie!") + log_runtime("Cleaning up blob with no prommie!") qdel(src) return diff --git a/code/modules/mob/living/carbon/human/species/station/traits/positive.dm b/code/modules/mob/living/carbon/human/species/station/traits/positive.dm index 8a17d13b23..7259132f24 100644 --- a/code/modules/mob/living/carbon/human/species/station/traits/positive.dm +++ b/code/modules/mob/living/carbon/human/species/station/traits/positive.dm @@ -143,13 +143,13 @@ /datum/trait/positive/melee_attack name = "Special Attack: Sharp Melee" // Trait Organization for easier browsing. TODO: Proper categorization of 'health/ability/resist/etc' - desc = "Provides sharp melee attacks that do slightly more damage." + desc = "Provides sharp melee attacks which can inflict bleeding." cost = 1 var_changes = list("unarmed_types" = list(/datum/unarmed_attack/stomp, /datum/unarmed_attack/kick, /datum/unarmed_attack/claws, /datum/unarmed_attack/bite/sharp)) /datum/trait/positive/melee_attack_fangs name = "Special Attack: Sharp Melee & Numbing Fangs" // Trait Organization for easier browsing. TODO: Proper categorization of 'health/ability/resist/etc' - desc = "Provides sharp melee attacks that do slightly more damage, along with fangs that makes the person bit unable to feel their body or pain." + desc = "Provides sharp melee attacks which can inflict bleeding, along with fangs that makes the person bit unable to feel their body or pain." cost = 2 var_changes = list("unarmed_types" = list(/datum/unarmed_attack/stomp, /datum/unarmed_attack/kick, /datum/unarmed_attack/claws, /datum/unarmed_attack/bite/sharp, /datum/unarmed_attack/bite/sharp/numbing)) diff --git a/code/modules/mob/living/damage_procs.dm b/code/modules/mob/living/damage_procs.dm index 3dc4dc9f64..c6ade8d909 100644 --- a/code/modules/mob/living/damage_procs.dm +++ b/code/modules/mob/living/damage_procs.dm @@ -11,7 +11,7 @@ /mob/living/proc/apply_damage(var/damage = 0, var/damagetype = BRUTE, var/def_zone = null, var/blocked = 0, var/soaked = 0, var/sharp = FALSE, var/edge = FALSE, var/obj/used_weapon = null, var/projectile = 0) SEND_SIGNAL(src, COMSIG_MOB_APPLY_DAMAGE, damage, damagetype, def_zone, blocked, soaked, sharp, edge, used_weapon, projectile) if(GLOB.Debug2) - to_world_log("## DEBUG: apply_damage() was called on [src], with [damage] damage, and an armor value of [blocked].") + log_world("## DEBUG: apply_damage() was called on [src], with [damage] damage, and an armor value of [blocked].") if(!damage || (blocked >= 100)) return 0 for(var/datum/modifier/M in modifiers) //MODIFIER STUFF. It's best to do this RIGHT before armor is calculated, so it's done here! This is the 'forcefield' defence. @@ -144,7 +144,7 @@ /mob/living/proc/apply_effect(var/effect = 0,var/effecttype = STUN, var/blocked = 0, var/check_protection = 1) if(GLOB.Debug2) - to_world_log("## DEBUG: apply_effect() was called. The type of effect is [effecttype]. Blocked by [blocked].") + log_world("## DEBUG: apply_effect() was called. The type of effect is [effecttype]. Blocked by [blocked].") if(!effect || (blocked >= 100)) return 0 blocked = (100-blocked)/100 diff --git a/code/modules/mob/living/living_defense.dm b/code/modules/mob/living/living_defense.dm index 3fb31cb608..7617cfc70f 100644 --- a/code/modules/mob/living/living_defense.dm +++ b/code/modules/mob/living/living_defense.dm @@ -13,7 +13,7 @@ */ /mob/living/proc/run_armor_check(var/def_zone = null, var/attack_flag = "melee", var/armour_pen = 0, var/absorb_text = null, var/soften_text = null) if(GLOB.Debug2) - to_world_log("## DEBUG: getarmor() was called.") + log_world("## DEBUG: getarmor() was called.") if(armour_pen >= 100) return 0 //might as well just skip the processing @@ -23,7 +23,7 @@ var/armor_variance_range = round(armor * 0.25) //Armor's effectiveness has a +25%/-25% variance. var/armor_variance = rand(-armor_variance_range, armor_variance_range) //Get a random number between -25% and +25% of the armor's base value if(GLOB.Debug2) - to_world_log("## DEBUG: The range of armor variance is [armor_variance_range]. The variance picked by RNG is [armor_variance].") + log_world("## DEBUG: The range of armor variance is [armor_variance_range]. The variance picked by RNG is [armor_variance].") armor = min(armor + armor_variance, 100) //Now we calcuate damage using the new armor percentage. armor = max(armor - armour_pen, 0) //Armor pen makes armor less effective. @@ -39,7 +39,7 @@ else to_chat(src, span_danger("Your armor softens the blow!")) if(GLOB.Debug2) - to_world_log("## DEBUG: Armor when [src] was attacked was [armor].") + log_world("## DEBUG: Armor when [src] was attacked was [armor].") return armor /* diff --git a/code/modules/mob/living/say.dm b/code/modules/mob/living/say.dm index fccbc8791d..c76853cbc1 100644 --- a/code/modules/mob/living/say.dm +++ b/code/modules/mob/living/say.dm @@ -424,12 +424,12 @@ var/list/channel_to_radio_key = list() blooploop(message, extrarange = -6, volume = 25, sound_preference = /datum/preference/toggle/whisper_sounds) // playsound(T, pick(voice_sounds_list), 25, TRUE, extrarange = -6, falloff = 1 , is_global = TRUE, frequency = voice_freq, ignore_walls = TRUE, preference = /datum/preference/toggle/whisper_sounds) //CHOMPEdit - ignore_walls = TRUE - INVOKE_ASYNC(GLOBAL_PROC, GLOBAL_PROC_REF(log_whisper), message, src) //CHOMP EDIT - TODO: FIX ME (selis logging pr) + log_talk(message, LOG_WHISPER) else if(do_sound && message) blooploop(message, volume = 75) // playsound(T, pick(voice_sounds_list), 75, TRUE, falloff = 1 , is_global = TRUE, frequency = voice_freq, ignore_walls = TRUE, preference = /datum/preference/toggle/say_sounds) //CHOMPEdit - ignore_walls = TRUE - INVOKE_ASYNC(GLOBAL_PROC, GLOBAL_PROC_REF(log_say), message, src) //CHOMP EDIT - TODO: FIX ME (selis logging pr) + log_talk(message, LOG_SAY) return 1 /*************************************************************************/ diff --git a/code/modules/mob/living/silicon/ai/malf.dm b/code/modules/mob/living/silicon/ai/malf.dm index f5310a4883..4f8baf250d 100644 --- a/code/modules/mob/living/silicon/ai/malf.dm +++ b/code/modules/mob/living/silicon/ai/malf.dm @@ -43,7 +43,7 @@ if(!research) if(!errored) errored = 1 - error("malf_process() called on AI without research datum. Report this.") + log_world("## ERROR malf_process() called on AI without research datum. Report this.") message_admins("ERROR: malf_process() called on AI without research datum. If admin modified one of the AI's vars revert the change and don't modify variables directly, instead use ProcCall or admin panels.") spawn(1200) errored = 0 diff --git a/code/modules/mob/living/silicon/pai/pai_vr.dm b/code/modules/mob/living/silicon/pai/pai_vr.dm index efe5d01ded..126836f10c 100644 --- a/code/modules/mob/living/silicon/pai/pai_vr.dm +++ b/code/modules/mob/living/silicon/pai/pai_vr.dm @@ -458,7 +458,7 @@ return card.screen_msg = message var/logmsg = "(CARD SCREEN)[message]" - log_say(logmsg,src) + log_talk(logmsg, LOG_SAY) to_chat(src, span_filter_say(span_cult("You print a message to your screen, \"[message]\""))) if(isliving(card.loc)) var/mob/living/L = card.loc diff --git a/code/modules/mob/living/silicon/pai/software.dm b/code/modules/mob/living/silicon/pai/software.dm index 027ba4bd67..67fdc68969 100644 --- a/code/modules/mob/living/silicon/pai/software.dm +++ b/code/modules/mob/living/silicon/pai/software.dm @@ -26,7 +26,7 @@ GLOBAL_LIST_EMPTY(default_pai_software) var/datum/pai_software/P = new type() if(GLOB.pai_software_by_key[P.id]) var/datum/pai_software/O = GLOB.pai_software_by_key[P.id] - to_world(span_warning("pAI software module [P.name] has the same key as [O.name]!")) + to_chat(world, span_warning("pAI software module [P.name] has the same key as [O.name]!")) r = 0 continue GLOB.pai_software_by_key[P.id] = P diff --git a/code/modules/mob/living/silicon/say.dm b/code/modules/mob/living/silicon/say.dm index f555887554..6eb82fe00e 100644 --- a/code/modules/mob/living/silicon/say.dm +++ b/code/modules/mob/living/silicon/say.dm @@ -57,7 +57,7 @@ //For holopads only. Usable by AI. /mob/living/silicon/ai/proc/holopad_talk(list/message_pieces, verb) - log_say("(HPAD) [multilingual_to_message(message_pieces)]",src) + log_talk("(HPAD) [multilingual_to_message(message_pieces)]", LOG_SAY) var/obj/machinery/hologram/holopad/T = src.holo if(T && T.masters[src])//If there is a hologram and its master is the user. @@ -108,7 +108,7 @@ if(O) O.see_emote(src, message) - log_emote("(HPAD) [message]", src) + log_message("(HPAD) [message]", LOG_EMOTE) else //This shouldn't occur, but better safe then sorry. to_chat(src, span_filter_notice("No holopad connected.")) diff --git a/code/modules/mob/living/simple_mob/subtypes/animal/alien animals/stardog.dm b/code/modules/mob/living/simple_mob/subtypes/animal/alien animals/stardog.dm index 040900e723..e517c4d55e 100644 --- a/code/modules/mob/living/simple_mob/subtypes/animal/alien animals/stardog.dm +++ b/code/modules/mob/living/simple_mob/subtypes/animal/alien animals/stardog.dm @@ -491,7 +491,7 @@ var/mob/living/simple_mob/vore/overmap/stardog/m = s.parent - log_subtle(message,L) + L.log_message("(SUBTLE) [message]", LOG_EMOTE) message = span_emote_subtle(span_bold("[L]") + " " + span_italics("[message]")) message = span_bold("(From the back of \the [m]) ") + message message = encode_html_emphasis(message) @@ -707,7 +707,7 @@ if(!spawnstuff) return if(!valid_flora.len) - to_world_log("[src] does not have a set valid flora list!") + log_mapping("[src] does not have a set valid flora list!") return TRUE var/obj/F @@ -723,7 +723,7 @@ if(!spawnstuff) return if(!valid_mobs.len) - to_world_log("[src] does not have a set valid mobs list!") + log_mapping("[src] does not have a set valid mobs list!") return TRUE var/mob/M @@ -750,7 +750,7 @@ if(!spawnstuff) return if(!valid_mobs.len) - to_world_log("[src] does not have a set valid mobs list!") + log_mapping("[src] does not have a set valid mobs list!") return if(!prob(mob_chance)) @@ -769,7 +769,7 @@ if(!spawnstuff) return if(!valid_flora.len) - to_world_log("[src] does not have a set valid flora list!") + log_mapping("[src] does not have a set valid flora list!") return var/obj/F @@ -787,7 +787,7 @@ if(treasure_chance <= 0) return if(!valid_treasure.len) - to_world_log("[src] does not have a set valid treasure list!") + log_mapping("[src] does not have a set valid treasure list!") return var/obj/F @@ -1156,7 +1156,7 @@ to_chat(L, span_warning("You can't do that here.")) return - log_subtle(message,L) + L.log_message("(SUBTLE) [message]", LOG_EMOTE) message = span_emote_subtle(span_bold("[L]") + " " + span_italics("[message]")) message = span_bold("(From within \the [s]) ") + message message = encode_html_emphasis(message) diff --git a/code/modules/mob/living/simple_mob/subtypes/animal/borer/borer_captive.dm b/code/modules/mob/living/simple_mob/subtypes/animal/borer/borer_captive.dm index 8304af1742..ca5feabcfa 100644 --- a/code/modules/mob/living/simple_mob/subtypes/animal/borer/borer_captive.dm +++ b/code/modules/mob/living/simple_mob/subtypes/animal/borer/borer_captive.dm @@ -17,7 +17,7 @@ message = sanitize(message) if (!message) return - log_say(message,src) + log_talk(message, LOG_SAY) if (stat == 2) return say_dead(message) diff --git a/code/modules/mob/living/simple_mob/subtypes/glamour/ddraig.dm b/code/modules/mob/living/simple_mob/subtypes/glamour/ddraig.dm index 56eb4caad9..db08ab0eda 100644 --- a/code/modules/mob/living/simple_mob/subtypes/glamour/ddraig.dm +++ b/code/modules/mob/living/simple_mob/subtypes/glamour/ddraig.dm @@ -447,18 +447,14 @@ var/mob/living/M = src - log_debug("polymorph start") if(!istype(M)) - log_debug("polymorph istype") return if(M.stat) //We can let it undo the TF, because the person will be dead, but otherwise things get weird. - log_debug("polymorph stat") to_chat(src, span_warning("You can't do that in your condition.")) return if(M.health <= 10) //We can let it undo the TF, because the person will be dead, but otherwise things get weird. - log_debug("polymorph injured") to_chat(src, span_warning("You are too injured to transform into a beast.")) return @@ -473,14 +469,11 @@ spawn(10) src.overlays -= coolanimation - log_debug("polymorph not dead") var/mob/living/new_mob = spawn_polymorph_mob(beast_options[chosen_beast]) new_mob.faction = M.faction if(new_mob && isliving(new_mob)) - log_debug("polymorph new_mob") for(var/obj/belly/B as anything in new_mob.vore_organs) - log_debug("polymorph new_mob belly") new_mob.vore_organs -= B qdel(B) new_mob.vore_organs = list() @@ -493,18 +486,14 @@ M.copy_vore_prefs_to_mob(new_mob) new_mob.vore_selected = M.vore_selected if(ishuman(M)) - log_debug("polymorph ishuman part2") var/mob/living/carbon/human/H = M if(ishuman(new_mob)) - log_debug("polymorph ishuman(newmob)") var/mob/living/carbon/human/N = new_mob N.gender = H.gender N.identifying_gender = H.identifying_gender else - log_debug("polymorph gender else") new_mob.gender = H.gender else - log_debug("polymorph gender else 2") new_mob.gender = M.gender if(ishuman(new_mob)) var/mob/living/carbon/human/N = new_mob @@ -530,13 +519,9 @@ new_mob.visible_message("\The [src] has transformed into \the [chosen_beast]!") /mob/living/proc/spawn_polymorph_mob(var/chosen_beast) - log_debug("polymorph proc spawn mob") var/tf_type = chosen_beast - log_debug("polymorph [tf_type]") if(!ispath(tf_type)) - log_debug("polymorph tf_type fail") return - log_debug("polymorph tf_type pass") var/new_mob = new tf_type(get_turf(src)) return new_mob diff --git a/code/modules/mob/login.dm b/code/modules/mob/login.dm index 338e7ae6cd..33d354f4fc 100644 --- a/code/modules/mob/login.dm +++ b/code/modules/mob/login.dm @@ -1,9 +1,6 @@ //handles setting lastKnownIP and computer_id for use by the ban systems as well as checking for multikeying /mob/proc/update_Login_details() //Multikey checks and logging - lastKnownIP = client.address - computer_id = client.computer_id - log_access_in(client) if(CONFIG_GET(flag/log_access)) for(var/mob/M in GLOB.player_list) if(M == src) continue @@ -25,15 +22,21 @@ if(matches) if(M.client) message_admins("[span_red(span_bold("Notice:"))] [span_blue("[key_name_admin(src)] has the same [matches] as [key_name_admin(M)].")]", 1) - log_adminwarn("Notice: [key_name(src)] has the same [matches] as [key_name(M)].") + log_admin_private("Notice: [key_name(src)] has the same [matches] as [key_name(M)].") else message_admins("[span_red(span_bold("Notice:"))] [span_blue("[key_name_admin(src)] has the same [matches] as [key_name_admin(M)] (no longer logged in). ")]", 1) - log_adminwarn("Notice: [key_name(src)] has the same [matches] as [key_name(M)] (no longer logged in).") + log_admin_private("Notice: [key_name(src)] has the same [matches] as [key_name(M)] (no longer logged in).") /mob/Login() - persistent_ckey = client.ckey + if(!client) + return FALSE + + client.persistent_client.set_mob(src) GLOB.player_list |= src + lastKnownIP = client.address + computer_id = client.computer_id + log_access("Mob Login: [key_name(src)] was assigned to a [type] ([tag])") update_Login_details() world.update_status() @@ -88,9 +91,18 @@ if(cloaked && cloaked_selfimage) client.images += cloaked_selfimage - client.init_verbs() + + if(client) + for(var/datum/action/A as anything in persistent_client.player_actions) + A.Grant(src) + + for(var/datum/callback/CB as anything in persistent_client.post_login_callbacks) + CB.Invoke() + + log_mob_tag("TAG: [tag] NEW OWNER: [key_name(src)]") SEND_SIGNAL(src, COMSIG_MOB_CLIENT_LOGIN, client) SEND_SIGNAL(client, COMSIG_CLIENT_MOB_LOGIN, src) + client.init_verbs() set_listening(LISTENING_PLAYER) GLOB.tickets.ClientLogin(client, TRUE) diff --git a/code/modules/mob/logout.dm b/code/modules/mob/logout.dm index 1f7e49f67f..7258c703f0 100644 --- a/code/modules/mob/logout.dm +++ b/code/modules/mob/logout.dm @@ -4,7 +4,7 @@ GLOB.player_list -= src disconnect_time = world.realtime //VOREStation Addition: logging when we disappear. update_client_z(null) - log_access_out(src) + log_access("Mob Logout: [key_name(src)]") unset_machine() var/datum/admins/is_admin = GLOB.admin_datums[src.ckey] diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index bd736224e6..741b425285 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -1,4 +1,9 @@ /mob/Destroy()//This makes sure that mobs withGLOB.clients/keys are not just deleted from the game. + if(client) + stack_trace("Mob with client has been deleted.") + + persistent_client?.set_mob(null) + SSmobs.currentrun -= src GLOB.mob_list -= src GLOB.dead_mob_list -= src @@ -79,6 +84,7 @@ set_focus(src) // VOREStation Add - Key Handling update_transform() // Some mobs may start bigger or smaller than normal. . = ..() + log_mob_tag("TAG: [tag] CREATED: [key_name(src)] \[[type]\]") //return QDEL_HINT_HARDDEL_NOW Just keep track of mob references. They delete SO much faster now. /mob/show_message(msg, type, alt, alt_type) diff --git a/code/modules/mob/mob_defines.dm b/code/modules/mob/mob_defines.dm index ee4c826ef2..fb9224e8d0 100644 --- a/code/modules/mob/mob_defines.dm +++ b/code/modules/mob/mob_defines.dm @@ -1,3 +1,11 @@ +/** + * The mob, usually meant to be a creature of some type + * + * Has a client attached that is a living person (most of the time), although I have to admit + * sometimes it's hard to tell they're sentient + * + * Has a lot of the creature game world logic, such as health etc + */ /mob density = TRUE layer = MOB_LAYER @@ -6,6 +14,10 @@ blocks_emissive = EMISSIVE_BLOCK_GENERIC ///when this be added to vis_contents of something it inherit something.plane, important for visualisation of mob in openspace. vis_flags = VIS_INHERIT_PLANE + + /// It's like a client, but persists! Persistent clients will stick to a mob until the client in question is logged into a different mob. + var/datum/persistent_client/persistent_client + var/datum/mind/mind var/stat = 0 //Whether a mob is alive or dead. TODO: Move this to living - Nodrak @@ -51,7 +63,10 @@ var/use_me = 1 //Allows all mobs to use the me verb by default, will have to manually specify they cannot var/damageoverlaytemp = 0 + var/computer_id = null + var/list/logging = list() + var/already_placed = 0.0 var/obj/machinery/machine = null var/other_mobs = null @@ -251,6 +266,3 @@ var/custom_footstep = FOOTSTEP_MOB_SHOE VAR_PRIVATE/is_motion_tracking = FALSE // Prevent multiple unsubs and resubs, also used to check if the vis layer is enabled, use has_motiontracking() to get externally. VAR_PRIVATE/wants_to_see_motion_echos = TRUE - - /// a ckey that persists client logout / ghosting, replaced when a client inhabits the mob - var/persistent_ckey diff --git a/code/modules/mob/mob_movement.dm b/code/modules/mob/mob_movement.dm index 599f5fb60e..ca0863db45 100644 --- a/code/modules/mob/mob_movement.dm +++ b/code/modules/mob/mob_movement.dm @@ -173,7 +173,7 @@ // We're in the middle of another move we've already decided to do if(moving) - log_debug("Client [src] attempted to move while moving=[moving]") + // to_chat(world, "Client [src] attempted to move while moving=[moving]") return 0 // We're still cooling down from the last move diff --git a/code/modules/mob/new_player/lobby_browser.dm b/code/modules/mob/new_player/lobby_browser.dm index ef992fae4d..8a3996f4e2 100644 --- a/code/modules/mob/new_player/lobby_browser.dm +++ b/code/modules/mob/new_player/lobby_browser.dm @@ -146,7 +146,7 @@ handle_server_news() return TRUE if("give_feedback") - if(!SSsqlite.can_submit_feedback(GLOB.directory[persistent_ckey])) + if(!SSsqlite.can_submit_feedback(persistent_client.client)) return if(client.feedback_form) diff --git a/code/modules/mob/new_player/login.dm b/code/modules/mob/new_player/login.dm index 66b1956b8d..f3fc3e0a3d 100644 --- a/code/modules/mob/new_player/login.dm +++ b/code/modules/mob/new_player/login.dm @@ -11,9 +11,6 @@ mind.active = 1 mind.current = src - if(client) - persistent_ckey = client.ckey - loc = null sight |= SEE_TURFS @@ -21,6 +18,7 @@ GLOB.new_player_list += src created_for = ckey + client.persistent_client.set_mob(src) addtimer(CALLBACK(src, PROC_REF(do_after_login)), 4 SECONDS, TIMER_DELETE_ME) initialize_lobby_screen() diff --git a/code/modules/mob/new_player/logout.dm b/code/modules/mob/new_player/logout.dm index d9443e8744..0b1c17ced8 100644 --- a/code/modules/mob/new_player/logout.dm +++ b/code/modules/mob/new_player/logout.dm @@ -17,6 +17,6 @@ return /mob/new_player/proc/disable_lobby_browser() - var/client/exiting_client = GLOB.directory[persistent_ckey] + var/client/exiting_client = persistent_client.client if(exiting_client) winset(exiting_client, "lobby_browser", "is-disabled=true;is-visible=false") diff --git a/code/modules/mob/new_player/new_player_vr.dm b/code/modules/mob/new_player/new_player_vr.dm index f5ea2b9b8a..efffbbae3c 100644 --- a/code/modules/mob/new_player/new_player_vr.dm +++ b/code/modules/mob/new_player/new_player_vr.dm @@ -3,7 +3,7 @@ var/datum/job/J = SSjob.get_job(rank) if(!J) - log_debug("Couldn't find job: [rank] for spawn_checks_vr, panic-returning that it's fine to spawn.") + NOTICE("Couldn't find job: [rank] for spawn_checks_vr, panic-returning that it's fine to spawn.") return TRUE //No Flavor Text diff --git a/code/modules/mob/say_vr.dm b/code/modules/mob/say_vr.dm index 6155c046cd..89b674706b 100644 --- a/code/modules/mob/say_vr.dm +++ b/code/modules/mob/say_vr.dm @@ -74,7 +74,7 @@ input = message if(input) - log_subtle(message,src) + src.log_message("(SUBTLE) [message]", LOG_EMOTE) message = span_emote_subtle(span_bold("[src]") + " " + span_italics("[input]")) if(src.absorbed && isbelly(src.loc)) var/obj/belly/B = src.loc @@ -366,7 +366,7 @@ G.client?.prefs?.read_preference(/datum/preference/toggle/ghost_see_whisubtle)) if(client?.prefs?.read_preference(/datum/preference/toggle/whisubtle_vis) || check_rights_for(G.client, R_HOLDER)) to_chat(G, span_psay("[formatted_name] thinks, \"[message]\"")) - log_say(message,M) + M.log_talk("(PSAY) [message]", LOG_SAY) else //There wasn't anyone to send the message to, pred or prey, so let's just say it instead and correct our psay just in case. M.forced_psay = FALSE M.say(message) @@ -480,7 +480,7 @@ G.client?.prefs?.read_preference(/datum/preference/toggle/ghost_see_whisubtle)) if(client?.prefs?.read_preference(/datum/preference/toggle/whisubtle_vis) || check_rights_for(G.client, R_HOLDER)) to_chat(G, span_pemote("[formatted_name] [message]")) - log_say(message,M) + M.log_talk(message, LOG_SAY) else //There wasn't anyone to send the message to, pred or prey, so let's just emote it instead and correct our psay just in case. M.forced_psay = FALSE M.me_verb(message) @@ -527,7 +527,7 @@ if(M.stat == UNCONSCIOUS || M.sleeping > 0) continue to_chat(M, span_filter_say("[isobserver(M) ? "[message] ([ghost_follow_link(src, M)])" : message]")) - log_emote(message, src) + log_message(message, LOG_EMOTE) /mob/verb/select_speech_bubble() set name = "Select Speech Bubble" diff --git a/code/modules/multiz/stairs.dm b/code/modules/multiz/stairs.dm index 45dee7223d..6b6904d7f9 100644 --- a/code/modules/multiz/stairs.dm +++ b/code/modules/multiz/stairs.dm @@ -74,7 +74,7 @@ /obj/structure/stairs/bottom/Initialize(mapload) . = ..() if(!GetAbove(src)) - warning("Stair created without level above: ([loc.x], [loc.y], [loc.z])") + WARNING("Stair created without level above: ([loc.x], [loc.y], [loc.z])") return INITIALIZE_HINT_QDEL /obj/structure/stairs/bottom/Destroy() @@ -247,7 +247,7 @@ /obj/structure/stairs/middle/Initialize(mapload) . = ..() if(!GetAbove(src)) - warning("Stair created without level above: ([loc.x], [loc.y], [loc.z])") + WARNING("Stair created without level above: ([loc.x], [loc.y], [loc.z])") return INITIALIZE_HINT_QDEL AddElement(/datum/element/climbable) @@ -330,7 +330,7 @@ /obj/structure/stairs/top/Initialize(mapload) . = ..() if(!GetBelow(src)) - warning("Stair created without level below: ([loc.x], [loc.y], [loc.z])") + WARNING("Stair created without level below: ([loc.x], [loc.y], [loc.z])") return INITIALIZE_HINT_QDEL /obj/structure/stairs/top/Destroy() @@ -504,10 +504,10 @@ var/turf/T2 = GetAbove(B2) if(!istype(B1) || !istype(B2)) - warning("Stair created at invalid loc: ([loc.x], [loc.y], [loc.z])") + WARNING("Stair created at invalid loc: ([loc.x], [loc.y], [loc.z])") return INITIALIZE_HINT_QDEL if(!istype(T1) || !istype(T2)) - warning("Stair created without level above: ([loc.x], [loc.y], [loc.z])") + WARNING("Stair created without level above: ([loc.x], [loc.y], [loc.z])") return INITIALIZE_HINT_QDEL // Spawn the stairs diff --git a/code/modules/news/news_init.dm b/code/modules/news/news_init.dm index 6b0f789792..6a13a788f7 100644 --- a/code/modules/news/news_init.dm +++ b/code/modules/news/news_init.dm @@ -25,11 +25,11 @@ GLOBAL_DATUM_INIT(news_data, /datum/lore/news, new) /datum/lore/news/proc/fill_codex_news() if(!news_network) - log_debug("Load: Could not find newscaster network.") + log_runtime("Load: Could not find newscaster network.") return if(!station_newspaper) - log_debug("Load: Could not find news channel Vir News Network to populate news articles.") + log_runtime("Load: Could not find news channel Vir News Network to populate news articles.") return //Feed the Lore Codex into the News Machine diff --git a/code/modules/nifsoft/software/13_soulcatcher.dm b/code/modules/nifsoft/software/13_soulcatcher.dm index e78a12eba6..49fdcadcd8 100644 --- a/code/modules/nifsoft/software/13_soulcatcher.dm +++ b/code/modules/nifsoft/software/13_soulcatcher.dm @@ -107,7 +107,7 @@ type = MESSAGE_TYPE_NIF, html = span_nif(span_bold("\[[icon2html(nif.big_icon, CS.client)]NIF\]") + message)) - log_nsay(message,nif.human.real_name,sender) + sender.log_talk("NSAY (NIF:[nif.human.real_name]): [message]", LOG_SAY) /datum/nifsoft/soulcatcher/proc/emote_into(var/message, var/mob/living/sender, var/mob/eyeobj, var/whisper) var/sender_name = eyeobj ? eyeobj.name : sender.name @@ -135,7 +135,7 @@ type = MESSAGE_TYPE_NIF, html = span_nif(span_bold("\[[icon2html(nif.big_icon,CS.client)]NIF\]") + message)) - log_nme(message,nif.human.real_name,sender) + sender.log_message("NME (NIF:[nif.human.real_name]): [message]", LOG_EMOTE) /datum/nifsoft/soulcatcher/proc/show_settings(var/mob/living/carbon/human/H) set waitfor = FALSE diff --git a/code/modules/organs/blood.dm b/code/modules/organs/blood.dm index 7275513121..26c0e74c55 100644 --- a/code/modules/organs/blood.dm +++ b/code/modules/organs/blood.dm @@ -356,13 +356,13 @@ var/const/CE_STABLE_THRESHOLD = 0.5 if (!injected) return if(!our) - log_debug("[src] has no blood reagent, proceeding with fallback reinitialization.") + log_runtime("[src] has no blood reagent, proceeding with fallback reinitialization.") var/vessel_old = vessel vessel = null qdel(vessel_old) make_blood(amount) if(!vessel) - log_debug("Failed to re-initialize blood datums on [src]!") + log_runtime("Failed to re-initialize blood datums on [src]!") return if(vessel.total_volume < species.blood_volume) vessel.add_reagent(REAGENT_ID_BLOOD, species.blood_volume - vessel.total_volume) @@ -371,7 +371,7 @@ var/const/CE_STABLE_THRESHOLD = 0.5 fixblood() our = get_blood(vessel) if(!our) - log_debug("Failed to re-initialize blood datums on [src]!") + log_runtime("Failed to re-initialize blood datums on [src]!") return if(is_changeling(src)) //Changelings don't reject blood! vessel.add_reagent(REAGENT_ID_BLOOD, amount, injected.data) @@ -437,7 +437,7 @@ var/const/CE_STABLE_THRESHOLD = 0.5 //Someone fed us a weird source. Let's log it. if(source && !istype(source, /datum/reagent/blood)) - log_debug("A blood splatter was made using non-blood datum [source]!") + log_runtime("A blood splatter was made using non-blood datum [source]!") source = null //Clear the source since it's invalid. Fallback to non-source behavior. // Are we dripping or splattering? diff --git a/code/modules/organs/organ.dm b/code/modules/organs/organ.dm index ddee429bc1..16e07f1f6e 100644 --- a/code/modules/organs/organ.dm +++ b/code/modules/organs/organ.dm @@ -96,7 +96,7 @@ var/list/organ_cache = list() data.setup_from_dna(C.dna) data.setup_from_species(C.species) else - log_debug("[src] at [loc] spawned without a proper DNA.") + log_runtime("[src] at [loc] spawned without a proper DNA.") var/mob/living/carbon/human/H = C if(istype(H)) if(internal) diff --git a/code/modules/organs/subtypes/standard.dm b/code/modules/organs/subtypes/standard.dm index 81d05b54f6..e39aee2731 100644 --- a/code/modules/organs/subtypes/standard.dm +++ b/code/modules/organs/subtypes/standard.dm @@ -36,7 +36,7 @@ var/datum/robolimb/R = GLOB.all_robolimbs[model] // company should be set in parent by now if(!R) - log_error("A torso was robotize() but has no model that can be found: [model]. May affect FBPs.") + log_runtime("A torso was robotize() but has no model that can be found: [model]. May affect FBPs.") owner.synthetic = R return FALSE diff --git a/code/modules/overmap/champagne.dm b/code/modules/overmap/champagne.dm index 63067e1d10..d16636755c 100644 --- a/code/modules/overmap/champagne.dm +++ b/code/modules/overmap/champagne.dm @@ -89,7 +89,7 @@ var/obj/effect/overmap/visitable/ship/landable/champagne/newship = new(start_loc, shuttle_name, shuttle_name) // It automatically registers itself with SSshuttles - log_debug("Created new ship [newship] for shuttle [shuttle] at landmark [starting_landmark]") + log_world("Created new ship [newship] for shuttle [shuttle] at landmark [starting_landmark]") return shuttle // diff --git a/code/modules/overmap/events/event_handler.dm b/code/modules/overmap/events/event_handler.dm index 1c470bb45b..21bf7e6784 100644 --- a/code/modules/overmap/events/event_handler.dm +++ b/code/modules/overmap/events/event_handler.dm @@ -18,7 +18,7 @@ GLOBAL_DATUM_INIT(overmap_event_handler, /decl/overmap_event_handler, new) break var/overmap_event_type = pick(subtypesof(/datum/overmap_event)) var/datum/overmap_event/datum_spawn = new overmap_event_type - log_debug("Generating cloud of [datum_spawn.count] [datum_spawn] overmap event hazards") + log_game("Generating cloud of [datum_spawn.count] [datum_spawn] overmap event hazards") var/list/event_turfs = acquire_event_turfs(datum_spawn.count, datum_spawn.radius, candidate_turfs, datum_spawn.continuous) candidate_turfs -= event_turfs diff --git a/code/modules/overmap/ships/panicbutton.dm b/code/modules/overmap/ships/panicbutton.dm index 49f1670c85..6459073ad0 100644 --- a/code/modules/overmap/ships/panicbutton.dm +++ b/code/modules/overmap/ships/panicbutton.dm @@ -56,7 +56,7 @@ launched = TRUE var/obj/effect/overmap/visitable/S = get_overmap_sector(z) if(!S) - error("Distress button hit on z[z] but that's not an overmap sector...") + log_mapping("## ERROR Distress button hit on z[z] but that's not an overmap sector...") return S.distress(user) //Kind of pricey, but this is a one-time thing that can't be reused, so I'm not too worried. diff --git a/code/modules/overmap/spacetravel.dm b/code/modules/overmap/spacetravel.dm index 63671f2992..f780f4dd6c 100644 --- a/code/modules/overmap/spacetravel.dm +++ b/code/modules/overmap/spacetravel.dm @@ -155,6 +155,6 @@ if(D.pulling) D.pulling.forceMove(dest) else - log_debug("CANARY: Could not move [A] to [nx], [ny], [nz]: [dest ? "[dest]" : "null"]") //CHOMPEdit - changed to log_debug + to_chat(world, "CANARY: Could not move [A] to [nx], [ny], [nz]: [dest ? "[dest]" : "null"]") M.cleanup() diff --git a/code/modules/pda/messenger.dm b/code/modules/pda/messenger.dm index 671a6f7925..3c98adaa69 100644 --- a/code/modules/pda/messenger.dm +++ b/code/modules/pda/messenger.dm @@ -180,7 +180,7 @@ PM.receive_message(list("sent" = 0, "owner" = "[pda.owner]", "job" = "[pda.ownjob]", "message" = "[t]", "target" = "\ref[pda]"), "\ref[pda]") SStgui.update_user_uis(U, P) // Update the sending user's PDA UI so that they can see the new message - log_pda("(PDA: [src.name]) sent \"[t]\" to [P.name]", U) + U.log_message("(PDA: [src.name] | [U.real_name]) sent \"[t]\" to [P.name]", LOG_PDA) to_chat(U, "[icon2html(pda,U.client)] Sent message to [P.owner] ([P.ownjob]), \"[t]\"") else to_chat(U, span_notice("ERROR: Messaging server is not responding.")) diff --git a/code/modules/pda/pda.dm b/code/modules/pda/pda.dm index bd75f0b51c..8f5e44e99f 100644 --- a/code/modules/pda/pda.dm +++ b/code/modules/pda/pda.dm @@ -158,7 +158,7 @@ else icon = 'icons/obj/pda_old.dmi' - log_debug("Invalid switch for PDA, defaulting to old PDA icons. [pdachoice] chosen.") + log_runtime("Invalid switch for PDA, defaulting to old PDA icons. [pdachoice] chosen.") //add_overlay("pda-pen") //ChompEDIT no icon ops on New start_program(find_program(/datum/data/pda/app/main_menu)) diff --git a/code/modules/pda/utilities.dm b/code/modules/pda/utilities.dm index da901afa87..5b39a458c9 100644 --- a/code/modules/pda/utilities.dm +++ b/code/modules/pda/utilities.dm @@ -49,7 +49,7 @@ user.show_message(span_notice("Analyzing Results for [C]:")) user.show_message(span_notice(" Overall Status: [C.stat > 1 ? "dead" : "[C.health - C.halloss]% healthy"]"), 1) - user.show_message(span_notice(" Damage Specifics:") + " [(C.getOxyLoss() > 50) ? span_warning(C.getOxyLoss()) : C.getOxyLoss()]-\ + user.show_message(span_notice(" Damage Specifics:") + " [(C.getOxyLoss() > 50) ? span_warning("[C.getOxyLoss()]") : C.getOxyLoss()]-\ [(C.getToxLoss() > 50) ? span_warning("[C.getToxLoss()]") : C.getToxLoss()]-\ [(C.getFireLoss() > 50) ? span_warning("[C.getFireLoss()]") : C.getFireLoss()]-\ [(C.getBruteLoss() > 50) ? span_warning("[C.getBruteLoss()]") : C.getBruteLoss()]", 1) diff --git a/code/modules/persistence/storage/smartfridge.dm b/code/modules/persistence/storage/smartfridge.dm index af3eebd64f..62c749d4bd 100644 --- a/code/modules/persistence/storage/smartfridge.dm +++ b/code/modules/persistence/storage/smartfridge.dm @@ -58,7 +58,7 @@ for(var/obj/item/stack/material/S as anything in L) var/real_path = istext(S) ? text2path(S) : S if(!ispath(real_path, /obj/item/stack/material) || ispath(real_path, /obj/item/stack/material/cyborg)) - log_debug("Warning: Sheet_storage persistent datum tried to create [S]") + WARNING("Warning: Sheet_storage persistent datum tried to create [S]") continue // Skip entire stack if we hit the chance diff --git a/code/modules/planet/sun.dm b/code/modules/planet/sun.dm index 1f25b32603..cccd1d904d 100644 --- a/code/modules/planet/sun.dm +++ b/code/modules/planet/sun.dm @@ -37,7 +37,7 @@ /datum/sun_holder/proc/apply_to_turf(turf/T) if(sun in T.vis_contents) - warning("Was asked to add fake sun to [T.x], [T.y], [T.z] despite already having us in it's vis contents") + WARNING("Was asked to add fake sun to [T.x], [T.y], [T.z] despite already having us in it's vis contents") return sun.apply_to_turf(T) diff --git a/code/modules/planet/weather.dm b/code/modules/planet/weather.dm index f55af16140..da98e249a7 100644 --- a/code/modules/planet/weather.dm +++ b/code/modules/planet/weather.dm @@ -29,14 +29,14 @@ /datum/weather_holder/proc/apply_to_turf(turf/T) if(visuals in T.vis_contents) - warning("Was asked to add weather to [T.x], [T.y], [T.z] despite already having us in it's vis contents") + WARNING("Was asked to add weather to [T.x], [T.y], [T.z] despite already having us in it's vis contents") return T.vis_contents += visuals T.vis_contents += special_visuals /datum/weather_holder/proc/remove_from_turf(turf/T) if(!(visuals in T.vis_contents)) - warning("Was asked to remove weather from [T.x], [T.y], [T.z] despite it not having us in it's vis contents") + WARNING("Was asked to remove weather from [T.x], [T.y], [T.z] despite it not having us in it's vis contents") return T.vis_contents -= visuals T.vis_contents -= special_visuals @@ -63,7 +63,7 @@ update_wind() if(old_light_modifier && current_weather.light_modifier != old_light_modifier) // Updating the sun should be done sparingly. our_planet.update_sun() - log_debug("[our_planet.name]'s weather is now [new_weather], with a temperature of [temperature]°K ([temperature - T0C]°C | [temperature * 1.8 - 459.67]°F).") + log_game("[our_planet.name]'s weather is now [new_weather], with a temperature of [temperature]°K ([temperature - T0C]°C | [temperature * 1.8 - 459.67]°F).") /datum/weather_holder/process() if(imminent_weather && world.time >= imminent_weather_shift) @@ -125,7 +125,7 @@ var/datum/weather/W = allowed_weather_types[position] // Get the actual datum and not a string. var/new_weather = get_next_weather(W) // Get a suitable weather pattern to shift to from this one. forecast += new_weather - log_debug("[our_planet.name]'s weather forecast is now '[english_list(forecast, and_text = " then ", final_comma_text = ", ")]'.") + log_game("[our_planet.name]'s weather forecast is now '[english_list(forecast, and_text = " then ", final_comma_text = ", ")]'.") // Wipes the forecast and regenerates it. Used for when the weather is forcefully changed, such as with admin verbs. /datum/weather_holder/proc/rebuild_forecast() diff --git a/code/modules/power/apc.dm b/code/modules/power/apc.dm index 02d10e870d..535c841c18 100644 --- a/code/modules/power/apc.dm +++ b/code/modules/power/apc.dm @@ -1053,7 +1053,7 @@ GLOBAL_LIST_EMPTY(apcs) main_status = APC_EXTERNAL_POWER_GOOD if(debug) - log_debug("Status: [main_status] - Excess: [excess] - Last Equip: [lastused_equip] - Last Light: [lastused_light] - Longterm: [longtermpower]") + log_world("[src]: Status: [main_status] - Excess: [excess] - Last Equip: [lastused_equip] - Last Light: [lastused_light] - Longterm: [longtermpower]") if(cell && !shorted && !grid_check) // draw power from cell as before to power the area diff --git a/code/modules/power/fusion/core/core_field.dm b/code/modules/power/fusion/core/core_field.dm index 3eba62d988..1311b86a08 100644 --- a/code/modules/power/fusion/core/core_field.dm +++ b/code/modules/power/fusion/core/core_field.dm @@ -352,7 +352,7 @@ if(skip_obstacle) continue - log_debug("R-UST DEBUG: [AM] is [AM.type]") + // to_chat(world, "R-UST DEBUG: [AM] is [AM.type]") AM.visible_message(span_danger("The field buckles visibly around \the [AM]!")) tick_instability += rand(15,30) AM.emp_act(empsev) diff --git a/code/modules/power/singularity/containment_field.dm b/code/modules/power/singularity/containment_field.dm index ec4a573578..39b255a9fb 100644 --- a/code/modules/power/singularity/containment_field.dm +++ b/code/modules/power/singularity/containment_field.dm @@ -65,7 +65,7 @@ return var/atom/movable/AM = WF.resolve() if(isnull(AM)) - log_debug("DEBUG: HasProximity called without reference on [src].") + log_runtime("DEBUG: HasProximity called without reference on [src].") return if(!isliving(AM) || AM.is_incorporeal()) return 0 diff --git a/code/modules/power/smes.dm b/code/modules/power/smes.dm index 890b9943cc..1b9d399738 100644 --- a/code/modules/power/smes.dm +++ b/code/modules/power/smes.dm @@ -85,7 +85,7 @@ GLOBAL_LIST_EMPTY(smeses) if(!powernet) connect_to_network() if(!should_be_mapped) - warning("Non-buildable or Non-magical SMES at [src.x]X [src.y]Y [src.z]Z") + WARNING("Non-buildable or Non-magical SMES at [src.x]X [src.y]Y [src.z]Z") /obj/machinery/power/smes/buildable/Initialize(mapload) . = ..() diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm index 8d8f9b8a9e..38cb2ed85e 100644 --- a/code/modules/projectiles/gun.dm +++ b/code/modules/projectiles/gun.dm @@ -531,13 +531,7 @@ if(ticker < burst) addtimer(CALLBACK(src, PROC_REF(handle_gunfire),target, ++ticker, TRUE), burst_delay, TIMER_DELETE_ME) - var/target_for_log - if(ismob(target)) - target_for_log = target - else - target_for_log = "[target.name]" - - add_attack_logs("Unmanned",target_for_log,"Fired [src.name]") + add_attack_logs("Unmanned",target,"Fired [src.name]") //obtains the next projectile to fire @@ -581,13 +575,7 @@ "You hear a [fire_sound_text]!" ) - var/target_for_log - if(ismob(target)) - target_for_log = target - else - target_for_log = "[target.name]" - - add_attack_logs(user, target_for_log, "Fired gun '[src.name]' ([reflex ? "REFLEX" : "MANUAL"])") + add_attack_logs(user, target, "Fired gun '[src.name]' ([reflex ? "REFLEX" : "MANUAL"])") //called after successfully firing /obj/item/gun/proc/handle_post_fire(mob/user, atom/target, var/pointblank=0, var/reflex=0) diff --git a/code/modules/random_map/drop/supply.dm b/code/modules/random_map/drop/supply.dm index 2e04d38d92..3613322d54 100644 --- a/code/modules/random_map/drop/supply.dm +++ b/code/modules/random_map/drop/supply.dm @@ -29,7 +29,7 @@ var/datum/supply_drop_loot/SDL = drop_type SDL.drop(T) else - error("Unhandled drop type: [drop_type]") + log_world("## ERROR Unhandled drop type: [drop_type]") /datum/admins/proc/call_supply_drop() diff --git a/code/modules/reagents/Chemistry-Colours.dm b/code/modules/reagents/Chemistry-Colours.dm index 6b8a96062e..ef307ca703 100644 --- a/code/modules/reagents/Chemistry-Colours.dm +++ b/code/modules/reagents/Chemistry-Colours.dm @@ -12,7 +12,7 @@ if(length(hex) == 7) hex += "FF" if(length(hex) != 9) // PANIC PANIC PANIC - warning("Reagent [R.id] has an incorrect color set ([R.color])") + WARNING("Reagent [R.id] has an incorrect color set ([R.color])") hex = "#FFFFFFFF" colors[1] += hex2num(copytext(hex, 2, 4)) * R.volume * R.color_weight colors[2] += hex2num(copytext(hex, 4, 6)) * R.volume * R.color_weight diff --git a/code/modules/reagents/reactions/_reactions.dm b/code/modules/reagents/reactions/_reactions.dm index 5e0a06c028..54b6b0b42d 100644 --- a/code/modules/reagents/reactions/_reactions.dm +++ b/code/modules/reagents/reactions/_reactions.dm @@ -104,7 +104,7 @@ if(result) holder.add_reagent(result, amt_produced, data, safety = 1, was_from_belly = belly_reagent) // #ifdef UNIT_TESTS - // log_unit_test("[name] - Reagent reaction result: [result] [amt_produced]") // Uncomment for UNIT_TESTS debug assistance + // log_test("[name] - Reagent reaction result: [result] [amt_produced]") // Uncomment for UNIT_TESTS debug assistance // #endif on_reaction(holder, amt_produced) diff --git a/code/modules/reagents/reagent_containers/_reagent_containers.dm b/code/modules/reagents/reagent_containers/_reagent_containers.dm index 5ad63dd8b0..c31e88267b 100644 --- a/code/modules/reagents/reagent_containers/_reagent_containers.dm +++ b/code/modules/reagents/reagent_containers/_reagent_containers.dm @@ -31,7 +31,7 @@ total_so_far += amt reagents.add_reagent(string, amt) if(total_so_far > volume) - warning("[src]([src.type]) starts with more reagents than it has total volume") + WARNING("[src]([src.type]) starts with more reagents than it has total volume") starts_with = null // it should gc, since it's just strings and numbers /obj/item/reagent_containers/attack_self(mob/user as mob) diff --git a/code/modules/reagents/reagent_containers/spray.dm b/code/modules/reagents/reagent_containers/spray.dm index 19b61877fa..9e3576fb4d 100644 --- a/code/modules/reagents/reagent_containers/spray.dm +++ b/code/modules/reagents/reagent_containers/spray.dm @@ -44,14 +44,11 @@ user.setClickCooldown(4) if(reagents.has_reagent(REAGENT_ID_SACID)) - message_admins("[key_name_admin(user)] fired sulphuric acid from \a [src].") - log_game("[key_name(user)] fired sulphuric acid from \a [src].") + log_and_message_admins("fired sulphuric acid from \a [src].", user) if(reagents.has_reagent(REAGENT_ID_PACID)) - message_admins("[key_name_admin(user)] fired Polyacid from \a [src].") - log_game("[key_name(user)] fired Polyacid from \a [src].") + log_and_message_admins("fired Polyacid from \a [src].", user) if(reagents.has_reagent(REAGENT_ID_LUBE)) - message_admins("[key_name_admin(user)] fired Space lube from \a [src].") - log_game("[key_name(user)] fired Space lube from \a [src].") + log_and_message_admins("fired Space lube from \a [src].", user) return /obj/item/reagent_containers/spray/proc/Spray_at(atom/A as mob|obj, mob/user, proximity) diff --git a/code/modules/reagents/reagents/medicine_vr.dm b/code/modules/reagents/reagents/medicine_vr.dm index 94afefed4e..db6f3d8b71 100644 --- a/code/modules/reagents/reagents/medicine_vr.dm +++ b/code/modules/reagents/reagents/medicine_vr.dm @@ -222,17 +222,13 @@ /datum/reagent/polymorph/affect_blood(var/mob/living/carbon/target, var/removed) var/mob/living/M = target - log_debug("polymorph start") if(!istype(M)) - log_debug("polymorph istype") return if(!M.allow_spontaneous_tf) return if(M.tf_mob_holder) - log_debug("polymorph tf_holder") var/mob/living/ourmob = M.tf_mob_holder if(ourmob.ai_holder) - log_debug("polymorph ai") var/datum/ai_holder/our_AI = ourmob.ai_holder our_AI.set_stance(STANCE_IDLE) M.tf_mob_holder = null @@ -256,11 +252,8 @@ qdel(target) return else - log_debug("polymorph else") if(M.stat == DEAD) //We can let it undo the TF, because the person will be dead, but otherwise things get weird. - log_debug("polymorph dead") return - log_debug("polymorph not dead") var/mob/living/new_mob = spawn_mob(M) M.tf_into(new_mob) @@ -269,14 +262,10 @@ target.touching.clear_reagents() /datum/reagent/polymorph/proc/spawn_mob(var/mob/living/target) - log_debug("polymorph proc spawn mob") var/choice = pick(tf_possible_types) tf_type = tf_possible_types[choice] - log_debug("polymorph [tf_type]") if(!ispath(tf_type)) - log_debug("polymorph tf_type fail") return - log_debug("polymorph tf_type pass") var/new_mob = new tf_type(get_turf(target)) return new_mob diff --git a/code/modules/recycling/recycling.dm b/code/modules/recycling/recycling.dm index 91598b24d9..430a7776d3 100644 --- a/code/modules/recycling/recycling.dm +++ b/code/modules/recycling/recycling.dm @@ -210,7 +210,7 @@ if(!M) D.forceMove(get_step(src, dir)) playsound(src, 'sound/machines/buzz-sigh.ogg', 50, 0) - warning("Dust in [src] had material_name [D.material_name], which can't be made into stacks") + WARNING("Dust in [src] had material_name [D.material_name], which can't be made into stacks") return var/stacktype = M.stack_type diff --git a/code/modules/resleeving/machines.dm b/code/modules/resleeving/machines.dm index d365838252..d0a3f1ac81 100644 --- a/code/modules/resleeving/machines.dm +++ b/code/modules/resleeving/machines.dm @@ -495,7 +495,7 @@ // Vore deaths get a fake modifier labeled as such if(!occupant.mind) - log_debug("[occupant] didn't have a mind to check for vore_death, which may be problematic.") + log_runtime("[occupant] didn't have a mind to check for vore_death, which may be problematic.") if(occupant.mind) if(occupant.original_player && ckey(occupant.mind.key) != occupant.original_player) diff --git a/code/modules/rogueminer_vr/controller.dm b/code/modules/rogueminer_vr/controller.dm index 47017c7620..16062f6780 100644 --- a/code/modules/rogueminer_vr/controller.dm +++ b/code/modules/rogueminer_vr/controller.dm @@ -107,7 +107,7 @@ var/datum/controller/rogue/rm_controller //decay() //Decay removed for now, since people aren't getting high scores as it is. /datum/controller/rogue/proc/decay(var/manual = 0) - to_world_log("RM(stats): DECAY on controller from [difficulty] to [difficulty+(RM_DIFF_DECAY_AMT)] min 100.") //DEBUG code for playtest stats gathering. + log_world("RM(stats): DECAY on controller from [difficulty] to [difficulty+(RM_DIFF_DECAY_AMT)] min 100.") //DEBUG code for playtest stats gathering. adjust_difficulty(RM_DIFF_DECAY_AMT) if(!manual) //If it was called manually somehow, then don't start the timer, just decay now. @@ -118,7 +118,7 @@ var/datum/controller/rogue/rm_controller /datum/controller/rogue/proc/dbg(var/message) ASSERT(message) //I want a stack trace if there's no message if(debugging) - to_world_log("[message]") + log_world("[message]") /datum/controller/rogue/proc/adjust_difficulty(var/amt) ASSERT(amt) @@ -185,7 +185,7 @@ var/datum/controller/rogue/rm_controller ZM_target = pick(clean_zones) if(ZM_target) - to_world_log("RM(stats): SCORING [ready_zones.len] zones (if unscored).") //DEBUG code for playtest stats gathering. + log_world("RM(stats): SCORING [ready_zones.len] zones (if unscored).") //DEBUG code for playtest stats gathering. for(var/datum/rogue/zonemaster/ZM_toscore in ready_zones) //Score all the zones first. if(ZM_toscore.scored) continue ZM_toscore.score_zone() diff --git a/code/modules/rogueminer_vr/zonemaster.dm b/code/modules/rogueminer_vr/zonemaster.dm index 64b09ca05b..742128aeeb 100644 --- a/code/modules/rogueminer_vr/zonemaster.dm +++ b/code/modules/rogueminer_vr/zonemaster.dm @@ -35,7 +35,7 @@ myarea = A myshuttle_landmark = locate(/obj/effect/shuttle_landmark) in myarea if(!istype(myshuttle_landmark)) - warning("Zonemaster cannot find a shuttle landmark in its area '[A]'") + WARNING("Zonemaster cannot find a shuttle landmark in its area '[A]'") spawn(10) //This is called from controller New() and freaks out if this calls back too fast. rm_controller.mark_clean(src) @@ -313,7 +313,7 @@ sleep(delay) rm_controller.dbg("ZM(p): Zone generation done.") - to_world_log("RM(stats): PREP [myarea] at [world.time] with [spawned_mobs.len] mobs, [mineral_rocks.len] minrocks, total of [rockspawns.len] rockspawns, [mobspawns.len] mobspawns.") //DEBUG code for playtest stats gathering. + log_world("RM(stats): PREP [myarea] at [world.time] with [spawned_mobs.len] mobs, [mineral_rocks.len] minrocks, total of [rockspawns.len] rockspawns, [mobspawns.len] mobspawns.") //DEBUG code for playtest stats gathering. prepared_at = world.time rm_controller.mark_ready(src) return myarea @@ -373,13 +373,13 @@ rm_controller.adjust_difficulty(tally) rm_controller.dbg("ZM(sz): Finished scoring and adjusted by [tally].") - to_world_log("RM(stats): SCORE [myarea] for [tally].") //DEBUG code for playtest stats gathering. + log_world("RM(stats): SCORE [myarea] for [tally].") //DEBUG code for playtest stats gathering. return tally //Overall 'destroy' proc (marks as unready) /datum/rogue/zonemaster/proc/clean_zone(var/delay = 1) rm_controller.dbg("ZM(cz): Cleaning zone with area [myarea].") - to_world_log("RM(stats): CLEAN start [myarea] at [world.time] prepared at [prepared_at].") //DEBUG code for playtest stats gathering. + log_world("RM(stats): CLEAN start [myarea] at [world.time] prepared at [prepared_at].") //DEBUG code for playtest stats gathering. rm_controller.unmark_ready(src) //Cut these lists so qdel can dereference the things properly @@ -433,7 +433,7 @@ original_mobs = 0 prepared_at = 0 - to_world_log("RM(stats): CLEAN done [myarea] at [world.time].") //DEBUG code for playtest stats gathering. + log_world("RM(stats): CLEAN done [myarea] at [world.time].") //DEBUG code for playtest stats gathering. rm_controller.dbg("ZM(cz): Finished cleaning up zone area [myarea].") rm_controller.mark_clean(src) diff --git a/code/modules/scripting/IDE.dm b/code/modules/scripting/IDE.dm index b46c2094d2..6f79ee65c3 100644 --- a/code/modules/scripting/IDE.dm +++ b/code/modules/scripting/IDE.dm @@ -10,7 +10,7 @@ var/obj/machinery/telecomms/server/Server = Machine.SelectedServer var/tcscode=winget(src, "tcscode", "text") var/msg="[mob.name] is adding script to server [Server]: [tcscode]" - log_misc(msg) + log_world("## MISC [msg]") message_admins("[mob.name] has uploaded a NTLS script to [Machine.SelectedServer] ([mob.x],[mob.y],[mob.z] - JMP)",0,1) Server.setcode( tcscode ) // this actually saves the code from input to the server src << output(null, "tcserror") // clear the errors diff --git a/code/modules/scripting/Implementations/Telecomms.dm b/code/modules/scripting/Implementations/Telecomms.dm index be93c2705f..3e08b06baf 100644 --- a/code/modules/scripting/Implementations/Telecomms.dm +++ b/code/modules/scripting/Implementations/Telecomms.dm @@ -234,7 +234,7 @@ var/obj/item/radio/hradio = S.server_radio if(!hradio) - error("[src] has no radio.") + log_world("## ERROR [src] has no radio.") return if((!message || message == "") && message != 0) diff --git a/code/modules/scripting/Implementations/_Logic.dm b/code/modules/scripting/Implementations/_Logic.dm index 60b9211a90..3f03fe49c3 100644 --- a/code/modules/scripting/Implementations/_Logic.dm +++ b/code/modules/scripting/Implementations/_Logic.dm @@ -281,11 +281,11 @@ Just found out there was already a string explode function, did some benchmarkin //CharCopy (dest + targetIndex, src + sourceIndex, count); //CharCopy (dest + curPos, source + lastReadPos, precopy); buf+=copytext(haystack,lastReadPos,precopy) - log_misc("buf+=copytext([haystack],[lastReadPos],[precopy])") - log_misc("[buf]") + log_world("## MISC buf+=copytext([haystack],[lastReadPos],[precopy])") + log_world("## MISC [buf]") lastReadPos = dat[i] + lena //CharCopy (dest + curPos, replace, newValue.length); buf+=b - log_misc("[buf]") + log_world("## MISC [buf]") buf+=copytext(haystack,lastReadPos, 0) return buf diff --git a/code/modules/security levels/keycard authentication.dm b/code/modules/security levels/keycard authentication.dm index 5eb9177515..36f27670c5 100644 --- a/code/modules/security levels/keycard authentication.dm +++ b/code/modules/security levels/keycard authentication.dm @@ -189,13 +189,13 @@ var/global/maint_all_access = 0 /proc/make_maint_all_access() maint_all_access = 1 - to_world(span_alert(span_red(span_huge("Attention!")))) - to_world(span_alert(span_red("The maintenance access requirement has been revoked on all airlocks."))) + to_chat(world, span_alert(span_red(span_huge("Attention!")))) + to_chat(world, span_alert(span_red("The maintenance access requirement has been revoked on all airlocks."))) /proc/revoke_maint_all_access() maint_all_access = 0 - to_world(span_alert(span_red(span_huge("Attention!")))) - to_world(span_alert(span_red("The maintenance access requirement has been readded on all maintenance airlocks."))) + to_chat(world, span_alert(span_red(span_huge("Attention!")))) + to_chat(world, span_alert(span_red("The maintenance access requirement has been readded on all maintenance airlocks."))) /obj/machinery/door/airlock/allowed(mob/M) if(maint_all_access && src.check_access_list(list(ACCESS_MAINT_TUNNELS))) diff --git a/code/modules/shieldgen/shield_generator.dm b/code/modules/shieldgen/shield_generator.dm index 770059aa7d..fc472b0dcd 100644 --- a/code/modules/shieldgen/shield_generator.dm +++ b/code/modules/shieldgen/shield_generator.dm @@ -217,7 +217,7 @@ for(var/obj/effect/shield/S in startends) var/adjacent = startends[S] - log_debug("Processing startend [S] at [S?.x],[S?.y] adjacent=[adjacent]") + // to_chat(world, "Processing startend [S] at [S?.x],[S?.y] adjacent=[adjacent]") var/turf/T = get_step(S, adjacent) var/obj/effect/shield/SO = locate() in T S.set_dir(SO.dir) diff --git a/code/modules/shuttles/landmarks.dm b/code/modules/shuttles/landmarks.dm index 916fd419bf..5ee542bbd3 100644 --- a/code/modules/shuttles/landmarks.dm +++ b/code/modules/shuttles/landmarks.dm @@ -51,7 +51,7 @@ var/docking_tag = docking_controller docking_controller = SSshuttles.docking_registry[docking_tag] if(!istype(docking_controller)) - log_error("Could not find docking controller for shuttle waypoint '[name]', docking tag was '[docking_tag]'.") + log_mapping("Could not find docking controller for shuttle waypoint '[name]', docking tag was '[docking_tag]'.") if(using_map.use_overmap) var/obj/effect/overmap/visitable/location = get_overmap_sector(z) if(location && location.docking_codes) diff --git a/code/modules/shuttles/shuttle_emergency.dm b/code/modules/shuttles/shuttle_emergency.dm index ebf3891388..ff49bd8e1b 100644 --- a/code/modules/shuttles/shuttle_emergency.dm +++ b/code/modules/shuttles/shuttle_emergency.dm @@ -73,7 +73,7 @@ if (istype(user, /obj/machinery/computer/shuttle_control/emergency)) //if we were given a command by an emergency shuttle console if (emergency_shuttle.autopilot) emergency_shuttle.autopilot = 0 - to_world(span_boldnotice("Alert: The shuttle autopilot has been overridden. Launch sequence initiated!")) + to_chat(world, span_boldnotice("Alert: The shuttle autopilot has been overridden. Launch sequence initiated!")) if(usr) log_admin("[key_name(usr)] has overridden the departure shuttle's autopilot and activated the launch sequence.") @@ -87,7 +87,7 @@ if (istype(user, /obj/machinery/computer/shuttle_control/emergency)) //if we were given a command by an emergency shuttle console if (emergency_shuttle.autopilot) emergency_shuttle.autopilot = 0 - to_world(span_boldnotice("Alert: The shuttle autopilot has been overridden. Bluespace drive engaged!")) + to_chat(world, span_boldnotice("Alert: The shuttle autopilot has been overridden. Bluespace drive engaged!")) if(usr) log_admin("[key_name(usr)] has overridden the departure shuttle's autopilot and forced immediate launch.") diff --git a/code/modules/shuttles/shuttles_multi.dm b/code/modules/shuttles/shuttles_multi.dm index 562a21f4d4..334e118f3d 100644 --- a/code/modules/shuttles/shuttles_multi.dm +++ b/code/modules/shuttles/shuttles_multi.dm @@ -32,7 +32,7 @@ return next_location = destinations_cache[destination_key] if(!next_location) - warning("Shuttle [src] set to destination we can't find: [destination_key]") + WARNING("Shuttle [src] set to destination we can't find: [destination_key]") /datum/shuttle/autodock/multi/proc/get_destinations() if (last_cache_rebuild_time < SSshuttles.last_landmark_registration_time) diff --git a/code/modules/shuttles/shuttles_web.dm b/code/modules/shuttles/shuttles_web.dm index 6d58efe7db..3e4628ef6d 100644 --- a/code/modules/shuttles/shuttles_web.dm +++ b/code/modules/shuttles/shuttles_web.dm @@ -39,7 +39,7 @@ // TODO - Probably don't even need to override this right? Debug testing code below will check! . = web_master?.get_current_destination()?.my_landmark?.docking_controller?.id_tag if (. != ..()) - warning("Web shuttle [src] had current_dock_target()=[.] but autodock.current_dock_target() = [..()]") + WARNING("Web shuttle [src] had current_dock_target()=[.] but autodock.current_dock_target() = [..()]") /datum/shuttle/autodock/web_shuttle/perform_shuttle_move() ..() @@ -432,7 +432,7 @@ var/travel_delay = D.routes_to_make[type_to_link] D.link_destinations(WM.get_destination_by_type(type_to_link), D.preferred_interim_tag, travel_delay) else - warning("[log_info_line()]'s shuttle [global.log_info_line(ES)] initialized but destinations:[destinations]") + WARNING("[log_info_line()]'s shuttle [global.log_info_line(ES)] initialized but destinations:[destinations]") qdel(src) diff --git a/code/modules/shuttles/web_datums.dm b/code/modules/shuttles/web_datums.dm index d3a0c42f3c..1137365173 100644 --- a/code/modules/shuttles/web_datums.dm +++ b/code/modules/shuttles/web_datums.dm @@ -72,7 +72,7 @@ /datum/shuttle_destination/New(var/new_master) my_landmark = SSshuttles.get_landmark(my_landmark) if(!my_landmark) - log_debug("Web shuttle destination '[name]' could not find its landmark '[my_landmark]'.") // Important error message + log_mapping("Web shuttle destination '[name]' could not find its landmark '[my_landmark]'.") // Important error message master = new_master /datum/shuttle_destination/Destroy() @@ -86,23 +86,23 @@ // This builds destination instances connected to this instance, recursively. /datum/shuttle_destination/proc/build_destinations(var/list/already_made = list()) already_made += src.type - to_world("SHUTTLES: [name] is going to build destinations. already_made list is \[[english_list(already_made)]\]") + to_chat(world, "SHUTTLES: [name] is going to build destinations. already_made list is \[[english_list(already_made)]\]") for(var/type_to_make in destinations_to_create) if(type_to_make in already_made) // Avoid circular initializations. - to_world("SHUTTLES: [name] can't build [type_to_make] due to being a duplicate.") + to_chat(world, "SHUTTLES: [name] can't build [type_to_make] due to being a duplicate.") continue // Instance the new destination, and call this proc on their 'downstream' destinations. var/datum/shuttle_destination/new_dest = new type_to_make() - to_world("SHUTTLES: [name] has created [new_dest.name] and will make it build their own destinations.") + to_chat(world, "SHUTTLES: [name] has created [new_dest.name] and will make it build their own destinations.") already_made += new_dest.build_destinations(already_made) // Now link our new destination to us. var/travel_delay = destinations_to_create[type_to_make] link_destinations(new_dest, preferred_interim_tag, travel_delay) - to_world("SHUTTLES: [name] has linked themselves to [new_dest.name]") + to_chat(world, "SHUTTLES: [name] has linked themselves to [new_dest.name]") - to_world("SHUTTLES: [name] has finished building destinations. already_made list is \[[english_list(already_made)]\].") + to_chat(world, "SHUTTLES: [name] has finished building destinations. already_made list is \[[english_list(already_made)]\].") return already_made /datum/shuttle_destination/proc/enter(var/datum/shuttle_destination/old_destination) diff --git a/code/modules/spells/spell_code.dm b/code/modules/spells/spell_code.dm index 7a85a8a3f4..35ee032ab3 100644 --- a/code/modules/spells/spell_code.dm +++ b/code/modules/spells/spell_code.dm @@ -179,7 +179,7 @@ var/list/spells = typesof(/spell) //needed for the badmin verb for now /spell/proc/cast_check(skipcharge = 0,mob/user = usr) //checks if the spell can be cast based on its settings; skipcharge is used when an additional cast_check is called inside the spell if(!(src in user.spell_list) && holder == user) - error("[user] utilized the spell '[src]' without having it.") + log_world("## ERROR [user] utilized the spell '[src]' without having it.") to_chat(user, span_warning("You shouldn't have this spell! Something's wrong.")) return 0 diff --git a/code/modules/tgs_commands/vorestation.dm b/code/modules/tgs_commands/vorestation.dm index f46b447885..868d1ab014 100644 --- a/code/modules/tgs_commands/vorestation.dm +++ b/code/modules/tgs_commands/vorestation.dm @@ -263,8 +263,8 @@ GLOBAL_LIST_EMPTY(pending_discord_registrations) return "```Invalid command, missing fax id```" var/faxid = all_params[1] if(!all_params[1] || !fexists("[CONFIG_GET(string/fax_export_dir)]/fax_[faxid].html")) - return "I’m sorry Dave, I’m afraid I can’t do that" - var/faxmsg = return_file_text("[CONFIG_GET(string/fax_export_dir)]/fax_[faxid].html") + return "I'm sorry Dave, I'm afraid I can't do that" + var/faxmsg = file2text("[CONFIG_GET(string/fax_export_dir)]/fax_[faxid].html") return "FAX: ```[strip_html_properly(faxmsg)]```" // Reply to admin tickets diff --git a/code/modules/tgui/modules/power_monitor.dm b/code/modules/tgui/modules/power_monitor.dm index 9e6b1eb00e..94f0eb9ea4 100644 --- a/code/modules/tgui/modules/power_monitor.dm +++ b/code/modules/tgui/modules/power_monitor.dm @@ -72,7 +72,7 @@ for(var/obj/machinery/power/sensor/S in GLOB.machines) if(T && (S.loc.z == T.z) || (S.loc.z in levels) || (S.long_range)) // Consoles have range on their Z-Level. Sensors with long_range var will work between Z levels. if(S.name_tag == "#UNKN#") // Default name. Shouldn't happen! - warning("Powernet sensor with unset ID Tag! [S.x]X [S.y]Y [S.z]Z") + WARNING("Powernet sensor with unset ID Tag! [S.x]X [S.y]Y [S.z]Z") else grid_sensors += S diff --git a/code/modules/tickets/tickets.dm b/code/modules/tickets/tickets.dm index fb2227003b..df5af2aeb6 100644 --- a/code/modules/tickets/tickets.dm +++ b/code/modules/tickets/tickets.dm @@ -246,7 +246,7 @@ INITIALIZE_IMMEDIATE(/obj/effect/statclick/ticket_list) initiator_ckey = C.ckey initiator_key_name = key_name(initiator, FALSE, TRUE) if(initiator.current_mentorhelp) //This is a bug - log_debug("Ticket erroneously left open by code") + log_admin("Ticket erroneously left open by code") initiator.current_mentorhelp.AddInteraction("Ticket erroneously left open by code") initiator.current_mentorhelp.Resolve() initiator.current_mentorhelp = src @@ -287,7 +287,7 @@ INITIALIZE_IMMEDIATE(/obj/effect/statclick/ticket_list) initiator_ckey = initiator.ckey initiator_key_name = key_name(initiator, FALSE, TRUE) if(initiator.current_ticket) //This is a bug - log_debug("Multiple ahelp current_tickets") + log_admin("Ticket erroneously left open by code, closing...") initiator.current_ticket.AddInteraction("Ticket erroneously left open by code") initiator.current_ticket.Close(usr) initiator.current_ticket = src diff --git a/code/modules/turbolift/turbolift.dm b/code/modules/turbolift/turbolift.dm index 1b9e16839e..7590bdb317 100644 --- a/code/modules/turbolift/turbolift.dm +++ b/code/modules/turbolift/turbolift.dm @@ -114,7 +114,7 @@ target_floor = null return PROCESS_KILL else if(!next_process) - log_debug("Turbolift [src] do_move() returned 1 but next_process = null; busy_state=[busy_state]") + log_runtime("Turbolift [src] do_move() returned 1 but next_process = null; busy_state=[busy_state]") return PROCESS_KILL if(LIFT_WAITING_A) var/area/turbolift/origin = locate(current_floor.area_ref) @@ -128,7 +128,7 @@ busy_state = null return PROCESS_KILL else - log_debug("Turbolift [src] process() called with unknown busy_state='[busy_state]'") + log_runtime("Turbolift [src] process() called with unknown busy_state='[busy_state]'") return PROCESS_KILL // Called by process when in LIFT_MOVING diff --git a/code/modules/turbolift/turbolift_floor.dm b/code/modules/turbolift/turbolift_floor.dm index 32c5ed7793..89cd85518a 100644 --- a/code/modules/turbolift/turbolift_floor.dm +++ b/code/modules/turbolift/turbolift_floor.dm @@ -13,7 +13,7 @@ /datum/turbolift_floor/proc/set_area_ref(var/ref) var/area/turbolift/A = locate(ref) if(!istype(A)) - log_debug("Turbolift floor area was of the wrong type: ref=[ref]") + log_mapping("Turbolift floor area was of the wrong type: ref=[ref]") return area_ref = ref diff --git a/code/modules/turbolift/turbolift_map.dm b/code/modules/turbolift/turbolift_map.dm index c57706008a..62273bf54e 100644 --- a/code/modules/turbolift/turbolift_map.dm +++ b/code/modules/turbolift/turbolift_map.dm @@ -140,7 +140,7 @@ var/turf/checking = locate(tx,ty,cz) if(!istype(checking)) - log_debug("[name] cannot find a component turf at [tx],[ty] on floor [cz]. Aborting.") + log_mapping("[name] cannot find a component turf at [tx],[ty] on floor [cz]. Aborting.") qdel(src) return @@ -211,7 +211,7 @@ // Update area. if(az > areas_to_use.len) - log_debug("Insufficient defined areas in turbolift datum, aborting.") + log_mapping("Insufficient defined areas in turbolift datum, aborting.") qdel(src) return diff --git a/code/modules/unit_tests/_unit_tests.dm b/code/modules/unit_tests/_unit_tests.dm index b582dd8973..c1c0f345cb 100644 --- a/code/modules/unit_tests/_unit_tests.dm +++ b/code/modules/unit_tests/_unit_tests.dm @@ -101,6 +101,7 @@ #include "language_tests.dm" #include "loadout_tests.dm" #include "map_tests.dm" +#include "mapping.dm" #include "material_tests.dm" // #include "nuke_cinematic.dm" // TODO: This is probably fixed later on #include "poster_tests.dm" diff --git a/code/modules/unit_tests/font_awesome_icons.dm b/code/modules/unit_tests/font_awesome_icons.dm index 6ee4372dc6..edbe5cc17b 100644 --- a/code/modules/unit_tests/font_awesome_icons.dm +++ b/code/modules/unit_tests/font_awesome_icons.dm @@ -25,8 +25,7 @@ * If there are any differences, note them. */ /datum/unit_test/font_awesome_icons/proc/load_parse_verify() - //log_test("CSS Actual: [length(font_awesome_css)]") - log_unit_test("CSS Actual: [length(font_awesome_css)]") + log_test("CSS Actual: [length(font_awesome_css)]") allowed_icons = parse_fa_css_into_icon_list(font_awesome_css) /** diff --git a/code/modules/unit_tests/mapping.dm b/code/modules/unit_tests/mapping.dm new file mode 100644 index 0000000000..7c42f958a3 --- /dev/null +++ b/code/modules/unit_tests/mapping.dm @@ -0,0 +1,19 @@ +/// Conveys all log_mapping messages as unit test failures, as they all indicate mapping problems. +/datum/unit_test/log_mapping + // Happen before all other tests, to make sure we only capture normal mapping logs. + priority = TEST_PRE + +/datum/unit_test/log_mapping/Run() + var/static/regex/test_areacoord_regex = regex(@"\(-?\d+,-?\d+,(-?\d+)\)") + + for(var/log_entry in GLOB.unit_test_mapping_logs) + // Only fail if AREACOORD was conveyed, and it's a station or mining z-level. FIXME: SEE BELOW! + // This is due to mapping errors don't have coords being impossible to diagnose as a unit test, + // and various ruins frequently intentionally doing non-standard things. + if(!test_areacoord_regex.Find(log_entry)) + continue + // var/z = text2num(test_areacoord_regex.group[1]) + //if(!is_station_level(z) && !is_mining_level(z)) // FIXME: We cannot check for these yet! + // continue + + TEST_FAIL(log_entry) diff --git a/code/modules/unit_tests/unit_test.dm b/code/modules/unit_tests/unit_test.dm index 681661167c..5cd286cca5 100644 --- a/code/modules/unit_tests/unit_test.dm +++ b/code/modules/unit_tests/unit_test.dm @@ -138,15 +138,13 @@ GLOBAL_VAR_INIT(focused_tests, focused_tests()) if (fexists(filename)) var/data_filename = "data/screenshots/[path_prefix]_[name].png" fcopy(icon, data_filename) - //log_test("\t[path_prefix]_[name] was found, putting in data/screenshots") - log_unit_test("\t[path_prefix]_[name] was found, putting in data/screenshots") + log_test("\t[path_prefix]_[name] was found, putting in data/screenshots") else #ifdef CIBUILDING // We are runing in real CI, so just pretend it worked and move on fcopy(icon, "data/screenshots_new/[path_prefix]_[name].png") - //log_test("\t[path_prefix]_[name] was put in data/screenshots_new") - log_unit_test("\t[path_prefix]_[name] was put in data/screenshots_new") + log_test("\t[path_prefix]_[name] was put in data/screenshots_new") #else // We are probably running in a local build fcopy(icon, filename) @@ -230,8 +228,7 @@ GLOBAL_VAR_INIT(focused_tests, focused_tests()) if(length(log_entry)) message = log_entry.Join("\n") - //log_test(message) - log_unit_test(message) + log_test(message) test_output_desc += " [duration / 10]s" if (test.succeeded) diff --git a/code/modules/vore/eating/belly_messages.dm b/code/modules/vore/eating/belly_messages.dm index b40663a008..5d6eec2442 100644 --- a/code/modules/vore/eating/belly_messages.dm +++ b/code/modules/vore/eating/belly_messages.dm @@ -443,7 +443,7 @@ GLOBAL_LIST_INIT(vore_words_snake, list("snake","serpent","reptilian","noodle"," if(LAZYLEN(raw_list) > 10) raw_list.Cut(11) - log_debug("[owner] tried to set [lowertext(name)] with 11+ messages") + log_admin("[owner] tried to set [lowertext(name)] with 11+ messages") var/realIndex = 0 for(var/i = 1, i <= LAZYLEN(raw_list), i++) @@ -455,7 +455,7 @@ GLOBAL_LIST_INIT(vore_words_snake, list("snake","serpent","reptilian","noodle"," to_chat(owner, span_warning("One of the message for [lowertext(name)] exceeded the limit of [limit] characters or has been below the lower limit of 10 characters and has been removed. Actual length: [length(raw_list[i])]")) //Reflect message to the player so that they don't just lose it to_chat(owner, span_warning("Message [realIndex]: [raw_list[i]]")) - log_debug("[owner] tried to set [lowertext(name)] [type] message with >[limit] or <10 characters") + log_admin("[owner] tried to set [lowertext(name)] [type] message with >[limit] or <10 characters") raw_list.Cut(i, i + 1) i-- diff --git a/code/modules/vore/eating/belly_obj_liquids.dm b/code/modules/vore/eating/belly_obj_liquids.dm index 5dc1bc664b..47867a8a25 100644 --- a/code/modules/vore/eating/belly_obj_liquids.dm +++ b/code/modules/vore/eating/belly_obj_liquids.dm @@ -292,7 +292,7 @@ var/datum/digest_mode/DM = GLOB.digest_modes["[digest_mode]"] if(!DM) - log_debug("Digest mode [digest_mode] didn't exist in the digest_modes list!!") + log_runtime("Digest mode [digest_mode] didn't exist in the digest_modes list!!") return FALSE if(DM.handle_atoms(src, touchable_atoms)) updateVRPanels() diff --git a/code/modules/vore/eating/belly_obj_vr.dm b/code/modules/vore/eating/belly_obj_vr.dm index 466401bcf4..a9ca7beb81 100644 --- a/code/modules/vore/eating/belly_obj_vr.dm +++ b/code/modules/vore/eating/belly_obj_vr.dm @@ -1255,7 +1255,7 @@ return owner.drop_location() //Sketchy fallback for safety, put them somewhere safe. else - log_debug("[src] (\ref[src]) doesn't have an owner, and dropped someone at a latespawn point!") + log_runtime("[src] (\ref[src]) doesn't have an owner, and dropped someone at a latespawn point!") var/fallback = pick(GLOB.latejoin) return get_turf(fallback) diff --git a/code/modules/vore/eating/bellymodes_vr.dm b/code/modules/vore/eating/bellymodes_vr.dm index 2699e36469..ed0814463e 100644 --- a/code/modules/vore/eating/bellymodes_vr.dm +++ b/code/modules/vore/eating/bellymodes_vr.dm @@ -52,7 +52,7 @@ touchable_atoms -= G var/datum/digest_mode/DM = GLOB.digest_modes["[digest_mode]"] if(!DM) - log_debug("Digest mode [digest_mode] didn't exist in the digest_modes list!!") + log_runtime("Digest mode [digest_mode] didn't exist in the digest_modes list!!") return FALSE if(digest_mode == DM_EGG) prey_loop() //Apparently on Egg mode the sound loop never played before? Just slapping this here to fix that diff --git a/code/modules/vore/eating/living_vr.dm b/code/modules/vore/eating/living_vr.dm index c3cad9dee3..3c3e66c9f9 100644 --- a/code/modules/vore/eating/living_vr.dm +++ b/code/modules/vore/eating/living_vr.dm @@ -111,7 +111,7 @@ qdel(G) return TRUE else - log_debug("[attacker] attempted to feed [G.affecting] to [user] ([user.type]) but it failed.") + log_vore("[attacker] attempted to feed [G.affecting] to [user] ([user.type]) but it failed.") ///// If user clicked on their grabbed target else if((src == G.affecting) && (attacker.a_intent == I_GRAB) && (attacker.zone_sel.selecting == BP_TORSO) && (is_vore_predator(G.affecting))) @@ -126,7 +126,7 @@ qdel(G) return TRUE else - log_debug("[attacker] attempted to feed [user] to [G.affecting] ([G.affecting ? G.affecting.type : "null"]) but it failed.") + log_vore("[attacker] attempted to feed [user] to [G.affecting] ([G.affecting ? G.affecting.type : "null"]) but it failed.") ///// If user clicked on anyone else but their grabbed target else if((src != G.affecting) && (src != G.assailant) && (is_vore_predator(src))) @@ -148,7 +148,7 @@ qdel(G) return TRUE else - log_debug("[attacker] attempted to feed [G.affecting] to [src] ([type]) but it failed.") + log_vore("[attacker] attempted to feed [G.affecting] to [src] ([type]) but it failed.") //Handle case: /obj/item/holder else if(istype(I, /obj/item/holder)) @@ -163,7 +163,7 @@ if(attacker.eat_held_mob(attacker, M, src)) return TRUE //return TRUE to exit upper procs else - log_debug("[attacker] attempted to feed [H.contents] to [src] ([type]) but it failed.") + log_vore("[attacker] attempted to feed [H.contents] to [src] ([type]) but it failed.") //Handle case: /obj/item/radio/beacon else if(istype(I,/obj/item/radio/beacon)) @@ -360,7 +360,7 @@ var/slotnum = charlist[choice] if(!slotnum) - error("Player picked [choice] slot to load, but that wasn't one we sent.") + log_world("## ERROR Player picked [choice] slot to load, but that wasn't one we sent.") return load_character(slotnum) diff --git a/code/modules/vore/eating/soulcatcher.dm b/code/modules/vore/eating/soulcatcher.dm index 6c9751dbd7..f5c0d8cfb4 100644 --- a/code/modules/vore/eating/soulcatcher.dm +++ b/code/modules/vore/eating/soulcatcher.dm @@ -104,7 +104,7 @@ for(var/mob/living/carbon/brain/caught_soul/CS as anything in brainmobs) to_chat(CS, message) - log_nsay(message, owner.real_name, sender) + sender.log_talk("NSAY (NIF:[owner.real_name]): [message]", LOG_SAY) // Forwards the emotes of captured souls /obj/soulgem/proc/use_emote(var/message, var/mob/living/sender, var/mob/eyeobj, var/whisper) @@ -127,7 +127,7 @@ for(var/mob/living/carbon/brain/caught_soul/CS as anything in brainmobs) to_chat(CS, message) - log_nme(message, owner.real_name,sender) + sender.log_message("NME (NIF:[owner.real_name]): [message]", LOG_EMOTE) // The capture function which transfers the given mob's mind into the soulcatcher /obj/soulgem/proc/catch_mob(var/mob/M, var/custom_name) diff --git a/code/modules/vore/eating/vore_procs.dm b/code/modules/vore/eating/vore_procs.dm index 0f91547dbb..728e027f16 100644 --- a/code/modules/vore/eating/vore_procs.dm +++ b/code/modules/vore/eating/vore_procs.dm @@ -162,7 +162,7 @@ /proc/vore_sanity_checks(mob/living/user, mob/living/prey, mob/living/pred, obj/belly/belly) //Sanity if(!user || !prey || !pred || !istype(belly) || !(belly in pred.vore_organs)) - log_debug("[user] attempted to feed [prey] to [pred], via [belly ? lowertext(belly.name) : "*null*"] but it went wrong.") + log_vore("[user] attempted to feed [prey] to [pred], via [belly ? lowertext(belly.name) : "*null*"] but it went wrong.") return FALSE if(pred == prey) return FALSE diff --git a/code/modules/vore/eating/vore_vr.dm b/code/modules/vore/eating/vore_vr.dm index f0d87cf142..bc8f3489a8 100644 --- a/code/modules/vore/eating/vore_vr.dm +++ b/code/modules/vore/eating/vore_vr.dm @@ -453,14 +453,14 @@ //List to JSON var/json_to_file = json_encode(settings_list) if(!json_to_file) - log_debug("Saving: [path] failed jsonencode") + log_runtime("Saving: [path] failed jsonencode") return FALSE //Write it out rustg_file_write(json_to_file, path) if(!fexists(path)) - log_debug("Saving: [path] failed file write") + log_runtime("Saving: [path] failed file write") return FALSE return TRUE diff --git a/code/modules/vore/eating/vorepanel_vr.dm b/code/modules/vore/eating/vorepanel_vr.dm index d6a7a29a03..8d9026b5ff 100644 --- a/code/modules/vore/eating/vorepanel_vr.dm +++ b/code/modules/vore/eating/vorepanel_vr.dm @@ -23,7 +23,7 @@ if(!vorePanel) if(!isnewplayer(src)) - log_debug("[src] ([type], \ref[src]) didn't have a vorePanel and tried to use the verb.") + log_vore("[src] ([type], \ref[src]) didn't have a vorePanel and tried to use the verb.") vorePanel = new(src) vorePanel.tgui_interact(src) diff --git a/code/modules/vore/persist/persist_vr.dm b/code/modules/vore/persist/persist_vr.dm index b6c87c7637..fd66428c3d 100644 --- a/code/modules/vore/persist/persist_vr.dm +++ b/code/modules/vore/persist/persist_vr.dm @@ -28,7 +28,7 @@ else var/turf/playerTurf = get_turf(Player) if(!playerTurf) - log_debug("Player [Player.name] ([Player.ckey]) playing as [Player.species] was in nullspace at round end.") + log_runtime("Player [Player.name] ([Player.ckey]) playing as [Player.species] was in nullspace at round end.") continue if(isAdminLevel(playerTurf.z)) // Evac'd - Next round they arrive on the shuttle. @@ -54,17 +54,17 @@ // Okay this mob has a real loaded-from-savefile mind in it! var/datum/preferences/prefs = preferences_datums[persister.mind.loaded_from_ckey] if(!prefs) - warning("Persist (P4P): [persister.mind] was loaded from ckey [persister.mind.loaded_from_ckey] but no prefs datum found.") + WARNING("Persist (P4P): [persister.mind] was loaded from ckey [persister.mind.loaded_from_ckey] but no prefs datum found.") return // Okay, lets do a few checks to see if we should really save tho! if(!prefs.load_character(persister.mind.loaded_from_slot)) - warning("Persist (P4P): [persister.mind] was loaded from slot [persister.mind.loaded_from_slot] but loading prefs failed.") + WARNING("Persist (P4P): [persister.mind] was loaded from slot [persister.mind.loaded_from_slot] but loading prefs failed.") return // Failed to load character // For now as a safety measure we will only save if the name matches. if(prefs.real_name != persister.real_name) - log_debug("Persist (P4P): Skipping [persister] because ORIG:[persister.real_name] != CURR:[prefs.real_name].") + NOTICE("Persist (P4P): Skipping [persister] because ORIG:[persister.real_name] != CURR:[prefs.real_name].") return return prefs @@ -85,7 +85,7 @@ var/datum/preferences/prefs = prep_for_persist(occupant) if(!prefs) - warning("Persist (PID): Skipping [occupant] for persisting, as they have no prefs.") + WARNING("Persist (PID): Skipping [occupant] for persisting, as they have no prefs.") return //This one doesn't rely on persistence prefs @@ -241,7 +241,7 @@ var/slot = H?.mind?.loaded_from_slot if(isnull(slot)) - warning("Persist (NIF): [H] has no mind slot, skipping") + WARNING("Persist (NIF): [H] has no mind slot, skipping") return var/datum/json_savefile/savefile = new /datum/json_savefile(nif_savefile_path(H.ckey)) diff --git a/code/modules/vore/trycatch_vr.dm b/code/modules/vore/trycatch_vr.dm index a383f0caff..b553055512 100644 --- a/code/modules/vore/trycatch_vr.dm +++ b/code/modules/vore/trycatch_vr.dm @@ -15,7 +15,7 @@ The proc you're attemping should return nonzero values on success. /proc/attempt_vr(callon, procname, list/arguments=null) try if(!callon || !procname) - error("attempt_vr: Invalid obj/proc: [callon]/[procname]") + log_world("## ERROR attempt_vr: Invalid obj/proc: [callon]/[procname]") return 0 var/result = call(callon,procname)(arglist(arguments)) @@ -23,8 +23,8 @@ The proc you're attemping should return nonzero values on success. return result catch(var/exception/e) - error("attempt_vr runtimed when calling [procname] on [callon].") - error("attempt_vr catch: [e] on [e.file]:[e.line]") + log_world("## ERROR attempt_vr runtimed when calling [procname] on [callon].") + log_world("## ERROR attempt_vr catch: [e] on [e.file]:[e.line]") log_runtime(e) return 0 @@ -46,18 +46,19 @@ The hooks you're calling should return nonzero values on success. try var/hook_path = text2path("/hook/[hook]") if(!hook_path) - error("hook_vr: Invalid hook '/hook/[hook]' called.") + log_world("## ERROR hook_vr: Invalid hook '/hook/[hook]' called.") return 0 var/hook_instance = new hook_path var/status = 1 for(var/P in typesof("[hook_path]/proc")) if(!call(hook_instance, P)(arglist(arguments))) - error("hook_vr: Hook '[P]' failed or runtimed.") + log_world("## ERROR hook_vr: Hook '[P]' failed or runtimed.") status = 0 return status catch(var/exception/e) - error("hook_vr itself failed or runtimed. Exception below.") - error("hook_vr catch: [e] on [e.file]:[e.line]") + log_world("## ERROR hook_vr itself failed or runtimed. Exception below.") + log_world("## ERROR hook_vr catch: [e] on [e.file]:[e.line]") + log_runtime(e) diff --git a/code/modules/webhooks/_webhook.dm b/code/modules/webhooks/_webhook.dm index c642bf0139..89dbd9160b 100644 --- a/code/modules/webhooks/_webhook.dm +++ b/code/modules/webhooks/_webhook.dm @@ -14,7 +14,7 @@ result = cached_json_decode(result) if (result["error_code"]) - log_debug("byhttp error: [result["error"]] ([result["error_code"]])") + log_runtime("byhttp error: [result["error"]] ([result["error_code"]])") return result["error_code"] return list( @@ -60,9 +60,9 @@ if (200 to 299) continue if (400 to 599) - log_debug("Webhooks: HTTP error code while sending to '[target_url]': [httpresponse["status_code"]]. Data: [httpresponse["body"]].") + log_runtime("Webhooks: HTTP error code while sending to '[target_url]': [httpresponse["status_code"]]. Data: [httpresponse["body"]].") else - log_debug("Webhooks: unknown HTTP code while sending to '[target_url]': [httpresponse["status_code"]]. Data: [httpresponse["body"]].") + log_runtime("Webhooks: unknown HTTP code while sending to '[target_url]': [httpresponse["status_code"]]. Data: [httpresponse["body"]].") . = FALSE /decl/webhook/proc/get_mentions(var/mentioning_url) diff --git a/code/modules/xenoarcheaology/effect_master.dm b/code/modules/xenoarcheaology/effect_master.dm index 7ff0879032..abcff8f4d0 100644 --- a/code/modules/xenoarcheaology/effect_master.dm +++ b/code/modules/xenoarcheaology/effect_master.dm @@ -405,7 +405,6 @@ var/list/toxic_reagents = list(TOXIN_PATH) for(var/datum/artifact_effect/my_effect in my_effects) if(is_path_in_list(T,water_reagents)) - //log_debug("ON REAGENT T in path = [is_path_in_list(T,water_reagents)]!") if(my_effect.trigger == TRIGGER_WATER) my_effect.ToggleActivate() else if(is_path_in_list(T,acid_reagents)) diff --git a/code/modules/xenobio2/controller.dm b/code/modules/xenobio2/controller.dm index 120809a1b3..30480aaa18 100644 --- a/code/modules/xenobio2/controller.dm +++ b/code/modules/xenobio2/controller.dm @@ -22,7 +22,7 @@ var/global/datum/controller/xenobio/xenobio_controller // Set in New(). /datum/controller/xenobio/New() if(xenobio_controller && xenobio_controller != src) - log_debug("Rebuilding xenobio controller.") + log_runtime("Rebuilding xenobio controller.") qdel(xenobio_controller) xenobio_controller = src setup() diff --git a/code/modules/xenobio2/mob/xeno procs.dm b/code/modules/xenobio2/mob/xeno procs.dm index 0b83a8b869..cd3edab8ba 100644 --- a/code/modules/xenobio2/mob/xeno procs.dm +++ b/code/modules/xenobio2/mob/xeno procs.dm @@ -124,8 +124,8 @@ Divergence proc, used in mutation to make unique datums. var/chosen = pick(speech_buffer) speak.Add(chosen) /* Uncoment for logging of speech list. - log_debug("Added [chosen] to speak list.") - log_debug("Speechlist cut.") */ + log_world("### DEBUG Added [chosen] to speak list.") + log_world("### DEBUG Speechlist cut.") */ speech_buffer.Cut() // /mob/living/simple_mob/xeno/proc/BuildReagentLists() diff --git a/code/modules/xgm/xgm_gas_data.dm b/code/modules/xgm/xgm_gas_data.dm index 1041793928..7419bcd0dc 100644 --- a/code/modules/xgm/xgm_gas_data.dm +++ b/code/modules/xgm/xgm_gas_data.dm @@ -22,7 +22,7 @@ GLOBAL_DATUM_INIT(gas_data, /datum/xgm_gas_data, new()) var/decl/xgm_gas/gas = new p //avoid initial() because of potential New() actions if(gas.id in gases) - error("Duplicate gas id `[gas.id]` in `[p]`") + log_world("## ERROR Duplicate gas id `[gas.id]` in `[p]`") gases += gas.id name[gas.id] = gas.name diff --git a/config/example/config.txt b/config/example/config.txt index 7d3d90cac0..f39c7ece2c 100644 --- a/config/example/config.txt +++ b/config/example/config.txt @@ -280,6 +280,16 @@ SECOND_CLICK_LIMIT 15 MINUTE_CLICK_LIMIT 400 +##Error handling related options +## The "cooldown" time for each occurrence of a unique error +#ERROR_COOLDOWN 600 +## How many occurrences before the next will silence them +#ERROR_LIMIT 90 +## How long a unique error will be silenced for +#ERROR_SILENCE_TIME 6000 +##How long to wait between messaging admins about occurrences of a unique error +#ERROR_MSG_DELAY 50 + ##Defines the ticklag for the world. Ticklag is the amount of time between game ticks (aka byond ticks) (in 1/10ths of a second). ## This also controls the client network update rate, as well as the default client fps TICKLAG 0.25 diff --git a/config/example/logging.txt b/config/example/logging.txt index 3d5e436d2b..3151e2c9f4 100644 --- a/config/example/logging.txt +++ b/config/example/logging.txt @@ -1,7 +1,7 @@ ### Config Flags for logging, compatibility flags are at the top -### << COMING SOON >> - +## Should we also log entries as human readable +LOG_AS_HUMAN_READABLE ### Actual logging flags @@ -17,9 +17,21 @@ LOG_ADMIN ## log admin chat LOG_ADMINCHAT +## log event chat +LOG_EVENTCHAT + +## log asset debug logs +# LOG_ASSET + ## log OOC channel LOG_OOC +## log LOOC channel +LOG_LOOC + +## log prayers +LOG_PRAYER + ## log client Say LOG_SAY @@ -56,5 +68,11 @@ LOG_GRAFFITI ## log world.log and runtime errors to a file LOG_RUNTIME -## log admin warning messages -LOG_ADMINWARN +## log all world.Topic() calls +LOG_WORLD_TOPIC + +## Enables log entries for logins that failed due to suspicious circumstances (banned player, CID randomiser, spoofed BYOND version, etc.) to a dedicated file. +LOG_SUSPICIOUS_LOGIN + +## log all vore interactions +LOG_VORE diff --git a/html/statbrowser.js b/html/statbrowser.js index d339809a1e..855bbda4a7 100644 --- a/html/statbrowser.js +++ b/html/statbrowser.js @@ -1,41 +1,41 @@ // Polyfills and compatibility ------------------------------------------------ -var decoder = decodeURIComponent || unescape; +const decoder = decodeURIComponent; if (!Array.prototype.includes) { Array.prototype.includes = function (thing) { - for (var i = 0; i < this.length; i++) { - if (this[i] == thing) return true; + for (let i = 0; i < this.length; i++) { + if (this[i] === thing) return true; } return false; }; } if (!String.prototype.trim) { String.prototype.trim = function () { - return this.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, ""); + return this.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, ''); }; } // Status panel implementation ------------------------------------------------ -var status_tab_parts = ["Loading..."]; -var current_tab = null; -var mc_tab_parts = [["Loading...", ""]]; -var href_token = null; -var spells = []; -var spell_tabs = []; -var verb_tabs = []; -var verbs = [["", ""]]; // list with a list inside -var examine = []; -var tickets = []; -var misc = new Map(); -var sdql2 = []; -var permanent_tabs = []; // tabs that won't be cleared by wipes -var turfcontents = []; -var turfname = ""; -var imageRetryDelay = 500; -var imageRetryLimit = 50; -var menu = document.getElementById("menu"); -var statcontentdiv = document.getElementById("statcontent"); -var storedimages = []; -var split_admin_tabs = false; +let status_tab_parts = ['Loading...']; +let current_tab = null; +let mc_tab_parts = [['Loading...', '']]; +let href_token = null; +let spells = []; +let spell_tabs = []; +let verb_tabs = []; +let verbs = [['', '']]; // list with a list inside +let examine = []; +let tickets = []; +const misc = new Map(); +let sdql2 = []; +const permanent_tabs = []; // tabs that won't be cleared by wipes +let turfcontents = []; +let turfname = ''; +const imageRetryDelay = 500; +const imageRetryLimit = 50; +const menu = document.getElementById('menu'); +const statcontentdiv = document.getElementById('statcontent'); +const storedimages = []; +let split_admin_tabs = false; // Any BYOND commands that could result in the client's focus changing go through this // to ensure that when we relinquish our focus, we don't do it after the result of @@ -45,18 +45,18 @@ function run_after_focus(callback) { } function createStatusTab(name) { - if (name.indexOf(".") != -1) { - var splitName = name.split("."); - if (split_admin_tabs && splitName[0] === "Admin") name = splitName[1]; + if (name.indexOf('.') !== -1) { + const splitName = name.split('.'); + if (split_admin_tabs && splitName[0] === 'Admin') name = splitName[1]; else name = splitName[0]; } - if (document.getElementById(name) || name.trim() == "") { + if (document.getElementById(name) || name.trim() === '') { return; } if (!verb_tabs.includes(name) && !permanent_tabs.includes(name)) { return; } - var button = document.createElement("DIV"); + const button = document.createElement('DIV'); button.onclick = function () { tab_change(name); this.blur(); @@ -64,13 +64,13 @@ function createStatusTab(name) { }; button.id = name; button.textContent = name; - button.className = "button"; + button.className = 'button'; //ORDERING ALPHABETICALLY button.style.order = name.charCodeAt(0); - if (name == "Status" || name == "MC") { - button.style.order = name == "Status" ? 1 : 2; + if (name === 'Status' || name === 'MC') { + button.style.order = name === 'Status' ? 1 : 2; } - if (name == "Tickets") { + if (name === 'Tickets') { button.style.order = 3; } //END ORDERING @@ -82,21 +82,21 @@ function removeStatusTab(name) { if (!document.getElementById(name) || permanent_tabs.includes(name)) { return; } - for (var i = verb_tabs.length - 1; i >= 0; --i) { - if (verb_tabs[i] == name) { + for (let i = verb_tabs.length - 1; i >= 0; --i) { + if (verb_tabs[i] === name) { verb_tabs.splice(i, 1); } } - if (current_tab == name) { - tab_change("Status"); + if (current_tab === name) { + tab_change('Status'); } menu.removeChild(document.getElementById(name)); TakeTabFromByond(name); } function sortVerbs() { - verbs.sort(function (a, b) { - var selector = a[0] == b[0] ? 1 : 0; + verbs.sort((a, b) => { + const selector = a[0] === b[0] ? 1 : 0; if (a[selector].toUpperCase() < b[selector].toUpperCase()) { return 1; } else if (a[selector].toUpperCase() > b[selector].toUpperCase()) { @@ -114,8 +114,8 @@ function addPermanentTab(name) { } function removePermanentTab(name) { - for (var i = permanent_tabs.length - 1; i >= 0; --i) { - if (permanent_tabs[i] == name) { + for (let i = permanent_tabs.length - 1; i >= 0; --i) { + if (permanent_tabs[i] === name) { permanent_tabs.splice(i, 1); } } @@ -123,7 +123,7 @@ function removePermanentTab(name) { } function checkStatusTab() { - for (var i = 0; i < menu.children.length; i++) { + for (let i = 0; i < menu.children.length; i++) { if ( !verb_tabs.includes(menu.children[i].id) && !permanent_tabs.includes(menu.children[i].id) @@ -134,96 +134,95 @@ function checkStatusTab() { } function remove_verb(v) { - var verb_to_remove = v; // to_remove = [verb:category, verb:name] - for (var i = verbs.length - 1; i >= 0; i--) { - var part_to_remove = verbs[i]; - if (part_to_remove[1] == verb_to_remove[1]) { + const verb_to_remove = v; // to_remove = [verb:category, verb:name] + for (let i = verbs.length - 1; i >= 0; i--) { + const part_to_remove = verbs[i]; + if (part_to_remove[1] === verb_to_remove[1]) { verbs.splice(i, 1); } } } function check_verbs() { - for (var v = verb_tabs.length - 1; v >= 0; v--) { + for (let v = verb_tabs.length - 1; v >= 0; v--) { verbs_cat_check(verb_tabs[v]); } } function verbs_cat_check(cat) { - var tabCat = cat; - if (cat.indexOf(".") != -1) { - var splitName = cat.split("."); - if (split_admin_tabs && splitName[0] === "Admin") tabCat = splitName[1]; + let tabCat = cat; + if (cat.indexOf('.') !== -1) { + const splitName = cat.split('.'); + if (split_admin_tabs && splitName[0] === 'Admin') tabCat = splitName[1]; else tabCat = splitName[0]; } - var verbs_in_cat = 0; - var verbcat = ""; + let verbs_in_cat = 0; + let verbcat = ''; if (!verb_tabs.includes(tabCat)) { removeStatusTab(tabCat); return; } - for (var v = 0; v < verbs.length; v++) { - var part = verbs[v]; + for (let v = 0; v < verbs.length; v++) { + const part = verbs[v]; verbcat = part[0]; - if (verbcat.indexOf(".") != -1) { - var splitName = verbcat.split("."); - if (split_admin_tabs && splitName[0] === "Admin") verbcat = splitName[1]; + if (verbcat.indexOf('.') !== -1) { + const splitName = verbcat.split('.'); + if (split_admin_tabs && splitName[0] === 'Admin') verbcat = splitName[1]; else verbcat = splitName[0]; } - if (verbcat != tabCat || verbcat.trim() == "") { - continue; + if (verbcat !== tabCat || verbcat.trim() === '') { } else { verbs_in_cat = 1; break; // we only need one } } - if (verbs_in_cat != 1) { + if (verbs_in_cat !== 1) { removeStatusTab(tabCat); - if (current_tab == tabCat) tab_change("Status"); + if (current_tab === tabCat) tab_change('Status'); } } function findVerbindex(name, verblist) { - for (var i = 0; i < verblist.length; i++) { - var part = verblist[i]; - if (part[1] == name) return i; + for (let i = 0; i < verblist.length; i++) { + const part = verblist[i]; + if (part[1] === name) return i; } } function wipe_verbs() { - verbs = [["", ""]]; + verbs = [['', '']]; verb_tabs = []; checkStatusTab(); // remove all empty verb tabs } function update_verbs() { wipe_verbs(); - Byond.sendMessage("Update-Verbs"); + Byond.sendMessage('Update-Verbs'); } function SendTabsToByond() { - var tabstosend = []; + let tabstosend = []; tabstosend = tabstosend.concat(permanent_tabs, verb_tabs); - for (var i = 0; i < tabstosend.length; i++) { + for (let i = 0; i < tabstosend.length; i++) { SendTabToByond(tabstosend[i]); } } function SendTabToByond(tab) { - Byond.sendMessage("Send-Tabs", { tab: tab }); + Byond.sendMessage('Send-Tabs', { tab: tab }); } //Byond can't have this tab anymore since we're removing it function TakeTabFromByond(tab) { - Byond.sendMessage("Remove-Tabs", { tab: tab }); + Byond.sendMessage('Remove-Tabs', { tab: tab }); } function spell_cat_check(cat) { - var spells_in_cat = 0; - var spellcat = ""; - for (var s = 0; s < spells.length; s++) { - var spell = spells[s]; + let spells_in_cat = 0; + let spellcat = ''; + for (let s = 0; s < spells.length; s++) { + const spell = spells[s]; spellcat = spell[0]; - if (spellcat == cat) { + if (spellcat === cat) { spells_in_cat++; } } @@ -233,58 +232,58 @@ function spell_cat_check(cat) { } function tab_change(tab) { - if (tab == current_tab) return; + if (tab === current_tab) return; if (document.getElementById(current_tab)) - document.getElementById(current_tab).className = "button"; // disable active on last button + document.getElementById(current_tab).className = 'button'; // disable active on last button current_tab = tab; set_byond_tab(tab); if (document.getElementById(tab)) - document.getElementById(tab).className = "button active"; // make current button active - var spell_tabs_thingy = spell_tabs.includes(tab); - var verb_tabs_thingy = verb_tabs.includes(tab); - if (tab == "Status") { + document.getElementById(tab).className = 'button active'; // make current button active + const spell_tabs_thingy = spell_tabs.includes(tab); + const verb_tabs_thingy = verb_tabs.includes(tab); + if (tab === 'Status') { draw_status(); - } else if (tab == "MC") { + } else if (tab === 'MC') { draw_mc(); } else if (spell_tabs_thingy) { draw_spells(tab); } else if (verb_tabs_thingy) { draw_verbs(tab); - } else if (tab == "Debug Stat Panel") { + } else if (tab === 'Debug Stat Panel') { draw_debug(); - } else if (tab == "Tickets") { + } else if (tab === 'Tickets') { draw_tickets(); } else if (misc.has(tab)) { draw_misc(tab); - } else if (tab == "Examine") { + } else if (tab === 'Examine') { draw_examine(); - } else if (tab == "SDQL2") { + } else if (tab === 'SDQL2') { draw_sdql2(); - } else if (tab == turfname) { + } else if (tab === turfname) { draw_listedturf(); } else { - statcontentdiv.textContext = "Loading..."; + statcontentdiv.textContext = 'Loading...'; } Byond.winset(Byond.windowId, { - "is-visible": true, + 'is-visible': true, }); } function set_byond_tab(tab) { - Byond.sendMessage("Set-Tab", { tab: tab }); + Byond.sendMessage('Set-Tab', { tab: tab }); } function draw_examine() { - statcontentdiv.textContent = ""; - var div_content = document.createElement("div"); - for (var i = 0; i < examine.length; i++) { - var parameter = document.createElement("p"); - var textList = examine[i].split("||"); + statcontentdiv.textContent = ''; + const div_content = document.createElement('div'); + for (let i = 0; i < examine.length; i++) { + const parameter = document.createElement('p'); + const textList = examine[i].split('||'); if (textList.length > 1) { - for (var j = 0; j < textList.length; j++) { - var spoilerText = document.createElement("span"); + for (let j = 0; j < textList.length; j++) { + const spoilerText = document.createElement('span'); if (j % 2) { - spoilerText.className = "spoiler"; + spoilerText.className = 'spoiler'; } spoilerText.innerHTML = textList[j]; parameter.appendChild(spoilerText); @@ -294,124 +293,121 @@ function draw_examine() { } div_content.appendChild(parameter); } - var images = div_content.querySelectorAll("img"); - for (var i = 0; i < images.length; i++) { - images[i].addEventListener("error", iconError); + const images = div_content.querySelectorAll('img'); + for (let i = 0; i < images.length; i++) { + images[i].addEventListener('error', iconError); } - document.getElementById("statcontent").appendChild(div_content); + document.getElementById('statcontent').appendChild(div_content); } function draw_debug() { - statcontentdiv.textContent = ""; - var wipeverbstabs = document.createElement("div"); - var link = document.createElement("a"); - link.onclick = function () { + statcontentdiv.textContent = ''; + const wipeverbstabs = document.createElement('div'); + const link = document.createElement('a'); + link.onclick = () => { wipe_verbs(); }; - link.textContent = "Wipe All Verbs"; + link.textContent = 'Wipe All Verbs'; wipeverbstabs.appendChild(link); - document.getElementById("statcontent").appendChild(wipeverbstabs); - var wipeUpdateVerbsTabs = document.createElement("div"); - var updateLink = document.createElement("a"); - updateLink.onclick = function () { + document.getElementById('statcontent').appendChild(wipeverbstabs); + const wipeUpdateVerbsTabs = document.createElement('div'); + const updateLink = document.createElement('a'); + updateLink.onclick = () => { update_verbs(); }; - updateLink.textContent = "Wipe and Update All Verbs"; + updateLink.textContent = 'Wipe and Update All Verbs'; wipeUpdateVerbsTabs.appendChild(updateLink); - document.getElementById("statcontent").appendChild(wipeUpdateVerbsTabs); - var text = document.createElement("div"); - text.textContent = "Verb Tabs:"; - document.getElementById("statcontent").appendChild(text); - var table1 = document.createElement("table"); - for (var i = 0; i < verb_tabs.length; i++) { - var part = verb_tabs[i]; + document.getElementById('statcontent').appendChild(wipeUpdateVerbsTabs); + const text = document.createElement('div'); + text.textContent = 'Verb Tabs:'; + document.getElementById('statcontent').appendChild(text); + const table1 = document.createElement('table'); + for (let i = 0; i < verb_tabs.length; i++) { + let part = verb_tabs[i]; // Hide subgroups except admin subgroups if they are split - if (verb_tabs[i].lastIndexOf(".") != -1) { - var splitName = verb_tabs[i].split("."); - if (split_admin_tabs && splitName[0] === "Admin") part = splitName[1]; + if (verb_tabs[i].lastIndexOf('.') !== -1) { + const splitName = verb_tabs[i].split('.'); + if (split_admin_tabs && splitName[0] === 'Admin') part = splitName[1]; else continue; } - var tr = document.createElement("tr"); - var td1 = document.createElement("td"); + const tr = document.createElement('tr'); + const td1 = document.createElement('td'); td1.textContent = part; - var a = document.createElement("a"); - a.onclick = (function (part) { - return function () { - removeStatusTab(part); - }; + const a = document.createElement('a'); + a.onclick = ((part) => () => { + removeStatusTab(part); })(part); - a.textContent = " Delete Tab " + part; + a.textContent = ` Delete Tab ${part}`; td1.appendChild(a); tr.appendChild(td1); table1.appendChild(tr); } - document.getElementById("statcontent").appendChild(table1); - var header2 = document.createElement("div"); - header2.textContent = "Verbs:"; - document.getElementById("statcontent").appendChild(header2); - var table2 = document.createElement("table"); - for (var v = 0; v < verbs.length; v++) { - var part2 = verbs[v]; - var trr = document.createElement("tr"); - var tdd1 = document.createElement("td"); + document.getElementById('statcontent').appendChild(table1); + const header2 = document.createElement('div'); + header2.textContent = 'Verbs:'; + document.getElementById('statcontent').appendChild(header2); + const table2 = document.createElement('table'); + for (let v = 0; v < verbs.length; v++) { + const part2 = verbs[v]; + const trr = document.createElement('tr'); + const tdd1 = document.createElement('td'); tdd1.textContent = part2[0]; - var tdd2 = document.createElement("td"); + const tdd2 = document.createElement('td'); tdd2.textContent = part2[1]; trr.appendChild(tdd1); trr.appendChild(tdd2); table2.appendChild(trr); } - document.getElementById("statcontent").appendChild(table2); - var text3 = document.createElement("div"); - text3.textContent = "Permanent Tabs:"; - document.getElementById("statcontent").appendChild(text3); - var table3 = document.createElement("table"); - for (var i = 0; i < permanent_tabs.length; i++) { - var part3 = permanent_tabs[i]; - var trrr = document.createElement("tr"); - var tddd1 = document.createElement("td"); + document.getElementById('statcontent').appendChild(table2); + const text3 = document.createElement('div'); + text3.textContent = 'Permanent Tabs:'; + document.getElementById('statcontent').appendChild(text3); + const table3 = document.createElement('table'); + for (let i = 0; i < permanent_tabs.length; i++) { + const part3 = permanent_tabs[i]; + const trrr = document.createElement('tr'); + const tddd1 = document.createElement('td'); tddd1.textContent = part3; trrr.appendChild(tddd1); table3.appendChild(trrr); } - document.getElementById("statcontent").appendChild(table3); + document.getElementById('statcontent').appendChild(table3); } function draw_status() { - if (!document.getElementById("Status")) { - createStatusTab("Status"); - current_tab = "Status"; + if (!document.getElementById('Status')) { + createStatusTab('Status'); + current_tab = 'Status'; } - statcontentdiv.textContent = ""; - for (var i = 0; i < status_tab_parts.length; i++) { - if (status_tab_parts[i].trim() == "") { + statcontentdiv.textContent = ''; + for (let i = 0; i < status_tab_parts.length; i++) { + if (status_tab_parts[i].trim() === '') { document - .getElementById("statcontent") - .appendChild(document.createElement("br")); + .getElementById('statcontent') + .appendChild(document.createElement('br')); } else { - var div = document.createElement("div"); + const div = document.createElement('div'); div.textContent = status_tab_parts[i]; - div.className = "status-info"; - document.getElementById("statcontent").appendChild(div); + div.className = 'status-info'; + document.getElementById('statcontent').appendChild(div); } } - if (verb_tabs.length == 0 || !verbs) { - Byond.command("Fix-Stat-Panel"); + if (verb_tabs.length === 0 || !verbs) { + Byond.command('Fix-Stat-Panel'); } } function draw_mc() { - statcontentdiv.textContent = ""; - var table = document.createElement("table"); - for (var i = 0; i < mc_tab_parts.length; i++) { - var part = mc_tab_parts[i]; - var tr = document.createElement("tr"); - var td1 = document.createElement("td"); + statcontentdiv.textContent = ''; + const table = document.createElement('table'); + for (let i = 0; i < mc_tab_parts.length; i++) { + const part = mc_tab_parts[i]; + const tr = document.createElement('tr'); + const td1 = document.createElement('td'); td1.textContent = part[0]; - var td2 = document.createElement("td"); + const td2 = document.createElement('td'); if (part[2]) { - var a = document.createElement("a"); - a.href = - "byond://?_src_=vars;admin_token=" + href_token + ";Vars=" + part[2]; + const a = document.createElement('a'); + a.href = `byond://?_src_=vars;admin_token=${href_token};Vars=${part[2]}`; a.textContent = part[1]; td2.appendChild(a); } else { @@ -421,14 +417,14 @@ function draw_mc() { tr.appendChild(td2); table.appendChild(tr); } - document.getElementById("statcontent").appendChild(table); + document.getElementById('statcontent').appendChild(table); } function remove_tickets() { if (tickets) { tickets = []; - removePermanentTab("Tickets"); - if (current_tab == "Tickets") tab_change("Status"); + removePermanentTab('Tickets'); + if (current_tab === 'Tickets') tab_change('Status'); } checkStatusTab(); } @@ -436,81 +432,81 @@ function remove_tickets() { function remove_sdql2() { if (sdql2) { sdql2 = []; - removePermanentTab("SDQL2"); - if (current_tab == "SDQL2") tab_change("Status"); + removePermanentTab('SDQL2'); + if (current_tab === 'SDQL2') tab_change('Status'); } checkStatusTab(); } function iconError(e) { - setTimeout(function () { - if (current_tab != turfname && current_tab != "Examine") { + setTimeout(() => { + if (current_tab !== turfname && current_tab !== 'Examine') { return; } - var node = e.target; - var current_attempts = Number(node.getAttribute("data-attempts")) || 0; + const node = e.target; + const current_attempts = Number(node.getAttribute('data-attempts')) || 0; if (current_attempts > imageRetryLimit) { return; } - var src = node.src; + const src = node.src; node.src = null; - node.src = src + "#" + current_attempts; - node.setAttribute("data-attempts", current_attempts + 1); + node.src = `${src}#${current_attempts}`; + node.setAttribute('data-attempts', current_attempts + 1); }, imageRetryDelay); } function draw_listedturf() { - statcontentdiv.textContent = ""; - var table = document.createElement("table"); - for (var i = 0; i < turfcontents.length; i++) { - var part = turfcontents[i]; + statcontentdiv.textContent = ''; + const table = document.createElement('table'); + for (let i = 0; i < turfcontents.length; i++) { + const part = turfcontents[i]; if (storedimages[part[1]] == null && part[2]) { - var img = document.createElement("img"); + const img = document.createElement('img'); img.src = part[2]; img.id = part[1]; storedimages[part[1]] = part[2]; img.onerror = iconError; table.appendChild(img); } else { - var img = document.createElement("img"); + const img = document.createElement('img'); img.onerror = iconError; img.src = storedimages[part[1]]; img.id = part[1]; table.appendChild(img); } - var b = document.createElement("div"); - b.className = "link"; - b.onmousedown = (function (part) { + const b = document.createElement('div'); + b.className = 'link'; + b.onmousedown = ((part) => { // The outer function is used to close over a fresh "part" variable, // rather than every onmousedown getting the "part" of the last entry. - return function (e) { + return (e) => { e.preventDefault(); - var params = { src: part[1] }; + const params = { src: part[1] }; switch (e.button) { case 1: - params["statpanel_item_click"] = "middle"; + params.statpanel_item_click = 'middle'; break; case 2: - params["statpanel_item_click"] = "right"; + params.statpanel_item_click = 'right'; break; default: - params["statpanel_item_click"] = "left"; + params.statpanel_item_click = 'left'; } if (e.shiftKey) { - params["statpanel_item_shiftclick"] = 1; + params.statpanel_item_shiftclick = 1; } if (e.ctrlKey) { - params["statpanel_item_ctrlclick"] = 1; + params.statpanel_item_ctrlclick = 1; } if (e.altKey) { - params["statpanel_item_altclick"] = 1; + params.statpanel_item_altclick = 1; } Byond.topic(params); }; })(part); b.textContent = part[0]; table.appendChild(b); - table.appendChild(document.createElement("br")); + table.appendChild(document.createElement('br')); } statcontentdiv.appendChild(table); } @@ -518,30 +514,30 @@ function draw_listedturf() { function remove_listedturf() { removePermanentTab(turfname); checkStatusTab(); - if (current_tab == turfname) { - tab_change("Status"); + if (current_tab === turfname) { + tab_change('Status'); } } function remove_mc() { - removePermanentTab("MC"); - if (current_tab == "MC") { - tab_change("Status"); + removePermanentTab('MC'); + if (current_tab === 'MC') { + tab_change('Status'); } } function draw_sdql2() { - statcontentdiv.textContent = ""; - var table = document.createElement("table"); - for (var i = 0; i < sdql2.length; i++) { - var part = sdql2[i]; - var tr = document.createElement("tr"); - var td1 = document.createElement("td"); + statcontentdiv.textContent = ''; + const table = document.createElement('table'); + for (let i = 0; i < sdql2.length; i++) { + const part = sdql2[i]; + const tr = document.createElement('tr'); + const td1 = document.createElement('td'); td1.textContent = part[0]; - var td2 = document.createElement("td"); + const td2 = document.createElement('td'); if (part[2]) { - var a = document.createElement("a"); - a.href = "byond://?src=" + part[2] + ";statpanel_item_click=left"; + const a = document.createElement('a'); + a.href = `byond://?src=${part[2]};statpanel_item_click=left`; a.textContent = part[1]; td2.appendChild(a); } else { @@ -551,34 +547,29 @@ function draw_sdql2() { tr.appendChild(td2); table.appendChild(tr); } - document.getElementById("statcontent").appendChild(table); + document.getElementById('statcontent').appendChild(table); } function draw_tickets() { - statcontentdiv.textContent = ""; - var table = document.createElement("table"); + statcontentdiv.textContent = ''; + const table = document.createElement('table'); if (!tickets) { return; } - for (var i = 0; i < tickets.length; i++) { - var part = tickets[i]; - var tr = document.createElement("tr"); - var td1 = document.createElement("td"); + for (let i = 0; i < tickets.length; i++) { + const part = tickets[i]; + const tr = document.createElement('tr'); + const td1 = document.createElement('td'); td1.textContent = part[0]; - var td2 = document.createElement("td"); + const td2 = document.createElement('td'); if (part[2]) { - var a = document.createElement("a"); - a.href = - "byond://?_src_=holder;admin_token=" + - href_token + - ";ahelp=" + - part[2] + - ";ahelp_action=ticket;statpanel_item_click=left;action=ticket"; + const a = document.createElement('a'); + a.href = `byond://?_src_=holder;admin_token=${href_token};ahelp=${part[2]};ahelp_action=ticket;statpanel_item_click=left;action=ticket`; a.textContent = part[1]; td2.appendChild(a); } else if (part[3]) { - var a = document.createElement("a"); - a.href = "byond://?src=" + part[3] + ";statpanel_item_click=left"; + const a = document.createElement('a'); + a.href = `byond://?src=${part[3]};statpanel_item_click=left`; a.textContent = part[1]; td2.appendChild(a); } else { @@ -588,85 +579,85 @@ function draw_tickets() { tr.appendChild(td2); table.appendChild(tr); } - document.getElementById("statcontent").appendChild(table); + document.getElementById('statcontent').appendChild(table); } function draw_misc(tab) { - statcontentdiv.textContent = ""; - var table = document.createElement("table"); - table.className = "elemcontainer"; - let data = misc.get(tab); + statcontentdiv.textContent = ''; + const table = document.createElement('table'); + table.className = 'elemcontainer'; + const data = misc.get(tab); if (!data) { return; } - for (var i = 0; i < data.length; i++) { - var tr = document.createElement("tr"); - var part = data[i]; + for (let i = 0; i < data.length; i++) { + const tr = document.createElement('tr'); + const part = data[i]; - var td1 = document.createElement("td"); + const td1 = document.createElement('td'); if (part[0]) { - td1.className = "elem"; + td1.className = 'elem'; td1.textContent = part[0]; } - var td2 = null; + let td2 = null; if (part[1] && storedimages[part[1]] == null && part[2]) { - td2 = document.createElement("td"); - var img = document.createElement("img"); + td2 = document.createElement('td'); + const img = document.createElement('img'); img.src = part[2]; img.id = part[1]; storedimages[part[1]] = part[2]; td2.appendChild(img); } else if (part[1]) { - td2 = document.createElement("td"); - var img = document.createElement("img"); + td2 = document.createElement('td'); + const img = document.createElement('img'); img.src = storedimages[part[1]]; img.id = part[1]; td2.appendChild(img); } - var td3 = null; - var b = document.createElement("div"); + let td3 = null; + const b = document.createElement('div'); if (part[4]) { - b.className = "linkelem"; - b.onmousedown = (function (part) { + b.className = 'linkelem'; + b.onmousedown = ((part) => { // The outer function is used to close over a fresh "part" variable, // rather than every onmousedown getting the "part" of the last entry. - return function (e) { + return (e) => { e.preventDefault(); - var params = { src: part[4] }; + const params = { src: part[4] }; switch (e.button) { case 1: - params["statpanel_item_click"] = "middle"; + params.statpanel_item_click = 'middle'; break; case 2: - params["statpanel_item_click"] = "right"; + params.statpanel_item_click = 'right'; break; default: - params["statpanel_item_click"] = "left"; + params.statpanel_item_click = 'left'; } if (e.shiftKey) { - params["statpanel_item_shiftclick"] = 1; + params.statpanel_item_shiftclick = 1; } if (e.ctrlKey) { - params["statpanel_item_ctrlclick"] = 1; + params.statpanel_item_ctrlclick = 1; } if (e.altKey) { - params["statpanel_item_altclick"] = 1; + params.statpanel_item_altclick = 1; } Byond.topic(params); }; })(part); } if (part[3]) { - td3 = document.createElement("td"); + td3 = document.createElement('td'); b.textContent = part[3]; td3.appendChild(b); } if (!td2 && !td3) { - td1.className = "elem_span3"; + td1.className = 'elem_span3'; td1.colSpan += 2; } else if (!td2) { - td1.className = "elem_span2"; + td1.className = 'elem_span2'; td1.colSpan += 1; } else if (!td3) { td2.colSpan += 1; @@ -680,22 +671,22 @@ function draw_misc(tab) { } table.appendChild(tr); } - document.getElementById("statcontent").appendChild(table); + document.getElementById('statcontent').appendChild(table); } function draw_spells(cat) { - statcontentdiv.textContent = ""; - var table = document.createElement("table"); - for (var i = 0; i < spells.length; i++) { - var part = spells[i]; - if (part[0] != cat) continue; - var tr = document.createElement("tr"); - var td1 = document.createElement("td"); + statcontentdiv.textContent = ''; + const table = document.createElement('table'); + for (let i = 0; i < spells.length; i++) { + const part = spells[i]; + if (part[0] !== cat) continue; + const tr = document.createElement('tr'); + const td1 = document.createElement('td'); td1.textContent = part[1]; - var td2 = document.createElement("td"); + const td2 = document.createElement('td'); if (part[3]) { - var a = document.createElement("a"); - a.href = "byond://?src=" + part[3] + ";statpanel_item_click=left"; + const a = document.createElement('a'); + a.href = `byond://?src=${part[3]};statpanel_item_click=left`; a.textContent = part[2]; td2.appendChild(a); } else { @@ -705,72 +696,72 @@ function draw_spells(cat) { tr.appendChild(td2); table.appendChild(tr); } - document.getElementById("statcontent").appendChild(table); + document.getElementById('statcontent').appendChild(table); } function make_verb_onclick(command) { - return function () { - run_after_focus(function () { + return () => { + run_after_focus(() => { Byond.command(command); }); }; } function draw_verbs(cat) { - statcontentdiv.textContent = ""; - var table = document.createElement("div"); - var additions = {}; // additional sub-categories to be rendered - table.className = "grid-container"; + statcontentdiv.textContent = ''; + const table = document.createElement('div'); + const additions = {}; // additional sub-categories to be rendered + table.className = 'grid-container'; sortVerbs(); - if (split_admin_tabs && cat.lastIndexOf(".") != -1) { - var splitName = cat.split("."); - if (splitName[0] === "Admin") cat = splitName[1]; + if (split_admin_tabs && cat.lastIndexOf('.') !== -1) { + const splitName = cat.split('.'); + if (splitName[0] === 'Admin') cat = splitName[1]; } verbs.reverse(); // sort verbs backwards before we draw - for (var i = 0; i < verbs.length; ++i) { - var part = verbs[i]; - var name = part[0]; - if (split_admin_tabs && name.lastIndexOf(".") != -1) { - var splitName = name.split("."); - if (splitName[0] === "Admin") name = splitName[1]; + for (let i = 0; i < verbs.length; ++i) { + const part = verbs[i]; + let name = part[0]; + if (split_admin_tabs && name.lastIndexOf('.') !== -1) { + const splitName = name.split('.'); + if (splitName[0] === 'Admin') name = splitName[1]; } - var command = part[1]; - var desc = part[2]; + const command = part[1]; + const desc = part[2]; if ( command && - name.lastIndexOf(cat, 0) != -1 && - (name.length == cat.length || name.charAt(cat.length) == ".") + name.lastIndexOf(cat, 0) !== -1 && + (name.length === cat.length || name.charAt(cat.length) === '.') ) { - var subCat = name.lastIndexOf(".") != -1 ? name.split(".")[1] : null; + const subCat = name.lastIndexOf('.') !== -1 ? name.split('.')[1] : null; if (subCat && !additions[subCat]) { - var newTable = document.createElement("div"); - newTable.className = "grid-container"; + const newTable = document.createElement('div'); + newTable.className = 'grid-container'; additions[subCat] = newTable; } - var a = document.createElement("a"); - a.href = "#"; - a.onclick = make_verb_onclick(command.replace(/\s/g, "-")); - a.className = "grid-item"; - a.title = desc || "No description"; - var t = document.createElement("span"); + const a = document.createElement('a'); + a.href = '#'; + a.onclick = make_verb_onclick(command.replace(/\s/g, '-')); + a.className = 'grid-item'; + a.title = desc || 'No description'; + const t = document.createElement('span'); t.textContent = command; - t.className = "grid-item-text"; + t.className = 'grid-item-text'; a.appendChild(t); (subCat ? additions[subCat] : table).appendChild(a); } } // Append base table to view - var content = document.getElementById("statcontent"); + const content = document.getElementById('statcontent'); content.appendChild(table); // Append additional sub-categories if relevant - for (var cat in additions) { - if (additions.hasOwnProperty(cat)) { + for (const cat in additions) { + if (Object.hasOwn(additions, cat)) { // do addition here - var header = document.createElement("h3"); + const header = document.createElement('h3'); header.textContent = cat; content.appendChild(header); content.appendChild(additions[cat]); @@ -779,69 +770,69 @@ function draw_verbs(cat) { } function set_theme(which) { - if (which == "light" || which == "vchatlight") { - document.body.className = ""; - document.documentElement.className = "light"; - } else if (which == "dark" || which == "vchatdark") { - document.body.className = "dark"; - document.documentElement.className = "dark"; + if (which === 'light' || which === 'vchatlight') { + document.body.className = ''; + document.documentElement.className = 'light'; + } else if (which === 'dark' || which === 'vchatdark') { + document.body.className = 'dark'; + document.documentElement.className = 'dark'; } } function set_font_size(size) { - document.body.style.setProperty("font-size", size); + document.body.style.setProperty('font-size', size); } function set_tabs_style(style) { - if (style == "default") { - menu.classList.add("menu-wrap"); - menu.classList.remove("tabs-classic"); - } else if (style == "classic") { - menu.classList.add("menu-wrap"); - menu.classList.add("tabs-classic"); - } else if (style == "scrollable") { - menu.classList.remove("menu-wrap"); - menu.classList.remove("tabs-classic"); + if (style === 'default') { + menu.classList.add('menu-wrap'); + menu.classList.remove('tabs-classic'); + } else if (style === 'classic') { + menu.classList.add('menu-wrap'); + menu.classList.add('tabs-classic'); + } else if (style === 'scrollable') { + menu.classList.remove('menu-wrap'); + menu.classList.remove('tabs-classic'); } } function restoreFocus() { - run_after_focus(function () { - Byond.winset("map", { + run_after_focus(() => { + Byond.winset('map', { focus: true, }); }); } function getCookie(cname) { - var name = cname + "="; - var ca = document.cookie.split(";"); - for (var i = 0; i < ca.length; i++) { - var c = ca[i]; - while (c.charAt(0) == " ") c = c.substring(1); + const name = `${cname}=`; + const ca = document.cookie.split(';'); + for (let i = 0; i < ca.length; i++) { + let c = ca[i]; + while (c.charAt(0) === ' ') c = c.substring(1); if (c.indexOf(name) === 0) { return decoder(c.substring(name.length, c.length)); } } - return ""; + return ''; } function add_verb_list(payload) { - var to_add = payload; // list of a list with category and verb inside it + const to_add = payload; // list of a list with category and verb inside it to_add.sort(); // sort what we're adding - for (var i = 0; i < to_add.length; i++) { - var part = to_add[i]; + for (let i = 0; i < to_add.length; i++) { + const part = to_add[i]; if (!part[0]) continue; - var category = part[0]; - if (category.indexOf(".") != -1) { - var splitName = category.split("."); - if (split_admin_tabs && splitName[0] === "Admin") category = splitName[1]; + let category = part[0]; + if (category.indexOf('.') !== -1) { + const splitName = category.split('.'); + if (split_admin_tabs && splitName[0] === 'Admin') category = splitName[1]; else category = splitName[0]; } if (findVerbindex(part[1], verbs)) continue; if (verb_tabs.includes(category)) { verbs.push(part); - if (current_tab == category) { + if (current_tab === category) { draw_verbs(category); // redraw if we added a verb to the tab we're currently in } } else if (category) { @@ -853,8 +844,8 @@ function add_verb_list(payload) { } function init_spells() { - var cat = ""; - for (var i = 0; i < spell_tabs.length; i++) { + let cat = ''; + for (let i = 0; i < spell_tabs.length; i++) { cat = spell_tabs[i]; if (cat.length > 0) { verb_tabs.push(cat); @@ -863,21 +854,21 @@ function init_spells() { } } -document.addEventListener("mouseup", restoreFocus); -document.addEventListener("keyup", restoreFocus); +document.addEventListener('mouseup', restoreFocus); +document.addEventListener('keyup', restoreFocus); if (!current_tab) { - addPermanentTab("Status"); - tab_change("Status"); + addPermanentTab('Status'); + tab_change('Status'); } -window.onload = function () { - Byond.sendMessage("Update-Verbs"); +window.onload = () => { + Byond.sendMessage('Update-Verbs'); }; -Byond.subscribeTo("update_spells", function (payload) { +Byond.subscribeTo('update_spells', (payload) => { spell_tabs = payload.spell_tabs; - var do_update = false; + let do_update = false; if (spell_tabs.includes(current_tab)) { do_update = true; } @@ -892,9 +883,9 @@ Byond.subscribeTo("update_spells", function (payload) { } }); -Byond.subscribeTo("remove_verb_list", function (v) { - var to_remove = v; - for (var i = 0; i < to_remove.length; i++) { +Byond.subscribeTo('remove_verb_list', (v) => { + const to_remove = v; + for (let i = 0; i < to_remove.length; i++) { remove_verb(to_remove[i]); } check_verbs(); @@ -904,14 +895,14 @@ Byond.subscribeTo("remove_verb_list", function (v) { // passes a 2D list of (verbcategory, verbname) creates tabs and adds verbs to respective list // example (IC, Say) -Byond.subscribeTo("init_verbs", function (payload) { +Byond.subscribeTo('init_verbs', (payload) => { wipe_verbs(); // remove all verb categories so we can replace them checkStatusTab(); // remove all status tabs verb_tabs = payload.panel_tabs; verb_tabs.sort(); // sort it - var do_update = false; - var cat = ""; - for (var i = 0; i < verb_tabs.length; i++) { + let do_update = false; + let cat = ''; + for (let i = 0; i < verb_tabs.length; i++) { cat = verb_tabs[i]; createStatusTab(cat); // create a category if the verb doesn't exist yet } @@ -928,49 +919,49 @@ Byond.subscribeTo("init_verbs", function (payload) { SendTabsToByond(); }); -Byond.subscribeTo("update_stat", function (payload) { +Byond.subscribeTo('update_stat', (payload) => { status_tab_parts = [payload.ping_str]; - var parsed = payload.global_data; + let parsed = payload.global_data; - for (var i = 0; i < parsed.length; i++) + for (let i = 0; i < parsed.length; i++) if (parsed[i] != null) status_tab_parts.push(parsed[i]); parsed = payload.other_str; - for (var i = 0; i < parsed.length; i++) + for (let i = 0; i < parsed.length; i++) if (parsed[i] != null) status_tab_parts.push(parsed[i]); - if (current_tab == "Status") { + if (current_tab === 'Status') { draw_status(); - } else if (current_tab == "Debug Stat Panel") { + } else if (current_tab === 'Debug Stat Panel') { draw_debug(); } }); -Byond.subscribeTo("update_mc", function (payload) { +Byond.subscribeTo('update_mc', (payload) => { mc_tab_parts = payload.mc_data; - mc_tab_parts.splice(0, 0, ["Location:", payload.coord_entry]); + mc_tab_parts.splice(0, 0, ['Location:', payload.coord_entry]); - if (!verb_tabs.includes("MC")) { - verb_tabs.push("MC"); + if (!verb_tabs.includes('MC')) { + verb_tabs.push('MC'); } - createStatusTab("MC"); + createStatusTab('MC'); - if (current_tab == "MC") { + if (current_tab === 'MC') { draw_mc(); } }); -Byond.subscribeTo("remove_spells", function () { - for (var s = 0; s < spell_tabs.length; s++) { +Byond.subscribeTo('remove_spells', () => { + for (let s = 0; s < spell_tabs.length; s++) { removeStatusTab(spell_tabs[s]); } }); -Byond.subscribeTo("init_spells", function () { - var cat = ""; - for (var i = 0; i < spell_tabs.length; i++) { +Byond.subscribeTo('init_spells', () => { + let cat = ''; + for (let i = 0; i < spell_tabs.length; i++) { cat = spell_tabs[i]; if (cat.length > 0) { verb_tabs.push(cat); @@ -979,123 +970,123 @@ Byond.subscribeTo("init_spells", function () { } }); -Byond.subscribeTo("check_spells", function () { - for (var v = 0; v < spell_tabs.length; v++) { +Byond.subscribeTo('check_spells', () => { + for (let v = 0; v < spell_tabs.length; v++) { spell_cat_check(spell_tabs[v]); } }); -Byond.subscribeTo("create_debug", function () { - if (!document.getElementById("Debug Stat Panel")) { - addPermanentTab("Debug Stat Panel"); +Byond.subscribeTo('create_debug', () => { + if (!document.getElementById('Debug Stat Panel')) { + addPermanentTab('Debug Stat Panel'); } else { - removePermanentTab("Debug Stat Panel"); + removePermanentTab('Debug Stat Panel'); } }); -Byond.subscribeTo("create_listedturf", function (TN) { +Byond.subscribeTo('create_listedturf', (TN) => { remove_listedturf(); // remove the last one if we had one turfname = TN; addPermanentTab(turfname); tab_change(turfname); }); -Byond.subscribeTo("create_misc", function (TN) { +Byond.subscribeTo('create_misc', (TN) => { addPermanentTab(TN); }); -Byond.subscribeTo("remove_misc", function (TN) { +Byond.subscribeTo('remove_misc', (TN) => { removePermanentTab(TN); }); -Byond.subscribeTo("remove_admin_tabs", function () { +Byond.subscribeTo('remove_admin_tabs', () => { href_token = null; remove_mc(); remove_tickets(); remove_sdql2(); }); -Byond.subscribeTo("update_listedturf", function (TC) { +Byond.subscribeTo('update_listedturf', (TC) => { turfcontents = TC; - if (current_tab == turfname) { + if (current_tab === turfname) { draw_listedturf(); } }); -Byond.subscribeTo("update_misc", function (payload) { - let TN = payload.TN; - let TC = payload.TC; +Byond.subscribeTo('update_misc', (payload) => { + const TN = payload.TN; + const TC = payload.TC; misc.set(TN, TC); - if (current_tab == TN) { + if (current_tab === TN) { draw_misc(TN); } }); -Byond.subscribeTo("update_split_admin_tabs", function (status) { - status = status == true; +Byond.subscribeTo('update_split_admin_tabs', (status) => { + status = status === true; if (split_admin_tabs !== status) { if (split_admin_tabs === true) { - removeStatusTab("Events"); - removeStatusTab("Fun"); - removeStatusTab("Game"); + removeStatusTab('Events'); + removeStatusTab('Fun'); + removeStatusTab('Game'); } update_verbs(); } split_admin_tabs = status; }); -Byond.subscribeTo("add_admin_tabs", function (ht) { +Byond.subscribeTo('add_admin_tabs', (ht) => { href_token = ht; - addPermanentTab("MC"); - addPermanentTab("Tickets"); + addPermanentTab('MC'); + addPermanentTab('Tickets'); }); -Byond.subscribeTo("add_tickets_tabs", function (ht) { +Byond.subscribeTo('add_tickets_tabs', (ht) => { href_token = ht; - addPermanentTab("Tickets"); + addPermanentTab('Tickets'); }); -Byond.subscribeTo("update_examine", function (payload) { +Byond.subscribeTo('update_examine', (payload) => { examine = payload.EX; - if (examine.length > 0 && !verb_tabs.includes("Examine")) { - verb_tabs.push("Examine"); - addPermanentTab("Examine"); + if (examine.length > 0 && !verb_tabs.includes('Examine')) { + verb_tabs.push('Examine'); + addPermanentTab('Examine'); } - if (current_tab == "Examine") { + if (current_tab === 'Examine') { draw_examine(); } if (payload.UPD) { - tab_change("Examine"); + tab_change('Examine'); } }); -Byond.subscribeTo("update_sdql2", function (S) { +Byond.subscribeTo('update_sdql2', (S) => { sdql2 = S; - if (sdql2.length > 0 && !verb_tabs.includes("SDQL2")) { - verb_tabs.push("SDQL2"); - addPermanentTab("SDQL2"); + if (sdql2.length > 0 && !verb_tabs.includes('SDQL2')) { + verb_tabs.push('SDQL2'); + addPermanentTab('SDQL2'); } - if (current_tab == "SDQL2") { + if (current_tab === 'SDQL2') { draw_sdql2(); } }); -Byond.subscribeTo("update_tickets", function (T) { +Byond.subscribeTo('update_tickets', (T) => { tickets = T; - if (!verb_tabs.includes("Tickets")) { - verb_tabs.push("Tickets"); - addPermanentTab("Tickets"); + if (!verb_tabs.includes('Tickets')) { + verb_tabs.push('Tickets'); + addPermanentTab('Tickets'); } - if (current_tab == "Tickets") { + if (current_tab === 'Tickets') { draw_tickets(); } }); -Byond.subscribeTo("remove_listedturf", remove_listedturf); +Byond.subscribeTo('remove_listedturf', remove_listedturf); -Byond.subscribeTo("remove_sdql2", remove_sdql2); +Byond.subscribeTo('remove_sdql2', remove_sdql2); -Byond.subscribeTo("remove_mc", remove_mc); +Byond.subscribeTo('remove_mc', remove_mc); -Byond.subscribeTo("add_verb_list", add_verb_list); +Byond.subscribeTo('add_verb_list', add_verb_list); diff --git a/maps/expedition_vr/alienship/_alienship.dm b/maps/expedition_vr/alienship/_alienship.dm index c73a99028b..a43aa86b31 100644 --- a/maps/expedition_vr/alienship/_alienship.dm +++ b/maps/expedition_vr/alienship/_alienship.dm @@ -135,7 +135,7 @@ if(isliving(mob) && get_area(mob) == src) abduct(mob) catch - log_debug("Problem doing [mob] for Alienship arrival teleport!") + log_runtime("Problem doing [mob] for Alienship arrival teleport!") did_entry = TRUE diff --git a/maps/offmap_vr/common_offmaps.dm b/maps/offmap_vr/common_offmaps.dm index 5bcba744a7..80d604f3ee 100644 --- a/maps/offmap_vr/common_offmaps.dm +++ b/maps/offmap_vr/common_offmaps.dm @@ -497,7 +497,7 @@ . = ..() if(!LAZYLEN(mobs_to_pick_from)) - error("Mob spawner at [x],[y],[z] ([get_area(src)]) had no mobs_to_pick_from set on it!") + log_mapping("Mob spawner at [x],[y],[z] ([get_area(src)]) had no mobs_to_pick_from set on it!") flags |= ATOM_INITIALIZED return INITIALIZE_HINT_QDEL START_PROCESSING(SSobj, src) diff --git a/maps/submaps/_helpers.dm b/maps/submaps/_helpers.dm index 89ed334e05..1e2991cfad 100644 --- a/maps/submaps/_helpers.dm +++ b/maps/submaps/_helpers.dm @@ -63,7 +63,9 @@ if(FS._stair_tag == _stair_tag) target = FS if(!target && mapload) - to_world(span_danger("Fake stairs at [x],[y],[z] couldn't get a target!")) + var/msg = span_danger("Fake stairs at [x],[y],[z] couldn't get a target!") + to_chat(world, msg) + log_mapping(msg) /obj/structure/fake_stairs/Destroy() if(target) @@ -80,7 +82,7 @@ var/dir_to_use = stepoff_dir ? stepoff_dir : dir var/turf/T = get_step(src, dir_to_use) if(!T) - log_debug("Fake stairs at [x],[y],[z] couldn't move someone to their destination.") + log_mapping("Fake stairs at [x],[y],[z] couldn't move someone to their destination.") return AM.forceMove(T) spawn AM.set_dir(dir_to_use) diff --git a/maps/submaps/engine_submaps/engine.dm b/maps/submaps/engine_submaps/engine.dm index 042afd4efe..9e30d4414c 100644 --- a/maps/submaps/engine_submaps/engine.dm +++ b/maps/submaps/engine_submaps/engine.dm @@ -6,7 +6,7 @@ INITIALIZE_IMMEDIATE(/obj/effect/landmark/engine_loader) /obj/effect/landmark/engine_loader/Initialize(mapload) if(SSmapping.engine_loader) - warning("Duplicate engine_loader landmarks: [log_info_line(src)] and [log_info_line(SSmapping.engine_loader)]") + WARNING("Duplicate engine_loader landmarks: [log_info_line(src)] and [log_info_line(SSmapping.engine_loader)]") delete_me = TRUE SSmapping.engine_loader = src return ..() diff --git a/maps/tether/tether-07-solars.dmm b/maps/tether/tether-07-solars.dmm index b830e0f7b8..b643535132 100644 --- a/maps/tether/tether-07-solars.dmm +++ b/maps/tether/tether-07-solars.dmm @@ -844,7 +844,7 @@ /area/rnd/outpost/mixing) "cf" = ( /turf/simulated/wall, -/area/rnd/outpost/testing) +/area/rnd/outpost/test) "cg" = ( /turf/simulated/wall, /area/rnd/outpost/eva) @@ -975,17 +975,17 @@ "cw" = ( /obj/machinery/bomb_tester, /turf/simulated/floor/tiled/steel_grid, -/area/rnd/outpost/testing) +/area/rnd/outpost/test) "cx" = ( /obj/structure/filingcabinet/filingcabinet, /turf/simulated/floor/tiled/steel_grid, -/area/rnd/outpost/testing) +/area/rnd/outpost/test) "cy" = ( /obj/effect/floor_decal/industrial/warning/cee{ dir = 1 }, /turf/simulated/floor/greengrid, -/area/rnd/outpost/testing) +/area/rnd/outpost/test) "cz" = ( /obj/structure/table/rack, /obj/machinery/door/window/eastleft, @@ -1169,7 +1169,7 @@ /obj/item/folder/white, /obj/item/pen/fountain, /turf/simulated/floor/tiled, -/area/rnd/outpost/testing) +/area/rnd/outpost/test) "cR" = ( /obj/structure/table/standard, /obj/machinery/atmospherics/unary/vent_scrubber/on{ @@ -1182,13 +1182,13 @@ /obj/item/stack/cable_coil, /obj/item/tool/wirecutters, /turf/simulated/floor/tiled, -/area/rnd/outpost/testing) +/area/rnd/outpost/test) "cS" = ( /obj/structure/cable/green{ icon_state = "2-4" }, /turf/simulated/floor/tiled/steel_grid, -/area/rnd/outpost/testing) +/area/rnd/outpost/test) "cT" = ( /obj/machinery/alarm{ pixel_y = 22 @@ -1197,7 +1197,7 @@ dir = 10 }, /turf/simulated/floor/tiled, -/area/rnd/outpost/testing) +/area/rnd/outpost/test) "cU" = ( /obj/machinery/power/apc{ dir = 4; @@ -1208,13 +1208,13 @@ icon_state = "0-8" }, /turf/simulated/floor/tiled/steel_grid, -/area/rnd/outpost/testing) +/area/rnd/outpost/test) "cV" = ( /obj/structure/cable/green{ icon_state = "4-8" }, /turf/simulated/floor/tiled/steel_grid, -/area/rnd/outpost/testing) +/area/rnd/outpost/test) "cW" = ( /obj/structure/table/rack, /obj/machinery/door/window/eastright, @@ -1262,7 +1262,7 @@ products = list(/obj/item/transfer_valve = 3, /obj/item/assembly/timer = 6, /obj/item/assembly/signaler = 6, /obj/item/assembly/prox_sensor = 6, /obj/item/assembly/igniter = 12) }, /turf/simulated/floor/tiled, -/area/rnd/outpost/testing) +/area/rnd/outpost/test) "da" = ( /obj/machinery/atmospherics/unary/vent_pump/high_volume{ frequency = 1379; @@ -1394,33 +1394,33 @@ dir = 8 }, /turf/simulated/floor/tiled, -/area/rnd/outpost/testing) +/area/rnd/outpost/test) "ds" = ( /obj/structure/table/standard, /obj/item/tank/phoron, /turf/simulated/floor/tiled, -/area/rnd/outpost/testing) +/area/rnd/outpost/test) "dt" = ( /obj/structure/cable/green{ icon_state = "1-2" }, /obj/machinery/hologram/holopad, /turf/simulated/floor/tiled/monotile, -/area/rnd/outpost/testing) +/area/rnd/outpost/test) "du" = ( /obj/machinery/atmospherics/pipe/simple/hidden/scrubbers, /turf/simulated/floor/tiled, -/area/rnd/outpost/testing) +/area/rnd/outpost/test) "dv" = ( /obj/structure/dispenser, /obj/machinery/light{ dir = 4 }, /turf/simulated/floor/tiled, -/area/rnd/outpost/testing) +/area/rnd/outpost/test) "dw" = ( /turf/simulated/floor/tiled, -/area/rnd/outpost/testing) +/area/rnd/outpost/test) "dx" = ( /obj/machinery/washing_machine, /obj/machinery/atmospherics/unary/vent_pump/on{ @@ -1590,7 +1590,7 @@ /obj/item/weldingtool, /obj/item/clothing/glasses/welding, /turf/simulated/floor/tiled, -/area/rnd/outpost/testing) +/area/rnd/outpost/test) "dS" = ( /obj/structure/table/standard, /obj/machinery/atmospherics/unary/vent_pump/on{ @@ -1607,20 +1607,20 @@ pixel_y = -24 }, /turf/simulated/floor/tiled, -/area/rnd/outpost/testing) +/area/rnd/outpost/test) "dT" = ( /obj/structure/cable/green{ icon_state = "1-2" }, /turf/simulated/floor/tiled, -/area/rnd/outpost/testing) +/area/rnd/outpost/test) "dU" = ( /obj/machinery/atmospherics/pipe/simple/hidden/supply{ dir = 10 }, /obj/machinery/atmospherics/pipe/simple/hidden/scrubbers, /turf/simulated/floor/tiled, -/area/rnd/outpost/testing) +/area/rnd/outpost/test) "dV" = ( /obj/machinery/vending/cola{ dir = 8 @@ -1632,7 +1632,7 @@ pixel_y = -30 }, /turf/simulated/floor/tiled, -/area/rnd/outpost/testing) +/area/rnd/outpost/test) "dX" = ( /obj/machinery/door/window/southright{ name = "Science Outpost EVA" @@ -1833,7 +1833,7 @@ }, /obj/machinery/door/firedoor/glass, /turf/simulated/floor/tiled, -/area/rnd/outpost/testing) +/area/rnd/outpost/test) "es" = ( /obj/machinery/atmospherics/pipe/simple/hidden/scrubbers, /obj/machinery/atmospherics/pipe/simple/hidden/supply, @@ -1842,7 +1842,7 @@ }, /obj/machinery/door/firedoor/glass, /turf/simulated/floor/tiled, -/area/rnd/outpost/testing) +/area/rnd/outpost/test) "et" = ( /obj/effect/floor_decal/borderfloor{ dir = 9 @@ -4713,7 +4713,7 @@ /area/rnd/outpost/storage) "jw" = ( /turf/simulated/wall/r_wall, -/area/rnd/outpost/anomaly_lab/testing) +/area/rnd/outpost/anomaly_lab/test) "jx" = ( /turf/simulated/wall, /area/rnd/outpost/anomaly_lab) @@ -4884,11 +4884,11 @@ dir = 8 }, /turf/simulated/floor/tiled/dark, -/area/rnd/outpost/anomaly_lab/testing) +/area/rnd/outpost/anomaly_lab/test) "jO" = ( /obj/effect/floor_decal/industrial/warning, /turf/simulated/floor/tiled/dark, -/area/rnd/outpost/anomaly_lab/testing) +/area/rnd/outpost/anomaly_lab/test) "jP" = ( /turf/simulated/wall/r_wall, /area/rnd/outpost/anomaly_lab/airlock) @@ -5026,13 +5026,13 @@ "kf" = ( /obj/effect/floor_decal/industrial/outline/red, /turf/simulated/floor/tiled/dark, -/area/rnd/outpost/anomaly_lab/testing) +/area/rnd/outpost/anomaly_lab/test) "kg" = ( /obj/effect/floor_decal/industrial/warning/corner{ dir = 8 }, /turf/simulated/floor/tiled/dark, -/area/rnd/outpost/anomaly_lab/testing) +/area/rnd/outpost/anomaly_lab/test) "kh" = ( /obj/machinery/door/airlock/glass_external{ frequency = 1453; @@ -5177,7 +5177,7 @@ name = "Anomaly Testing Vent" }, /turf/simulated/floor/reinforced/airless, -/area/rnd/outpost/anomaly_lab/testing) +/area/rnd/outpost/anomaly_lab/test) "kw" = ( /obj/effect/floor_decal/borderfloor{ dir = 4 @@ -5491,7 +5491,7 @@ pixel_x = 25 }, /turf/simulated/floor/tiled/dark, -/area/rnd/outpost/anomaly_lab/testing) +/area/rnd/outpost/anomaly_lab/test) "kV" = ( /obj/machinery/door/firedoor/glass, /obj/structure/cable/green{ @@ -5500,7 +5500,7 @@ /obj/structure/grille, /obj/structure/window/reinforced/full, /turf/simulated/floor/tiled, -/area/rnd/outpost/anomaly_lab/testing) +/area/rnd/outpost/anomaly_lab/test) "kW" = ( /obj/effect/floor_decal/industrial/danger{ dir = 4 @@ -5731,7 +5731,7 @@ "lp" = ( /obj/effect/floor_decal/industrial/warning/corner, /turf/simulated/floor/tiled/dark, -/area/rnd/outpost/anomaly_lab/testing) +/area/rnd/outpost/anomaly_lab/test) "lq" = ( /obj/structure/table/rack, /obj/item/clothing/suit/bio_suit/anomaly, @@ -5874,7 +5874,7 @@ dir = 8 }, /turf/simulated/floor/tiled/dark, -/area/rnd/outpost/anomaly_lab/testing) +/area/rnd/outpost/anomaly_lab/test) "lz" = ( /obj/machinery/alarm{ alarm_id = "anomaly_testing"; @@ -5884,7 +5884,7 @@ report_danger_level = 0 }, /turf/simulated/floor/tiled/dark, -/area/rnd/outpost/anomaly_lab/testing) +/area/rnd/outpost/anomaly_lab/test) "lA" = ( /obj/machinery/airlock_sensor/phoron{ frequency = 1453; @@ -6125,13 +6125,13 @@ dir = 4 }, /turf/simulated/floor/tiled/dark, -/area/rnd/outpost/anomaly_lab/testing) +/area/rnd/outpost/anomaly_lab/test) "lU" = ( /obj/machinery/atmospherics/pipe/manifold/visible/yellow{ dir = 1 }, /turf/simulated/floor/tiled/dark, -/area/rnd/outpost/anomaly_lab/testing) +/area/rnd/outpost/anomaly_lab/test) "lV" = ( /obj/machinery/atmospherics/unary/vent_scrubber{ dir = 8 @@ -6140,13 +6140,13 @@ icon_state = "2-4" }, /turf/simulated/floor/tiled/dark, -/area/rnd/outpost/anomaly_lab/testing) +/area/rnd/outpost/anomaly_lab/test) "lW" = ( /obj/effect/floor_decal/industrial/warning{ dir = 4 }, /turf/simulated/floor/tiled/dark, -/area/rnd/outpost/anomaly_lab/testing) +/area/rnd/outpost/anomaly_lab/test) "lX" = ( /obj/machinery/door/airlock/glass_external{ frequency = 1453; @@ -6253,19 +6253,19 @@ dir = 1 }, /turf/simulated/floor/tiled/dark, -/area/rnd/outpost/anomaly_lab/testing) +/area/rnd/outpost/anomaly_lab/test) "mh" = ( /obj/effect/floor_decal/industrial/warning/corner{ dir = 1 }, /turf/simulated/floor/tiled/dark, -/area/rnd/outpost/anomaly_lab/testing) +/area/rnd/outpost/anomaly_lab/test) "mi" = ( /obj/structure/grille, /obj/machinery/door/firedoor/glass, /obj/structure/window/reinforced/full, /turf/simulated/floor, -/area/rnd/outpost/anomaly_lab/testing) +/area/rnd/outpost/anomaly_lab/test) "mj" = ( /obj/machinery/atmospherics/pipe/simple/hidden/scrubbers, /obj/effect/floor_decal/industrial/warning{ @@ -6433,7 +6433,7 @@ /obj/structure/window/reinforced/full, /obj/machinery/atmospherics/pipe/simple/visible/yellow, /turf/simulated/floor, -/area/rnd/outpost/anomaly_lab/testing) +/area/rnd/outpost/anomaly_lab/test) "mA" = ( /obj/machinery/atmospherics/unary/vent_pump/on, /obj/machinery/alarm{ @@ -6646,7 +6646,7 @@ dir = 4 }, /turf/simulated/floor/tiled/dark, -/area/rnd/outpost/anomaly_lab/testing) +/area/rnd/outpost/anomaly_lab/test) "mS" = ( /obj/machinery/atmospherics/unary/vent_scrubber/on{ dir = 4 @@ -7020,7 +7020,7 @@ /area/rnd/outpost/anomaly_lab) "nI" = ( /turf/simulated/floor/tiled/dark, -/area/rnd/outpost/anomaly_lab/testing) +/area/rnd/outpost/anomaly_lab/test) "nJ" = ( /obj/machinery/power/apc{ dir = 4; @@ -7031,7 +7031,7 @@ icon_state = "0-8" }, /turf/simulated/floor/tiled/dark, -/area/rnd/outpost/anomaly_lab/testing) +/area/rnd/outpost/anomaly_lab/test) "nK" = ( /obj/machinery/atmospherics/portables_connector{ dir = 1 diff --git a/maps/tether/tether_areas.dm b/maps/tether/tether_areas.dm index f2b30d5528..4589a8862b 100644 --- a/maps/tether/tether_areas.dm +++ b/maps/tether/tether_areas.dm @@ -861,7 +861,7 @@ icon_state = "toxmix" ambience = AMBIENCE_ATMOS -/area/rnd/outpost/testing +/area/rnd/outpost/test name = "\improper Research Outpost Testing" icon_state = "toxtest" ambience = AMBIENCE_ATMOS @@ -875,7 +875,7 @@ /area/rnd/outpost/anomaly_lab/analysis name = "\improper Anomaly Lab Analysis Chamber" icon_state = "research" -/area/rnd/outpost/anomaly_lab/testing +/area/rnd/outpost/anomaly_lab/test name = "\improper Anomaly Lab Testing Chamber" icon_state = "research" /area/rnd/outpost/anomaly_lab/airlock diff --git a/maps/virgo_minitest/virgo_minitest_shuttles.dm b/maps/virgo_minitest/virgo_minitest_shuttles.dm index 5516791f46..d92d28aa33 100644 --- a/maps/virgo_minitest/virgo_minitest_shuttles.dm +++ b/maps/virgo_minitest/virgo_minitest_shuttles.dm @@ -59,11 +59,6 @@ landmark_tag = "nav_ferrydemo_transit" flags = SLANDMARK_FLAG_AUTOSET -// /obj/machinery/computer/shuttle_control/power_change() -// log_debug("[src].power_change() - area=[get_area(src)] powered=[powered(power_channel)]") -// . = ..() - - // // MULTI DEMO SHUTTLE // diff --git a/maps/~map_system/maps.dm b/maps/~map_system/maps.dm index a6b4bba2e4..3510aedd3f 100644 --- a/maps/~map_system/maps.dm +++ b/maps/~map_system/maps.dm @@ -11,7 +11,7 @@ var/list/all_maps = list() else M = new type if(!M.path) - log_debug("Map '[M]' does not have a defined path, not adding to map list!") + log_mapping("Map '[M]' does not have a defined path, not adding to map list!") else all_maps[M.path] = M return 1 diff --git a/maps/~map_system/maps_vr.dm b/maps/~map_system/maps_vr.dm index 8b9742915c..3de7c3f242 100644 --- a/maps/~map_system/maps_vr.dm +++ b/maps/~map_system/maps_vr.dm @@ -17,7 +17,7 @@ return if(!islist(picklist)) //So you can have a 'chain' of z-levels that make up one away mission - error("Randompick Z level [picklist] is not a list! Must be in a list!") + log_mapping("Randompick Z level [picklist] is not a list! Must be in a list!") return for(var/map in picklist) @@ -27,7 +27,7 @@ map = pick(map) var/datum/map_template/MT = map_templates[map] if(!istype(MT)) - error("Randompick Z level \"[map]\" is not a valid map!") + log_mapping("Randompick Z level \"[map]\" is not a valid map!") else MT.load_new_z(centered = FALSE) diff --git a/modular_chomp/code/game/machinery/bluespace_denier.dm b/modular_chomp/code/game/machinery/bluespace_denier.dm index 59da71752c..f892074ef7 100644 --- a/modular_chomp/code/game/machinery/bluespace_denier.dm +++ b/modular_chomp/code/game/machinery/bluespace_denier.dm @@ -77,7 +77,7 @@ var/atom/movable/AM = WF.resolve() if(isnull(AM)) - log_debug("DEBUG: HasProximity called without reference on [src].") + log_runtime("DEBUG: HasProximity called without reference on [src].") return if(!anchored || (last_pulse && world.time < last_pulse + 150)) diff --git a/modular_chomp/code/game/objects/effects/step_triggers.dm b/modular_chomp/code/game/objects/effects/step_triggers.dm index 378f68caac..15fb2e261a 100644 --- a/modular_chomp/code/game/objects/effects/step_triggers.dm +++ b/modular_chomp/code/game/objects/effects/step_triggers.dm @@ -5,7 +5,7 @@ /obj/effect/step_trigger/teleporter/deathfall/Trigger(var/atom/movable/A) var/turf/simulated/T = locate(teleport_x, teleport_y, teleport_z) if(!istype(T)) - log_debug("[src] failed to find destination turf.") + log_mapping("[src] failed to find destination turf.") return if(A.hovering)//Flying people dont fall return diff --git a/modular_chomp/code/modules/event/horde_infestation.dm b/modular_chomp/code/modules/event/horde_infestation.dm index 11da53e7a8..96fbbdf230 100644 --- a/modular_chomp/code/modules/event/horde_infestation.dm +++ b/modular_chomp/code/modules/event/horde_infestation.dm @@ -20,13 +20,13 @@ vents += temp_vent if(prob(50)) //50/50 chance on spiders or metroids. - log_debug("Hord event, spiders selected.") + log_game("Hord event, spiders selected.") spawncount = rand(4 * severity, 10 * severity) sent_spiders_to_station = 0 spiders = TRUE else - log_debug("Horde event, metroids selected.") + log_game("Horde event, metroids selected.") spawncount = rand(2 * severity, 4 * severity) metroids = TRUE diff --git a/modular_chomp/code/modules/event/infectedroom.dm b/modular_chomp/code/modules/event/infectedroom.dm index d206f83ead..5e98d1eab9 100644 --- a/modular_chomp/code/modules/event/infectedroom.dm +++ b/modular_chomp/code/modules/event/infectedroom.dm @@ -33,7 +33,7 @@ for(var/i in 1 to 10) var/area/A = pick(affected_area) if(is_area_occupied(A)) - log_debug("infectedroom event: Rejected [A] because it is occupied.") + log_game("infectedroom event: Rejected [A] because it is occupied.") continue var/list/turfs = list() @@ -41,17 +41,17 @@ if(!F.check_density()) turfs += F if(turfs.len == 0) - log_debug("infectedroom event: Rejected [A] because it has no clear turfs.") + log_game("infectedroom event: Rejected [A] because it has no clear turfs.") continue target_area = A target_turfs = turfs if(!target_area) - log_debug("infectedroom event: Giving up after too many failures to pick target area") + log_game("infectedroom event: Giving up after too many failures to pick target area") kill() return else - log_debug("infectedroom event: [target_area] was chosen. Infecting...") + log_game("infectedroom event: [target_area] was chosen. Infecting...") log_admin("Infected room event started; Virus: [chosen_disease.name]") message_admins("Infected room event started; Virus: [chosen_disease.name]") diff --git a/modular_chomp/code/modules/lore_codex/codex_tree.dm b/modular_chomp/code/modules/lore_codex/codex_tree.dm index c1d0f73818..b067a79b9a 100644 --- a/modular_chomp/code/modules/lore_codex/codex_tree.dm +++ b/modular_chomp/code/modules/lore_codex/codex_tree.dm @@ -100,7 +100,7 @@ current_page["[user]"] = home D = current_page["[user]"] if(!istype(D)) - log_debug("Codex_tree failed to failed to load for [user].") + log_runtime("Codex_tree failed to failed to load for [user].") return var/list/H_init = list() H_init.Add(home) diff --git a/modular_chomp/code/modules/lore_codex/cooking_codex.dm b/modular_chomp/code/modules/lore_codex/cooking_codex.dm index 5f8ee3683b..bd1ac7898b 100644 --- a/modular_chomp/code/modules/lore_codex/cooking_codex.dm +++ b/modular_chomp/code/modules/lore_codex/cooking_codex.dm @@ -44,7 +44,7 @@ for(var/Rp in subtypesof(/datum/recipe)) var/datum/recipe/R = new Rp() // Datums must be initialized to read list vars if(!istype(R)) - log_debug("Recipe generation failed, recipe datum is [R].") + log_runtime("Recipe generation failed, recipe datum is [R].") qdel(R) continue diff --git a/modular_chomp/code/modules/overmap/dynamic_sector.dm b/modular_chomp/code/modules/overmap/dynamic_sector.dm index f168a5f766..6170b6f188 100644 --- a/modular_chomp/code/modules/overmap/dynamic_sector.dm +++ b/modular_chomp/code/modules/overmap/dynamic_sector.dm @@ -211,7 +211,7 @@ GLOBAL_VAR_INIT(dynamic_sector_master, null) var/turf/T = locate(round(world.maxx/2), round(world.maxy/2), map_z[1]) // Find center turf, or near center for even-dimension maps. if(!istype(T)) - log_debug("Dynamic overmap POI found [T] instead of a valid turf.") + log_mapping("Dynamic overmap POI found [T] instead of a valid turf.") return // Move the shuttle landmarks. @@ -238,7 +238,7 @@ GLOBAL_VAR_INIT(dynamic_sector_master, null) /obj/effect/overmap/visitable/dynamic/poi/proc/destroy_poi(mob/user) if(!loaded) // Ideally this should never happen. - log_debug("Dynamic overmap POI tried to unload itself but is not loaded.") + log_mapping("Dynamic overmap POI tried to unload itself but is not loaded.") return if(!parent) // Also shouldn't happen. log_and_message_admins("Dynamic overmap POI attempted to unload without a parent z-level.") @@ -246,7 +246,7 @@ GLOBAL_VAR_INIT(dynamic_sector_master, null) qdel(src) return if(!((my_index >= 1) && (my_index <= MAX_DYNAMIC_LEVELS))) // Make sure my_index is sane - log_debug("Dynamic overmap POI attempted to unload with an invalid index.") + log_mapping("Dynamic overmap POI attempted to unload with an invalid index.") loaded = FALSE qdel(src) return @@ -260,7 +260,7 @@ GLOBAL_VAR_INIT(dynamic_sector_master, null) return to_chat(user, "Destabilization initiated...") - log_debug("Dynamic overmap POI unloading initiated...") + log_mapping("Dynamic overmap POI unloading initiated...") // Some math to return a block of block_size turfs (+ 1 to each dimension to account for even-size maps lacking a true center to safely do math with). Basically, start from center turf and subtract half of block_size for bottom left corner, add for top right corner. var/list/turfs_to_reset = block(locate(round(world.maxx/2 - my_template.block_size/2 - 1), round(world.maxy/2 - my_template.block_size/2 - 1), map_z[1]), locate(round(world.maxx/2 + my_template.block_size/2 + 1), round(world.maxy/2 + my_template.block_size/2 + 1), map_z[1])) var/deleted_atoms = 0 @@ -282,7 +282,7 @@ GLOBAL_VAR_INIT(dynamic_sector_master, null) loaded = FALSE map_z = null icon_state = "ring_destroyed" - log_debug("Dynamic POI unload complete, [deleted_atoms] atoms destroyed.") + log_mapping("Dynamic POI unload complete, [deleted_atoms] atoms destroyed.") to_chat(user, "Subspace pocket collapse successful.") qdel(src) diff --git a/modular_chomp/code/modules/paperwork/faxmachine.dm b/modular_chomp/code/modules/paperwork/faxmachine.dm index 707d297517..c11df3bf5d 100644 --- a/modular_chomp/code/modules/paperwork/faxmachine.dm +++ b/modular_chomp/code/modules/paperwork/faxmachine.dm @@ -80,7 +80,7 @@ /obj/machinery/photocopier/faxmachine/message_chat_admins(var/mob/sender, var/faxname, var/obj/item/sent, var/faxid, font_colour="#006100") var/faxmsg if(faxid && fexists("[CONFIG_GET(string/fax_export_dir)]/fax_[faxid].html")) - faxmsg = return_file_text("[CONFIG_GET(string/fax_export_dir)]/fax_[faxid].html") + faxmsg = file2text("[CONFIG_GET(string/fax_export_dir)]/fax_[faxid].html") if(faxmsg) fax_discord_message("A fax; '[faxname]' was sent.\nSender: [sender.name]\nFax name: [sent.name]\nFax ID: **[faxid]**\nFax: ```[strip_html_properly(faxmsg)]```") diff --git a/modular_chomp/maps/common/common_shuttles_crew.dm b/modular_chomp/maps/common/common_shuttles_crew.dm index edd42b7bb1..b73976cfd4 100644 --- a/modular_chomp/maps/common/common_shuttles_crew.dm +++ b/modular_chomp/maps/common/common_shuttles_crew.dm @@ -120,7 +120,7 @@ GLOBAL_LIST_EMPTY(shuttdisp_list) /obj/machinery/status_display/shuttle_display/proc/get_my_shuttle() //Links the displays to their shuttles. Must be called after the shuttle datums exist. var/datum/shuttle/autodock/shuttle = SSshuttles.shuttles[shuttle_tag] if(!shuttle) - log_debug("Shuttle display could not find its shuttle!") + log_mapping("Shuttle display could not find its shuttle!") else my_shuttle = shuttle GLOB.shuttdisp_list -= src //Remove the displays from the global list to reduce memory usage because it's only needed before shuttles initialize. diff --git a/modular_chomp/maps/common/common_things.dm b/modular_chomp/maps/common/common_things.dm index 205c4b424a..6ffc9d90b4 100644 --- a/modular_chomp/maps/common/common_things.dm +++ b/modular_chomp/maps/common/common_things.dm @@ -31,7 +31,7 @@ . = ..() if(!LAZYLEN(mobs_to_pick_from)) - error("Mob spawner at [x],[y],[z] ([get_area(src)]) had no mobs_to_pick_from set on it!") + log_mapping("Mob spawner at [x],[y],[z] ([get_area(src)]) had no mobs_to_pick_from set on it!") flags |= ATOM_INITIALIZED return INITIALIZE_HINT_QDEL START_PROCESSING(SSobj, src) diff --git a/modular_chomp/maps/common/common_wildlife_encounter.dm b/modular_chomp/maps/common/common_wildlife_encounter.dm index f7ac550813..e9a53189b5 100644 --- a/modular_chomp/maps/common/common_wildlife_encounter.dm +++ b/modular_chomp/maps/common/common_wildlife_encounter.dm @@ -34,7 +34,7 @@ /datum/event2/event/wildlife_encounter/start() if(!victim) - log_debug("Failed to find a target for random encounter. Aborting.") + log_game("Failed to find a target for random encounter. Aborting.") abort() return @@ -60,19 +60,19 @@ for(var/i = 1 to potential_victims.len) if (get_dist(spawning_turf, potential_victims[i]) < world.view) spawning_turf = null - log_debug("Failed to locate position out of sight of [potential_victims[i]].") + log_game("Failed to locate position out of sight of [potential_victims[i]].") attempts++ potential_victims = null - log_debug("Sending [number_of_packs] [build_path]\s after \the [victim].") + log_game("Sending [number_of_packs] [build_path]\s after \the [victim].") for(var/i = 1 to number_of_packs) if(spawning_turf) var/mob/living/simple_mob/M = new build_path(spawning_turf) M.ai_holder?.give_destination(get_turf(victim)) else - log_debug("Failed to locate turf to spawn encounter.") + log_game("Failed to locate turf to spawn encounter.") /datum/event2/event/wildlife_encounter/proc/item_to_spawn() return pick(prob(22);/mob/living/simple_mob/animal/sif/savik, diff --git a/modular_chomp/maps/~map_system/maps.dm b/modular_chomp/maps/~map_system/maps.dm index 108e9551f4..33e904fea6 100644 --- a/modular_chomp/maps/~map_system/maps.dm +++ b/modular_chomp/maps/~map_system/maps.dm @@ -10,7 +10,7 @@ var/list/all_maps = list() else M = new type if(!M.path) - log_debug("Map '[M]' does not have a defined path, not adding to map list!") + log_mapping("Map '[M]' does not have a defined path, not adding to map list!") else all_maps[M.path] = M return 1 diff --git a/tgui/packages/tgui/interfaces/LogViewer/CategoryBar.tsx b/tgui/packages/tgui/interfaces/LogViewer/CategoryBar.tsx new file mode 100644 index 0000000000..615a47c2e1 --- /dev/null +++ b/tgui/packages/tgui/interfaces/LogViewer/CategoryBar.tsx @@ -0,0 +1,52 @@ +import { useState } from 'react'; +import { Input, Section, Tabs, Tooltip } from 'tgui-core/components'; +import { CATEGORY_ALL } from './constants'; +import type { CategoryBarProps } from './types'; + +export const CategoryBar = (props: CategoryBarProps) => { + const { options, active, setActive } = props; + + const sorted = [...options].sort(); + const [categorySearch, setCategorySearch] = useState(''); + + return ( +
+ } + > + + setActive('')}> + None + + + setActive(CATEGORY_ALL)} + > + All + + + {sorted + .filter((cat) => + cat.toLowerCase().includes(categorySearch.toLowerCase()), + ) + .map((category) => ( + setActive(category)} + > + {category} + + ))} + +
+ ); +}; diff --git a/tgui/packages/tgui/interfaces/LogViewer/CategoryViewer.tsx b/tgui/packages/tgui/interfaces/LogViewer/CategoryViewer.tsx new file mode 100644 index 0000000000..f03c323ca4 --- /dev/null +++ b/tgui/packages/tgui/interfaces/LogViewer/CategoryViewer.tsx @@ -0,0 +1,149 @@ +import { useState } from 'react'; +import { useBackend } from 'tgui//backend'; +import { + Button, + Collapsible, + Input, + NoticeBox, + Section, + Stack, +} from 'tgui-core/components'; +import { validateRegExp } from './functions'; +import type { CategoryViewerProps } from './types'; + +export const CategoryViewer = (props: CategoryViewerProps) => { + const { act } = useBackend(); + const { data, activeCategory } = props; + + const [search, setSearch] = useState(''); + const [searchRegex, setSearchRegex] = useState(false); + const [caseSensitive, setCaseSensitive] = useState(false); + if (!search && searchRegex) { + setSearchRegex(false); + } + let regexValidation: boolean | SyntaxError = true; + if (searchRegex) { + regexValidation = validateRegExp(search); + } + + return ( +
+ +
+ ); +}; + +const JsonViewer = (props: { data: any; title: string }) => { + const { data, title } = props; + + return ( + +
{JSON.stringify(data, null, 2)}
+
+ ); +}; diff --git a/tgui/packages/tgui/interfaces/LogViewer/constants.ts b/tgui/packages/tgui/interfaces/LogViewer/constants.ts new file mode 100644 index 0000000000..f53d50bc99 --- /dev/null +++ b/tgui/packages/tgui/interfaces/LogViewer/constants.ts @@ -0,0 +1 @@ +export const CATEGORY_ALL = 'all'; diff --git a/tgui/packages/tgui/interfaces/LogViewer/functions.ts b/tgui/packages/tgui/interfaces/LogViewer/functions.ts new file mode 100644 index 0000000000..44488549aa --- /dev/null +++ b/tgui/packages/tgui/interfaces/LogViewer/functions.ts @@ -0,0 +1,8 @@ +export function validateRegExp(str: string) { + try { + new RegExp(str); + return true; + } catch (e) { + return e; + } +} diff --git a/tgui/packages/tgui/interfaces/LogViewer/index.tsx b/tgui/packages/tgui/interfaces/LogViewer/index.tsx new file mode 100644 index 0000000000..e1ce71878c --- /dev/null +++ b/tgui/packages/tgui/interfaces/LogViewer/index.tsx @@ -0,0 +1,53 @@ +import { useState } from 'react'; +import { useBackend } from 'tgui/backend'; +import { Window } from 'tgui/layouts'; +import { Stack } from 'tgui-core/components'; +import { CategoryBar } from './CategoryBar'; +import { CategoryViewer } from './CategoryViewer'; +import { CATEGORY_ALL } from './constants'; +import type { LogViewerCategoryData, LogViewerData } from './types'; + +export const LogViewer = (_: any) => { + const { data } = useBackend(); + + const [activeCategory, setActiveCategory] = useState(''); + + let viewerData: LogViewerCategoryData = { + entry_count: 0, + entries: [], + }; + + if (activeCategory) { + if (activeCategory !== CATEGORY_ALL) { + viewerData = data.categories[activeCategory]; + } else { + for (const category in data.categories) { + const categoryData = data.categories[category]; + for (const entry of categoryData.entries) { + viewerData.entries.push(entry); + } + viewerData.entry_count += categoryData.entry_count; + } + viewerData.entries.sort((a, b) => a.id - b.id); + } + } + + return ( + + + + + + + + + + + + + ); +}; diff --git a/tgui/packages/tgui/interfaces/LogViewer/types.ts b/tgui/packages/tgui/interfaces/LogViewer/types.ts new file mode 100644 index 0000000000..0a6807969f --- /dev/null +++ b/tgui/packages/tgui/interfaces/LogViewer/types.ts @@ -0,0 +1,36 @@ +export type LogViewerData = { + round_id: number; + logging_start_timestamp: string; + tree: LogViewerCategoryTree; + last_data_update: number; + categories: Record; +}; + +export type LogViewerCategoryTree = { + enabled: string[]; + disabled: string[]; +}; + +export type LogViewerCategoryData = { + entry_count: number; + entries: LogEntryData[]; +}; + +export type LogEntryData = { + id: number; + message: string; + timestamp: string; + semver?: Record; + data?: any[]; +}; + +export type CategoryBarProps = { + options: string[]; + active: string; + setActive: (active: string) => void; +}; + +export type CategoryViewerProps = { + activeCategory: string; + data?: LogViewerCategoryData; +}; diff --git a/tgui/packages/tgui/interfaces/PlayerNotes.tsx b/tgui/packages/tgui/interfaces/PlayerNotes.tsx index 0d6ab55d64..5022dc104f 100644 --- a/tgui/packages/tgui/interfaces/PlayerNotes.tsx +++ b/tgui/packages/tgui/interfaces/PlayerNotes.tsx @@ -1,6 +1,7 @@ +import { useState } from 'react'; import { useBackend } from 'tgui/backend'; import { Window } from 'tgui/layouts'; -import { Button, Divider, Section, Table } from 'tgui-core/components'; +import { Button, Section, Stack, Table } from 'tgui-core/components'; type Data = { device_theme: string; @@ -13,6 +14,8 @@ export const PlayerNotes = (props) => { const { act, data } = useBackend(); const { device_theme, filter, pages, ckeys } = data; + const [activePage, setActivePage] = useState(1); + const runCallback = (cb) => { return cb(); }; @@ -24,67 +27,100 @@ export const PlayerNotes = (props) => { width={400} height={500} > - -
- - - - - act('show_player_info', { - name: value, - }) - } - /> - - - - - {ckeys.map((ckey) => ( - - + +
+ + + + + + + + + + + + + + + act('show_player_info', { - name: ckey.name, + name: value, }) } + /> + + + + - - - ))} -
- - {runCallback(() => { - const row: any[] = []; - for (let i = 1; i < pages; i++) { - row.push( - , - ); - } - return row; - })} + + + + + + + {ckeys.map((ckey) => ( + + + + + + ))} +
+
+ + + {runCallback(() => { + const row: any[] = []; + for (let i = 1; i < pages; i++) { + row.push( + , + ); + } + return row; + })} + +
diff --git a/vorestation.dme b/vorestation.dme index 1f6851d139..427d106441 100644 --- a/vorestation.dme +++ b/vorestation.dme @@ -21,6 +21,7 @@ #include "code\__byond_version_compat.dm" #include "code\__odlint.dm" #include "code\__spaceman_dmm.dm" +#include "code\_compile_options.dm" #include "code\_macros.dm" #include "code\coalesce.dm" #include "code\global_init.dm" @@ -30,6 +31,7 @@ #include "code\__defines\_bitfields.dm" #include "code\__defines\_click.dm" #include "code\__defines\_compile_options.dm" +#include "code\__defines\_flags.dm" #include "code\__defines\_fruits.dm" #include "code\__defines\_helpers.dm" #include "code\__defines\_init.dm" @@ -180,6 +182,7 @@ #include "code\__defines\spells.dm" #include "code\__defines\sprite_sheets.dm" #include "code\__defines\sqlite_defines.dm" +#include "code\__defines\stack_trace.dm" #include "code\__defines\stat_tracking.dm" #include "code\__defines\statpanel.dm" #include "code\__defines\subsystems.dm" @@ -274,13 +277,12 @@ #include "code\_helpers\generators.dm" #include "code\_helpers\global_lists.dm" #include "code\_helpers\global_lists_vr.dm" +#include "code\_helpers\guid.dm" #include "code\_helpers\icons.dm" #include "code\_helpers\icons_procs.dm" #include "code\_helpers\icons_vr.dm" #include "code\_helpers\legacy_tg_path_ch.dm" #include "code\_helpers\lighting.dm" -#include "code\_helpers\logging.dm" -#include "code\_helpers\logging_vr.dm" #include "code\_helpers\matrices.dm" #include "code\_helpers\mobs.dm" #include "code\_helpers\nameof.dm" @@ -292,6 +294,7 @@ #include "code\_helpers\sanitize_values.dm" #include "code\_helpers\screen_objs.dm" #include "code\_helpers\shell.dm" +#include "code\_helpers\stack_trace.dm" #include "code\_helpers\storage.dm" #include "code\_helpers\string_lists.dm" #include "code\_helpers\text.dm" @@ -308,7 +311,15 @@ #include "code\_helpers\widelists_ch.dm" #include "code\_helpers\graphs\astar_ch.dm" #include "code\_helpers\icons\flatten.dm" +#include "code\_helpers\logging\_logging.dm" +#include "code\_helpers\logging\admin.dm" +#include "code\_helpers\logging\attack.dm" #include "code\_helpers\logging\debug.dm" +#include "code\_helpers\logging\game.dm" +#include "code\_helpers\logging\mob.dm" +#include "code\_helpers\logging\pda.dm" +#include "code\_helpers\logging\research.dm" +#include "code\_helpers\logging\talk.dm" #include "code\_helpers\logging\ui.dm" #include "code\_helpers\pathfinding_ch\astar.dm" #include "code\_helpers\pathfinding_ch\common.dm" @@ -1596,13 +1607,10 @@ #include "code\game\objects\items\devices\radio\beacon.dm" #include "code\game\objects\items\devices\radio\electropack.dm" #include "code\game\objects\items\devices\radio\encryptionkey.dm" -#include "code\game\objects\items\devices\radio\encryptionkey_vr.dm" #include "code\game\objects\items\devices\radio\headset.dm" #include "code\game\objects\items\devices\radio\intercom.dm" #include "code\game\objects\items\devices\radio\jammer.dm" -#include "code\game\objects\items\devices\radio\jammer_vr.dm" #include "code\game\objects\items\devices\radio\radio.dm" -#include "code\game\objects\items\devices\radio\radio_vr.dm" #include "code\game\objects\items\devices\radio\radio_yw.dm" #include "code\game\objects\items\devices\radio\radiopack.dm" #include "code\game\objects\items\devices\scanners\gas.dm" @@ -2319,6 +2327,7 @@ #include "code\modules\client\client procs.dm" #include "code\modules\client\client procs_vr.dm" #include "code\modules\client\movement.dm" +#include "code\modules\client\persistent_client.dm" #include "code\modules\client\preferences.dm" #include "code\modules\client\preferences_factions.dm" #include "code\modules\client\preferences_savefile.dm" @@ -2686,10 +2695,8 @@ #include "code\modules\entopics_vr\entopics.dm" #include "code\modules\entrepreneur\entrepreneur_items.dm" #include "code\modules\env_message\env_message.dm" -#include "code\modules\error_handler\_defines.dm" #include "code\modules\error_handler\error_handler.dm" #include "code\modules\error_handler\error_viewer.dm" -#include "code\modules\error_handler\~defines.dm" #include "code\modules\eventkit\event_machinery.dm" #include "code\modules\eventkit\medical_issues.dm" #include "code\modules\eventkit\collector_event\admin_commands.dm" @@ -3079,6 +3086,17 @@ #include "code\modules\lighting\lighting_turf.dm" #include "code\modules\lighting\planet_sunlight.dm" #include "code\modules\lighting\sunlight_handler.dm" +#include "code\modules\logging\log_category.dm" +#include "code\modules\logging\log_entry.dm" +#include "code\modules\logging\log_holder.dm" +#include "code\modules\logging\categories\log_category_admin.dm" +#include "code\modules\logging\categories\log_category_compats.dm" +#include "code\modules\logging\categories\log_category_debug.dm" +#include "code\modules\logging\categories\log_category_game.dm" +#include "code\modules\logging\categories\log_category_href.dm" +#include "code\modules\logging\categories\log_category_internal.dm" +#include "code\modules\logging\categories\log_category_misc.dm" +#include "code\modules\logging\categories\log_category_pda.dm" #include "code\modules\looking_glass\lg_area.dm" #include "code\modules\looking_glass\lg_console.dm" #include "code\modules\looking_glass\lg_imageholder.dm"