Browse Source

Change to new AcediaCore collections

develop
Anton Tarasenko 2 years ago
parent
commit
83f137c063
  1. 10
      sources/GameModes/GameMode.uc
  2. 7
      sources/VotingHandlerAdapter.uc

10
sources/GameModes/GameMode.uc

@ -167,13 +167,13 @@ public function ReportBadOptions()
} }
/** /**
* @return Server options as key-value pairs in an `AssociativeArray`. * @return Server options as key-value pairs in an `HashTable`.
*/ */
public function AssociativeArray GetOptions() public function HashTable GetOptions()
{ {
local int i; local int i;
local AssociativeArray result; local HashTable result;
result = _.collections.EmptyAssociativeArray(); result = _.collections.EmptyHashTable();
for (i = 0; i < option.length; i += 1) for (i = 0; i < option.length; i += 1)
{ {
if (!ValidateServerURLName(option[i].key)) continue; if (!ValidateServerURLName(option[i].key)) continue;

7
sources/VotingHandlerAdapter.uc

@ -170,19 +170,18 @@ private function string BuildOptionsString(GameMode gameMode)
local string result; local string result;
local string nextKey, nextValue; local string nextKey, nextValue;
local CollectionIterator iter; local CollectionIterator iter;
local AssociativeArray options; local HashTable options;
options = gameMode.GetOptions(); options = gameMode.GetOptions();
for (iter = options.Iterate(); !iter.HasFinished(); iter.Next()) for (iter = options.Iterate(); !iter.HasFinished(); iter.Next())
{ {
nextKey = Text(iter.GetKey()).ToString(); nextKey = _.text.ToString(Text(iter.GetKey()));
nextValue = Text(iter.Get()).ToString(); nextValue = _.text.ToString(Text(iter.Get()));
if (optionWasAdded) { if (optionWasAdded) {
result $= "?"; result $= "?";
} }
result $= (nextKey $ "=" $ nextValue); result $= (nextKey $ "=" $ nextValue);
optionWasAdded = true; optionWasAdded = true;
} }
options.Empty(true);
options.FreeSelf(); options.FreeSelf();
iter.FreeSelf(); iter.FreeSelf();
return result; return result;

Loading…
Cancel
Save