From 750ebbf9aa25f0209d7f1c7186718fa07377881d Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Wed, 17 Apr 2024 12:50:34 -0400 Subject: Prevent colorful cdp if genned before 0.4.5 --- Archipelago/client.gd | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'Archipelago/client.gd') diff --git a/Archipelago/client.gd b/Archipelago/client.gd index 489fdb9..2f66c1b 100644 --- a/Archipelago/client.gd +++ b/Archipelago/client.gd @@ -95,6 +95,7 @@ var _item_name_to_id = {} # LINGO only var _location_name_to_id = {} # LINGO only var _remote_version = {"major": 0, "minor": 0, "build": 0} +var _gen_version = {"major": 0, "minor": 0, "build": 0} # TODO: caching per MW/slot, reset between connections var _authenticated = false @@ -233,6 +234,7 @@ func _on_data(): if cmd == "RoomInfo": _seed = message["seed_name"] _remote_version = message["version"] + _gen_version = message["generator_version"] var needed_games = [] for game in message["datapackage_checksums"].keys(): @@ -779,3 +781,17 @@ func colorForItemType(flags): return "#d63a22" else: # filler return "#14de9e" + + +func compareVersion(lhs, rhs): + if lhs["major"] == rhs["major"]: + if lhs["minor"] == rhs["minor"]: + return lhs["build"] < rhs["build"] + else: + return lhs["minor"] < rhs["minor"] + else: + return lhs["major"] < rhs["major"] + + +func wasGeneratedBeforeVersion(major, minor, build): + return compareVersion(_gen_version, {"major": major, "minor": minor, "build": build}) -- cgit 1.4.1