about summary refs log tree commit diff stats
path: root/Archipelago/client.gd
diff options
context:
space:
mode:
authorStar Rauchenberger <fefferburbia@gmail.com>2024-04-17 12:50:34 -0400
committerStar Rauchenberger <fefferburbia@gmail.com>2024-04-17 12:50:34 -0400
commit750ebbf9aa25f0209d7f1c7186718fa07377881d (patch)
tree9e65c74808494c9832d8f01564c302e788137e5a /Archipelago/client.gd
parentce831897b89974f38fd6f0583e5feac178643a14 (diff)
downloadlingo-archipelago-750ebbf9aa25f0209d7f1c7186718fa07377881d.tar.gz
lingo-archipelago-750ebbf9aa25f0209d7f1c7186718fa07377881d.tar.bz2
lingo-archipelago-750ebbf9aa25f0209d7f1c7186718fa07377881d.zip
Prevent colorful cdp if genned before 0.4.5
Diffstat (limited to 'Archipelago/client.gd')
-rw-r--r--Archipelago/client.gd16
1 files changed, 16 insertions, 0 deletions
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
95var _location_name_to_id = {} # LINGO only 95var _location_name_to_id = {} # LINGO only
96 96
97var _remote_version = {"major": 0, "minor": 0, "build": 0} 97var _remote_version = {"major": 0, "minor": 0, "build": 0}
98var _gen_version = {"major": 0, "minor": 0, "build": 0}
98 99
99# TODO: caching per MW/slot, reset between connections 100# TODO: caching per MW/slot, reset between connections
100var _authenticated = false 101var _authenticated = false
@@ -233,6 +234,7 @@ func _on_data():
233 if cmd == "RoomInfo": 234 if cmd == "RoomInfo":
234 _seed = message["seed_name"] 235 _seed = message["seed_name"]
235 _remote_version = message["version"] 236 _remote_version = message["version"]
237 _gen_version = message["generator_version"]
236 238
237 var needed_games = [] 239 var needed_games = []
238 for game in message["datapackage_checksums"].keys(): 240 for game in message["datapackage_checksums"].keys():
@@ -779,3 +781,17 @@ func colorForItemType(flags):
779 return "#d63a22" 781 return "#d63a22"
780 else: # filler 782 else: # filler
781 return "#14de9e" 783 return "#14de9e"
784
785
786func compareVersion(lhs, rhs):
787 if lhs["major"] == rhs["major"]:
788 if lhs["minor"] == rhs["minor"]:
789 return lhs["build"] < rhs["build"]
790 else:
791 return lhs["minor"] < rhs["minor"]
792 else:
793 return lhs["major"] < rhs["major"]
794
795
796func wasGeneratedBeforeVersion(major, minor, build):
797 return compareVersion(_gen_version, {"major": major, "minor": minor, "build": build})