diff --git a/code/game/objects/structures/medical_stand_vr.dm b/code/game/objects/structures/medical_stand_vr.dm index 0f12674003..4630658586 100644 --- a/code/game/objects/structures/medical_stand_vr.dm +++ b/code/game/objects/structures/medical_stand_vr.dm @@ -190,7 +190,7 @@ update_icon() return else if (!is_loosen) - user.visible_message(span_warningplain(span_bold("\The [user]") + " tries to removes \the [tank] from \the [src] but it won't budge."), span_warning("You try to removes \the [tank] from \the [src] but it won't budge.")) + user.visible_message(span_warningplain(span_bold("\The [user]") + " tries to removes \the [tank] from \the [src] but it won't budge."), span_warning("You try to remove \the [tank] from \the [src] but it won't budge.")) return if ("Toggle valve") if (!tank) diff --git a/code/modules/logging/log_category.dm b/code/modules/logging/log_category.dm index 363fb5ad0b..73f2992aa2 100644 --- a/code/modules/logging/log_category.dm +++ b/code/modules/logging/log_category.dm @@ -27,12 +27,15 @@ /// 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() + /// Ring buffer of log entries for this category + var/list/log_ring = list() /// Total number of entries this round so far var/entry_count = 0 + /// We have a lot more than those log lines, so we only store the last ones in a ring + var/ring_write_index = 1 + 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! @@ -49,8 +52,14 @@ GENERAL_PROTECT_DATUM(/datum/log_category) write_entry(entry) entry_count += 1 + if(entry_count <= CONFIG_MAX_CACHED_LOG_ENTRIES) - entries += entry + log_ring += entry + else + log_ring[ring_write_index] = entry + ring_write_index++ + if(ring_write_index > CONFIG_MAX_CACHED_LOG_ENTRIES) + ring_write_index = 1 /// 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) @@ -68,3 +77,31 @@ GENERAL_PROTECT_DATUM(/datum/log_category) entry.write_readable_entry_to_file(get_output_file(entry, "log"), format_internally = internal_formatting) entry.write_entry_to_file(get_output_file(entry)) + +/datum/log_category/proc/access_logs() + var/list/result = list() + var/count = min(entry_count, CONFIG_MAX_CACHED_LOG_ENTRIES) + + for(var/i = 0, i < count, i++) + var/index = ((ring_write_index - count + i - 1 + CONFIG_MAX_CACHED_LOG_ENTRIES) % CONFIG_MAX_CACHED_LOG_ENTRIES) + 1 + result += log_ring[index] + + return result + +/datum/log_category/proc/build_ui_log_entries() + var/list/entries = list() + var/count = min(entry_count, CONFIG_MAX_CACHED_LOG_ENTRIES) + + for(var/i = 0, i < count, i++) + var/index = ((ring_write_index - count + i - 1 + CONFIG_MAX_CACHED_LOG_ENTRIES) % CONFIG_MAX_CACHED_LOG_ENTRIES) + 1 + var/datum/log_entry/entry = log_ring[index] + + entries += list(list( + "id" = entry.id, + "message" = entry.message, + "timestamp" = entry.timestamp, + "data" = entry.data, + "semver" = entry.semver_store + )) + + return entries diff --git a/code/modules/logging/log_holder.dm b/code/modules/logging/log_holder.dm index 10e4ef2acd..8e82c17d4e 100644 --- a/code/modules/logging/log_holder.dm +++ b/code/modules/logging/log_holder.dm @@ -79,16 +79,7 @@ ADMIN_VERB(log_viewer_new, R_ADMIN|R_MOD|R_DEBUG, "View Round Logs", "View the r 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["entries"] = category.build_ui_log_entries() category_data["entry_count"] = category.entry_count category_map[category.category] = category_data diff --git a/code/modules/power/lighting.dm b/code/modules/power/lighting.dm index e05d715e63..221c34629b 100644 --- a/code/modules/power/lighting.dm +++ b/code/modules/power/lighting.dm @@ -825,7 +825,7 @@ GLOBAL_LIST_EMPTY(light_type_cache) else if(TK in user.mutations) to_chat(user, "You telekinetically remove the light [get_fitting_name()].") else - to_chat(user, "You try to remove the light [get_fitting_name()], but it's too hot and you don't want to burn your hand.") + to_chat(user, "You try to remove the [get_fitting_name()], but it's too hot and you don't want to burn your hand.") return // if burned, don't remove the light else to_chat(user, "You remove the light [get_fitting_name()].") diff --git a/tgui/packages/common/storage.ts b/tgui/packages/common/storage.ts index 8dc8c22eb1..58b15341cf 100644 --- a/tgui/packages/common/storage.ts +++ b/tgui/packages/common/storage.ts @@ -172,6 +172,7 @@ class StorageProxy implements StorageBackend { setTimeout(async () => { const hub = new HubStorageBackend(); + // Migrate these existing settings from byondstorage to the IFrame for (const setting of [ 'panel-settings', 'chat-state',