From 788fd92161d24d2e8853ebe94980805383ccee33 Mon Sep 17 00:00:00 2001 From: VerySoft Date: Sun, 15 Dec 2024 05:49:02 -0500 Subject: [PATCH 1/4] peep --- code/__defines/dcs/signals_rs.dm | 1 + code/controllers/subsystems/transcore_vr.dm | 15 +++++- code/modules/client/stored_item.dm | 25 +++++++++- .../living/Character Persist/item_storage.dm | 35 +++++++++++++- code/modules/resleeving/implant.dm | 46 ++++++++++++++++++- code/modules/vore/persist/persist_vr.dm | 2 + vorestation.dme | 1 + 7 files changed, 119 insertions(+), 6 deletions(-) create mode 100644 code/__defines/dcs/signals_rs.dm diff --git a/code/__defines/dcs/signals_rs.dm b/code/__defines/dcs/signals_rs.dm new file mode 100644 index 00000000000..efb77a017f1 --- /dev/null +++ b/code/__defines/dcs/signals_rs.dm @@ -0,0 +1 @@ +#define COMSIG_BACKUP_IMPLANT "backup_implant" diff --git a/code/controllers/subsystems/transcore_vr.dm b/code/controllers/subsystems/transcore_vr.dm index f185c4bbb81..a26bf751c1e 100644 --- a/code/controllers/subsystems/transcore_vr.dm +++ b/code/controllers/subsystems/transcore_vr.dm @@ -9,7 +9,7 @@ SUBSYSTEM_DEF(transcore) name = "Transcore" priority = 20 - wait = 3 MINUTES + wait = 10 SECONDS //RS edit - reduced from 3 minutes, because not firing at all means the MC panel will never update flags = SS_BACKGROUND runlevels = RUNLEVEL_GAME init_order = INIT_ORDER_TRANSCORE @@ -27,6 +27,8 @@ SUBSYSTEM_DEF(transcore) var/list/current_run = list() + var/cooldown = 18 //RS ADD - A countdown used with wait. While cooldown is 0, fire will signal, otherwise it only counts down + /datum/controller/subsystem/transcore/Initialize() default_db = new() databases["default"] = default_db @@ -39,10 +41,19 @@ SUBSYSTEM_DEF(transcore) return ..() /datum/controller/subsystem/transcore/fire(resumed = 0) - var/timer = TICK_USAGE + cooldown -- //RS ADD - countdown to send the signal + + if(cooldown == 0) + SEND_SIGNAL(src, COMSIG_BACKUP_IMPLANT) //Rather than doing a bunch of for or whiles, just signal every implant to update itself. + cooldown = 18 + +//RS EDIT START +/* var/timer = TICK_USAGE INTERNAL_PROCESS_STEP(SSTRANSCORE_IMPLANTS,TRUE,process_implants,cost_implants,SSTRANSCORE_BACKUPS) INTERNAL_PROCESS_STEP(SSTRANSCORE_BACKUPS,FALSE,process_backups,cost_backups,SSTRANSCORE_IMPLANTS) +*/ +//RS EDIT END /datum/controller/subsystem/transcore/proc/process_implants(resumed = 0) if (!resumed) diff --git a/code/modules/client/stored_item.dm b/code/modules/client/stored_item.dm index a8fb2fa4b54..bdd7bbeba8b 100644 --- a/code/modules/client/stored_item.dm +++ b/code/modules/client/stored_item.dm @@ -123,8 +123,18 @@ busy_bank = FALSE icon_state = "item_bank" return - var/ourtype = user.etching.item_storage[our_item] //RS EDIT - var/obj/N = new ourtype(get_turf(src)) //RS EDIT + var/ourtype = user.etching.item_storage[our_item] //RS EDIT START + var/backup + if(!ispath(ourtype)) + backup = ourtype + ourtype = text2path(ourtype) + + if(!ourtype) + user.etching.item_storage -= our_item + log_and_message_admins("[user]/[user.ckey] attempted to retrieve an invalid item: [our_item] - [backup]") + + return + var/obj/N = new ourtype(get_turf(src)) //RS EDIT END log_admin("[key_name_admin(user)] retrieved [N] from the item bank.") visible_message("\The [src] dispenses the [N] to \the [user].") user.put_in_hands(N) @@ -165,6 +175,17 @@ icon_state = "item_bank" return var/ourtype = user.etching.unlockables[our_item] + //RS EDIT START + var/backup + if(!ispath(ourtype)) + backup = ourtype + ourtype = text2path(ourtype) + + if(!ourtype) + user.etching.unlockables -= our_item + log_and_message_admins("[user]/[user.ckey] attempted to retrieve an invalid unlockable item: [our_item] - [backup]") + return + //RS EDIT END var/obj/N = new ourtype(get_turf(src)) log_admin("[key_name_admin(user)] retrieved [N] from the item bank.") visible_message("\The [src] dispenses the [N] to \the [user].") diff --git a/code/modules/mob/living/Character Persist/item_storage.dm b/code/modules/mob/living/Character Persist/item_storage.dm index 1f3ced9d17f..5f48b79e535 100644 --- a/code/modules/mob/living/Character Persist/item_storage.dm +++ b/code/modules/mob/living/Character Persist/item_storage.dm @@ -45,6 +45,9 @@ var/global/list/permanent_unlockables = list( var/triangles = 0 //Triangle money var/list/item_storage = list() //Various items that are stored in the bank, these can only be stored and pulled out once var/list/unlockables = list() //Scene items that, once stored, can be pulled once per round forever. + var/nif_type = null //The type of nif you have + var/nif_durability = 0 //The durability of your nif + var/nif_savedata = list() /datum/etching/proc/store_item(item,var/obj/machinery/item_bank/bank) if(!isobj(item)) @@ -128,12 +131,18 @@ var/global/list/permanent_unlockables = list( item_storage = null item_storage = load["item_storage"] unlockables = load["unlockables"] + nif_type = load["nif_type"] + nif_durability = load["nif_durability"] + nif_savedata = load["nif_savedata"] /datum/etching/proc/item_save() var/list/to_save = list( "triangles" = triangles, "item_storage" = item_storage, - "unlockables" = unlockables + "unlockables" = unlockables, + "nif_type" = nif_type, + "nif_durability" = nif_durability, + "nif_savedata" = nif_savedata ) return to_save @@ -146,3 +155,27 @@ var/global/list/permanent_unlockables = list( if(.) . += "\n" . += our_money + +/datum/etching/proc/update_nif(var/mob/living/carbon/human/H) + if(H.nif) //We have a nif, let's see if it needs to be updated + if(H.nif.owner != ourmob.real_name) //Is this nif ours? If not, we shouldn't save it + nif_type = null + nif_durability = 0 + needs_saving = TRUE + if(H.nif.type != nif_type) //Our nif types don't match, we either just got a nif, or we got an upgrade, nice, let's record it! + nif_type = H.nif.type + nif_durability = H.nif.durability + needs_saving = TRUE + else if(nif_type) //We don't have a nif, but we do have a record of one, so we probably got ours removed, let's clear the data. + nif_type = null + nif_durability = 0 + needs_saving = TRUE + +/proc/persist_nif_data(var/mob/living/carbon/human/H) + to_world("persist_nif_data") + if(!ishuman(H)) //We are not a human, don't bother! + stack_trace("Persist (NIF): Given a nonhuman: [H]") + return + if(!H.etching) //We do not have the ability to save character persist data, don't bother! + return + H.etching.update_nif(H) diff --git a/code/modules/resleeving/implant.dm b/code/modules/resleeving/implant.dm index 3290cc26c1b..c8df086e39f 100644 --- a/code/modules/resleeving/implant.dm +++ b/code/modules/resleeving/implant.dm @@ -17,6 +17,7 @@ // Needs a matching /datum/transcore_db with key defined in code var/db_key var/datum/transcore_db/our_db // These persist all round and are never destroyed, just keep a hard ref + var/our_mob_name //RS EDIT START /obj/item/weapon/implant/backup/get_data() var/dat = {" @@ -37,8 +38,30 @@ /obj/item/weapon/implant/backup/Initialize() . = ..() + RegisterSignal(SStranscore,COMSIG_BACKUP_IMPLANT,PROC_REF(check_backup), TRUE) //RS ADD - Listen for transcore to fire so we can update now and then + our_db = SStranscore.db_by_key(db_key) +/obj/item/weapon/implant/backup/proc/check_backup() //RS ADD START + if(!our_db) //Something is wrong, let's not + return + if(!imp_in) //We haven't been implanted + return + if(!isorgan(src.loc)) //We are probably still in the implanter, don't do anything + return + var/obj/item/organ/O = src.loc + if(!ishuman(O.owner)) //We are in an organ, but that organ isn't in a human mob, something bad probably happened... + return + + var/mob/living/carbon/human/H = O.owner + + BITSET(H.hud_updateflag, BACKUP_HUD) + ////BODY BACKUP//// + if(H == imp_in && H.mind && H.stat < DEAD) + our_db.m_backup(H.mind,H.nif) + +//RS ADD END + /obj/item/weapon/implant/backup/Destroy() our_db.implants -= src return ..() @@ -47,9 +70,30 @@ if(istype(H)) BITSET(H.hud_updateflag, BACKUP_HUD) our_db.implants |= src - + //RS ADD START + RegisterSignal(H, COMSIG_MOB_DEATH, PROC_REF(mob_death), TRUE) //Listen for our mob to die + RegisterSignal(H, COMSIG_PARENT_QDELETING, PROC_REF(mob_death), TRUE) //Listen for our mob to be deleted (gurgles) + check_backup() //Let's get backed up right now + our_mob_name = H.real_name //To prevent race conditions, let's write down our mob's name in case the mob no longer exists when we need to update the db + //RS ADD END return 1 +//RS ADD START +/obj/item/weapon/implant/backup/proc/mob_death() + if(!our_mob_name) //Our implant never got set up right, so we can't get updated about death + return + + var/datum/transhuman/mind_record/curr_MR = our_db.backed_up[our_mob_name] //Using our name to get our mind record from the DB + + if(!curr_MR) //We couldn't find a mind record + return + + //Onetimes do not get processing or notifications + if(curr_MR.one_time) + return + curr_MR.dead_state = MR_DEAD //Tell the mind record we died +//RS ADD END + //New, modern implanter instead of old style implanter. /obj/item/weapon/backup_implanter name = "backup implanter" diff --git a/code/modules/vore/persist/persist_vr.dm b/code/modules/vore/persist/persist_vr.dm index 3b5e490ffd4..381ce27717b 100644 --- a/code/modules/vore/persist/persist_vr.dm +++ b/code/modules/vore/persist/persist_vr.dm @@ -235,6 +235,7 @@ * towards future shenanigans such as upgradable NIFs or different types or things of that nature, * without invoking the need for a bunch of different save file variables. */ +/* //RS EDIT - Rewritten and added to item_storage.dm /proc/persist_nif_data(var/mob/living/carbon/human/H,var/datum/preferences/prefs) if(!istype(H)) stack_trace("Persist (NIF): Given a nonhuman: [H]") @@ -269,3 +270,4 @@ if(!S) warning("Persist (NIF): Couldn't load NIF save savefile? [prefs.real_name]") S.cd = "/character[prefs.default_slot]" nif_prefs.save_character(S) +*/ diff --git a/vorestation.dme b/vorestation.dme index 9fb1da03b61..2e114e5df57 100644 --- a/vorestation.dme +++ b/vorestation.dme @@ -117,6 +117,7 @@ #include "code\__defines\dcs\flags.dm" #include "code\__defines\dcs\helpers.dm" #include "code\__defines\dcs\signals.dm" +#include "code\__defines\dcs\signals_rs.dm" #include "code\_global_vars\bitfields.dm" #include "code\_global_vars\misc.dm" #include "code\_global_vars\mobs.dm" From 351f2a0fce66389382c59a6f73d0ca849470de59 Mon Sep 17 00:00:00 2001 From: VerySoft Date: Thu, 19 Dec 2024 06:51:13 -0500 Subject: [PATCH 2/4] 0650 --- .../client/preference_setup/vore/08_nif.dm | 7 +- code/modules/client/preferences_savefile.dm | 2 + .../character_persistance_core.dm | 76 +++++++++++++------ .../living/Character Persist/item_storage.dm | 53 +++++++++++-- code/modules/nifsoft/nif.dm | 1 + code/modules/nifsoft/nif_tgui.dm | 1 + .../nifsoft/software/13_soulcatcher.dm | 1 + code/modules/nifsoft/software/14_commlink.dm | 1 + maps/virgo_minitest/virgo_minitest-1.dmm | 49 +++++++++--- 9 files changed, 154 insertions(+), 37 deletions(-) diff --git a/code/modules/client/preference_setup/vore/08_nif.dm b/code/modules/client/preference_setup/vore/08_nif.dm index d502fb447bf..f498a6c91ae 100644 --- a/code/modules/client/preference_setup/vore/08_nif.dm +++ b/code/modules/client/preference_setup/vore/08_nif.dm @@ -14,10 +14,12 @@ S["nif_durability"] >> pref.nif_durability S["nif_savedata"] >> pref.nif_savedata +/* //RS REMOVE /datum/category_item/player_setup_item/vore/nif/save_character(var/savefile/S) S["nif_path"] << pref.nif_path S["nif_durability"] << pref.nif_durability S["nif_savedata"] << pref.nif_savedata +*/ /datum/category_item/player_setup_item/vore/nif/sanitize_character() if(pref.nif_path && !ispath(pref.nif_path)) //We have at least a text string that should be a path. @@ -36,7 +38,9 @@ if(!islist(pref.nif_savedata)) pref.nif_savedata = list() +/* RS REMOVAL - gets handled elsewhere /datum/category_item/player_setup_item/vore/nif/copy_to_mob(var/mob/living/carbon/human/character) + //If you had a NIF... if((character.type == /mob/living/carbon/human) && ispath(pref.nif_path) && pref.nif_durability) new pref.nif_path(character,pref.nif_durability,pref.nif_savedata) @@ -55,6 +59,7 @@ if(!S) WARNING ("Couldn't load NIF save savefile? [pref.real_name]") S.cd = "/character[pref.default_slot]" save_character(S) + */ /datum/category_item/player_setup_item/vore/nif/content(var/mob/user) - . += "NIF: [ispath(pref.nif_path) ? "Present" : "None"]" + . += "NIF: [ispath(pref.client.etching.nif_type) ? "Present" : "None"]" diff --git a/code/modules/client/preferences_savefile.dm b/code/modules/client/preferences_savefile.dm index 47b846efc1f..0e334899e05 100644 --- a/code/modules/client/preferences_savefile.dm +++ b/code/modules/client/preferences_savefile.dm @@ -84,6 +84,8 @@ player_setup.save_character(S) clear_character_previews() // VOREStation Edit + + client.load_etching() //RS ADD - Let's reload our character persist data return 1 /datum/preferences/proc/save_character() diff --git a/code/modules/mob/living/Character Persist/character_persistance_core.dm b/code/modules/mob/living/Character Persist/character_persistance_core.dm index c6953a704c4..c922a461685 100644 --- a/code/modules/mob/living/Character Persist/character_persistance_core.dm +++ b/code/modules/mob/living/Character Persist/character_persistance_core.dm @@ -1,6 +1,6 @@ //RS FILE -/mob/living +/mob var/datum/etching/etching var/admin_magic = FALSE @@ -85,9 +85,24 @@ log_debug("Saving: [old_path] failed to delete on rename function") return +/client + var/datum/etching/etching + +/client/New() + . = ..() + load_etching() + +/client/proc/load_etching() + if(etching) + var/datum/etching/oldetch = etching + etching = null + qdel(oldetch) + etching = new /datum/etching(src) + etching.load() /datum/etching var/mob/living/ourmob //Reference to the mob we are working with + var/client/ourclient //Reference to the client, which may not represent the mob var/event_character = FALSE //If true, saves to an alternative path and allows editing var/shutting_down = FALSE //If true it won't try to save again @@ -103,41 +118,54 @@ log_debug("Etching: No target, delete self") qdel(src) return - if(!isliving(L)) - log_debug("Etching: Target [L] is not living, delete self") - qdel(src) - return - ourmob = L - save_cooldown = rand(200,350) //Make the number be random so that there's less chance it tries to autosave everyone at the same time. - return ..() + if(isliving(L)) + ourmob = L + save_cooldown = rand(5,10) //Make the number be random so that there's less chance it tries to autosave everyone at the same time. + return ..() + if(isclient(L)) + ourclient = L + savable = FALSE + return ..() + + log_debug("Etching: Target [L] is invalid, delete self") + qdel(src) /datum/etching/Destroy() . = ..() ourmob = null + ourclient = null /datum/etching/proc/process_etching() if(savable) if(save_cooldown <= 0) save() - save_cooldown = rand(200,350) //Make the number be random so that there's less chance it tries to autosave everyone at the same time. + save_cooldown = rand(5,10) //Make the number be random so that there's less chance it tries to autosave everyone at the same time. else save_cooldown -- /datum/etching/proc/get_save_path() - - if(event_character) - save_path = "data/player_saves/[copytext(ourmob.ckey, 1, 2)]/[ourmob.ckey]/magic/[ourmob.real_name]-EVENT-etching.json" - else - save_path = "data/player_saves/[copytext(ourmob.ckey, 1, 2)]/[ourmob.ckey]/magic/[ourmob.real_name]-etching.json" + if(isliving(ourmob)) + if(event_character) + save_path = "data/player_saves/[copytext(ourmob.ckey, 1, 2)]/[ourmob.ckey]/magic/[ourmob.real_name]-EVENT-etching.json" + else + save_path = "data/player_saves/[copytext(ourmob.ckey, 1, 2)]/[ourmob.ckey]/magic/[ourmob.real_name]-etching.json" + else if(isclient(ourclient)) + save_path = "data/player_saves/[copytext(ourclient.ckey, 1, 2)]/[ourclient.ckey]/magic/[ourclient.prefs.real_name]-etching.json" /datum/etching/proc/load() - if(IsGuestKey(ourmob.key)) - return - if(!ourmob.ckey) + if(ourmob) + if(IsGuestKey(ourmob.key)) + return + if(ourmob && !ourmob.ckey) log_debug("Etching load failed: Aborting etching load for [ourmob.real_name], no ckey") savable = FALSE return + if(ourclient && !ourclient.ckey) + log_debug("Etching load failed: Aborting etching load for [ourclient.prefs.real_name], no ckey") + savable = FALSE + return + get_save_path() if(!save_path) @@ -178,11 +206,15 @@ xp = load["xp"] item_load(load) - log_debug("Etching load complete for [ourmob.real_name].") + if(ourmob) + log_debug("Etching load complete for [ourmob.real_name].") + if(ourclient) + log_debug("Etching load complete for [ourclient.prefs.real_name].") /datum/etching/proc/save(delet = FALSE) - if(IsGuestKey(ourmob.key)) - return + if(ourmob) + if(IsGuestKey(ourmob.key)) + return if((!savable && !event_character) || !needs_saving) return @@ -192,7 +224,7 @@ if(delet) //Our mob got deleted, so we're saving and quitting. shutting_down = TRUE - if(!save_path || !ishuman(ourmob) || istype(ourmob, /mob/living/carbon/human/dummy)) + if(!save_path) if(shutting_down) ourmob = null qdel(src) @@ -230,7 +262,7 @@ qdel(src) /datum/etching/proc/setup() - return + needs_saving = TRUE /datum/etching/proc/update_etching(mode,value) needs_saving = TRUE diff --git a/code/modules/mob/living/Character Persist/item_storage.dm b/code/modules/mob/living/Character Persist/item_storage.dm index 5f48b79e535..52fd64051c5 100644 --- a/code/modules/mob/living/Character Persist/item_storage.dm +++ b/code/modules/mob/living/Character Persist/item_storage.dm @@ -135,16 +135,22 @@ var/global/list/permanent_unlockables = list( nif_durability = load["nif_durability"] nif_savedata = load["nif_savedata"] + load_nif() + /datum/etching/proc/item_save() var/list/to_save = list( "triangles" = triangles, "item_storage" = item_storage, - "unlockables" = unlockables, - "nif_type" = nif_type, - "nif_durability" = nif_durability, - "nif_savedata" = nif_savedata + "unlockables" = unlockables ) + if(ishuman(ourmob)) + var/mob/living/carbon/human/H = ourmob + if(H.nif) + to_save["nif_type"] = H.nif.type + to_save["nif_durability"] = H.nif.durability + to_save["nif_savedata"] = H.nif.save_data + return to_save /datum/etching/report_status() @@ -172,10 +178,47 @@ var/global/list/permanent_unlockables = list( needs_saving = TRUE /proc/persist_nif_data(var/mob/living/carbon/human/H) - to_world("persist_nif_data") if(!ishuman(H)) //We are not a human, don't bother! stack_trace("Persist (NIF): Given a nonhuman: [H]") return if(!H.etching) //We do not have the ability to save character persist data, don't bother! return H.etching.update_nif(H) + +/datum/etching/setup() + if(ourmob) + if(!nif_type && ourmob.client.prefs.nif_path) + convert_nif(ourmob.client) + load_nif() + if(ourclient) + if(!nif_type && ourclient.prefs.nif_path) + convert_nif(ourclient) + +/datum/etching/proc/convert_nif(var/client/thissun) + if(event_character) + return + var/orig = savable + savable = TRUE + log_debug("ETCHING: Converting legacy NIF data: [thissun.prefs.nif_path] - [thissun.prefs.nif_durability] - [thissun.prefs.nif_savedata]") + nif_type = thissun.prefs.nif_path + nif_durability = thissun.prefs.nif_durability + nif_savedata = thissun.prefs.nif_savedata + needs_saving = TRUE + thissun.prefs.nif_path = null + log_debug("ETCHING: Legacy NIF data conversion complete.") + save() + savable = orig + +/datum/etching/proc/load_nif() + if(!nif_type || !ourmob) + return + var/backup + if(!ispath(nif_type)) + backup = nif_type + nif_type = text2path(nif_type) + if(!nif_type) + log_debug("ETCHING: Attempted to load nif, but had invalid type: [backup], aborting") + nif_type = backup + return + + new nif_type(ourmob,nif_durability,nif_savedata) diff --git a/code/modules/nifsoft/nif.dm b/code/modules/nifsoft/nif.dm index 98f61c0b60c..c46b978c541 100644 --- a/code/modules/nifsoft/nif.dm +++ b/code/modules/nifsoft/nif.dm @@ -699,3 +699,4 @@ You can also set the stat of a NIF to NIF_TEMPFAIL without any issues to disable else nif.examine_msg = new_flavor nif.save_data["examine_msg"] = new_flavor + etching.needs_saving = TRUE //RS ADD diff --git a/code/modules/nifsoft/nif_tgui.dm b/code/modules/nifsoft/nif_tgui.dm index 7699e9929e6..d0e8eea5ed7 100644 --- a/code/modules/nifsoft/nif_tgui.dm +++ b/code/modules/nifsoft/nif_tgui.dm @@ -157,6 +157,7 @@ if("setTheme") if((params["theme"] in valid_ui_themes) || params["theme"] == null) save_data["ui_theme"] = params["theme"] + human.etching.needs_saving = TRUE //RS ADD return TRUE if("toggle_module") var/datum/nifsoft/NS = locate(params["module"]) in nifsofts diff --git a/code/modules/nifsoft/software/13_soulcatcher.dm b/code/modules/nifsoft/software/13_soulcatcher.dm index e6223a85a7e..92b31ee334e 100644 --- a/code/modules/nifsoft/software/13_soulcatcher.dm +++ b/code/modules/nifsoft/software/13_soulcatcher.dm @@ -59,6 +59,7 @@ if(!nif) return nif.save_data["[list_pos]"] = inside_flavor + nif.human.etching.needs_saving = TRUE //RS ADD return TRUE /datum/nifsoft/soulcatcher/proc/load_settings() diff --git a/code/modules/nifsoft/software/14_commlink.dm b/code/modules/nifsoft/software/14_commlink.dm index 47b602e184c..892ecef629c 100644 --- a/code/modules/nifsoft/software/14_commlink.dm +++ b/code/modules/nifsoft/software/14_commlink.dm @@ -55,6 +55,7 @@ owner = new_name name = "[owner]'s [initial(name)]" nif.save_data["commlink_name"] = owner + nif.human.etching.needs_saving = TRUE //RS ADD //So that only the owner's chat is relayed to others. /obj/item/device/communicator/commlink/hear_talk(mob/living/M, list/message_pieces, verb) diff --git a/maps/virgo_minitest/virgo_minitest-1.dmm b/maps/virgo_minitest/virgo_minitest-1.dmm index 209f8df24d4..6368ed0b7d8 100644 --- a/maps/virgo_minitest/virgo_minitest-1.dmm +++ b/maps/virgo_minitest/virgo_minitest-1.dmm @@ -2733,6 +2733,7 @@ /obj/structure/cable{ icon_state = "0-4" }, +/obj/item/weapon/backup_implanter, /turf/simulated/floor/tiled, /area/bridge) "gk" = ( @@ -3198,6 +3199,13 @@ }, /turf/simulated/floor/tiled/techmaint, /area/engineering/engine_monitoring) +"iI" = ( +/obj/machinery/atmospherics/pipe/simple/hidden/supply{ + dir = 4 + }, +/obj/item/weapon/backup_implanter, +/turf/simulated/floor/tiled, +/area/bridge) "iJ" = ( /obj/structure/cable/yellow{ icon_state = "2-4" @@ -3216,6 +3224,10 @@ }, /turf/simulated/floor/airless, /area/space) +"iR" = ( +/obj/machinery/computer/transhuman/resleeving, +/turf/simulated/floor/tiled, +/area/bridge) "iT" = ( /obj/machinery/portable_atmospherics/canister/nitrogen, /obj/machinery/button/remote/blast_door{ @@ -4002,6 +4014,10 @@ }, /turf/simulated/wall/r_wall, /area/engineering/workshop) +"rG" = ( +/obj/machinery/clonepod/transhuman, +/turf/simulated/floor/tiled, +/area/bridge) "rJ" = ( /obj/effect/floor_decal/industrial/warning{ dir = 8 @@ -4218,6 +4234,10 @@ }, /turf/simulated/floor/airless, /area/space) +"tY" = ( +/obj/machinery/transhuman/resleever, +/turf/simulated/floor/tiled, +/area/bridge) "uc" = ( /obj/machinery/atmospherics/unary/heat_exchanger{ dir = 4 @@ -5218,6 +5238,13 @@ }, /turf/simulated/floor/airless, /area/space) +"EP" = ( +/obj/structure/cable{ + icon_state = "4-8" + }, +/obj/item/weapon/backup_implanter, +/turf/simulated/floor/tiled, +/area/bridge) "ES" = ( /obj/machinery/atmospherics/unary/vent_scrubber/on, /obj/effect/floor_decal/borderfloor{ @@ -6159,6 +6186,10 @@ }, /turf/simulated/floor, /area/engineering/engine_monitoring) +"PM" = ( +/obj/item/weapon/backup_implanter, +/turf/simulated/floor/tiled, +/area/bridge) "PO" = ( /obj/machinery/power/tesla_coil, /turf/simulated/floor/tiled/techfloor, @@ -8808,7 +8839,7 @@ aa aa fY gh -gf +rG gq gf gf @@ -8910,7 +8941,7 @@ aa aa fY gi -gf +tY gr gf gf @@ -9012,7 +9043,7 @@ Pg aa fY GC -gf +iR gr gf gf @@ -9114,9 +9145,9 @@ aa aa fY gj -gf -gr -gf +PM +iI +PM gf gz gf @@ -9215,9 +9246,9 @@ aa aa aa fY -gk -gf -gr +EP +PM +iI gf gf gf From f15ad7c3b8ff8adfafbf820a76ebf24261d849f5 Mon Sep 17 00:00:00 2001 From: VerySoft Date: Sat, 21 Dec 2024 17:29:36 -0500 Subject: [PATCH 3/4] 1729 --- .../client/preference_setup/vore/08_nif.dm | 2 +- code/modules/client/preferences_savefile.dm | 3 +- .../character_persistance_core.dm | 41 ++++++++++--------- .../living/Character Persist/item_storage.dm | 26 +++++++----- 4 files changed, 40 insertions(+), 32 deletions(-) diff --git a/code/modules/client/preference_setup/vore/08_nif.dm b/code/modules/client/preference_setup/vore/08_nif.dm index f498a6c91ae..630f41aef42 100644 --- a/code/modules/client/preference_setup/vore/08_nif.dm +++ b/code/modules/client/preference_setup/vore/08_nif.dm @@ -62,4 +62,4 @@ */ /datum/category_item/player_setup_item/vore/nif/content(var/mob/user) - . += "NIF: [ispath(pref.client.etching.nif_type) ? "Present" : "None"]" + . += "NIF: [ispath(text2path("[pref.client.etching.nif_type]")) ? "Present" : "None"]" //RS EDIT diff --git a/code/modules/client/preferences_savefile.dm b/code/modules/client/preferences_savefile.dm index 0e334899e05..17b2f402265 100644 --- a/code/modules/client/preferences_savefile.dm +++ b/code/modules/client/preferences_savefile.dm @@ -85,7 +85,8 @@ clear_character_previews() // VOREStation Edit - client.load_etching() //RS ADD - Let's reload our character persist data + client.load_etching(src) //RS ADD - Let's reload our character persist data + return 1 /datum/preferences/proc/save_character() diff --git a/code/modules/mob/living/Character Persist/character_persistance_core.dm b/code/modules/mob/living/Character Persist/character_persistance_core.dm index c922a461685..d43994bfe79 100644 --- a/code/modules/mob/living/Character Persist/character_persistance_core.dm +++ b/code/modules/mob/living/Character Persist/character_persistance_core.dm @@ -10,9 +10,12 @@ /mob/living/Login() . = ..() - if(etching) - log_debug("Etching started: Registered to [ckey]") - etching.load() + if(!etching) + return + if(etching.save_path) //We already got loaded + return + log_debug("Etching started: Registered to [ckey]") + etching.load(client.prefs) /mob/living/Destroy() if(etching && istype(etching, /datum/etching)) @@ -88,17 +91,13 @@ /client var/datum/etching/etching -/client/New() - . = ..() - load_etching() - -/client/proc/load_etching() +/client/proc/load_etching(var/datum/preferences/P) if(etching) var/datum/etching/oldetch = etching etching = null qdel(oldetch) etching = new /datum/etching(src) - etching.load() + etching.load(P) /datum/etching var/mob/living/ourmob //Reference to the mob we are working with @@ -109,7 +108,7 @@ var/save_path //The file path for the save/load function var/list/xp = list() //A list of different experience values - var/savable = TRUE //Will never save while false + var/savable = FALSE //Will never save while false var/needs_saving = FALSE //For if changes have occured, it will try to save if it can var/save_cooldown = 0 @@ -143,19 +142,23 @@ else save_cooldown -- -/datum/etching/proc/get_save_path() +/datum/etching/proc/get_save_path(var/datum/preferences/P) if(isliving(ourmob)) if(event_character) save_path = "data/player_saves/[copytext(ourmob.ckey, 1, 2)]/[ourmob.ckey]/magic/[ourmob.real_name]-EVENT-etching.json" else save_path = "data/player_saves/[copytext(ourmob.ckey, 1, 2)]/[ourmob.ckey]/magic/[ourmob.real_name]-etching.json" + savable = TRUE else if(isclient(ourclient)) - save_path = "data/player_saves/[copytext(ourclient.ckey, 1, 2)]/[ourclient.ckey]/magic/[ourclient.prefs.real_name]-etching.json" + save_path = "data/player_saves/[copytext(ourclient.ckey, 1, 2)]/[ourclient.ckey]/magic/[P.real_name]-etching.json" + -/datum/etching/proc/load() +/datum/etching/proc/load(var/datum/preferences/P) if(ourmob) if(IsGuestKey(ourmob.key)) return + if(save_path) + return if(ourmob && !ourmob.ckey) log_debug("Etching load failed: Aborting etching load for [ourmob.real_name], no ckey") savable = FALSE @@ -166,7 +169,7 @@ savable = FALSE return - get_save_path() + get_save_path(P) if(!save_path) log_debug("Etching load failed: No save_path") @@ -174,7 +177,7 @@ return if(!fexists(save_path)) log_debug("Etching load failed: No file '[save_path]' exists. Beginning setup.") - setup() + setup(P) return var/content @@ -207,9 +210,9 @@ item_load(load) if(ourmob) - log_debug("Etching load complete for [ourmob.real_name].") + log_debug("Mob etching load complete for [ourmob.real_name].") if(ourclient) - log_debug("Etching load complete for [ourclient.prefs.real_name].") + log_debug("Client etching load complete for [ourclient.prefs.real_name].") /datum/etching/proc/save(delet = FALSE) if(ourmob) @@ -261,7 +264,7 @@ ourmob = null qdel(src) -/datum/etching/proc/setup() +/datum/etching/proc/setup(var/datum/preferences/P) needs_saving = TRUE /datum/etching/proc/update_etching(mode,value) @@ -366,7 +369,7 @@ to_chat(usr, "Loading [L]'s event etching.") else to_chat(usr, "Loading [L]'s etching.") - L.etching.load() + L.etching.load(L.client.prefs) log_and_message_admins(" has loaded [L]'s etching.") /* //Just for fun. UwU diff --git a/code/modules/mob/living/Character Persist/item_storage.dm b/code/modules/mob/living/Character Persist/item_storage.dm index 52fd64051c5..a4a3f8a36d7 100644 --- a/code/modules/mob/living/Character Persist/item_storage.dm +++ b/code/modules/mob/living/Character Persist/item_storage.dm @@ -150,6 +150,10 @@ var/global/list/permanent_unlockables = list( to_save["nif_type"] = H.nif.type to_save["nif_durability"] = H.nif.durability to_save["nif_savedata"] = H.nif.save_data + else if(ourclient) //For nif conversion + to_save["nif_type"] = nif_type + to_save["nif_durability"] = nif_durability + to_save["nif_savedata"] = nif_savedata return to_save @@ -185,27 +189,27 @@ var/global/list/permanent_unlockables = list( return H.etching.update_nif(H) -/datum/etching/setup() +/datum/etching/setup(var/datum/preferences/P) + . = ..() if(ourmob) if(!nif_type && ourmob.client.prefs.nif_path) - convert_nif(ourmob.client) + convert_nif(ourmob.client, P) load_nif() if(ourclient) - if(!nif_type && ourclient.prefs.nif_path) - convert_nif(ourclient) + if(!nif_type && P.nif_path) + convert_nif(ourclient,P) -/datum/etching/proc/convert_nif(var/client/thissun) +/datum/etching/proc/convert_nif(var/client/thissun,var/datum/preferences/P) if(event_character) return var/orig = savable savable = TRUE - log_debug("ETCHING: Converting legacy NIF data: [thissun.prefs.nif_path] - [thissun.prefs.nif_durability] - [thissun.prefs.nif_savedata]") - nif_type = thissun.prefs.nif_path - nif_durability = thissun.prefs.nif_durability - nif_savedata = thissun.prefs.nif_savedata + log_debug("ETCHING: Converting legacy NIF data: [P.nif_path] - [P.nif_durability] - [P.nif_savedata]") + nif_type = P.nif_path + nif_durability = P.nif_durability + nif_savedata = P.nif_savedata needs_saving = TRUE - thissun.prefs.nif_path = null - log_debug("ETCHING: Legacy NIF data conversion complete.") + log_debug("ETCHING: Legacy NIF data conversion complete - [nif_type] - [nif_durability] - [nif_savedata]") save() savable = orig From 155494d04cd0096e65f9b58f57af78df12d2246d Mon Sep 17 00:00:00 2001 From: VerySoft Date: Sat, 4 Jan 2025 15:02:39 -0500 Subject: [PATCH 4/4] 1502 --- code/modules/client/preference_setup/vore/08_nif.dm | 5 +++++ .../living/Character Persist/character_persistance_core.dm | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/code/modules/client/preference_setup/vore/08_nif.dm b/code/modules/client/preference_setup/vore/08_nif.dm index 630f41aef42..b124fe11386 100644 --- a/code/modules/client/preference_setup/vore/08_nif.dm +++ b/code/modules/client/preference_setup/vore/08_nif.dm @@ -62,4 +62,9 @@ */ /datum/category_item/player_setup_item/vore/nif/content(var/mob/user) + + if(!pref.client.etching) + log_debug("[user] etching data to populate") + return + . += "NIF: [ispath(text2path("[pref.client.etching.nif_type]")) ? "Present" : "None"]" //RS EDIT diff --git a/code/modules/mob/living/Character Persist/character_persistance_core.dm b/code/modules/mob/living/Character Persist/character_persistance_core.dm index d43994bfe79..a811659149e 100644 --- a/code/modules/mob/living/Character Persist/character_persistance_core.dm +++ b/code/modules/mob/living/Character Persist/character_persistance_core.dm @@ -212,7 +212,7 @@ if(ourmob) log_debug("Mob etching load complete for [ourmob.real_name].") if(ourclient) - log_debug("Client etching load complete for [ourclient.prefs.real_name].") + log_debug("Client etching load complete for [P.real_name].") /datum/etching/proc/save(delet = FALSE) if(ourmob)