Compare commits

..

No commits in common. 'e8ae6fd8d16dc51d22ad4f5525c5399a447e9f69' and 'ff31ef24728557cbfecc4f3d109f5e317af80e1d' have entirely different histories.

  1. 4
      sources/BaseAPI/API/Commands/Voting/Voting.uc
  2. 2
      sources/BaseAPI/API/Unflect/UnflectApi.uc
  3. 25
      sources/Data/Database/DBAPI.uc

4
sources/BaseAPI/API/Commands/Voting/Voting.uc

@ -526,6 +526,7 @@ public final function PrintVotingInfoFor(EPlayer requester) {
/// Override this to perform necessary logic after voting has succeeded. /// Override this to perform necessary logic after voting has succeeded.
protected function Execute(HashTable arguments) {} protected function Execute(HashTable arguments) {}
/// Fill `currentAnnouncements` here!!!
/// Override this method to: /// Override this method to:
/// ///
/// 1. Specify any of the messages inside `currentAnnouncements` to fit passed /// 1. Specify any of the messages inside `currentAnnouncements` to fit passed
@ -828,8 +829,7 @@ private final function AnnounceOutcome(BaseText outcomeMessage, optional EPlayer
currentPlayers = _.players.GetAll(); currentPlayers = _.players.GetAll();
for (i = 0; i < currentPlayers.length; i += 1) { for (i = 0; i < currentPlayers.length; i += 1) {
writer = currentPlayers[i].BorrowConsole(); writer = currentPlayers[i].BorrowConsole();
writer.Write(editedOutcomeMessage); writer.WriteLine(editedOutcomeMessage);
writer.Write(P(" / "));
writer.WriteLine(summaryLine); writer.WriteLine(summaryLine);
currentPlayers[i].Notify(editedOutcomeMessage, summaryLine,, P("voting")); currentPlayers[i].Notify(editedOutcomeMessage, summaryLine,, P("voting"));
} }

2
sources/BaseAPI/API/Unflect/UnflectApi.uc

@ -67,7 +67,6 @@ public final function _drop() {
// Drop is called when Acedia is shutting down, so releasing references isn't necessary // Drop is called when Acedia is shutting down, so releasing references isn't necessary
iter = HashTableIterator(completedReplacements.Iterate()); iter = HashTableIterator(completedReplacements.Iterate());
while (!iter.HasFinished()) { while (!iter.HasFinished()) {
nextFunctionInstance = none;
nextFunctionName = Text(iter.GetKey()); nextFunctionName = Text(iter.GetKey());
nextSources = ByteArrayBox(originalScriptCodes.GetItem(nextFunctionName)); nextSources = ByteArrayBox(originalScriptCodes.GetItem(nextFunctionName));
if (nextSources != none ) { if (nextSources != none ) {
@ -76,7 +75,6 @@ public final function _drop() {
if (nextFunctionInstance != none) { if (nextFunctionInstance != none) {
nextFunctionInstance.script = nextSources.Get(); nextFunctionInstance.script = nextSources.Get();
} }
iter.Next();
} }
} }

25
sources/Data/Database/DBAPI.uc

@ -250,49 +250,48 @@ public final function LocalDatabaseInstance LoadLocal(BaseText databaseName)
local DBRecord rootRecord; local DBRecord rootRecord;
local Text rootRecordName; local Text rootRecordName;
local LocalDatabase newConfig; local LocalDatabase newConfig;
local LocalDatabaseInstance newLocalDBInstance, result; local LocalDatabaseInstance newLocalDBInstance;
local Text dbKey; local Text dbKey;
if (databaseName == none) { if (databaseName == none) {
return none; return none;
} }
CreateLocalDBMapIfMissing(); CreateLocalDBMapIfMissing();
dbKey = databaseName.Copy(); if (loadedLocalDatabases.HasKey(databaseName))
if (loadedLocalDatabases.HasKey(dbKey))
{ {
result = LocalDatabaseInstance(loadedLocalDatabases.GetItem(dbKey)); return LocalDatabaseInstance(loadedLocalDatabases
_.memory.Free(dbKey); .GetItem(databaseName));
return result;
} }
// No need to check `dbKey` for being valid, // No need to check `databaseName` for being valid,
// since `Load()` will just return `none` if it is not. // since `Load()` will just return `none` if it is not.
newConfig = class'LocalDatabase'.static.Load(dbKey); newConfig = class'LocalDatabase'.static.Load(databaseName);
if (newConfig == none) { if (newConfig == none) {
_.memory.Free(dbKey);
return none; return none;
} }
if (!newConfig.HasDefinedRoot() && !newConfig.ShouldCreateIfMissing()) { if (!newConfig.HasDefinedRoot() && !newConfig.ShouldCreateIfMissing()) {
_.memory.Free(dbKey);
return none; return none;
} }
newLocalDBInstance = LocalDatabaseInstance(_.memory.Allocate(localDBClass)); newLocalDBInstance = LocalDatabaseInstance(_.memory.Allocate(localDBClass));
dbKey = databaseName.Copy();
loadedLocalDatabases.SetItem(dbKey, newLocalDBInstance); loadedLocalDatabases.SetItem(dbKey, newLocalDBInstance);
dbKey.FreeSelf(); dbKey.FreeSelf();
if (newConfig.HasDefinedRoot()) if (newConfig.HasDefinedRoot())
{ {
rootRecordName = newConfig.GetRootName(); rootRecordName = newConfig.GetRootName();
rootRecord = class'DBRecord'.static.LoadRecord(rootRecordName, dbKey); rootRecord = class'DBRecord'.static
.LoadRecord(rootRecordName, databaseName);
} }
else else
{ {
rootRecord = class'DBRecord'.static.NewRecord(dbKey); rootRecord = class'DBRecord'.static.NewRecord(databaseName);
rootRecordName = _.text.FromString(string(rootRecord.name)); rootRecordName = _.text.FromString(string(rootRecord.name));
newConfig.SetRootName(rootRecordName); newConfig.SetRootName(rootRecordName);
newConfig.Save(); newConfig.Save();
} }
newLocalDBInstance.Initialize(newConfig, rootRecord); newLocalDBInstance.Initialize(newConfig, rootRecord);
_.logger.Auto(infoLocalDatabaseLoaded).Arg(dbKey); _.logger.Auto(infoLocalDatabaseLoaded).Arg(databaseName.Copy());
_.memory.Free(rootRecordName); _.memory.Free(rootRecordName);
_.memory.Free(newLocalDBInstance);
return newLocalDBInstance; return newLocalDBInstance;
} }

Loading…
Cancel
Save