diff options
Diffstat (limited to 'Archipelago/client.gd')
-rw-r--r-- | Archipelago/client.gd | 16 |
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 | |||
95 | var _location_name_to_id = {} # LINGO only | 95 | var _location_name_to_id = {} # LINGO only |
96 | 96 | ||
97 | var _remote_version = {"major": 0, "minor": 0, "build": 0} | 97 | var _remote_version = {"major": 0, "minor": 0, "build": 0} |
98 | var _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 |
100 | var _authenticated = false | 101 | var _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 | |||
786 | func 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 | |||
796 | func wasGeneratedBeforeVersion(major, minor, build): | ||
797 | return compareVersion(_gen_version, {"major": major, "minor": minor, "build": build}) | ||