Skip to content

Commit 107b369

Browse files
committed
e
1 parent ceb378d commit 107b369

File tree

3 files changed

+26
-4
lines changed

3 files changed

+26
-4
lines changed

source/archipelago/APGameState.hx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -934,6 +934,8 @@ class APGameState
934934
{
935935
trace("Bounce packet received: " + haxe.Json.stringify(data));
936936

937+
info()?.tagsManager?.syncToClient();
938+
937939
// Check for TrapLink packet first
938940
if (Reflect.hasField(data, "trap_name"))
939941
{
@@ -1208,7 +1210,8 @@ class APGameState
12081210
{
12091211
APEntryState.ap = null;
12101212
}
1211-
} public function getSongAndMod(songName:String):{song:String, ?mod:String}
1213+
}
1214+
public function getSongAndMod(songName:String):{song:String, ?mod:String}
12121215
{
12131216
var input = songName;
12141217
var modName = "";

source/archipelago/APTagsManager.hx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,22 @@ class APTagsManager {
265265
}
266266
}
267267

268+
// public function emergencySync():Void {
269+
// // Only sync if tags differ between manager and client
270+
// if (client != null) {
271+
// var clientTags = client.tags != null ? client.tags : [];
272+
// var tagsMatch = _tags.length == clientTags.length && _tags.map(function(tag, i) return tag == clientTags[i]);
273+
// if (!tagsMatch) {
274+
// syncToClient();
275+
// trace('APTagsManager: Emergency sync performed (tags differed)');
276+
// } else {
277+
// trace('APTagsManager: Emergency sync skipped (tags already match)');
278+
// }
279+
// } else {
280+
// trace('APTagsManager: Emergency sync failed (client is null)');
281+
// }
282+
// }
283+
268284
/**
269285
* Sync from the client to update internal state
270286
* Call this if the client's tags were modified externally

source/archipelago/Client.hx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -526,8 +526,7 @@ class Client {
526526
trace('Death link not sent - state: $state, deathByLink: ${APPlayState.deathByLink}, deathlink enabled: ${ClientPrefs.data.deathlink}');
527527
}
528528

529-
// Removed the redundant toggleDeathLink call here as it may cause unexpected tag changes
530-
// The death link state should only be toggled when explicitly changing settings, not when sending
529+
tagsManager.syncToClient();
531530
}
532531

533532

@@ -558,7 +557,7 @@ class Client {
558557
var currentTags:Array<String> = [];
559558

560559
inline function get_tags()
561-
return currentTags;
560+
return _tags;
562561

563562
inline function get_tagsManager():APTagsManager {
564563
if (_tagsManager == null) {
@@ -1077,6 +1076,10 @@ class Client {
10771076
if (_ws != null)
10781077
process_queue();
10791078

1079+
if (_tags != currentTags) {
1080+
tagsManager.syncToClient();
1081+
}
1082+
10801083

10811084
// var needDataPackage = if (_gotDataPackage) false else true;
10821085
// try {

0 commit comments

Comments
 (0)