mirror of
https://github.com/IntQuant/noita_entangled_worlds.git
synced 2025-10-19 07:03:16 +00:00
Fix mod auto-enabler.
This commit is contained in:
parent
89d88fc154
commit
33a98483a8
5 changed files with 160 additions and 6 deletions
148
docs/distributed_world_sync.drawio
Normal file
148
docs/distributed_world_sync.drawio
Normal file
|
@ -0,0 +1,148 @@
|
|||
<mxfile host="app.diagrams.net" modified="2024-07-25T17:03:18.633Z" agent="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36" etag="KGxcVGMI3KsoYl3J__li" version="24.1.0" type="device">
|
||||
<diagram name="Page-1" id="yAP61gIlMFJ8xVlhgKfl">
|
||||
<mxGraphModel dx="1406" dy="763" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="0" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0">
|
||||
<root>
|
||||
<mxCell id="0" />
|
||||
<mxCell id="1" parent="0" />
|
||||
<mxCell id="cJPfaDZgqvKlEicy9vYQ-6" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" source="cJPfaDZgqvKlEicy9vYQ-1">
|
||||
<mxGeometry relative="1" as="geometry">
|
||||
<mxPoint x="200" y="420" as="targetPoint" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="cJPfaDZgqvKlEicy9vYQ-8" value="Request<div>authority</div>" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="cJPfaDZgqvKlEicy9vYQ-6">
|
||||
<mxGeometry x="-0.0638" y="1" relative="1" as="geometry">
|
||||
<mxPoint as="offset" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="cJPfaDZgqvKlEicy9vYQ-1" value="Unsynced" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="40" y="400" width="80" height="40" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="cJPfaDZgqvKlEicy9vYQ-2" value="Chunk state diagram" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=25;" vertex="1" parent="1">
|
||||
<mxGeometry x="340" y="160" width="240" height="30" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="cJPfaDZgqvKlEicy9vYQ-12" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" source="cJPfaDZgqvKlEicy9vYQ-10" target="cJPfaDZgqvKlEicy9vYQ-11">
|
||||
<mxGeometry relative="1" as="geometry">
|
||||
<Array as="points">
|
||||
<mxPoint x="220" y="340" />
|
||||
</Array>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="cJPfaDZgqvKlEicy9vYQ-13" value="Authority<div>already taken</div>" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="cJPfaDZgqvKlEicy9vYQ-12">
|
||||
<mxGeometry x="0.2352" y="1" relative="1" as="geometry">
|
||||
<mxPoint x="11" y="1" as="offset" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="cJPfaDZgqvKlEicy9vYQ-15" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" source="cJPfaDZgqvKlEicy9vYQ-10" target="cJPfaDZgqvKlEicy9vYQ-18">
|
||||
<mxGeometry relative="1" as="geometry">
|
||||
<mxPoint x="320" y="500" as="targetPoint" />
|
||||
<Array as="points">
|
||||
<mxPoint x="220" y="500" />
|
||||
</Array>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="cJPfaDZgqvKlEicy9vYQ-16" value="Got authority<br>(Also load existing state here, if any)" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="cJPfaDZgqvKlEicy9vYQ-15">
|
||||
<mxGeometry x="0.0631" y="2" relative="1" as="geometry">
|
||||
<mxPoint x="20" y="-18" as="offset" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="cJPfaDZgqvKlEicy9vYQ-10" value="wait" style="rhombus;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="200" y="400" width="40" height="40" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="cJPfaDZgqvKlEicy9vYQ-19" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" edge="1" parent="1" source="cJPfaDZgqvKlEicy9vYQ-11">
|
||||
<mxGeometry relative="1" as="geometry">
|
||||
<mxPoint x="480" y="340" as="targetPoint" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="cJPfaDZgqvKlEicy9vYQ-20" value="Request<div>chunk&nbsp;</div><div>and listen</div>" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="cJPfaDZgqvKlEicy9vYQ-19">
|
||||
<mxGeometry x="-0.0363" y="1" relative="1" as="geometry">
|
||||
<mxPoint as="offset" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="cJPfaDZgqvKlEicy9vYQ-11" value="Waiting for chunk" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="320" y="320" width="80" height="40" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="cJPfaDZgqvKlEicy9vYQ-39" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" source="cJPfaDZgqvKlEicy9vYQ-18" target="cJPfaDZgqvKlEicy9vYQ-33">
|
||||
<mxGeometry relative="1" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="cJPfaDZgqvKlEicy9vYQ-40" value="Relinquish authority<div>(And save existing state to host)</div>" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="cJPfaDZgqvKlEicy9vYQ-39">
|
||||
<mxGeometry x="-0.2707" y="-1" relative="1" as="geometry">
|
||||
<mxPoint x="19" y="-21" as="offset" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="cJPfaDZgqvKlEicy9vYQ-18" value="Authority" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="460" y="480" width="80" height="40" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="cJPfaDZgqvKlEicy9vYQ-25" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" source="cJPfaDZgqvKlEicy9vYQ-23" target="cJPfaDZgqvKlEicy9vYQ-24">
|
||||
<mxGeometry relative="1" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="cJPfaDZgqvKlEicy9vYQ-26" value="Got chunk" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="cJPfaDZgqvKlEicy9vYQ-25">
|
||||
<mxGeometry x="-0.3833" y="1" relative="1" as="geometry">
|
||||
<mxPoint x="15" y="-9" as="offset" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="cJPfaDZgqvKlEicy9vYQ-28" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=1;entryY=0.75;entryDx=0;entryDy=0;" edge="1" parent="1" source="cJPfaDZgqvKlEicy9vYQ-23" target="cJPfaDZgqvKlEicy9vYQ-27">
|
||||
<mxGeometry relative="1" as="geometry">
|
||||
<Array as="points">
|
||||
<mxPoint x="500" y="270" />
|
||||
</Array>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="cJPfaDZgqvKlEicy9vYQ-30" value="On error" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="cJPfaDZgqvKlEicy9vYQ-28">
|
||||
<mxGeometry x="0.4347" y="1" relative="1" as="geometry">
|
||||
<mxPoint x="8" y="-1" as="offset" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="cJPfaDZgqvKlEicy9vYQ-23" value="" style="rhombus;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="480" y="320" width="40" height="40" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="cJPfaDZgqvKlEicy9vYQ-29" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=1;entryY=0.25;entryDx=0;entryDy=0;" edge="1" parent="1" source="cJPfaDZgqvKlEicy9vYQ-24" target="cJPfaDZgqvKlEicy9vYQ-27">
|
||||
<mxGeometry relative="1" as="geometry">
|
||||
<Array as="points">
|
||||
<mxPoint x="620" y="250" />
|
||||
</Array>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="cJPfaDZgqvKlEicy9vYQ-31" value="Authority relinquished<div>On error</div>" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="cJPfaDZgqvKlEicy9vYQ-29">
|
||||
<mxGeometry x="0.6181" y="2" relative="1" as="geometry">
|
||||
<mxPoint x="105" y="-2" as="offset" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="cJPfaDZgqvKlEicy9vYQ-38" value="<span style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 11px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: center; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: nowrap; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;">Chunk no longer needed</span>" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0;entryY=0.25;entryDx=0;entryDy=0;" edge="1" parent="1" source="cJPfaDZgqvKlEicy9vYQ-24" target="cJPfaDZgqvKlEicy9vYQ-37">
|
||||
<mxGeometry x="0.2628" relative="1" as="geometry">
|
||||
<Array as="points">
|
||||
<mxPoint x="760" y="340" />
|
||||
<mxPoint x="760" y="410" />
|
||||
</Array>
|
||||
<mxPoint as="offset" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="cJPfaDZgqvKlEicy9vYQ-24" value="Listener" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="600" y="320" width="80" height="40" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="cJPfaDZgqvKlEicy9vYQ-32" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="cJPfaDZgqvKlEicy9vYQ-27" target="cJPfaDZgqvKlEicy9vYQ-1">
|
||||
<mxGeometry relative="1" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="cJPfaDZgqvKlEicy9vYQ-27" value="Retry" style="rounded=0;whiteSpace=wrap;html=1;shadow=0;glass=0;dashed=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="320" y="240" width="80" height="40" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="cJPfaDZgqvKlEicy9vYQ-41" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0;entryY=0.75;entryDx=0;entryDy=0;" edge="1" parent="1" source="cJPfaDZgqvKlEicy9vYQ-33" target="cJPfaDZgqvKlEicy9vYQ-37">
|
||||
<mxGeometry relative="1" as="geometry">
|
||||
<Array as="points">
|
||||
<mxPoint x="760" y="500" />
|
||||
<mxPoint x="760" y="430" />
|
||||
</Array>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="cJPfaDZgqvKlEicy9vYQ-33" value="" style="rhombus;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="700" y="480" width="40" height="40" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="cJPfaDZgqvKlEicy9vYQ-37" value="Unload" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="800" y="400" width="80" height="40" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="cJPfaDZgqvKlEicy9vYQ-42" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=none;strokeColor=#C7C7C7;" vertex="1" parent="1">
|
||||
<mxGeometry y="200" width="920" height="360" as="geometry" />
|
||||
</mxCell>
|
||||
</root>
|
||||
</mxGraphModel>
|
||||
</diagram>
|
||||
</mxfile>
|
2
noita-proxy/Cargo.lock
generated
2
noita-proxy/Cargo.lock
generated
|
@ -1997,7 +1997,7 @@ checksum = "2bf50223579dc7cdcfb3bfcacf7069ff68243f8c363f62ffa99cf000a6b9c451"
|
|||
|
||||
[[package]]
|
||||
name = "noita-proxy"
|
||||
version = "0.15.0"
|
||||
version = "0.15.1"
|
||||
dependencies = [
|
||||
"argh",
|
||||
"bincode",
|
||||
|
|
|
@ -5,7 +5,7 @@ resolver = "2"
|
|||
[package]
|
||||
name = "noita-proxy"
|
||||
description = "Noita Entangled Worlds companion app."
|
||||
version = "0.15.0"
|
||||
version = "0.15.1"
|
||||
edition = "2021"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
|
|
@ -382,10 +382,16 @@ impl Mods {
|
|||
}
|
||||
|
||||
fn enable_mod(saves_path: &Path) -> Result<(), Box<dyn Error>> {
|
||||
let config_path = saves_path.join("save00/mod_config.xml");
|
||||
let mut data: Mods = quick_xml::de::from_reader(BufReader::new(File::open(&config_path)?))?;
|
||||
let shared_config_path = saves_path.join("save_shared/config.xml");
|
||||
// Certainly not the cleanest solution, but parsing that config properly is _hard_.
|
||||
let config = fs::read_to_string(&shared_config_path)?;
|
||||
let config = config.replace("mods_sandbox_enabled=\"1\"", "mods_sandbox_enabled=\"0\"");
|
||||
fs::write(&shared_config_path, config)?;
|
||||
|
||||
let mod_config_path = saves_path.join("save00/mod_config.xml");
|
||||
let mut data: Mods = quick_xml::de::from_reader(BufReader::new(File::open(&mod_config_path)?))?;
|
||||
data.entry("quant.ew").enabled = 1;
|
||||
let xml = quick_xml::se::to_string(&data)?;
|
||||
fs::write(&config_path, xml)?;
|
||||
fs::write(&mod_config_path, xml)?;
|
||||
Ok(())
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@ function module.on_local_player_spawn(my_player)
|
|||
-- EntitySetTransform(player_entity, 7427, -4960)
|
||||
|
||||
-- Meat biome
|
||||
EntitySetTransform(player_entity, 7328, 9263)
|
||||
-- EntitySetTransform(player_entity, 7328, 9263)
|
||||
|
||||
-- util.load_ephemerial("mods/quant.ew/files/entities/client.xml", 512*3+20, 512*3+10)
|
||||
-- EntityLoad("mods/quant.ew/files/entities/client.xml", 512*3+20, 512*3+10)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue