Browse Source

Change configs to adapt to AcediaCore's changes

master
Anton Tarasenko 2 years ago
parent
commit
89dd02820f
  1. 12
      sources/FixAmmoSelling/FixAmmoSelling.uc
  2. 18
      sources/FixDoshSpam/FixDoshSpam.uc
  3. 10
      sources/FixDualiesCost/FixDualiesCost.uc
  4. 36
      sources/FixFFHack/FixFFHack.uc
  5. 12
      sources/FixInfiniteNades/FixInfiniteNades.uc
  6. 28
      sources/FixInventoryAbuse/FixInventoryAbuse.uc
  7. 14
      sources/FixLogSpam/FixLogSpam.uc
  8. 20
      sources/FixPipes/FixPipes.uc
  9. 12
      sources/FixProjectileFF/FixProjectileFF.uc
  10. 14
      sources/FixSpectatorCrash/FixSpectatorCrash.uc
  11. 15
      sources/FixZedTimeLags/FixZedTimeLags.uc

12
sources/FixAmmoSelling/FixAmmoSelling.uc

@ -1,6 +1,6 @@
/** /**
* Config object for `FixAmmoSelling_Feature`. * Config object for `FixAmmoSelling_Feature`.
* Copyright 2021 Anton Tarasenko * Copyright 2021-2022 Anton Tarasenko
*------------------------------------------------------------------------------ *------------------------------------------------------------------------------
* This file is part of Acedia. * This file is part of Acedia.
* *
@ -23,15 +23,15 @@ class FixAmmoSelling extends FeatureConfig
var public config bool allowNegativeDosh; var public config bool allowNegativeDosh;
protected function AssociativeArray ToData() protected function HashTable ToData()
{ {
local AssociativeArray data; local HashTable data;
data = __().collections.EmptyAssociativeArray(); data = __().collections.EmptyHashTable();
data.SetBool(P("allowNegativeDosh"), allowNegativeDosh, true); data.SetBool(P("allowNegativeDosh"), allowNegativeDosh);
return data; return data;
} }
protected function FromData(AssociativeArray source) protected function FromData(HashTable source)
{ {
if (source != none) { if (source != none) {
allowNegativeDosh = source.GetBool(P("allowNegativeDosh")); allowNegativeDosh = source.GetBool(P("allowNegativeDosh"));

18
sources/FixDoshSpam/FixDoshSpam.uc

@ -1,6 +1,6 @@
/** /**
* Config object for `FixDoshSpam_Feature`. * Config object for `FixDoshSpam_Feature`.
* Copyright 2021 Anton Tarasenko * Copyright 2021-2022 Anton Tarasenko
*------------------------------------------------------------------------------ *------------------------------------------------------------------------------
* This file is part of Acedia. * This file is part of Acedia.
* *
@ -26,18 +26,18 @@ var public /*config*/ float doshPerSecondLimitMin;
var public /*config*/ int criticalDoshAmount; var public /*config*/ int criticalDoshAmount;
var public /*config*/ float checkInterval; var public /*config*/ float checkInterval;
protected function AssociativeArray ToData() protected function HashTable ToData()
{ {
local AssociativeArray data; local HashTable data;
data = __().collections.EmptyAssociativeArray(); data = __().collections.EmptyHashTable();
data.SetFloat(P("doshPerSecondLimitMax"), doshPerSecondLimitMax, true); data.SetFloat(P("doshPerSecondLimitMax"), doshPerSecondLimitMax);
data.SetFloat(P("doshPerSecondLimitMin"), doshPerSecondLimitMin, true); data.SetFloat(P("doshPerSecondLimitMin"), doshPerSecondLimitMin);
data.SetInt(P("criticalDoshAmount"), criticalDoshAmount, true); data.SetInt(P("criticalDoshAmount"), criticalDoshAmount);
data.SetFloat(P("checkInterval"), checkInterval, true); data.SetFloat(P("checkInterval"), checkInterval);
return data; return data;
} }
protected function FromData(AssociativeArray source) protected function FromData(HashTable source)
{ {
if (source != none) if (source != none)
{ {

10
sources/FixDualiesCost/FixDualiesCost.uc

@ -23,15 +23,15 @@ class FixDualiesCost extends FeatureConfig
var public config bool allowSellValueIncrease; var public config bool allowSellValueIncrease;
protected function AssociativeArray ToData() protected function HashTable ToData()
{ {
local AssociativeArray data; local HashTable data;
data = __().collections.EmptyAssociativeArray(); data = __().collections.EmptyHashTable();
data.SetBool(P("allowSellValueIncrease"), allowSellValueIncrease, true); data.SetBool(P("allowSellValueIncrease"), allowSellValueIncrease);
return data; return data;
} }
protected function FromData(AssociativeArray source) protected function FromData(HashTable source)
{ {
if (source != none) if (source != none)
{ {

36
sources/FixFFHack/FixFFHack.uc

@ -1,6 +1,6 @@
/** /**
* Config object for `FixFFHack_Feature`. * Config object for `FixFFHack_Feature`.
* Copyright 2021 Anton Tarasenko * Copyright 2021-2022 Anton Tarasenko
*------------------------------------------------------------------------------ *------------------------------------------------------------------------------
* This file is part of Acedia. * This file is part of Acedia.
* *
@ -25,52 +25,56 @@ var public config bool scaleByDefault;
var public config array< class<DamageType> > alwaysScale; var public config array< class<DamageType> > alwaysScale;
var public config array< class<DamageType> > neverScale; var public config array< class<DamageType> > neverScale;
protected function AssociativeArray ToData() protected function HashTable ToData()
{ {
local int i; local int i;
local DynamicArray damageTypeArray; local HashTable data;
local AssociativeArray data; local ArrayList damageTypeArray;
data = _.collections.EmptyAssociativeArray(); data = _.collections.EmptyHashTable();
data.SetBool(P("scaleByDefault"), scaleByDefault, true); data.SetBool(P("scaleByDefault"), scaleByDefault);
damageTypeArray = _.collections.EmptyDynamicArray(); damageTypeArray = _.collections.EmptyArrayList();
for (i = 0; i < alwaysScale.length; i += 1) { 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); data.SetItem(P("alwaysScale"), damageTypeArray);
damageTypeArray = _.collections.EmptyDynamicArray(); _.memory.Free(damageTypeArray);
damageTypeArray = _.collections.EmptyArrayList();
for (i = 0; i < neverScale.length; i += 1) { 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); data.SetItem(P("neverScale"), damageTypeArray);
_.memory.Free(damageTypeArray);
return data; return data;
} }
protected function FromData(AssociativeArray source) protected function FromData(HashTable source)
{ {
local int i; local int i;
local DynamicArray damageTypeArray; local ArrayList damageTypeArray;
if (source == none) { if (source == none) {
return; return;
} }
scaleByDefault = source.GetBool(P("scaleByDefault")); scaleByDefault = source.GetBool(P("scaleByDefault"));
alwaysScale.length = 0; alwaysScale.length = 0;
damageTypeArray = source.GetDynamicArray(P("alwaysScale")); damageTypeArray = source.GetArrayList(P("alwaysScale"));
if (damageTypeArray != none) { if (damageTypeArray != none) {
for (i = 0; i < damageTypeArray.GetLength(); i += 1) for (i = 0; i < damageTypeArray.GetLength(); i += 1)
{ {
alwaysScale[i] = class<DamageType>( alwaysScale[i] = class<DamageType>(
_.memory.LoadClass(damageTypeArray.GetText(i))); _.memory.LoadClassS(damageTypeArray.GetString(i)));
} }
} }
_.memory.Free(damageTypeArray);
neverScale.length = 0; neverScale.length = 0;
damageTypeArray = source.GetDynamicArray(P("neverScale")); damageTypeArray = source.GetArrayList(P("neverScale"));
if (damageTypeArray != none) { if (damageTypeArray != none) {
for (i = 0; i < damageTypeArray.GetLength(); i += 1) for (i = 0; i < damageTypeArray.GetLength(); i += 1)
{ {
neverScale[i] = class<DamageType>( neverScale[i] = class<DamageType>(
_.memory.LoadClass(damageTypeArray.GetText(i))); _.memory.LoadClassS(damageTypeArray.GetString(i)));
} }
} }
_.memory.Free(damageTypeArray);
} }
protected function DefaultIt() protected function DefaultIt()

12
sources/FixInfiniteNades/FixInfiniteNades.uc

@ -1,6 +1,6 @@
/** /**
* Config object for `FixInfiniteNades_Feature`. * Config object for `FixInfiniteNades_Feature`.
* Copyright 2021 Anton Tarasenko * Copyright 2021-2022 Anton Tarasenko
*------------------------------------------------------------------------------ *------------------------------------------------------------------------------
* This file is part of Acedia. * This file is part of Acedia.
* *
@ -23,15 +23,15 @@ class FixInfiniteNades extends FeatureConfig
var public config bool ignoreTossFlags; var public config bool ignoreTossFlags;
protected function AssociativeArray ToData() protected function HashTable ToData()
{ {
local AssociativeArray data; local HashTable data;
data = __().collections.EmptyAssociativeArray(); data = __().collections.EmptyHashTable();
data.SetBool(P("ignoreTossFlags"), ignoreTossFlags, true); data.SetBool(P("ignoreTossFlags"), ignoreTossFlags);
return data; return data;
} }
protected function FromData(AssociativeArray source) protected function FromData(HashTable source)
{ {
if (source != none) { if (source != none) {
ignoreTossFlags = source.GetBool(P("ignoreTossFlags"), true); ignoreTossFlags = source.GetBool(P("ignoreTossFlags"), true);

28
sources/FixInventoryAbuse/FixInventoryAbuse.uc

@ -1,6 +1,6 @@
/** /**
* Config object for `FixInventoryAbuse_Feature`. * Config object for `FixInventoryAbuse_Feature`.
* Copyright 2021 Anton Tarasenko * Copyright 2021-2022 Anton Tarasenko
*------------------------------------------------------------------------------ *------------------------------------------------------------------------------
* This file is part of Acedia. * This file is part of Acedia.
* *
@ -25,17 +25,17 @@ class FixInventoryAbuse extends FeatureConfig
var public config float checkInterval; var public config float checkInterval;
var public config array<FixInventoryAbuse_Feature.DualiesPair> dualiesClasses; var public config array<FixInventoryAbuse_Feature.DualiesPair> dualiesClasses;
protected function AssociativeArray ToData() protected function HashTable ToData()
{ {
local int i; local int i;
local DynamicArray pairsArray; local ArrayList pairsArray;
local AssociativeArray data, pair; local HashTable data, pair;
data = _.collections.EmptyAssociativeArray(); data = _.collections.EmptyHashTable();
data.SetFloat(P("checkInterval"), checkInterval, true); data.SetFloat(P("checkInterval"), checkInterval);
pairsArray = _.collections.EmptyDynamicArray(); pairsArray = _.collections.EmptyArrayList();
for (i = 0; i < dualiesClasses.length; i += 1) for (i = 0; i < dualiesClasses.length; i += 1)
{ {
pair = _.collections.EmptyAssociativeArray(); pair = _.collections.EmptyHashTable();
pair.SetItem( P("single"), pair.SetItem( P("single"),
_.text.FromString(string(dualiesClasses[i].single))); _.text.FromString(string(dualiesClasses[i].single)));
pair.SetItem( P("dual"), pair.SetItem( P("dual"),
@ -43,27 +43,28 @@ protected function AssociativeArray ToData()
pairsArray.AddItem(pair); pairsArray.AddItem(pair);
} }
data.SetItem(P("dualiesClasses"), pairsArray); data.SetItem(P("dualiesClasses"), pairsArray);
_.memory.Free(pairsArray);
return data; return data;
} }
protected function FromData(AssociativeArray source) protected function FromData(HashTable source)
{ {
local int i; local int i;
local DynamicArray pairsArray; local ArrayList pairsArray;
local AssociativeArray loadedPair; local HashTable loadedPair;
local FixInventoryAbuse_Feature.DualiesPair newPair; local FixInventoryAbuse_Feature.DualiesPair newPair;
if (source == none) { if (source == none) {
return; return;
} }
checkInterval = source.GetFloat(P("checkInterval"), 0.25); checkInterval = source.GetFloat(P("checkInterval"), 0.25);
pairsArray = source.GetDynamicArray(P("dualiesClasses")); pairsArray = source.GetArrayList(P("dualiesClasses"));
dualiesClasses.length = 0; dualiesClasses.length = 0;
if (pairsArray == none) { if (pairsArray == none) {
return; return;
} }
for (i = 0; i < pairsArray.GetLength(); i += 1) for (i = 0; i < pairsArray.GetLength(); i += 1)
{ {
loadedPair = pairsArray.GetAssociativeArray(i); loadedPair = pairsArray.GetHashTable(i);
if (loadedPair == none) continue; if (loadedPair == none) continue;
newPair.single = class<KFWeaponPickup>( newPair.single = class<KFWeaponPickup>(
@ -72,6 +73,7 @@ protected function FromData(AssociativeArray source)
_.memory.LoadClass(loadedPair.GetText(P("dual"))) ); _.memory.LoadClass(loadedPair.GetText(P("dual"))) );
dualiesClasses[dualiesClasses.length] = newPair; dualiesClasses[dualiesClasses.length] = newPair;
} }
_.memory.Free(pairsArray);
} }
protected function DefaultIt() protected function DefaultIt()

14
sources/FixLogSpam/FixLogSpam.uc

@ -1,6 +1,6 @@
/** /**
* Config object for `FixLogSpam_Feature`. * Config object for `FixLogSpam_Feature`.
* Copyright 2021 Anton Tarasenko * Copyright 2021-2022 Anton Tarasenko
*------------------------------------------------------------------------------ *------------------------------------------------------------------------------
* This file is part of Acedia. * This file is part of Acedia.
* *
@ -24,16 +24,16 @@ class FixLogSpam extends FeatureConfig
var public config bool fixPickupSpam; var public config bool fixPickupSpam;
var public config bool fixTraderSpam; var public config bool fixTraderSpam;
protected function AssociativeArray ToData() protected function HashTable ToData()
{ {
local AssociativeArray data; local HashTable data;
data = __().collections.EmptyAssociativeArray(); data = __().collections.EmptyHashTable();
data.SetBool(P("fixPickupSpam"), fixPickupSpam, true); data.SetBool(P("fixPickupSpam"), fixPickupSpam);
data.SetBool(P("fixTraderSpam"), fixTraderSpam, true); data.SetBool(P("fixTraderSpam"), fixTraderSpam);
return data; return data;
} }
protected function FromData(AssociativeArray source) protected function FromData(HashTable source)
{ {
if (source != none) if (source != none)
{ {

20
sources/FixPipes/FixPipes.uc

@ -1,6 +1,6 @@
/** /**
* Config object for `FixPipes_Feature`. * Config object for `FixPipes_Feature`.
* Copyright 2021 Anton Tarasenko * Copyright 2021-2022 Anton Tarasenko
*------------------------------------------------------------------------------ *------------------------------------------------------------------------------
* This file is part of Acedia. * This file is part of Acedia.
* *
@ -27,19 +27,19 @@ var public config bool preventCorpseDetonation;
var public config bool preventNPCDetonation; var public config bool preventNPCDetonation;
var public config float proximityCheckElevation; var public config float proximityCheckElevation;
protected function AssociativeArray ToData() protected function HashTable ToData()
{ {
local AssociativeArray data; local HashTable data;
data = __().collections.EmptyAssociativeArray(); data = __().collections.EmptyHashTable();
data.SetBool(P("preventMassiveDamage"), preventMassiveDamage, true); data.SetBool(P("preventMassiveDamage"), preventMassiveDamage);
data.SetBool(P("preventSuspiciousDamage"), preventSuspiciousDamage, true); data.SetBool(P("preventSuspiciousDamage"), preventSuspiciousDamage);
data.SetBool(P("preventCorpseDetonation"), preventCorpseDetonation, true); data.SetBool(P("preventCorpseDetonation"), preventCorpseDetonation);
data.SetBool(P("preventNPCDetonation"), preventNPCDetonation, true); data.SetBool(P("preventNPCDetonation"), preventNPCDetonation);
data.SetFloat(P("proximityCheckElevation"), proximityCheckElevation, true); data.SetFloat(P("proximityCheckElevation"), proximityCheckElevation);
return data; return data;
} }
protected function FromData(AssociativeArray source) protected function FromData(HashTable source)
{ {
if (source == none) { if (source == none) {
return; return;

12
sources/FixProjectileFF/FixProjectileFF.uc

@ -1,6 +1,6 @@
/** /**
* Config object for `FixProjectileFF_Feature`. * Config object for `FixProjectileFF_Feature`.
* Copyright 2021 Anton Tarasenko * Copyright 2021-2022 Anton Tarasenko
*------------------------------------------------------------------------------ *------------------------------------------------------------------------------
* This file is part of Acedia. * This file is part of Acedia.
* *
@ -23,15 +23,15 @@ class FixProjectileFF extends FeatureConfig
var public config bool ignoreFriendlyFire; var public config bool ignoreFriendlyFire;
protected function AssociativeArray ToData() protected function HashTable ToData()
{ {
local AssociativeArray data; local HashTable data;
data = __().collections.EmptyAssociativeArray(); data = __().collections.EmptyHashTable();
data.SetBool(P("ignoreFriendlyFire"), ignoreFriendlyFire, true); data.SetBool(P("ignoreFriendlyFire"), ignoreFriendlyFire);
return data; return data;
} }
protected function FromData(AssociativeArray source) protected function FromData(HashTable source)
{ {
if (source != none) { if (source != none) {
ignoreFriendlyFire = source.GetBool(P("ignoreFriendlyFire")); ignoreFriendlyFire = source.GetBool(P("ignoreFriendlyFire"));

14
sources/FixSpectatorCrash/FixSpectatorCrash.uc

@ -1,6 +1,6 @@
/** /**
* Config object for `FixSpectatorCrash_Feature`. * Config object for `FixSpectatorCrash_Feature`.
* Copyright 2021 Anton Tarasenko * Copyright 2021-2022 Anton Tarasenko
*------------------------------------------------------------------------------ *------------------------------------------------------------------------------
* This file is part of Acedia. * This file is part of Acedia.
* *
@ -24,16 +24,16 @@ class FixSpectatorCrash extends FeatureConfig
var public config float spectatorChangeTimeout; var public config float spectatorChangeTimeout;
var public config bool allowServerBlock; var public config bool allowServerBlock;
protected function AssociativeArray ToData() protected function HashTable ToData()
{ {
local AssociativeArray data; local HashTable data;
data = __().collections.EmptyAssociativeArray(); data = __().collections.EmptyHashTable();
data.SetBool(P("allowServerBlock"), allowServerBlock, true); data.SetBool(P("allowServerBlock"), allowServerBlock);
data.SetFloat(P("spectatorChangeTimeout"), spectatorChangeTimeout, true); data.SetFloat(P("spectatorChangeTimeout"), spectatorChangeTimeout);
return data; return data;
} }
protected function FromData(AssociativeArray source) protected function FromData(HashTable source)
{ {
if (source == none) { if (source == none) {
return; return;

15
sources/FixZedTimeLags/FixZedTimeLags.uc

@ -1,6 +1,6 @@
/** /**
* Config object for `FixZedTimeLags_Feature`. * Config object for `FixZedTimeLags_Feature`.
* Copyright 2021 Anton Tarasenko * Copyright 2021-2022 Anton Tarasenko
*------------------------------------------------------------------------------ *------------------------------------------------------------------------------
* This file is part of Acedia. * This file is part of Acedia.
* *
@ -24,17 +24,16 @@ class FixZedTimeLags extends FeatureConfig
var public config int maxGameSpeedUpdatesAmount; var public config int maxGameSpeedUpdatesAmount;
var public config bool disableTick; var public config bool disableTick;
protected function AssociativeArray ToData() protected function HashTable ToData()
{ {
local AssociativeArray data; local HashTable data;
data = __().collections.EmptyAssociativeArray(); data = __().collections.EmptyHashTable();
data.SetBool(P("disableTick"), disableTick, true); data.SetBool(P("disableTick"), disableTick);
data.SetInt(P("maxGameSpeedUpdatesAmount"), data.SetInt(P("maxGameSpeedUpdatesAmount"), maxGameSpeedUpdatesAmount);
maxGameSpeedUpdatesAmount, true);
return data; return data;
} }
protected function FromData(AssociativeArray source) protected function FromData(HashTable source)
{ {
if (source == none) { if (source == none) {
return; return;

Loading…
Cancel
Save