From 89dd02820f667e8329d3c8f0bf128632d9b91d86 Mon Sep 17 00:00:00 2001 From: Anton Tarasenko Date: Tue, 5 Jul 2022 01:59:46 +0700 Subject: [PATCH] Change configs to adapt to AcediaCore's changes --- sources/FixAmmoSelling/FixAmmoSelling.uc | 12 +++--- sources/FixDoshSpam/FixDoshSpam.uc | 18 ++++----- sources/FixDualiesCost/FixDualiesCost.uc | 10 ++--- sources/FixFFHack/FixFFHack.uc | 40 ++++++++++--------- sources/FixInfiniteNades/FixInfiniteNades.uc | 12 +++--- .../FixInventoryAbuse/FixInventoryAbuse.uc | 30 +++++++------- sources/FixLogSpam/FixLogSpam.uc | 14 +++---- sources/FixPipes/FixPipes.uc | 20 +++++----- sources/FixProjectileFF/FixProjectileFF.uc | 12 +++--- .../FixSpectatorCrash/FixSpectatorCrash.uc | 14 +++---- sources/FixZedTimeLags/FixZedTimeLags.uc | 15 ++++--- 11 files changed, 101 insertions(+), 96 deletions(-) diff --git a/sources/FixAmmoSelling/FixAmmoSelling.uc b/sources/FixAmmoSelling/FixAmmoSelling.uc index 28e8b3b..b8780d8 100644 --- a/sources/FixAmmoSelling/FixAmmoSelling.uc +++ b/sources/FixAmmoSelling/FixAmmoSelling.uc @@ -1,6 +1,6 @@ /** * Config object for `FixAmmoSelling_Feature`. - * Copyright 2021 Anton Tarasenko + * Copyright 2021-2022 Anton Tarasenko *------------------------------------------------------------------------------ * This file is part of Acedia. * @@ -23,15 +23,15 @@ class FixAmmoSelling extends FeatureConfig var public config bool allowNegativeDosh; -protected function AssociativeArray ToData() +protected function HashTable ToData() { - local AssociativeArray data; - data = __().collections.EmptyAssociativeArray(); - data.SetBool(P("allowNegativeDosh"), allowNegativeDosh, true); + local HashTable data; + data = __().collections.EmptyHashTable(); + data.SetBool(P("allowNegativeDosh"), allowNegativeDosh); return data; } -protected function FromData(AssociativeArray source) +protected function FromData(HashTable source) { if (source != none) { allowNegativeDosh = source.GetBool(P("allowNegativeDosh")); diff --git a/sources/FixDoshSpam/FixDoshSpam.uc b/sources/FixDoshSpam/FixDoshSpam.uc index 9a55cc8..484f41b 100644 --- a/sources/FixDoshSpam/FixDoshSpam.uc +++ b/sources/FixDoshSpam/FixDoshSpam.uc @@ -1,6 +1,6 @@ /** * Config object for `FixDoshSpam_Feature`. - * Copyright 2021 Anton Tarasenko + * Copyright 2021-2022 Anton Tarasenko *------------------------------------------------------------------------------ * This file is part of Acedia. * @@ -26,18 +26,18 @@ var public /*config*/ float doshPerSecondLimitMin; var public /*config*/ int criticalDoshAmount; var public /*config*/ float checkInterval; -protected function AssociativeArray ToData() +protected function HashTable ToData() { - local AssociativeArray data; - data = __().collections.EmptyAssociativeArray(); - data.SetFloat(P("doshPerSecondLimitMax"), doshPerSecondLimitMax, true); - data.SetFloat(P("doshPerSecondLimitMin"), doshPerSecondLimitMin, true); - data.SetInt(P("criticalDoshAmount"), criticalDoshAmount, true); - data.SetFloat(P("checkInterval"), checkInterval, true); + local HashTable data; + data = __().collections.EmptyHashTable(); + data.SetFloat(P("doshPerSecondLimitMax"), doshPerSecondLimitMax); + data.SetFloat(P("doshPerSecondLimitMin"), doshPerSecondLimitMin); + data.SetInt(P("criticalDoshAmount"), criticalDoshAmount); + data.SetFloat(P("checkInterval"), checkInterval); return data; } -protected function FromData(AssociativeArray source) +protected function FromData(HashTable source) { if (source != none) { diff --git a/sources/FixDualiesCost/FixDualiesCost.uc b/sources/FixDualiesCost/FixDualiesCost.uc index 1c913cd..c26bb70 100644 --- a/sources/FixDualiesCost/FixDualiesCost.uc +++ b/sources/FixDualiesCost/FixDualiesCost.uc @@ -23,15 +23,15 @@ class FixDualiesCost extends FeatureConfig var public config bool allowSellValueIncrease; -protected function AssociativeArray ToData() +protected function HashTable ToData() { - local AssociativeArray data; - data = __().collections.EmptyAssociativeArray(); - data.SetBool(P("allowSellValueIncrease"), allowSellValueIncrease, true); + local HashTable data; + data = __().collections.EmptyHashTable(); + data.SetBool(P("allowSellValueIncrease"), allowSellValueIncrease); return data; } -protected function FromData(AssociativeArray source) +protected function FromData(HashTable source) { if (source != none) { diff --git a/sources/FixFFHack/FixFFHack.uc b/sources/FixFFHack/FixFFHack.uc index 97964b2..6a728ec 100644 --- a/sources/FixFFHack/FixFFHack.uc +++ b/sources/FixFFHack/FixFFHack.uc @@ -1,6 +1,6 @@ /** * Config object for `FixFFHack_Feature`. - * Copyright 2021 Anton Tarasenko + * Copyright 2021-2022 Anton Tarasenko *------------------------------------------------------------------------------ * This file is part of Acedia. * @@ -25,52 +25,56 @@ var public config bool scaleByDefault; var public config array< class > alwaysScale; var public config array< class > neverScale; -protected function AssociativeArray ToData() +protected function HashTable ToData() { - local int i; - local DynamicArray damageTypeArray; - local AssociativeArray data; - data = _.collections.EmptyAssociativeArray(); - data.SetBool(P("scaleByDefault"), scaleByDefault, true); - damageTypeArray = _.collections.EmptyDynamicArray(); + local int i; + local HashTable data; + local ArrayList damageTypeArray; + data = _.collections.EmptyHashTable(); + data.SetBool(P("scaleByDefault"), scaleByDefault); + damageTypeArray = _.collections.EmptyArrayList(); for (i = 0; i < alwaysScale.length; i += 1) { - damageTypeArray.AddItem(_.text.FromString(string(alwaysScale[i]))); + damageTypeArray.AddString(string(alwaysScale[i])); } data.SetItem(P("alwaysScale"), damageTypeArray); - damageTypeArray = _.collections.EmptyDynamicArray(); + _.memory.Free(damageTypeArray); + damageTypeArray = _.collections.EmptyArrayList(); for (i = 0; i < neverScale.length; i += 1) { - damageTypeArray.AddItem(_.text.FromString(string(neverScale[i]))); + damageTypeArray.AddString(string(neverScale[i])); } data.SetItem(P("neverScale"), damageTypeArray); + _.memory.Free(damageTypeArray); return data; } -protected function FromData(AssociativeArray source) +protected function FromData(HashTable source) { - local int i; - local DynamicArray damageTypeArray; + local int i; + local ArrayList damageTypeArray; if (source == none) { return; } scaleByDefault = source.GetBool(P("scaleByDefault")); alwaysScale.length = 0; - damageTypeArray = source.GetDynamicArray(P("alwaysScale")); + damageTypeArray = source.GetArrayList(P("alwaysScale")); if (damageTypeArray != none) { for (i = 0; i < damageTypeArray.GetLength(); i += 1) { alwaysScale[i] = class( - _.memory.LoadClass(damageTypeArray.GetText(i))); + _.memory.LoadClassS(damageTypeArray.GetString(i))); } } + _.memory.Free(damageTypeArray); neverScale.length = 0; - damageTypeArray = source.GetDynamicArray(P("neverScale")); + damageTypeArray = source.GetArrayList(P("neverScale")); if (damageTypeArray != none) { for (i = 0; i < damageTypeArray.GetLength(); i += 1) { neverScale[i] = class( - _.memory.LoadClass(damageTypeArray.GetText(i))); + _.memory.LoadClassS(damageTypeArray.GetString(i))); } } + _.memory.Free(damageTypeArray); } protected function DefaultIt() diff --git a/sources/FixInfiniteNades/FixInfiniteNades.uc b/sources/FixInfiniteNades/FixInfiniteNades.uc index c01602e..9b1c057 100644 --- a/sources/FixInfiniteNades/FixInfiniteNades.uc +++ b/sources/FixInfiniteNades/FixInfiniteNades.uc @@ -1,6 +1,6 @@ /** * Config object for `FixInfiniteNades_Feature`. - * Copyright 2021 Anton Tarasenko + * Copyright 2021-2022 Anton Tarasenko *------------------------------------------------------------------------------ * This file is part of Acedia. * @@ -23,15 +23,15 @@ class FixInfiniteNades extends FeatureConfig var public config bool ignoreTossFlags; -protected function AssociativeArray ToData() +protected function HashTable ToData() { - local AssociativeArray data; - data = __().collections.EmptyAssociativeArray(); - data.SetBool(P("ignoreTossFlags"), ignoreTossFlags, true); + local HashTable data; + data = __().collections.EmptyHashTable(); + data.SetBool(P("ignoreTossFlags"), ignoreTossFlags); return data; } -protected function FromData(AssociativeArray source) +protected function FromData(HashTable source) { if (source != none) { ignoreTossFlags = source.GetBool(P("ignoreTossFlags"), true); diff --git a/sources/FixInventoryAbuse/FixInventoryAbuse.uc b/sources/FixInventoryAbuse/FixInventoryAbuse.uc index f8c7ac9..cfce6ee 100644 --- a/sources/FixInventoryAbuse/FixInventoryAbuse.uc +++ b/sources/FixInventoryAbuse/FixInventoryAbuse.uc @@ -1,6 +1,6 @@ /** * Config object for `FixInventoryAbuse_Feature`. - * Copyright 2021 Anton Tarasenko + * Copyright 2021-2022 Anton Tarasenko *------------------------------------------------------------------------------ * This file is part of Acedia. * @@ -25,17 +25,17 @@ class FixInventoryAbuse extends FeatureConfig var public config float checkInterval; var public config array dualiesClasses; -protected function AssociativeArray ToData() +protected function HashTable ToData() { - local int i; - local DynamicArray pairsArray; - local AssociativeArray data, pair; - data = _.collections.EmptyAssociativeArray(); - data.SetFloat(P("checkInterval"), checkInterval, true); - pairsArray = _.collections.EmptyDynamicArray(); + local int i; + local ArrayList pairsArray; + local HashTable data, pair; + data = _.collections.EmptyHashTable(); + data.SetFloat(P("checkInterval"), checkInterval); + pairsArray = _.collections.EmptyArrayList(); for (i = 0; i < dualiesClasses.length; i += 1) { - pair = _.collections.EmptyAssociativeArray(); + pair = _.collections.EmptyHashTable(); pair.SetItem( P("single"), _.text.FromString(string(dualiesClasses[i].single))); pair.SetItem( P("dual"), @@ -43,27 +43,28 @@ protected function AssociativeArray ToData() pairsArray.AddItem(pair); } data.SetItem(P("dualiesClasses"), pairsArray); + _.memory.Free(pairsArray); return data; } -protected function FromData(AssociativeArray source) +protected function FromData(HashTable source) { local int i; - local DynamicArray pairsArray; - local AssociativeArray loadedPair; + local ArrayList pairsArray; + local HashTable loadedPair; local FixInventoryAbuse_Feature.DualiesPair newPair; if (source == none) { return; } checkInterval = source.GetFloat(P("checkInterval"), 0.25); - pairsArray = source.GetDynamicArray(P("dualiesClasses")); + pairsArray = source.GetArrayList(P("dualiesClasses")); dualiesClasses.length = 0; if (pairsArray == none) { return; } for (i = 0; i < pairsArray.GetLength(); i += 1) { - loadedPair = pairsArray.GetAssociativeArray(i); + loadedPair = pairsArray.GetHashTable(i); if (loadedPair == none) continue; newPair.single = class( @@ -72,6 +73,7 @@ protected function FromData(AssociativeArray source) _.memory.LoadClass(loadedPair.GetText(P("dual"))) ); dualiesClasses[dualiesClasses.length] = newPair; } + _.memory.Free(pairsArray); } protected function DefaultIt() diff --git a/sources/FixLogSpam/FixLogSpam.uc b/sources/FixLogSpam/FixLogSpam.uc index e21e956..951ecd1 100644 --- a/sources/FixLogSpam/FixLogSpam.uc +++ b/sources/FixLogSpam/FixLogSpam.uc @@ -1,6 +1,6 @@ /** * Config object for `FixLogSpam_Feature`. - * Copyright 2021 Anton Tarasenko + * Copyright 2021-2022 Anton Tarasenko *------------------------------------------------------------------------------ * This file is part of Acedia. * @@ -24,16 +24,16 @@ class FixLogSpam extends FeatureConfig var public config bool fixPickupSpam; var public config bool fixTraderSpam; -protected function AssociativeArray ToData() +protected function HashTable ToData() { - local AssociativeArray data; - data = __().collections.EmptyAssociativeArray(); - data.SetBool(P("fixPickupSpam"), fixPickupSpam, true); - data.SetBool(P("fixTraderSpam"), fixTraderSpam, true); + local HashTable data; + data = __().collections.EmptyHashTable(); + data.SetBool(P("fixPickupSpam"), fixPickupSpam); + data.SetBool(P("fixTraderSpam"), fixTraderSpam); return data; } -protected function FromData(AssociativeArray source) +protected function FromData(HashTable source) { if (source != none) { diff --git a/sources/FixPipes/FixPipes.uc b/sources/FixPipes/FixPipes.uc index 8dc7bb8..1fd4134 100644 --- a/sources/FixPipes/FixPipes.uc +++ b/sources/FixPipes/FixPipes.uc @@ -1,6 +1,6 @@ /** * Config object for `FixPipes_Feature`. - * Copyright 2021 Anton Tarasenko + * Copyright 2021-2022 Anton Tarasenko *------------------------------------------------------------------------------ * This file is part of Acedia. * @@ -27,19 +27,19 @@ var public config bool preventCorpseDetonation; var public config bool preventNPCDetonation; var public config float proximityCheckElevation; -protected function AssociativeArray ToData() +protected function HashTable ToData() { - local AssociativeArray data; - data = __().collections.EmptyAssociativeArray(); - data.SetBool(P("preventMassiveDamage"), preventMassiveDamage, true); - data.SetBool(P("preventSuspiciousDamage"), preventSuspiciousDamage, true); - data.SetBool(P("preventCorpseDetonation"), preventCorpseDetonation, true); - data.SetBool(P("preventNPCDetonation"), preventNPCDetonation, true); - data.SetFloat(P("proximityCheckElevation"), proximityCheckElevation, true); + local HashTable data; + data = __().collections.EmptyHashTable(); + data.SetBool(P("preventMassiveDamage"), preventMassiveDamage); + data.SetBool(P("preventSuspiciousDamage"), preventSuspiciousDamage); + data.SetBool(P("preventCorpseDetonation"), preventCorpseDetonation); + data.SetBool(P("preventNPCDetonation"), preventNPCDetonation); + data.SetFloat(P("proximityCheckElevation"), proximityCheckElevation); return data; } -protected function FromData(AssociativeArray source) +protected function FromData(HashTable source) { if (source == none) { return; diff --git a/sources/FixProjectileFF/FixProjectileFF.uc b/sources/FixProjectileFF/FixProjectileFF.uc index b66f78e..de5dc3c 100644 --- a/sources/FixProjectileFF/FixProjectileFF.uc +++ b/sources/FixProjectileFF/FixProjectileFF.uc @@ -1,6 +1,6 @@ /** * Config object for `FixProjectileFF_Feature`. - * Copyright 2021 Anton Tarasenko + * Copyright 2021-2022 Anton Tarasenko *------------------------------------------------------------------------------ * This file is part of Acedia. * @@ -23,15 +23,15 @@ class FixProjectileFF extends FeatureConfig var public config bool ignoreFriendlyFire; -protected function AssociativeArray ToData() +protected function HashTable ToData() { - local AssociativeArray data; - data = __().collections.EmptyAssociativeArray(); - data.SetBool(P("ignoreFriendlyFire"), ignoreFriendlyFire, true); + local HashTable data; + data = __().collections.EmptyHashTable(); + data.SetBool(P("ignoreFriendlyFire"), ignoreFriendlyFire); return data; } -protected function FromData(AssociativeArray source) +protected function FromData(HashTable source) { if (source != none) { ignoreFriendlyFire = source.GetBool(P("ignoreFriendlyFire")); diff --git a/sources/FixSpectatorCrash/FixSpectatorCrash.uc b/sources/FixSpectatorCrash/FixSpectatorCrash.uc index d898530..1f0f647 100644 --- a/sources/FixSpectatorCrash/FixSpectatorCrash.uc +++ b/sources/FixSpectatorCrash/FixSpectatorCrash.uc @@ -1,6 +1,6 @@ /** * Config object for `FixSpectatorCrash_Feature`. - * Copyright 2021 Anton Tarasenko + * Copyright 2021-2022 Anton Tarasenko *------------------------------------------------------------------------------ * This file is part of Acedia. * @@ -24,16 +24,16 @@ class FixSpectatorCrash extends FeatureConfig var public config float spectatorChangeTimeout; var public config bool allowServerBlock; -protected function AssociativeArray ToData() +protected function HashTable ToData() { - local AssociativeArray data; - data = __().collections.EmptyAssociativeArray(); - data.SetBool(P("allowServerBlock"), allowServerBlock, true); - data.SetFloat(P("spectatorChangeTimeout"), spectatorChangeTimeout, true); + local HashTable data; + data = __().collections.EmptyHashTable(); + data.SetBool(P("allowServerBlock"), allowServerBlock); + data.SetFloat(P("spectatorChangeTimeout"), spectatorChangeTimeout); return data; } -protected function FromData(AssociativeArray source) +protected function FromData(HashTable source) { if (source == none) { return; diff --git a/sources/FixZedTimeLags/FixZedTimeLags.uc b/sources/FixZedTimeLags/FixZedTimeLags.uc index 89a8e81..72bf6a2 100644 --- a/sources/FixZedTimeLags/FixZedTimeLags.uc +++ b/sources/FixZedTimeLags/FixZedTimeLags.uc @@ -1,6 +1,6 @@ /** * Config object for `FixZedTimeLags_Feature`. - * Copyright 2021 Anton Tarasenko + * Copyright 2021-2022 Anton Tarasenko *------------------------------------------------------------------------------ * This file is part of Acedia. * @@ -24,17 +24,16 @@ class FixZedTimeLags extends FeatureConfig var public config int maxGameSpeedUpdatesAmount; var public config bool disableTick; -protected function AssociativeArray ToData() +protected function HashTable ToData() { - local AssociativeArray data; - data = __().collections.EmptyAssociativeArray(); - data.SetBool(P("disableTick"), disableTick, true); - data.SetInt(P("maxGameSpeedUpdatesAmount"), - maxGameSpeedUpdatesAmount, true); + local HashTable data; + data = __().collections.EmptyHashTable(); + data.SetBool(P("disableTick"), disableTick); + data.SetInt(P("maxGameSpeedUpdatesAmount"), maxGameSpeedUpdatesAmount); return data; } -protected function FromData(AssociativeArray source) +protected function FromData(HashTable source) { if (source == none) { return;