|
|
|
@ -7,7 +7,7 @@
|
|
|
|
|
* Auxiliary data object that can store either a JSON array or an object in |
|
|
|
|
* the local Acedia database. It is supposed to be saved and loaded |
|
|
|
|
* to / from packages. |
|
|
|
|
* Copyright 2021-2022 Anton Tarasenko |
|
|
|
|
* Copyright 2021-2023 Anton Tarasenko |
|
|
|
|
*------------------------------------------------------------------------------ |
|
|
|
|
* This file is part of Acedia. |
|
|
|
|
* |
|
|
|
@ -184,6 +184,7 @@ private final function DBRecordPointer MakeRecordPointer(
|
|
|
|
|
return pointer; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Converts `JSONPointer` into our internal representation. |
|
|
|
|
private final function DBRecordPointer ConvertPointer(JSONPointer jsonPointer) |
|
|
|
|
{ |
|
|
|
|
if (jsonPointer == none) { |
|
|
|
@ -192,6 +193,8 @@ private final function DBRecordPointer ConvertPointer(JSONPointer jsonPointer)
|
|
|
|
|
return ConvertPointerPath(jsonPointer, 0, jsonPointer.GetLength()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Produced out internal pointer representation `DBRecordPointer` to |
|
|
|
|
// the container that stores object, referred to by a given `JSONPointer`. |
|
|
|
|
private final function DBRecordPointer ConvertContainerPointer( |
|
|
|
|
JSONPointer jsonPointer) |
|
|
|
|
{ |
|
|
|
@ -264,9 +267,9 @@ public static final function Global __()
|
|
|
|
|
return class'Global'.static.GetInstance(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public static final function ServerGlobal __server() |
|
|
|
|
public static final function CoreGlobal __core() |
|
|
|
|
{ |
|
|
|
|
return class'ServerGlobal'.static.GetInstance(); |
|
|
|
|
return class'CoreGlobal'.static.GetGenericInstance(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
@ -304,7 +307,7 @@ private final static function DBRecord NewRecordFor(string dbPackageName)
|
|
|
|
|
if (recordCandidate != none) { |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
recordCandidate = __server().unreal.GetGameType() |
|
|
|
|
recordCandidate = __core().unreal_api().GetGameType() |
|
|
|
|
.CreateDataObject(class'DBRecord', nextName, dbPackageName); |
|
|
|
|
recordCandidate.package = dbPackageName; |
|
|
|
|
return recordCandidate; |
|
|
|
@ -330,7 +333,7 @@ private final static function DBRecord LoadRecordFor(
|
|
|
|
|
string name, |
|
|
|
|
string package) |
|
|
|
|
{ |
|
|
|
|
return __server().unreal.GetGameType() |
|
|
|
|
return __core().unreal_api().GetGameType() |
|
|
|
|
.LoadDataObject(class'DBRecord', name, package); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -689,7 +692,7 @@ private final function SetItem(
|
|
|
|
|
if (oldRecord != none) { |
|
|
|
|
oldRecord.EmptySelf(); |
|
|
|
|
} |
|
|
|
|
__server().unreal.GetGameType() |
|
|
|
|
__core().unreal_api().GetGameType() |
|
|
|
|
.DeleteDataObject(class'DBRecord', oldItem.s, package); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -723,7 +726,7 @@ private final function RemoveItem(int index)
|
|
|
|
|
if (oldRecord != none) { |
|
|
|
|
oldRecord.EmptySelf(); |
|
|
|
|
} |
|
|
|
|
__server().unreal.GetGameType() |
|
|
|
|
__core().unreal_api().GetGameType() |
|
|
|
|
.DeleteDataObject(class'DBRecord', oldItem.s, package); |
|
|
|
|
} |
|
|
|
|
storage.Remove(index, 1); |
|
|
|
@ -872,7 +875,7 @@ public final function EmptySelf()
|
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
lockEraseSelf = true; |
|
|
|
|
game = __server().unreal.GetGameType(); |
|
|
|
|
game = __core().unreal_api().GetGameType(); |
|
|
|
|
for (i = 0; i < storage.length; i += 1) |
|
|
|
|
{ |
|
|
|
|
if (storage[i].t != DBAT_Reference) continue; |
|
|
|
|