diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8a0dbb3..ce09785 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,10 +21,10 @@ jobs: echo "========= Install latest LDC =========" wget -q https://dlang.org/install.sh -O /tmp/install.sh - bash /tmp/install.sh install ldc-1.24.0 # PIN LDC VERSION because of https://github.com/mysql-d/mysql-native/issues/224 + bash /tmp/install.sh install ldc echo "========= Create LDC activation symlink =========" - ln -s "$(bash /tmp/install.sh install ldc-1.24.0 -a)" ~/dlang/activate # PIN LDC VERSION because of https://github.com/mysql-d/mysql-native/issues/224 + ln -s "$(bash /tmp/install.sh install ldc -a)" ~/dlang/activate source ~/dlang/activate echo "========= Install LDC windows libs for cross compiling =========" diff --git a/adjust-item-prices/dub.sdl b/adjust-item-prices/dub.sdl index 39dfb5a..58baef0 100644 --- a/adjust-item-prices/dub.sdl +++ b/adjust-item-prices/dub.sdl @@ -3,7 +3,7 @@ description "Set additional cost to reach a certain gold value" authors "Crom" copyright "Copyright © 2020, Crom" license "GPLv3" -dependency "nwn-lib-d" version="~>1.0.0" +dependency "nwn-lib-d" version="~>1.1.0" sourcePaths "source" -stringImportPaths "res" \ No newline at end of file +stringImportPaths "res" diff --git a/adjust-item-prices/dub.selections.json b/adjust-item-prices/dub.selections.json index 6cc1b37..35dc746 100644 --- a/adjust-item-prices/dub.selections.json +++ b/adjust-item-prices/dub.selections.json @@ -1,7 +1,8 @@ { "fileVersion": 1, "versions": { - "gfm": "7.0.8", - "nwn-lib-d": "1.0.0" + "gfm": "8.0.6", + "intel-intrinsics": "1.11.15", + "nwn-lib-d": "1.1.0" } } diff --git a/bictoutc/dub.sdl b/bictoutc/dub.sdl index b9e1051..53331f3 100644 --- a/bictoutc/dub.sdl +++ b/bictoutc/dub.sdl @@ -4,6 +4,6 @@ license "GPL-3.0" copyright "Copyright © 2016, Thibaut CHARLES" authors "Thibaut CHARLES" -dependency "nwn-lib-d" version="*" +dependency "nwn-lib-d" version="~>1.1.0" sourcePaths "source" diff --git a/bictoutc/dub.selections.json b/bictoutc/dub.selections.json index 3df8092..35dc746 100644 --- a/bictoutc/dub.selections.json +++ b/bictoutc/dub.selections.json @@ -1,7 +1,8 @@ { "fileVersion": 1, "versions": { - "gfm": "7.0.8", - "nwn-lib-d": "0.0.4+commit.38.g5f823f2" + "gfm": "8.0.6", + "intel-intrinsics": "1.11.15", + "nwn-lib-d": "1.1.0" } } diff --git a/bictoutc/source/app.d b/bictoutc/source/app.d index b46a7f3..fa0df45 100644 --- a/bictoutc/source/app.d +++ b/bictoutc/source/app.d @@ -53,19 +53,19 @@ int main(string[] args) if(rmEquip){ // Remove equipped items - gff["Equip_ItemList"].as!(GffType.List).length = 0; + gff["Equip_ItemList"].get!GffList.length = 0; } else{ //Set item list resrefs - foreach(ref item ; gff["Equip_ItemList"].as!(GffType.List)){ + foreach(ref item ; gff["Equip_ItemList"].get!GffList){ - auto newItem = GffNode(GffType.Struct); - newItem.structType = item.structType; - newItem["Repos_PosX"] = GffNode(GffType.Word, null, 0); - newItem["Repos_PosY"] = GffNode(GffType.Word, null, 0); - newItem["Pickpocketable"] = GffNode(GffType.Byte, null, 0); - newItem["Dropable"] = GffNode(GffType.Byte, null, 0); - newItem["EquippedRes"] = GffNode(GffType.ResRef, null, item["TemplateResRef"].to!string); + auto newItem = GffStruct(); + newItem.id = item.id; + newItem["Repos_PosX"] = GffWord(0); + newItem["Repos_PosY"] = GffWord(0); + newItem["Pickpocketable"] = GffByte(0); + newItem["Dropable"] = GffByte(0); + newItem["EquippedRes"] = GffResRef(item["TemplateResRef"].to!string); item = newItem; } @@ -73,30 +73,30 @@ int main(string[] args) if(keepInv){ //Set item list resrefs - foreach(ref item ; gff["ItemList"].as!(GffType.List)){ + foreach(ref item ; gff["ItemList"].get!GffList){ - auto newItem = GffNode(GffType.Struct); - newItem.structType = item.structType; - newItem["Repos_PosX"] = GffNode(GffType.Word, null, 0); - newItem["Repos_PosY"] = GffNode(GffType.Word, null, 0); - newItem["Pickpocketable"] = GffNode(GffType.Byte, null, 0); - newItem["Dropable"] = GffNode(GffType.Byte, null, 0); - newItem["EquippedRes"] = GffNode(GffType.ResRef, null, item["TemplateResRef"].to!string); + auto newItem = GffStruct(); + newItem.id = item.id; + newItem["Repos_PosX"] = GffWord(0); + newItem["Repos_PosY"] = GffWord(0); + newItem["Pickpocketable"] = GffByte(0); + newItem["Dropable"] = GffByte(0); + newItem["EquippedRes"] = GffResRef(item["TemplateResRef"].to!string); item = newItem; } } else{ //Remove inventory items - gff["ItemList"].as!(GffType.List).length = 0; + gff["ItemList"].get!GffList.length = 0; } //Set misc - gff["TemplateResRef"].as!(GffType.ResRef) = resref; - gff["Tag"].as!(GffType.ExoString) = resref; - gff["FactionID"].as!(GffType.Word) = factionId; - gff["Classification"] = GffNode(GffType.ExoString, null, classification); - gff["IsPC"].as!(GffType.Byte) = 0; + gff["TemplateResRef"].get!GffResRef = resref; + gff["Tag"].get!GffString = resref; + gff["FactionID"].get!GffWord = factionId; + gff["Classification"] = classification; + gff["IsPC"].get!GffByte = 0; foreach(key ; [ "LvlStatList", @@ -163,24 +163,24 @@ int main(string[] args) "CreatnScrptFird", ]){ if(key in gff) - gff.as!(GffType.Struct).remove(key); + gff.root.remove(key); } //Set scripts - gff["ScriptAttacked"].as!(GffType.ResRef) = scriptsOverride.get("Attacked", "nw_c2_default5"); - gff["ScriptDamaged"].as!(GffType.ResRef) = scriptsOverride.get("Damaged", "nw_c2_default6"); - gff["ScriptDeath"].as!(GffType.ResRef) = scriptsOverride.get("Death", "nw_c2_default7"); - gff["ScriptDialogue"].as!(GffType.ResRef) = scriptsOverride.get("Dialogue", "nw_c2_default4"); - gff["ScriptDisturbed"].as!(GffType.ResRef) = scriptsOverride.get("Disturbed", "nw_c2_default8"); - gff["ScriptEndRound"].as!(GffType.ResRef) = scriptsOverride.get("EndRound", "nw_c2_default3"); - gff["ScriptHeartbeat"].as!(GffType.ResRef) = scriptsOverride.get("Heartbeat", "nw_c2_default1"); - gff["ScriptOnBlocked"].as!(GffType.ResRef) = scriptsOverride.get("OnBlocked", "nw_c2_defaulte"); - gff["ScriptOnNotice"].as!(GffType.ResRef) = scriptsOverride.get("OnNotice", "nw_c2_default2"); - gff["ScriptRested"].as!(GffType.ResRef) = scriptsOverride.get("Rested", "nw_c2_defaulta"); - gff["ScriptSpawn"].as!(GffType.ResRef) = scriptsOverride.get("Spawn", "nw_c2_default9"); - gff["ScriptSpellAt"].as!(GffType.ResRef) = scriptsOverride.get("SpellAt", "nw_c2_defaultb"); - gff["ScriptUserDefine"].as!(GffType.ResRef) = scriptsOverride.get("UserDefine", "nw_c2_defaultd"); + gff["ScriptAttacked"].get!GffResRef = scriptsOverride.get("Attacked", "nw_c2_default5"); + gff["ScriptDamaged"].get!GffResRef = scriptsOverride.get("Damaged", "nw_c2_default6"); + gff["ScriptDeath"].get!GffResRef = scriptsOverride.get("Death", "nw_c2_default7"); + gff["ScriptDialogue"].get!GffResRef = scriptsOverride.get("Dialogue", "nw_c2_default4"); + gff["ScriptDisturbed"].get!GffResRef = scriptsOverride.get("Disturbed", "nw_c2_default8"); + gff["ScriptEndRound"].get!GffResRef = scriptsOverride.get("EndRound", "nw_c2_default3"); + gff["ScriptHeartbeat"].get!GffResRef = scriptsOverride.get("Heartbeat", "nw_c2_default1"); + gff["ScriptOnBlocked"].get!GffResRef = scriptsOverride.get("OnBlocked", "nw_c2_defaulte"); + gff["ScriptOnNotice"].get!GffResRef = scriptsOverride.get("OnNotice", "nw_c2_default2"); + gff["ScriptRested"].get!GffResRef = scriptsOverride.get("Rested", "nw_c2_defaulta"); + gff["ScriptSpawn"].get!GffResRef = scriptsOverride.get("Spawn", "nw_c2_default9"); + gff["ScriptSpellAt"].get!GffResRef = scriptsOverride.get("SpellAt", "nw_c2_defaultb"); + gff["ScriptUserDefine"].get!GffResRef = scriptsOverride.get("UserDefine", "nw_c2_defaultd"); diff --git a/camtosql/dub.sdl b/camtosql/dub.sdl index 39f8151..7f6ef84 100644 --- a/camtosql/dub.sdl +++ b/camtosql/dub.sdl @@ -4,7 +4,7 @@ authors "Thibaut CHARLES" copyright "Copyright © 2020, Thibaut CHARLES" license "GPL-3.0" -dependency "nwn-lib-d" version="==0.0.7" +dependency "nwn-lib-d" version="~>1.1.0" dependency "colorize" version="~>1.0.5" dependency "mysql-native" version="~>3.0.0" diff --git a/camtosql/dub.selections.json b/camtosql/dub.selections.json index f6f707a..058cac1 100644 --- a/camtosql/dub.selections.json +++ b/camtosql/dub.selections.json @@ -2,15 +2,17 @@ "fileVersion": 1, "versions": { "colorize": "1.0.5", - "eventcore": "0.9.13", - "gfm": "7.0.8", + "eventcore": "0.9.26", + "gfm": "8.0.6", + "intel-intrinsics": "1.11.15", "libasync": "0.8.6", - "memutils": "1.0.4", - "mysql-native": "3.0.1", - "nwn-lib-d": "0.0.7", + "memutils": "1.0.9", + "mysql-native": "3.0.3", + "nwn-lib-d": "1.1.0", "stdx-allocator": "2.77.5", - "taggedalgebraic": "0.11.21", + "taggedalgebraic": "0.11.22", "unit-threaded": "0.7.55", - "vibe-core": "1.16.0" + "vibe-container": "1.0.0", + "vibe-core": "2.4.0" } } diff --git a/camtosql/source/app.d b/camtosql/source/app.d index 69d6fe6..0b7af48 100644 --- a/camtosql/source/app.d +++ b/camtosql/source/app.d @@ -82,7 +82,7 @@ int main(string[] args){ enforce((sqlTablePrefix is null) ^ (sqlSingleTable is null), "You cannot use both --sql-table-prefix and --sql-table-name"); camFiles = args[1 .. $]; - camFiles.each!(a => { + camFiles.each!((a) { enforce(a.extension.toLower == ".dbf", "File " ~ a ~ " is not a .dbf file"); enforce(a.exists, "File " ~ a ~ " does not exist"); }); @@ -409,4 +409,4 @@ string buildPathCI(T...)(in string basePath, T subFiles){ } } return path; -} \ No newline at end of file +} diff --git a/itemupdater/dub.sdl b/itemupdater/dub.sdl index 3c6386b..6a455d6 100644 --- a/itemupdater/dub.sdl +++ b/itemupdater/dub.sdl @@ -4,5 +4,5 @@ license "GPL-3.0" copyright "Copyright © 2016, Thibaut CHARLES" authors "Thibaut CHARLES" -dependency "nwn-lib-d" version="==0.0.7" +dependency "nwn-lib-d" version="~>1.1.0" dependency "mysql-native" version="~>3.0.0" diff --git a/itemupdater/dub.selections.json b/itemupdater/dub.selections.json index f832172..f4f0b48 100644 --- a/itemupdater/dub.selections.json +++ b/itemupdater/dub.selections.json @@ -1,18 +1,20 @@ { "fileVersion": 1, "versions": { - "eventcore": "0.9.13", - "gfm": "7.0.8", + "eventcore": "0.9.26", + "gfm": "8.0.6", "gl3n": "1.3.1", + "intel-intrinsics": "1.11.15", "libasync": "0.8.6", "libevent": "2.0.2+2.0.16", - "memutils": "1.0.4", - "mysql-native": "3.0.0", - "nwn-lib-d": "0.0.7", + "memutils": "1.0.9", + "mysql-native": "3.0.3", + "nwn-lib-d": "1.1.0", "stdx-allocator": "2.77.5", - "taggedalgebraic": "0.11.19", + "taggedalgebraic": "0.11.22", "unit-threaded": "0.7.55", - "vibe-core": "1.13.0", + "vibe-container": "1.0.0", + "vibe-core": "2.4.0", "vibe-d": "0.8.4" } } diff --git a/itemupdater/source/app.d b/itemupdater/source/app.d index 89840ed..d2af071 100644 --- a/itemupdater/source/app.d +++ b/itemupdater/source/app.d @@ -154,7 +154,7 @@ int main(string[] args){ updateResref[bpu.from] = UpdateTarget(gff, bpu.policy); } else{ - immutable tplResref = gff["TemplateResRef"].as!(GffType.ResRef); + immutable tplResref = gff["TemplateResRef"].get!GffResRef; enforce(tplResref !in updateResref, "Template resref '"~tplResref~"' already registered. Cannot add blueprint '"~bpu.blueprint~"'"); updateResref[tplResref] = UpdateTarget(gff, bpu.policy); @@ -171,7 +171,7 @@ int main(string[] args){ updateTag[bpu.from] = UpdateTarget(gff, bpu.policy); } else{ - immutable tag = gff["Tag"].as!(GffType.ExoString); + immutable tag = gff["Tag"].get!GffString; enforce(tag !in updateTag, "Tag '"~tag~"' already registered. Cannot add blueprint '"~bpu.blueprint~"'"); updateTag[tag] = UpdateTarget(gff, bpu.policy); @@ -223,7 +223,7 @@ int main(string[] args){ bool charUpdated = false; int[string] updatedItemStats; - void updateSingleItem(string UpdateMethod)(ref GffNode item, in UpdateTarget target){ + void updateSingleItem(string UpdateMethod)(ref GffStruct item, in UpdateTarget target){ static if(UpdateMethod=="tag") auto identifier = item["Tag"].to!string; else static if(UpdateMethod=="resref") @@ -240,10 +240,10 @@ int main(string[] args){ item = item.updateItem(target.gff, target.policy); } - void updateInventory(ref GffNode container){ - assert("ItemList" in container.as!(GffType.Struct)); + void updateInventory(ref GffStruct container){ + assert("ItemList" in container); - foreach(ref item ; container["ItemList"].as!(GffType.List)){ + foreach(ref item ; container["ItemList"].get!GffList){ if(auto target = item["TemplateResRef"].to!string in updateResref){ updateSingleItem!"resref"(item, *target); } @@ -251,14 +251,14 @@ int main(string[] args){ updateSingleItem!"tag"(item, *target); } - if("ItemList" in item.as!(GffType.Struct)){ + if("ItemList" in item){ updateInventory(item); } } - if("Equip_ItemList" in container.as!(GffType.Struct)){ + if("Equip_ItemList" in container){ bool[size_t] itemsToRemove; - foreach(ref item ; container["Equip_ItemList"].as!(GffType.List)){ + foreach(ref item ; container["Equip_ItemList"].get!GffList){ bool u = false; if(auto target = item["TemplateResRef"].to!string in updateResref){ @@ -271,9 +271,9 @@ int main(string[] args){ } if(u){ - if(container["ItemList"].as!(GffType.List).length < 128){ - itemsToRemove[item.structType] = true; - container["ItemList"].as!(GffType.List) ~= item.dup; + if(container["ItemList"].get!GffList.length < 128){ + itemsToRemove[item.id] = true; + container["ItemList"].get!GffList ~= item.dup; } else{ stderr.writeln( @@ -284,12 +284,12 @@ int main(string[] args){ } } - foreach_reverse(i, ref item ; container["Equip_ItemList"].as!(GffType.List)){ - if(item.structType in itemsToRemove){ - immutable l = container["Equip_ItemList"].as!(GffType.List).length; - container["Equip_ItemList"].as!(GffType.List) = - container["Equip_ItemList"].as!(GffType.List)[0..i] - ~ (i+1 "~blueprint["TemplateResRef"].to!string~")"); //The item is a container (bag) - updatedItem["ItemList"] = oldItem["ItemList"].dup; + updatedItem["ItemList"] = oldItem["ItemList"]; } - updatedItem.structType = oldItem.structType; + updatedItem.id = oldItem.id; //Fix nwn2 oddities - updatedItem["ArmorRulesType"] = GffNode(GffType.Int, "ArmorRulesType", blueprint["ArmorRulesType"].as!(GffType.Byte)); - updatedItem["Cost"].as!(GffType.DWord) = 0; - foreach(ref prop ; updatedItem["PropertiesList"].as!(GffType.List)){ - prop.as!(GffType.Struct).remove("Param2"); - prop.as!(GffType.Struct).remove("Param2Value"); - prop["UsesPerDay"] = GffNode(GffType.Byte, "UsesPerDay", 255); - prop["Useable"] = GffNode(GffType.Byte, "Useable", 1); + updatedItem["ArmorRulesType"] = blueprint["ArmorRulesType"]; + updatedItem["Cost"].get!GffDWord = 0; + foreach(ref prop ; updatedItem["PropertiesList"].get!GffList){ + prop.remove("Param2"); + prop.remove("Param2Value"); + prop["UsesPerDay"] = GffByte(255); + prop["Useable"] = GffByte(1); } //Copy local variables size_t[string] varsInUpdatedItem; - foreach(i, ref var ; updatedItem["VarTable"].as!(GffType.List)) - varsInUpdatedItem[var["Name"].as!(GffType.ExoString)] = i; + foreach(i, ref var ; updatedItem["VarTable"].get!GffList) + varsInUpdatedItem[var["Name"].get!GffString] = i; - foreach(ref oldItemVar ; oldItem["VarTable"].as!(GffType.List)){ + foreach(ref oldItemVar ; oldItem["VarTable"].get!GffList){ immutable name = oldItemVar["Name"].to!string; auto policy = UpdatePolicy.Keep; @@ -580,8 +580,8 @@ GffNode updateItem(in GffNode oldItem, in GffNode blueprint, in ItemPolicy itemP //Append var if(policy == UpdatePolicy.Keep){ //Add oldvar to updated item - varsInUpdatedItem[name] = updatedItem["VarTable"].as!(GffType.List).length; - updatedItem["VarTable"].as!(GffType.List) ~= oldItemVar.dup; + varsInUpdatedItem[name] = updatedItem["VarTable"].get!GffList.length; + updatedItem["VarTable"].get!GffList ~= oldItemVar.dup; } else{ //Do not add oldvar to updated item @@ -593,8 +593,8 @@ GffNode updateItem(in GffNode oldItem, in GffNode blueprint, in ItemPolicy itemP foreach(propName, policy ; itemPolicy){ if(propName.length<4 || propName[0..4]!="Var."){ //policy is for a property - auto propOld = propName in oldItem.as!(GffType.Struct); - auto propUpd = propName in updatedItem.as!(GffType.Struct); + auto propOld = propName in oldItem; + auto propUpd = propName in updatedItem; enforce(propOld && propUpd, "Property '"~propName~"' does not exist in both instance and blueprint, impossible to enforce policy."); if(policy == UpdatePolicy.Keep){ *propUpd = propOld.dup; @@ -718,4 +718,4 @@ void improvedGetoptPrinter(string text, Option[] opt, int width=80){ first = false; } } -} \ No newline at end of file +} diff --git a/stagingtool/dub.sdl b/stagingtool/dub.sdl index 8551b1b..d323d52 100644 --- a/stagingtool/dub.sdl +++ b/stagingtool/dub.sdl @@ -3,7 +3,8 @@ description "Stage and upload client files" authors "Thibaut CHARLES" copyright "Copyright © 2017, Thibaut CHARLES" license "GPL-3.0" -dependency "nwn-lib-d" version=">=1.0.0" +dependency "dxml" version="~>0.4.4" +dependency "nwn-lib-d" version="~>1.1.0" dependency "undead" version="~>1.1.8" sourceFiles "lzma.o" platform="posix" sourceFiles "lzma.obj" platform="windows" diff --git a/stagingtool/dub.selections.json b/stagingtool/dub.selections.json index c559ace..fe94f07 100644 --- a/stagingtool/dub.selections.json +++ b/stagingtool/dub.selections.json @@ -1,9 +1,10 @@ { "fileVersion": 1, "versions": { + "dxml": "0.4.4", "gfm": "8.0.6", "intel-intrinsics": "1.11.15", - "nwn-lib-d": "1.0.6", + "nwn-lib-d": "1.1.0", "undead": "1.1.8" } } diff --git a/update-module-arealist/dub.selections.json b/update-module-arealist/dub.selections.json index 558f1e6..1ce0b74 100644 --- a/update-module-arealist/dub.selections.json +++ b/update-module-arealist/dub.selections.json @@ -1,7 +1,8 @@ { "fileVersion": 1, "versions": { - "gfm": "7.0.8", - "nwn-lib-d": "1.0.2" + "gfm": "8.0.6", + "intel-intrinsics": "1.10.10", + "nwn-lib-d": "1.0.4" } }