diff --git a/components/match2/commons/match.lua b/components/match2/commons/match.lua index 846e378f1d5..070fa989a9a 100644 --- a/components/match2/commons/match.lua +++ b/components/match2/commons/match.lua @@ -374,6 +374,7 @@ function Match._prepareGameRecordForStore(matchRecord, gameRecord) gameRecord.parent = matchRecord.parent gameRecord.tournament = matchRecord.tournament + gameRecord.extradata = Match._addCommonGameExtradata(gameRecord) if not gameRecord.participants then gameRecord.participants = {} for opponentId, opponent in ipairs(gameRecord.opponents or {}) do @@ -387,6 +388,20 @@ function Match._prepareGameRecordForStore(matchRecord, gameRecord) Match.clampFields(gameRecord, Match.gameFields) end +---@param game table +---@return table +function Match._addCommonGameExtradata(game) + local commonExtradata = { + comment = game.comment, + dateexact = game.dateexact, + timestamp = tonumber(game.timestamp), + timezoneid = game.timezoneId, + timezoneoffset = game.timezoneOffset, + } + + return Table.merge(commonExtradata, game.extradata or {}) +end + ---@param playerRecord table function Match._preparePlayerRecordForStore(playerRecord) playerRecord.extradata = playerRecord.extradata or {} diff --git a/components/match2/commons/starcraft_starcraft2/match_group_input_starcraft.lua b/components/match2/commons/starcraft_starcraft2/match_group_input_starcraft.lua index 701562e47ea..1af5904c900 100644 --- a/components/match2/commons/starcraft_starcraft2/match_group_input_starcraft.lua +++ b/components/match2/commons/starcraft_starcraft2/match_group_input_starcraft.lua @@ -374,7 +374,6 @@ end ---@return table function MapFunctions.getExtraData(match, map, opponents) local extradata = { - comment = map.comment, header = map.header, server = map.server, } diff --git a/components/match2/commons/starcraft_starcraft2/match_group_input_starcraft_ffa.lua b/components/match2/commons/starcraft_starcraft2/match_group_input_starcraft_ffa.lua index c04ca6919f6..44fe1991aa7 100644 --- a/components/match2/commons/starcraft_starcraft2/match_group_input_starcraft_ffa.lua +++ b/components/match2/commons/starcraft_starcraft2/match_group_input_starcraft_ffa.lua @@ -156,7 +156,7 @@ function MatchFunctions.extractMaps(match, opponents) local hasScores = not Logic.readBool(match.noscore) local maps = {} for mapKey, mapInput in Table.iter.pairsByPrefix(match, 'map', {requireIndex = true}) do - local map = MapFunctions.readMap(mapInput, #opponents, hasScores) + local map = MapFunctions.readMap(match, mapInput, #opponents, hasScores) Array.forEach(map.opponents, function(opponent, opponentIndex) opponent.players = BaseMapFunctions.getPlayersOfMapOpponent(map, opponents[opponentIndex], opponentIndex) @@ -171,11 +171,12 @@ function MatchFunctions.extractMaps(match, opponents) return maps end +---@param match table ---@param mapInput table ---@param opponentCount integer ---@param hasScores boolean ---@return table -function MapFunctions.readMap(mapInput, opponentCount, hasScores) +function MapFunctions.readMap(match, mapInput, opponentCount, hasScores) local mapName = mapInput.map if mapName and mapName:upper() ~= TBD then mapName = mw.ext.TeamLiquidIntegration.resolve_redirect(mapInput.map) @@ -194,10 +195,7 @@ function MapFunctions.readMap(mapInput, opponentCount, hasScores) } } - if mapInput.date then - Table.mergeInto(map, MatchGroupInputUtil.readDate(mapInput.date)) - map.extradata.dateexact = map.dateexact - end + Table.mergeInto(map, MatchGroupInputUtil.readDate(mapInput.date or match.date)) if MatchGroupInputUtil.isNotPlayed(mapInput.winner, mapInput.finished) then map.finished = true diff --git a/components/match2/wikis/ageofempires/match_group_input_custom.lua b/components/match2/wikis/ageofempires/match_group_input_custom.lua index f2eef125b2e..a8b85e79682 100644 --- a/components/match2/wikis/ageofempires/match_group_input_custom.lua +++ b/components/match2/wikis/ageofempires/match_group_input_custom.lua @@ -285,7 +285,6 @@ end ---@return table function MapFunctions.getExtraData(match, map, opponents) return { - comment = map.comment, mapmode = Table.extract(map, 'mode'), } end @@ -355,15 +354,4 @@ function FfaMapFunctions.getPlayersOfMapOpponent(map, opponent, opponentMapInput ) end ----@param match table ----@param map table ----@param opponents table[] ----@return table -function FfaMapFunctions.getExtraData(match, map, opponents) - return { - dateexact = map.dateexact, - comment = map.comment, - } -end - return CustomMatchGroupInput diff --git a/components/match2/wikis/apexlegends/match_group_input_custom.lua b/components/match2/wikis/apexlegends/match_group_input_custom.lua index ef4b397e59e..3f3dd52ae8e 100644 --- a/components/match2/wikis/apexlegends/match_group_input_custom.lua +++ b/components/match2/wikis/apexlegends/match_group_input_custom.lua @@ -69,16 +69,6 @@ function MatchFunctions.getExtraData(match, games, opponents) } end ----@param match table ----@param map table ----@param opponents table[] ----@return table -function MapFunctions.getExtraData(match, map, opponents) - return { - comment = map.comment, - } -end - ---@param map table ---@return fun(opponentIndex: integer): integer? function MapFunctions.calculateMapScore(map) @@ -125,15 +115,4 @@ function FfaMatchFunctions.getExtraData(match, games, opponents, settings) } end ----@param match table ----@param map table ----@param opponents table[] ----@return table -function FfaMapFunctions.getExtraData(match, map, opponents) - return { - dateexact = map.dateexact, - comment = map.comment, - } -end - return CustomMatchGroupInput diff --git a/components/match2/wikis/arenafps/match_group_input_custom.lua b/components/match2/wikis/arenafps/match_group_input_custom.lua index 107c8ff6687..04541d01f1d 100644 --- a/components/match2/wikis/arenafps/match_group_input_custom.lua +++ b/components/match2/wikis/arenafps/match_group_input_custom.lua @@ -72,16 +72,6 @@ function MatchFunctions.calculateMatchScore(maps) end end ----@param match table ----@param map table ----@param opponents table[] ----@return table -function MapFunctions.getExtraData(match, map, opponents) - return { - comment = map.comment, - } -end - --- FFA Match ---@param match table @@ -115,15 +105,4 @@ function FfaMatchFunctions.getExtraData(match, games, opponents, settings) } end ----@param match table ----@param map table ----@param opponents table[] ----@return table -function FfaMapFunctions.getExtraData(match, map, opponents) - return { - dateexact = map.dateexact, - comment = map.comment, - } -end - return CustomMatchGroupInput diff --git a/components/match2/wikis/artifact/match_group_input_custom.lua b/components/match2/wikis/artifact/match_group_input_custom.lua index 0a007ae55c5..251acf630f6 100644 --- a/components/match2/wikis/artifact/match_group_input_custom.lua +++ b/components/match2/wikis/artifact/match_group_input_custom.lua @@ -78,16 +78,6 @@ function MapFunctions.getPlayersOfMapOpponent(map, opponent, opponentIndex) } end ----@param match table ----@param map table ----@param opponents table[] ----@return table -function MapFunctions.getExtraData(match, map, opponents) - return { - comment = map.comment, - } -end - ---@param map table ---@return fun(opponentIndex: integer): integer? function MapFunctions.calculateMapScore(map) diff --git a/components/match2/wikis/autochess/match_group_input_custom.lua b/components/match2/wikis/autochess/match_group_input_custom.lua index 41acdc20657..23e06aaac74 100644 --- a/components/match2/wikis/autochess/match_group_input_custom.lua +++ b/components/match2/wikis/autochess/match_group_input_custom.lua @@ -107,15 +107,4 @@ function FfaMatchFunctions.getExtraData(match, games, opponents, settings) } end ----@param match table ----@param map table ----@param opponents table[] ----@return table -function FfaMapFunctions.getExtraData(match, map, opponents) - return { - dateexact = map.dateexact, - comment = map.comment, - } -end - return CustomMatchGroupInput diff --git a/components/match2/wikis/battalion/match_group_input_custom.lua b/components/match2/wikis/battalion/match_group_input_custom.lua index f53521911eb..49d670d9e46 100644 --- a/components/match2/wikis/battalion/match_group_input_custom.lua +++ b/components/match2/wikis/battalion/match_group_input_custom.lua @@ -51,18 +51,4 @@ function MatchFunctions.calculateMatchScore(maps) end end --- --- map related functions --- - ----@param match table ----@param map table ----@param opponents table[] ----@return table -function MapFunctions.getExtraData(match, map, opponents) - return { - comment = map.comment, - } -end - return CustomMatchGroupInput diff --git a/components/match2/wikis/battlerite/match_group_input_custom.lua b/components/match2/wikis/battlerite/match_group_input_custom.lua index 6d154207e42..16a2830acf7 100644 --- a/components/match2/wikis/battlerite/match_group_input_custom.lua +++ b/components/match2/wikis/battlerite/match_group_input_custom.lua @@ -66,18 +66,4 @@ function MatchFunctions.getExtraData(match, games, opponents) } end --- --- map related functions --- - ----@param match table ----@param map table ----@param opponents table[] ----@return table -function MapFunctions.getExtraData(match, map, opponents) - return { - comment = map.comment, - } -end - return CustomMatchGroupInput diff --git a/components/match2/wikis/brawlhalla/match_group_input_custom.lua b/components/match2/wikis/brawlhalla/match_group_input_custom.lua index bf1fea3ef9e..24c4cc7f870 100644 --- a/components/match2/wikis/brawlhalla/match_group_input_custom.lua +++ b/components/match2/wikis/brawlhalla/match_group_input_custom.lua @@ -105,14 +105,4 @@ function MapFunctions.getMapName(map, mapIndex, match) return map.map end ----@param match table ----@param map table ----@param opponents table[] ----@return table -function MapFunctions.getExtraData(match, map, opponents) - return { - comment = map.comment, - } -end - return CustomMatchGroupInput diff --git a/components/match2/wikis/brawlstars/match_group_input_custom.lua b/components/match2/wikis/brawlstars/match_group_input_custom.lua index 6890f1a78ac..df02ae14b8e 100644 --- a/components/match2/wikis/brawlstars/match_group_input_custom.lua +++ b/components/match2/wikis/brawlstars/match_group_input_custom.lua @@ -107,7 +107,6 @@ end function MapFunctions.getExtraData(match, map, opponents) local extradata = { bestof = map.bestof, - comment = map.comment, maptype = map.maptype, firstpick = FIRST_PICK_CONVERSION[string.lower(map.firstpick or '')] } diff --git a/components/match2/wikis/callofduty/match_group_input_custom.lua b/components/match2/wikis/callofduty/match_group_input_custom.lua index fe778e147fc..09be21ace29 100644 --- a/components/match2/wikis/callofduty/match_group_input_custom.lua +++ b/components/match2/wikis/callofduty/match_group_input_custom.lua @@ -75,16 +75,6 @@ function MatchFunctions.getExtraData(match, games, opponents) } end ----@param match table ----@param map table ----@param opponents table[] ----@return table -function MapFunctions.getExtraData(match, map, opponents) - return { - comment = map.comment, - } -end - --- FFA Match ---@param match table @@ -118,15 +108,4 @@ function FfaMatchFunctions.getExtraData(match, games, opponents, settings) } end ----@param match table ----@param map table ----@param opponents table[] ----@return table -function FfaMapFunctions.getExtraData(match, map, opponents) - return { - dateexact = map.dateexact, - comment = map.comment, - } -end - return CustomMatchGroupInput diff --git a/components/match2/wikis/clashofclans/match_group_input_custom.lua b/components/match2/wikis/clashofclans/match_group_input_custom.lua index c1497733c84..674d11a1797 100644 --- a/components/match2/wikis/clashofclans/match_group_input_custom.lua +++ b/components/match2/wikis/clashofclans/match_group_input_custom.lua @@ -93,7 +93,6 @@ end ---@return table function MapFunctions.getExtraData(match, map, opponents) return { - comment = map.comment, times = MapFunctions.readTimes(map), percentages = MapFunctions.readPercentages(map), } diff --git a/components/match2/wikis/clashroyale/match_group_input_custom.lua b/components/match2/wikis/clashroyale/match_group_input_custom.lua index 9c81274e36e..3982e6d6eab 100644 --- a/components/match2/wikis/clashroyale/match_group_input_custom.lua +++ b/components/match2/wikis/clashroyale/match_group_input_custom.lua @@ -167,11 +167,7 @@ end ---@param opponents table[] ---@return table function MapFunctions.getExtraData(match, map, opponents) - local extradata = { - comment = map.comment, - } - - return Table.merge(extradata, MapFunctions.getCardsExtradata(map.opponents)) + return MapFunctions.getCardsExtradata(map.opponents) end --- additionally store cards info in extradata so we can condition on them diff --git a/components/match2/wikis/counterstrike/match_group_input_custom.lua b/components/match2/wikis/counterstrike/match_group_input_custom.lua index 04638b738b5..135e7916aab 100644 --- a/components/match2/wikis/counterstrike/match_group_input_custom.lua +++ b/components/match2/wikis/counterstrike/match_group_input_custom.lua @@ -187,13 +187,7 @@ end ---@param opponents table[] ---@return table function MapFunctions.getExtraData(match, map, opponents) - local extradata = { - comment = map.comment, - } - - Table.mergeInto(extradata, MapFunctions._getHalfScores(map)) - - return extradata + return MapFunctions._getHalfScores(map) end ---@param map table @@ -284,15 +278,4 @@ function FfaMatchFunctions.getExtraData(match, games, opponents, settings) } end ----@param match table ----@param map table ----@param opponents table[] ----@return table -function FfaMapFunctions.getExtraData(match, map, opponents) - return { - dateexact = map.dateexact, - comment = map.comment, - } -end - return CustomMatchGroupInput diff --git a/components/match2/wikis/criticalops/match_group_input_custom.lua b/components/match2/wikis/criticalops/match_group_input_custom.lua index ea85f3ebe21..900a2e6d29d 100644 --- a/components/match2/wikis/criticalops/match_group_input_custom.lua +++ b/components/match2/wikis/criticalops/match_group_input_custom.lua @@ -11,7 +11,6 @@ local Logic = require('Module:Logic') local Lua = require('Module:Lua') local MathUtil = require('Module:MathUtil') local Operator = require('Module:Operator') -local Table = require('Module:Table') local MatchGroupInputUtil = Lua.import('Module:MatchGroup/Input/Util') @@ -77,9 +76,7 @@ end ---@param opponents table[] ---@return table function MapFunctions.getExtraData(match, map, opponents) - local extradata = MapFunctions.getSideData(map) - - return Table.merge(extradata, {comment = map.comment}) + return MapFunctions.getSideData(map) end ---@param map table diff --git a/components/match2/wikis/crossfire/match_group_input_custom.lua b/components/match2/wikis/crossfire/match_group_input_custom.lua index df6f3f899fc..688d21e4143 100644 --- a/components/match2/wikis/crossfire/match_group_input_custom.lua +++ b/components/match2/wikis/crossfire/match_group_input_custom.lua @@ -82,18 +82,4 @@ function MatchFunctions.getExtraData(match, games, opponents) } end --- --- map related functions --- - ----@param match table ----@param map table ----@param opponents table[] ----@return table -function MapFunctions.getExtraData(match, map, opponents) - return { - comment = map.comment, - } -end - return CustomMatchGroupInput diff --git a/components/match2/wikis/deadlock/match_group_input_custom.lua b/components/match2/wikis/deadlock/match_group_input_custom.lua index 52ca3f3c9aa..450f9b1eae4 100644 --- a/components/match2/wikis/deadlock/match_group_input_custom.lua +++ b/components/match2/wikis/deadlock/match_group_input_custom.lua @@ -46,14 +46,6 @@ function MatchFunctions.calculateMatchScore(maps) end end ----@param match table ----@return table -function MatchFunctions.getExtraData(match) - return { - comment = match.comment, - } -end - ---@param map table ---@param mapIndex table ---@param match table @@ -69,7 +61,6 @@ end ---@return table function MapFunctions.getExtraData(match, map, opponents) local extradata = { - comment = map.comment, team1side = map.team1side, team2side = map.team2side, } diff --git a/components/match2/wikis/dota2/match_group_input_custom.lua b/components/match2/wikis/dota2/match_group_input_custom.lua index 02b2dc3ce2f..17a202cc2c1 100644 --- a/components/match2/wikis/dota2/match_group_input_custom.lua +++ b/components/match2/wikis/dota2/match_group_input_custom.lua @@ -195,7 +195,6 @@ end function MapFunctions.getExtraData(MapParser, map, opponentCount) local extraData = { publisherid = tonumber(map.publisherid), - comment = map.comment, } local getCharacterName = FnUtil.curry(MatchGroupInputUtil.getCharacterName, HeroNames) diff --git a/components/match2/wikis/easportsfc/match_group_input_custom.lua b/components/match2/wikis/easportsfc/match_group_input_custom.lua index ae07da502b4..a86425fe1bc 100644 --- a/components/match2/wikis/easportsfc/match_group_input_custom.lua +++ b/components/match2/wikis/easportsfc/match_group_input_custom.lua @@ -163,7 +163,6 @@ end ---@return table function MapFunctions.getExtraData(match, map, opponents) return { - comment = map.comment, penaltyscores = CustomMatchGroupInput._submatchPenaltyScores(map, opponents, Logic.readBool(match.hasSubmatches)), } end diff --git a/components/match2/wikis/fighters/match_group_input_custom.lua b/components/match2/wikis/fighters/match_group_input_custom.lua index de8e1c3eec0..0dc2a952881 100644 --- a/components/match2/wikis/fighters/match_group_input_custom.lua +++ b/components/match2/wikis/fighters/match_group_input_custom.lua @@ -122,14 +122,4 @@ function MapFunctions.calculateMapScore(map) end end ----@param match table ----@param map table ----@param opponents table[] ----@return table -function MapFunctions.getExtraData(match, map, opponents) - return { - comment = map.comment, - } -end - return CustomMatchGroupInput diff --git a/components/match2/wikis/fortnite/match_group_input_custom.lua b/components/match2/wikis/fortnite/match_group_input_custom.lua index 4faea9f0fc2..94ab7b4b7bf 100644 --- a/components/match2/wikis/fortnite/match_group_input_custom.lua +++ b/components/match2/wikis/fortnite/match_group_input_custom.lua @@ -64,16 +64,6 @@ function MatchFunctions.removeUnsetMaps(games) return Array.filter(games, Logic.isNotDeepEmpty) end ----@param match table ----@param map table ----@param opponents table[] ----@return table -function MapFunctions.getExtraData(match, map, opponents) - return { - comment = map.comment, - } -end - ---@param map table ---@return fun(opponentIndex: integer): integer? function MapFunctions.calculateMapScore(map) @@ -120,15 +110,4 @@ function FfaMatchFunctions.getExtraData(match, games, opponents, settings) } end ----@param match table ----@param map table ----@param opponents table[] ----@return table -function FfaMapFunctions.getExtraData(match, map, opponents) - return { - dateexact = map.dateexact, - comment = map.comment, - } -end - return CustomMatchGroupInput diff --git a/components/match2/wikis/freefire/match_group_input_custom.lua b/components/match2/wikis/freefire/match_group_input_custom.lua index 90f0d06814e..97cef714414 100644 --- a/components/match2/wikis/freefire/match_group_input_custom.lua +++ b/components/match2/wikis/freefire/match_group_input_custom.lua @@ -64,16 +64,6 @@ function MatchFunctions.removeUnsetMaps(games) return Array.filter(games, Logic.isNotDeepEmpty) end ----@param match table ----@param map table ----@param opponents table[] ----@return table -function MapFunctions.getExtraData(match, map, opponents) - return { - comment = map.comment, - } -end - ---@param map table ---@return fun(opponentIndex: integer): integer? function MapFunctions.calculateMapScore(map) @@ -120,15 +110,4 @@ function FfaMatchFunctions.getExtraData(match, games, opponents, settings) } end ----@param match table ----@param map table ----@param opponents table[] ----@return table -function FfaMapFunctions.getExtraData(match, map, opponents) - return { - dateexact = map.dateexact, - comment = map.comment, - } -end - return CustomMatchGroupInput diff --git a/components/match2/wikis/geoguessr/match_group_input_custom.lua b/components/match2/wikis/geoguessr/match_group_input_custom.lua index 43d20f184e4..9f9cca0f4c4 100644 --- a/components/match2/wikis/geoguessr/match_group_input_custom.lua +++ b/components/match2/wikis/geoguessr/match_group_input_custom.lua @@ -49,18 +49,4 @@ function MatchFunctions.calculateMatchScore(maps) end end --- --- map related functions --- - ----@param match table ----@param map table ----@param opponents table[] ----@return table -function MapFunctions.getExtraData(match, map, opponents) - return { - comment = map.comment, - } -end - return CustomMatchGroupInput diff --git a/components/match2/wikis/halo/match_group_input_custom.lua b/components/match2/wikis/halo/match_group_input_custom.lua index 38fe416f9b0..3d6bd4b647d 100644 --- a/components/match2/wikis/halo/match_group_input_custom.lua +++ b/components/match2/wikis/halo/match_group_input_custom.lua @@ -123,7 +123,6 @@ end ---@return table function MapFunctions.getExtraData(match, map, opponents) return { - comment = map.comment, points1 = map.points1, points2 = map.points2, } @@ -162,16 +161,4 @@ function FfaMatchFunctions.getExtraData(match, games, opponents, settings) } end ----@param match table ----@param map table ----@param opponents table[] ----@return table -function FfaMapFunctions.getExtraData(match, map, opponents) - return { - dateexact = map.dateexact, - comment = map.comment, - } -end - - return CustomMatchGroupInput diff --git a/components/match2/wikis/hearthstone/match_group_input_custom.lua b/components/match2/wikis/hearthstone/match_group_input_custom.lua index d7e711cd2d7..33d071bd55e 100644 --- a/components/match2/wikis/hearthstone/match_group_input_custom.lua +++ b/components/match2/wikis/hearthstone/match_group_input_custom.lua @@ -80,7 +80,7 @@ end ---@param opponents table[] ---@return table function MapFunctions.getExtraData(match, map, opponents) - local extradata = {comment = map.comment} + local extradata = {} Array.forEach(opponents, function(_, opponentIndex) local prefix = 'o' .. opponentIndex .. 'c' @@ -204,15 +204,4 @@ function FffMatchFunctions.getExtraData(match, games, opponents, settings) } end ----@param match table ----@param map table ----@param opponents table[] ----@return table -function FfaMapFunctions.getExtraData(match, map, opponents) - return { - dateexact = map.dateexact, - comment = map.comment, - } -end - return CustomMatchGroupInput diff --git a/components/match2/wikis/heroes/match_group_input_custom.lua b/components/match2/wikis/heroes/match_group_input_custom.lua index 65bd9959afd..97733028308 100644 --- a/components/match2/wikis/heroes/match_group_input_custom.lua +++ b/components/match2/wikis/heroes/match_group_input_custom.lua @@ -83,9 +83,7 @@ end ---@param opponents table[] ---@return table function MapFunctions.getExtraData(match, map, opponents) - local extraData = { - comment = map.comment, - } + local extraData = {} local getCharacterName = FnUtil.curry(MatchGroupInputUtil.getCharacterName, ChampionNames) diff --git a/components/match2/wikis/honorofkings/match_group_input_custom.lua b/components/match2/wikis/honorofkings/match_group_input_custom.lua index b3c0d90ba0e..2f6bca4b442 100644 --- a/components/match2/wikis/honorofkings/match_group_input_custom.lua +++ b/components/match2/wikis/honorofkings/match_group_input_custom.lua @@ -98,9 +98,7 @@ end ---@param opponents table[] ---@return table function MapFunctions.getExtraData(match, map, opponents) - local extraData = { - comment = map.comment, - } + local extraData = {} local getCharacterName = FnUtil.curry(MatchGroupInputUtil.getCharacterName, ChampionNames) diff --git a/components/match2/wikis/leagueoflegends/match_group_input_custom.lua b/components/match2/wikis/leagueoflegends/match_group_input_custom.lua index a326b2376e0..5304a6bdfae 100644 --- a/components/match2/wikis/leagueoflegends/match_group_input_custom.lua +++ b/components/match2/wikis/leagueoflegends/match_group_input_custom.lua @@ -137,9 +137,7 @@ end ---@param opponentCount integer ---@return table function MapFunctions.getExtraData(MapParser, map, opponentCount) - local extraData = { - comment = map.comment, - } + local extraData = {} local getCharacterName = FnUtil.curry(MatchGroupInputUtil.getCharacterName, HeroNames) local function prefixKeyWithTeam(key, opponentIndex) diff --git a/components/match2/wikis/magic/match_group_input_custom.lua b/components/match2/wikis/magic/match_group_input_custom.lua index 97a9cec079e..ef7926a508c 100644 --- a/components/match2/wikis/magic/match_group_input_custom.lua +++ b/components/match2/wikis/magic/match_group_input_custom.lua @@ -109,15 +109,4 @@ function MapFunctions.getMapMode(match, map, opponents) return Opponent.toMode(opponents[1].type, opponents[2].type) end - ----@param match table ----@param map table ----@param opponents table[] ----@return table -function MapFunctions.getExtraData(match, map, opponents) - return { - comment = map.comment, - } -end - return CustomMatchGroupInput diff --git a/components/match2/wikis/marvelrivals/match_group_input_custom.lua b/components/match2/wikis/marvelrivals/match_group_input_custom.lua index d965d3e717f..aaec4bd98b9 100644 --- a/components/match2/wikis/marvelrivals/match_group_input_custom.lua +++ b/components/match2/wikis/marvelrivals/match_group_input_custom.lua @@ -42,18 +42,4 @@ function MatchFunctions.calculateMatchScore(maps) end end --- --- map related functions --- - ----@param match table ----@param map table ----@param opponents table[] ----@return table -function MapFunctions.getExtraData(match, map, opponents) - return { - comment = map.comment, - } -end - return CustomMatchGroupInput diff --git a/components/match2/wikis/mobilelegends/match_group_input_custom.lua b/components/match2/wikis/mobilelegends/match_group_input_custom.lua index e2515c78beb..ddcb0ac90fc 100644 --- a/components/match2/wikis/mobilelegends/match_group_input_custom.lua +++ b/components/match2/wikis/mobilelegends/match_group_input_custom.lua @@ -83,7 +83,6 @@ end ---@return table function MapFunctions.getExtraData(match, map, opponents) local extradata = { - comment = map.comment, team1side = string.lower(map.team1side or ''), team2side = string.lower(map.team2side or ''), } diff --git a/components/match2/wikis/naraka/match_group_input_custom.lua b/components/match2/wikis/naraka/match_group_input_custom.lua index 8001bc428c0..76ee61de962 100644 --- a/components/match2/wikis/naraka/match_group_input_custom.lua +++ b/components/match2/wikis/naraka/match_group_input_custom.lua @@ -65,19 +65,4 @@ function MatchFunctions.getExtraData(match, games, opponents, settings) } end --- --- map related functions --- - ----@param match table ----@param map table ----@param opponents table[] ----@return table -function MapFunctions.getExtraData(match, map, opponents) - return { - dateexact = map.dateexact, - comment = map.comment, - } -end - return CustomMatchGroupInput diff --git a/components/match2/wikis/omegastrikers/match_group_input_custom.lua b/components/match2/wikis/omegastrikers/match_group_input_custom.lua index 511f39f4f18..efe0e9f0fd8 100644 --- a/components/match2/wikis/omegastrikers/match_group_input_custom.lua +++ b/components/match2/wikis/omegastrikers/match_group_input_custom.lua @@ -79,7 +79,6 @@ end function MapFunctions.getExtraData(match, map, opponents) local extradata = { bestof = map.bestof, - comment = map.comment, } local bans = {} diff --git a/components/match2/wikis/osu/match_group_input_custom.lua b/components/match2/wikis/osu/match_group_input_custom.lua index 9e90d4fea79..7c48ed3e464 100644 --- a/components/match2/wikis/osu/match_group_input_custom.lua +++ b/components/match2/wikis/osu/match_group_input_custom.lua @@ -77,16 +77,6 @@ end -- map related functions -- ----@param match table ----@param map table ----@param opponents table[] ----@return table -function MapFunctions.getExtraData(match, map, opponents) - return { - comment = map.comment, - } -end - ---@param props {walkover: string|integer?, winner: string|integer?, score: string|integer?, opponentIndex: integer} ---@param autoScore? fun(opponentIndex: integer): integer? ---@return integer|string? #SCORE diff --git a/components/match2/wikis/overwatch/match_group_input_custom.lua b/components/match2/wikis/overwatch/match_group_input_custom.lua index beee93cac15..e4a1f54fa6d 100644 --- a/components/match2/wikis/overwatch/match_group_input_custom.lua +++ b/components/match2/wikis/overwatch/match_group_input_custom.lua @@ -70,15 +70,6 @@ end -- map related functions -- ----@param match table ----@param map table ----@param opponents table[] ----@return table -function MapFunctions.getExtraData(match, map, opponents) - return { - comment = map.comment, - } -end ---@param props {walkover: string|integer?, winner: string|integer?, score: string|integer?, opponentIndex: integer} ---@param autoScore? fun(opponentIndex: integer): integer? ---@return integer? #SCORE diff --git a/components/match2/wikis/paladins/match_group_input_custom.lua b/components/match2/wikis/paladins/match_group_input_custom.lua index 5bf5b5c349d..6a192dfc7d4 100644 --- a/components/match2/wikis/paladins/match_group_input_custom.lua +++ b/components/match2/wikis/paladins/match_group_input_custom.lua @@ -81,16 +81,6 @@ function MapFunctions.getPlayersOfMapOpponent(map, opponent, opponentIndex) ) end ----@param match table ----@param map table ----@param opponents table[] ----@return table -function MapFunctions.getExtraData(match, map, opponents) - return { - comment = map.comment, - } -end - ---@param map table ---@return fun(opponentIndex: integer): integer? function MapFunctions.calculateMapScore(map) diff --git a/components/match2/wikis/pokemon/match_group_input_custom.lua b/components/match2/wikis/pokemon/match_group_input_custom.lua index f95920d9e63..8df94141bd4 100644 --- a/components/match2/wikis/pokemon/match_group_input_custom.lua +++ b/components/match2/wikis/pokemon/match_group_input_custom.lua @@ -86,7 +86,6 @@ end ---@return table function MapFunctions.getExtraData(match, map, opponents) local extradata = { - comment = map.comment, team1side = string.lower(map.team1side or ''), team2side = string.lower(map.team2side or ''), } diff --git a/components/match2/wikis/pubg/match_group_input_custom.lua b/components/match2/wikis/pubg/match_group_input_custom.lua index 40142f4ba2f..b1c69398cc2 100644 --- a/components/match2/wikis/pubg/match_group_input_custom.lua +++ b/components/match2/wikis/pubg/match_group_input_custom.lua @@ -65,19 +65,4 @@ function MatchFunctions.getExtraData(match, games, opponents, settings) } end --- --- map related functions --- - ----@param match table ----@param map table ----@param opponents table[] ----@return table -function MapFunctions.getExtraData(match, map, opponents) - return { - dateexact = map.dateexact, - comment = map.comment, - } -end - return CustomMatchGroupInput diff --git a/components/match2/wikis/pubgmobile/match_group_input_custom.lua b/components/match2/wikis/pubgmobile/match_group_input_custom.lua index f9b691ba142..71259912846 100644 --- a/components/match2/wikis/pubgmobile/match_group_input_custom.lua +++ b/components/match2/wikis/pubgmobile/match_group_input_custom.lua @@ -69,16 +69,6 @@ function MatchFunctions.getExtraData(match, games, opponents) } end ----@param match table ----@param map table ----@param opponents table[] ----@return table -function MapFunctions.getExtraData(match, map, opponents) - return { - comment = map.comment, - } -end - ---@param map table ---@return fun(opponentIndex: integer): integer? function MapFunctions.calculateMapScore(map) @@ -125,15 +115,4 @@ function FfaMatchFunctions.getExtraData(match, games, opponents, settings) } end ----@param match table ----@param map table ----@param opponents table[] ----@return table -function FfaMapFunctions.getExtraData(match, map, opponents) - return { - dateexact = map.dateexact, - comment = map.comment, - } -end - return CustomMatchGroupInput diff --git a/components/match2/wikis/rainbowsix/match_group_input_custom.lua b/components/match2/wikis/rainbowsix/match_group_input_custom.lua index 30bfccd3a61..fc717d84820 100644 --- a/components/match2/wikis/rainbowsix/match_group_input_custom.lua +++ b/components/match2/wikis/rainbowsix/match_group_input_custom.lua @@ -78,7 +78,6 @@ end ---@return table function MapFunctions.getExtraData(match, map, opponents) local extradata = { - comment = map.comment, t1firstside = {rt = map.t1firstside, ot = map.t1firstsideot}, t1halfs = {atk = map.t1atk, def = map.t1def, otatk = map.t1otatk, otdef = map.t1otdef}, t2halfs = {atk = map.t2atk, def = map.t2def, otatk = map.t2otatk, otdef = map.t2otdef}, diff --git a/components/match2/wikis/rocketleague/match_group_input_custom.lua b/components/match2/wikis/rocketleague/match_group_input_custom.lua index dd2066e9453..b91b16ca8fe 100644 --- a/components/match2/wikis/rocketleague/match_group_input_custom.lua +++ b/components/match2/wikis/rocketleague/match_group_input_custom.lua @@ -219,7 +219,6 @@ function MapFunctions.getExtraData(map) return { ot = map.ot, otlength = map.otlength, - comment = map.comment, header = map.header, --the following is used to store 'mapXtYgoals' from LegacyMatchLists t1goals = map.t1goals, diff --git a/components/match2/wikis/sideswipe/match_group_input_custom.lua b/components/match2/wikis/sideswipe/match_group_input_custom.lua index c3fe8d6444b..21166f55bbb 100644 --- a/components/match2/wikis/sideswipe/match_group_input_custom.lua +++ b/components/match2/wikis/sideswipe/match_group_input_custom.lua @@ -72,7 +72,6 @@ function MapFunctions.getExtraData(match, map, opponents) return { ot = map.ot, otlength = map.otlength, - comment = map.comment, } end diff --git a/components/match2/wikis/smash/match_group_input_custom.lua b/components/match2/wikis/smash/match_group_input_custom.lua index ff3ff90173a..28fdf17bc30 100644 --- a/components/match2/wikis/smash/match_group_input_custom.lua +++ b/components/match2/wikis/smash/match_group_input_custom.lua @@ -151,14 +151,4 @@ function MapFunctions.calculateMapScore(map) end end ----@param match table ----@param map table ----@param opponents table[] ----@return table -function MapFunctions.getExtraData(match, map, opponents) - return { - comment = map.comment, - } -end - return CustomMatchGroupInput diff --git a/components/match2/wikis/smite/match_group_input_custom.lua b/components/match2/wikis/smite/match_group_input_custom.lua index 6fedd18c6bf..16f49f57d9b 100644 --- a/components/match2/wikis/smite/match_group_input_custom.lua +++ b/components/match2/wikis/smite/match_group_input_custom.lua @@ -99,7 +99,6 @@ end ---@return table function MapFunctions.getExtraData(match, map, opponents) return Table.merge({ - comment = map.comment, team1side = string.lower(map.team1side or ''), team2side = string.lower(map.team2side or ''), }, MapFunctions.getPicksAndBans(map, #opponents)) diff --git a/components/match2/wikis/splatoon/match_group_input_custom.lua b/components/match2/wikis/splatoon/match_group_input_custom.lua index c8b4885b679..ac8023fdaab 100644 --- a/components/match2/wikis/splatoon/match_group_input_custom.lua +++ b/components/match2/wikis/splatoon/match_group_input_custom.lua @@ -65,7 +65,6 @@ end ---@return table function MapFunctions.getExtraData(match, map, opponents) return { - comment = map.comment, maptype = map.maptype, } end diff --git a/components/match2/wikis/splitgate/match_group_input_custom.lua b/components/match2/wikis/splitgate/match_group_input_custom.lua index 22e3780d695..8c0bf80111e 100644 --- a/components/match2/wikis/splitgate/match_group_input_custom.lua +++ b/components/match2/wikis/splitgate/match_group_input_custom.lua @@ -76,18 +76,4 @@ function MatchFunctions.getExtraData(match, games, opponents) } end --- --- map related functions --- - ----@param match table ----@param map table ----@param opponents table[] ----@return table -function MapFunctions.getExtraData(match, map, opponents) - return { - comment = map.comment, - } -end - return CustomMatchGroupInput diff --git a/components/match2/wikis/stormgate/match_group_input_custom.lua b/components/match2/wikis/stormgate/match_group_input_custom.lua index be4bde68f4f..504fca2b4ae 100644 --- a/components/match2/wikis/stormgate/match_group_input_custom.lua +++ b/components/match2/wikis/stormgate/match_group_input_custom.lua @@ -304,7 +304,6 @@ end ---@return table function MapFunctions.getExtraData(match, map, opponents) local extradata = { - comment = map.comment, header = map.header, } diff --git a/components/match2/wikis/teamfortress/match_group_input_custom.lua b/components/match2/wikis/teamfortress/match_group_input_custom.lua index 7ac4ea533a2..07d55cc857f 100644 --- a/components/match2/wikis/teamfortress/match_group_input_custom.lua +++ b/components/match2/wikis/teamfortress/match_group_input_custom.lua @@ -68,18 +68,4 @@ function MatchFunctions.getLinks(match, games) return links end --- --- map related functions --- - ----@param match table ----@param map table ----@param opponents table[] ----@return table -function MapFunctions.getExtraData(match, map, opponents) - return { - comment = map.comment, - } -end - return CustomMatchGroupInput diff --git a/components/match2/wikis/tetris/match_group_input_custom.lua b/components/match2/wikis/tetris/match_group_input_custom.lua index e7cfe70f9bd..8a831c56f77 100644 --- a/components/match2/wikis/tetris/match_group_input_custom.lua +++ b/components/match2/wikis/tetris/match_group_input_custom.lua @@ -100,16 +100,6 @@ function MapFunctions.getMapName(map, mapIndex, match) return nil end ----@param match table ----@param map table ----@param opponents table[] ----@return table -function MapFunctions.getExtraData(match, map, opponents) - return { - comment = map.comment, - } -end - ---@param match table ---@param map table ---@param opponents table[] diff --git a/components/match2/wikis/tft/match_group_input_custom.lua b/components/match2/wikis/tft/match_group_input_custom.lua index 5491078ea61..9db6f504559 100644 --- a/components/match2/wikis/tft/match_group_input_custom.lua +++ b/components/match2/wikis/tft/match_group_input_custom.lua @@ -76,16 +76,6 @@ function MatchFunctions.removeUnsetMaps(games) end) end ----@param match table ----@param map table ----@param opponents table[] ----@return table -function MapFunctions.getExtraData(match, map, opponents) - return { - comment = map.comment, - } -end - ---@param map table ---@return fun(opponentIndex: integer): integer? function MapFunctions.calculateMapScore(map) @@ -132,16 +122,4 @@ function FfaMatchFunctions.getExtraData(match, games, opponents, settings) } end ----@param match table ----@param map table ----@param opponents table[] ----@return table -function FfaMapFunctions.getExtraData(match, map, opponents) - return { - dateexact = map.dateexact, - comment = map.comment, - } -end - - return CustomMatchGroupInput diff --git a/components/match2/wikis/trackmania/match_group_input_custom.lua b/components/match2/wikis/trackmania/match_group_input_custom.lua index cc750de03af..ceb5ad4462c 100644 --- a/components/match2/wikis/trackmania/match_group_input_custom.lua +++ b/components/match2/wikis/trackmania/match_group_input_custom.lua @@ -125,7 +125,6 @@ end ---@return table function MapFunctions.getExtraData(match, map, opponents) return { - comment = map.comment, overtime = Logic.readBool(map.overtime) } end @@ -163,15 +162,4 @@ function FfaMatchFunctions.getExtraData(match, games, opponents, settings) } end ----@param match table ----@param map table ----@param opponents table[] ----@return table -function FfaMapFunctions.getExtraData(match, map, opponents) - return { - dateexact = map.dateexact, - comment = map.comment, - } -end - return CustomMatchGroupInput diff --git a/components/match2/wikis/underlords/match_group_input_custom.lua b/components/match2/wikis/underlords/match_group_input_custom.lua index 9255d24df86..33220c739ff 100644 --- a/components/match2/wikis/underlords/match_group_input_custom.lua +++ b/components/match2/wikis/underlords/match_group_input_custom.lua @@ -65,19 +65,4 @@ function MatchFunctions.getExtraData(match, games, opponents, settings) } end --- --- map related functions --- - ----@param match table ----@param map table ----@param opponents table[] ----@return table -function MapFunctions.getExtraData(match, map, opponents) - return { - dateexact = map.dateexact, - comment = map.comment, - } -end - return CustomMatchGroupInput diff --git a/components/match2/wikis/valorant/match_group_input_custom.lua b/components/match2/wikis/valorant/match_group_input_custom.lua index 6f71f1098da..454b2bd7da4 100644 --- a/components/match2/wikis/valorant/match_group_input_custom.lua +++ b/components/match2/wikis/valorant/match_group_input_custom.lua @@ -89,7 +89,6 @@ end function MapFunctions.getExtraData(match, map, opponents) ---@type table local extraData = { - comment = map.comment, t1firstside = map.t1firstside, t1halfs = {atk = map.t1atk, def = map.t1def, otatk = map.t1otatk, otdef = map.t1otdef}, t2halfs = {atk = map.t2atk, def = map.t2def, otatk = map.t2otatk, otdef = map.t2otdef}, diff --git a/components/match2/wikis/warcraft/match_group_input_custom.lua b/components/match2/wikis/warcraft/match_group_input_custom.lua index 54ba385c78d..138589800d3 100644 --- a/components/match2/wikis/warcraft/match_group_input_custom.lua +++ b/components/match2/wikis/warcraft/match_group_input_custom.lua @@ -348,7 +348,6 @@ end ---@return table function MapFunctions.getExtraData(match, map, opponents) local extradata = { - comment = map.comment, header = map.header, } @@ -513,7 +512,7 @@ function FfaMatchFunctions.extractMaps(match, opponents) local hasScores = Logic.readBool(match.hasscore) local maps = {} for mapKey, mapInput in Table.iter.pairsByPrefix(match, 'map', {requireIndex = true}) do - local map = FfaMapFunctions.readMap(mapInput, #opponents, hasScores) + local map = FfaMapFunctions.readMap(match, mapInput, #opponents, hasScores) Array.forEach(map.opponents, function(opponent, opponentIndex) opponent.players = MapFunctions.getPlayersOfMapOpponent(mapInput, opponents[opponentIndex], opponentIndex) @@ -528,11 +527,12 @@ function FfaMatchFunctions.extractMaps(match, opponents) return maps end +---@param match table ---@param mapInput table ---@param opponentCount integer ---@param hasScores boolean ---@return table -function FfaMapFunctions.readMap(mapInput, opponentCount, hasScores) +function FfaMapFunctions.readMap(match, mapInput, opponentCount, hasScores) local mapName = mapInput.map if mapName and mapName:upper() ~= TBD then mapName = mw.ext.TeamLiquidIntegration.resolve_redirect(mapInput.map) @@ -551,10 +551,7 @@ function FfaMapFunctions.readMap(mapInput, opponentCount, hasScores) } } - if mapInput.date then - Table.mergeInto(map, MatchGroupInputUtil.readDate(mapInput.date)) - map.extradata.dateexact = map.dateexact - end + Table.mergeInto(map, MatchGroupInputUtil.readDate(mapInput.date or match.date)) if MatchGroupInputUtil.isNotPlayed(mapInput.winner, mapInput.finished) then map.finished = true diff --git a/components/match2/wikis/wildrift/match_group_input_custom.lua b/components/match2/wikis/wildrift/match_group_input_custom.lua index 5a3d30e868f..c0993b23a6c 100644 --- a/components/match2/wikis/wildrift/match_group_input_custom.lua +++ b/components/match2/wikis/wildrift/match_group_input_custom.lua @@ -85,9 +85,7 @@ end ---@param opponents table[] ---@return table function MapFunctions.getExtraData(match, map, opponents) - local extraData = { - comment = map.comment, - } + local extraData = {} local getCharacterName = FnUtil.curry(MatchGroupInputUtil.getCharacterName, ChampionNames) diff --git a/components/match2/wikis/worldoftanks/match_group_input_custom.lua b/components/match2/wikis/worldoftanks/match_group_input_custom.lua index b6b2f117b48..a1a8b5ae537 100644 --- a/components/match2/wikis/worldoftanks/match_group_input_custom.lua +++ b/components/match2/wikis/worldoftanks/match_group_input_custom.lua @@ -74,17 +74,4 @@ function MatchFunctions.getExtraData(match, games, opponents) } end --- --- map related functions --- ----@param match table ----@param map table ----@param opponents table[] ----@return table -function MapFunctions.getExtraData(match, map, opponents) - return { - comment = map.comment, - } -end - return CustomMatchGroupInput diff --git a/components/match2/wikis/worldofwarcraft/match_group_input_custom.lua b/components/match2/wikis/worldofwarcraft/match_group_input_custom.lua index fce7179b5fb..825f878b750 100644 --- a/components/match2/wikis/worldofwarcraft/match_group_input_custom.lua +++ b/components/match2/wikis/worldofwarcraft/match_group_input_custom.lua @@ -53,7 +53,6 @@ end ---@return table function MapFunctions.getExtraData(match, map, opponents) local extradata = { - comment = map.comment, damp = map.damp, } diff --git a/components/match2/wikis/zula/match_group_input_custom.lua b/components/match2/wikis/zula/match_group_input_custom.lua index ea015792972..1b5f9c48307 100644 --- a/components/match2/wikis/zula/match_group_input_custom.lua +++ b/components/match2/wikis/zula/match_group_input_custom.lua @@ -60,15 +60,4 @@ function MatchFunctions.getExtraData(match) } end --- --- map related functions --- ----@param match table ----@param map table ----@param opponents table[] ----@return table -function MapFunctions.getExtraData(match, map, opponents) - return {comment = map.comment} -end - return CustomMatchGroupInput