Skip to content

Commit 18795cd

Browse files
committed
Return a more workable data structure for parsing mission data
1 parent 1621610 commit 18795cd

File tree

1 file changed

+60
-60
lines changed

1 file changed

+60
-60
lines changed

addons/libs/extdata.lua

Lines changed: 60 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1972,88 +1972,88 @@ end
19721972

19731973
function decode.AssaultLog(itemid, str)
19741974
local missions = T{
1975-
[2491] = T{
1975+
[2491] = {
19761976
-- "Leujaoam Log"
1977-
[1] = "Leujaom Cleansing",
1978-
[2] = "Orichalcum Survey",
1979-
[3] = "Escort Professor Chanoix",
1980-
[4] = "Shanarha Grass Conservation",
1981-
[5] = "Counting Sheep",
1982-
[6] = "Supplies Recovery",
1983-
[7] = "Azure Experiments",
1984-
[8] = "Imperial Code",
1985-
[9] = "Red Versus Blue",
1986-
[10] = "Bloody Rhondo"
1987-
1977+
[1] = {name="Leujaom Cleansing"},
1978+
[2] = {name="Orichalcum Survey"},
1979+
[3] = {name="Escort Professor Chanoix"},
1980+
[4] = {name="Shanarha Grass Conservation"},
1981+
[5] = {name="Counting Sheep"},
1982+
[6] = {name="Supplies Recovery"},
1983+
[7] = {name="Azure Experiments"},
1984+
[8] = {name="Imperial Code"},
1985+
[9] = {name="Red Versus Blue"},
1986+
[10] = {name="Bloody Rhondo"},
19881987
},
1989-
[2492] = T{
1988+
[2492] = {
19901989
-- "Mamool Ja Journal"
1991-
[1] = "Imperial Agent Rescue",
1992-
[2] = "Preemptive Strike",
1993-
[3] = "Sagelord Elimination",
1994-
[4] = "Breaking Morale",
1995-
[5] = "The Double Agent",
1996-
[6] = "Imperial Treasure Retrieval",
1997-
[7] = "Blitzkrieg",
1998-
[8] = "Marids in the Mist",
1999-
[9] = "Azure Ailments",
2000-
[10] = "The Susanoo Shuffle"
1990+
[1] = {name="Imperial Agent Rescue"},
1991+
[2] = {name="Preemptive Strike"},
1992+
[3] = {name="Sagelord Elimination"},
1993+
[4] = {name="Breaking Morale"},
1994+
[5] = {name="The Double Agent"},
1995+
[6] = {name="Imperial Treasure Retrieval"},
1996+
[7] = {name="Blitzkrieg"},
1997+
[8] = {name="Marids in the Mist"},
1998+
[9] = {name="Azure Ailments"},
1999+
[10] = {name="The Susanoo Shuffle"},
20012000
},
20022001

2003-
[2493] = T{
2002+
[2493] = {
20042003
-- "Lebros Chronicle"
2005-
[1] = "Excavation Duty",
2006-
[2] = "Lebros Supplies",
2007-
[3] = "Troll Fugitives",
2008-
[4] = "Evade and Escape",
2009-
[5] = "Siegemaster Assassination",
2010-
[6] = "Apkallu Breeding",
2011-
[7] = "Wamoura Farm Raid",
2012-
[8] = "Egg Conservation",
2013-
[9] = "Operation: Black Pearl",
2014-
[10] = "Better than One",
2004+
[1] = {name="Excavation Duty"},
2005+
[2] = {name="Lebros Supplies"},
2006+
[3] = {name="Troll Fugitives"},
2007+
[4] = {name="Evade and Escape"},
2008+
[5] = {name="Siegemaster Assassination"},
2009+
[6] = {name="Apkallu Breeding"},
2010+
[7] = {name="Wamoura Farm Raid"},
2011+
[8] = {name="Egg Conservation"},
2012+
[9] = {name="Operation: Black Pearl"},
2013+
[10] = {name="Better than One"},
20152014
},
2016-
[2494] = T{
2015+
[2494] = {
20172016
-- "Periqia Diary"
2018-
[1] = "Seagull Grounded",
2019-
[2] = "Requiem",
2020-
[3] = "Saving Private Ryaaf",
2021-
[4] = "Shooting Down the Baron",
2022-
[5] = "Building Bridges",
2023-
[6] = "Stop the Bloodshed",
2024-
[7] = "Defuse the Threat",
2025-
[8] = "Operation: Snake Eyes",
2026-
[9] = "Wake the Puppet",
2027-
[10] = "The Price Is Right",
2017+
[1] = {name="Seagull Grounded"},
2018+
[2] = {name="Requiem"},
2019+
[3] = {name="Saving Private Ryaaf"},
2020+
[4] = {name="Shooting Down the Baron"},
2021+
[5] = {name="Building Bridges"},
2022+
[6] = {name="Stop the Bloodshed"},
2023+
[7] = {name="Defuse the Threat"},
2024+
[8] = {name="Operation: Snake Eyes"},
2025+
[9] = {name="Wake the Puppet"},
2026+
[10] = {name="The Price Is Right"},
20282027
},
2029-
[2495] = T{
2028+
[2495] = {
20302029
-- "Ilrusi Ledger"
2031-
[1] = "Golden Salvage",
2032-
[2] = "Lamia No.13",
2033-
[3] = "Extermination",
2034-
[4] = "Demolition Duty",
2035-
[5] = "Searat Salvation",
2036-
[6] = "Apkallu Seizure",
2037-
[7] = "Lost and Found",
2038-
[8] = "Deserter",
2039-
[9] = "Desperately Seeking Cephalopods",
2040-
[10] = "Bellerophon's Bliss",
2030+
[1] = {name="Golden Salvage"},
2031+
[2] = {name="Lamia No.13"},
2032+
[3] = {name="Extermination"},
2033+
[4] = {name="Demolition Duty"},
2034+
[5] = {name="Searat Salvation"},
2035+
[6] = {name="Apkallu Seizure"},
2036+
[7] = {name="Lost and Found"},
2037+
[8] = {name="Deserter"},
2038+
[9] = {name="Desperately Seeking Cephalopods"},
2039+
[10] = {name="Bellerophon's Bliss"},
20412040
},
20422041
}
20432042

20442043
local names = missions[itemid]
20452044
local flags = T{str:unpack("<q10")}
2046-
local data = flags:key_map(function(id) return names[id] end)
2045+
for key, val in ipairs(flags) do
2046+
names[key].completed = val
2047+
end
2048+
20472049
local rettab = {
20482050
type='Assault Log',
2049-
completed = data,
2051+
completed = names,
20502052
flags = flags,
20512053
}
20522054
return rettab
20532055
end
20542056

2055-
2056-
20572057
function decode.BonanzaMarble(str)
20582058
local event_list = {
20592059
[0x00] = 'CS Event Race',

0 commit comments

Comments
 (0)