mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-09-17 05:52:39 +00:00
feat: printer agent isolation across devices (#15147)
# Description Printers discovered/bound under one printer agent (e.g. built-in BBL) were leaking into another, independent agent's "My Device"/"Other Device" lists and inheriting its saved access code, since neither the device list nor bind state was ever scoped by which agent found them. - Add printer_agent_id to MachineObject/BBLocalMachine, stamped at discovery/bind time; filter get_my_machine_list(), get_my_cloud_machine_list(), and update_other_devices() by it. - clear_other_devices() now drops entries stamped by the outgoing agent on swap, so the incoming agent's own discovery re-inserts and re-stamps them fresh instead of leaving them stale-tagged forever. - Scope access_code by (dev_id, printer_agent_id) on BBLocalMachine (LAN only since cloud's userMachineList is always refreshed live from the account API, so it isn't at risk the same way), with a BBL-only legacy fallback to the old flat access_code/user_access_code keys so existing bindings keep working. # Screenshots/Recordings/Graphs <!-- > Please attach relevant screenshots to showcase the UI changes. > Please attach images that can help explain the changes. --> ## Tests <!-- > Please describe the tests that you have conducted to verify the changes made in this PR. --> <!-- > A guide for users on how to download the artifacts from this PR. --> [How to Download Pull Requests Artifacts for Testing](https://www.orcaslicer.com/wiki/how_to_download_pr_artifacts)
This commit is contained in:
@@ -856,6 +856,10 @@ std::string AppConfig::load()
|
||||
local_machine.dev_ip = p["dev_ip"].get<std::string>();
|
||||
if (p.contains("printer_type"))
|
||||
local_machine.printer_type = p["printer_type"].get<std::string>();
|
||||
if (p.contains("printer_agent_id"))
|
||||
local_machine.printer_agent_id = p["printer_agent_id"].get<std::string>();
|
||||
if (p.contains("access_code"))
|
||||
local_machine.access_code = p["access_code"].get<std::string>();
|
||||
m_local_machines[local_machine.dev_id] = local_machine;
|
||||
}
|
||||
} else {
|
||||
@@ -1068,6 +1072,8 @@ void AppConfig::save()
|
||||
m_json["dev_name"] = local_machine.second.dev_name;
|
||||
m_json["dev_ip"] = local_machine.second.dev_ip;
|
||||
m_json["printer_type"] = local_machine.second.printer_type;
|
||||
m_json["printer_agent_id"] = local_machine.second.printer_agent_id;
|
||||
m_json["access_code"] = local_machine.second.access_code;
|
||||
|
||||
j["local_machines"][local_machine.first] = m_json;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user