# HG changeset patch # User Wuzzy # Date 1541151068 -3600 # Node ID a5be3ef4bbbe94c5296f0bedc9bea784af9d90f7 # Parent abb42ba345b67413d92c17c1bdb25a282ee09b45 Update official challenge hashes, improve console logging (warning: racer #17 is missing!) diff -r abb42ba345b6 -r a5be3ef4bbbe share/hedgewars/Data/Scripts/Multiplayer/Racer.lua --- a/share/hedgewars/Data/Scripts/Multiplayer/Racer.lua Fri Nov 02 09:45:54 2018 +0100 +++ b/share/hedgewars/Data/Scripts/Multiplayer/Racer.lua Fri Nov 02 10:31:08 2018 +0100 @@ -118,6 +118,8 @@ local waypointCursor = false local waypointPreview = nil +local officialChallenge + -------------------------- -- hog and team tracking variales -------------------------- @@ -710,6 +712,7 @@ roundN = 0 lastRound = TotalRounds RoundHasChanged = false + officialChallenge = detectMapWithDigest() if GetBackgroundBrightness() == 1 then -- Dark waypoint colour theme @@ -1094,15 +1097,13 @@ raceType = "mixed race" end - map = detectMapWithDigest() - for i = 0, (numTeams-1) do if teamScore[i] < MAX_TURN_TIME then - DeclareAchievement(raceType, teamNameArr[i], map, teamScore[i]) + DeclareAchievement(raceType, teamNameArr[i], officialChallenge, teamScore[i]) end end - if map ~= nil and fastCount > 0 then + if officialChallenge ~= nil and fastCount > 0 then StartGhostPoints(fastCount) for i = 0, (fastCount - 1) do diff -r abb42ba345b6 -r a5be3ef4bbbe share/hedgewars/Data/Scripts/Multiplayer/TechRacer.lua --- a/share/hedgewars/Data/Scripts/Multiplayer/TechRacer.lua Fri Nov 02 09:45:54 2018 +0100 +++ b/share/hedgewars/Data/Scripts/Multiplayer/TechRacer.lua Fri Nov 02 10:31:08 2018 +0100 @@ -699,7 +699,6 @@ if mapID == nil then mapID = 2 + GetRandom(7) end - WriteLnToConsole("TechRacer: Using map "..tostring(mapID)) addHashData(mapID) @@ -911,6 +910,8 @@ roundN = 0 lastRound = TotalRounds RoundHasChanged = false + WriteLnToConsole("TechRacer: Using map #"..tostring(mapID-1).." (mapID="..tostring(mapID)..")") + officialChallenge = detectMapWithDigest() RebuildTeamInfo() @@ -1252,15 +1253,13 @@ raceType = "mixed race" end - map = detectMapWithDigest() - for i = 0, (numTeams-1) do if teamScore[i] < MAX_TURN_TIME then - DeclareAchievement(raceType, teamNameArr[i], map, teamScore[i]) + DeclareAchievement(raceType, teamNameArr[i], officialChallenge, teamScore[i]) end end - if map ~= nil and fastCount > 0 then + if officialChallenge ~= nil and fastCount > 0 then StartGhostPoints(fastCount) for i = 0, (fastCount - 1) do diff -r abb42ba345b6 -r a5be3ef4bbbe share/hedgewars/Data/Scripts/OfficialChallengeHashes.lua --- a/share/hedgewars/Data/Scripts/OfficialChallengeHashes.lua Fri Nov 02 09:45:54 2018 +0100 +++ b/share/hedgewars/Data/Scripts/OfficialChallengeHashes.lua Fri Nov 02 10:31:08 2018 +0100 @@ -1,31 +1,32 @@ official_racer_maps = { - ["Border,60526986531,838018718"] = "Racer Challenge #1" - , ["Border,71022545335,-490229244"] = "Racer Challenge #2" - , ["Border,40469748943,806689586"] = "Racer Challenge #3" - , ["85940488650,-134869715"] = "Racer Challenge #4" - , ["62080348735,-661895109"] = "Racer Challenge #5" - , ["56818170733,479034891"] = "Racer Challenge #6" - , ["Border,25372705797,1770509913"] = "Racer Challenge #7" - , ["Border,10917540013,1902370941"] = "Racer Challenge #8" - , ["Border,43890274319,185940363"] = "Racer Challenge #9" - , ["Border,27870148394,751885839"] = "Racer Challenge #10" - , ["Border,22647869226,178845011"] = "Racer Challenge #11" - , ["Border,46954401793,706743197"] = "Racer Challenge #12" - , ["Border,60760377667,157242054"] = "Racer Challenge #13" - , ["Border,51825989393,-1585582638"] = "Racer Challenge #14" - , ["81841189250,256715557"] = "Racer Challenge #15" - , ["Border,44246064625,-528106034"] = "Racer Challenge #16" - , ["60906776802,-1389184823"] = "Racer Challenge #17" - , ["Border,70774747774,-534640804"] = "Racer Challenge #18" - , ["Border,50512019610,-1839546856"] = "Racer Challenge #19" - , ["60715683005,-281312897"] = "Racer Challenge #20" + ["Border,60526986531,-1902170174"] = "Racer Challenge #1" + , ["Border,71022545335,-68467181"] = "Racer Challenge #2" + , ["Border,40469748943,-1955933813"] = "Racer Challenge #3" + , ["85940488650,1891067114"] = "Racer Challenge #4" + , ["62080348735,186146414"] = "Racer Challenge #5" + , ["56818170733,1680930033"] = "Racer Challenge #6" + , ["Border,25372705797,-2143001865"] = "Racer Challenge #7" + , ["Border,10917540013,1294253786"] = "Racer Challenge #8" + , ["Border,43890274319,-691113420"] = "Racer Challenge #9" + , ["Border,27870148394,1263586737"] = "Racer Challenge #10" + , ["Border,22647869226,-1011473400"] = "Racer Challenge #11" + , ["Border,46954401793,-164671701"] = "Racer Challenge #12" + , ["Border,60760377667,458374282"] = "Racer Challenge #13" + , ["Border,51825989393,-589164698"] = "Racer Challenge #14" + , ["81841189250,-1216146050"] = "Racer Challenge #15" + , ["Border,44246064625,-898958339"] = "Racer Challenge #16" + -- TODO: Add Racer Challenge #17 + --, ["?????,?????"] = "Racer Challenge #17" + , ["Border,70774747774,1976202242"] = "Racer Challenge #18" + , ["Border,50512019610,122061403"] = "Racer Challenge #19" + , ["60715683005,45638031"] = "Racer Challenge #20" -- tech racer - , ["Border,19661006772,-975391975"] = "Tech Racer #1" - , ["Border,19661306766,-975391975"] = "Tech Racer #2" - , ["Border,19661606760,-975391975"] = "Tech Racer #3" - , ["Border,19661906754,-975391975"] = "Tech Racer #4" - , ["Border,19662206748,-975391975"] = "Tech Racer #5" - , ["Border,19662506742,-975391975"] = "Tech Racer #6" - , ["Border,19662806736,-975391975"] = "Tech Racer #7" - , ["Border,19663106730,-975391975"] = "Tech Racer #8" + , ["Border,19661006772,634694529"] = "Tech Racer #1" + , ["Border,19661306766,634694529"] = "Tech Racer #2" + , ["Border,19661606760,634694529"] = "Tech Racer #3" + , ["Border,19661906754,634694529"] = "Tech Racer #4" + , ["Border,19662206748,634694529"] = "Tech Racer #5" + , ["Border,19662506742,634694529"] = "Tech Racer #6" + , ["Border,19662806736,634694529"] = "Tech Racer #7" + , ["Border,19663106730,634694529"] = "Tech Racer #8" } diff -r abb42ba345b6 -r a5be3ef4bbbe share/hedgewars/Data/Scripts/OfficialChallenges.lua --- a/share/hedgewars/Data/Scripts/OfficialChallenges.lua Fri Nov 02 09:45:54 2018 +0100 +++ b/share/hedgewars/Data/Scripts/OfficialChallenges.lua Fri Nov 02 10:31:08 2018 +0100 @@ -27,7 +27,11 @@ mapString = "Border," .. mapString end - --WriteLnToConsole(mapString) - return(official_racer_maps[mapString]) + WriteLnToConsole("OfficialChallenges: Hash: "..mapString) + local map = official_racer_maps[mapString] + if map ~= nil then + WriteLnToConsole("OfficialChallenges: Detected official challenge: "..map) + end + return map end end diff -r abb42ba345b6 -r a5be3ef4bbbe share/hedgewars/Data/Scripts/TechMaps.lua --- a/share/hedgewars/Data/Scripts/TechMaps.lua Fri Nov 02 09:45:54 2018 +0100 +++ b/share/hedgewars/Data/Scripts/TechMaps.lua Fri Nov 02 10:31:08 2018 +0100 @@ -102,7 +102,7 @@ if mapID == nil then mapID = 2 + GetRandom(7) end - WriteLnToConsole("TechRacer preview: Using map "..tostring(mapID)) + WriteLnToConsole("TechRacer preview: Using map #"..tostring(mapID-1).." (mapID="..tostring(mapID)..")") TemplateFilter = 0