Browse Source

Rename API classes to better fit naming model

pull/8/head
Anton Tarasenko 2 years ago
parent
commit
2293ffe132
  1. 6
      sources/ClientRealm/API/Unreal/ClientUnrealAPI.uc
  2. 2
      sources/ClientRealm/API/Unreal/InteractionAPI/InteractionAPI.uc
  3. 8
      sources/ClientRealm/ClientAcediaAdapter.uc
  4. 4
      sources/ClientRealm/ClientGlobal.uc
  5. 137
      sources/CoreRealm/API/SideEffects/SideEffectAPI.uc
  6. 76
      sources/CoreRealm/API/SideEffects/SideEffectAPIBase.uc
  7. 2
      sources/CoreRealm/API/UnrealAPI/UnrealAPI.uc
  8. 4
      sources/CoreRealm/AcediaAdapter.uc
  9. 2
      sources/CoreRealm/CoreGlobal.uc
  10. 4
      sources/CoreRealm/SideEffects.uc
  11. 2
      sources/Gameplay/KF1Frontend/BaseImplementation/EKFInventory.uc
  12. 4
      sources/KFRealm/Client/API/Unreal/InteractionAPI/KF1_InteractionAPI.uc
  13. 4
      sources/KFRealm/Client/API/Unreal/KF1_ClientUnrealAPI.uc
  14. 115
      sources/KFRealm/Core/KF1_SideEffectAPI.uc
  15. 4
      sources/KFRealm/Server/Time/KF1_ServerTimeAPI.uc
  16. 4
      sources/KFRealm/Server/Unreal/BroadcastsAPI/BroadcastEventsObserver.uc
  17. 5
      sources/KFRealm/Server/Unreal/BroadcastsAPI/BroadcastSideEffect.uc
  18. 4
      sources/KFRealm/Server/Unreal/BroadcastsAPI/KF1_BroadcastAPI.uc
  19. 4
      sources/KFRealm/Server/Unreal/GameRulesAPI/KF1_GameRulesAPI.uc
  20. 4
      sources/KFRealm/Server/Unreal/InventoryAPI/KF1_InventoryAPI.uc
  21. 4
      sources/KFRealm/Server/Unreal/KF1_ServerUnrealAPI.uc
  22. 4
      sources/KFRealm/Server/Unreal/MutatorAPI/KF1_MutatorAPI.uc
  23. 2
      sources/ServerRealm/API/Time/ServerTimeAPI.uc
  24. 2
      sources/ServerRealm/API/Unreal/BroadcastsAPI/BroadcastAPI.uc
  25. 2
      sources/ServerRealm/API/Unreal/GameRulesAPI/GameRulesAPI.uc
  26. 2
      sources/ServerRealm/API/Unreal/InventoryAPI/InventoryAPI.uc
  27. 2
      sources/ServerRealm/API/Unreal/MutatorsAPI/MutatorAPI.uc
  28. 18
      sources/ServerRealm/API/Unreal/ServerUnrealAPI.uc
  29. 24
      sources/ServerRealm/ServerAcediaAdapter.uc
  30. 6
      sources/ServerRealm/ServerGlobal.uc

6
sources/ClientRealm/API/Unreal/ClientUnrealAPIBase.uc → sources/ClientRealm/API/Unreal/ClientUnrealAPI.uc

@ -18,12 +18,12 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Acedia. If not, see <https://www.gnu.org/licenses/>. * along with Acedia. If not, see <https://www.gnu.org/licenses/>.
*/ */
class ClientUnrealAPIBase extends UnrealAPIBase class ClientUnrealAPI extends UnrealAPI
abstract; abstract;
var protected bool initialized; var protected bool initialized;
var public InteractionAPIBase interaction; var public InteractionAPI interaction;
public function Initialize(class<ClientAcediaAdapter> adapterClass) public function Initialize(class<ClientAcediaAdapter> adapterClass)
{ {
@ -34,7 +34,7 @@ public function Initialize(class<ClientAcediaAdapter> adapterClass)
if (adapterClass == none) { if (adapterClass == none) {
return; return;
} }
interaction = InteractionAPIBase(_.memory.Allocate( interaction = InteractionAPI(_.memory.Allocate(
adapterClass.default.clientInteractionAPIClass)); adapterClass.default.clientInteractionAPIClass));
} }

2
sources/ClientRealm/API/Unreal/InteractionAPI/InteractionAPIBase.uc → sources/ClientRealm/API/Unreal/InteractionAPI/InteractionAPI.uc

@ -17,7 +17,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Acedia. If not, see <https://www.gnu.org/licenses/>. * along with Acedia. If not, see <https://www.gnu.org/licenses/>.
*/ */
class InteractionAPIBase extends AcediaObject; class InteractionAPI extends AcediaObject;
/** /**
* Called before rendering, when `Interaction`s receive their `PreRender()` * Called before rendering, when `Interaction`s receive their `PreRender()`

8
sources/ClientRealm/ClientAcediaAdapter.uc

@ -22,11 +22,11 @@
class ClientAcediaAdapter extends AcediaAdapter class ClientAcediaAdapter extends AcediaAdapter
abstract; abstract;
var public const class<ClientUnrealAPIBase> clientUnrealAPIClass; var public const class<ClientUnrealAPI> clientUnrealAPIClass;
var public const class<InteractionAPIBase> clientInteractionAPIClass; var public const class<InteractionAPI> clientInteractionAPIClass;
defaultproperties defaultproperties
{ {
clientUnrealAPIClass = class'ClientUnrealAPI' clientUnrealAPIClass = class'KF1_ClientUnrealAPI'
clientInteractionAPIClass = class'InteractionAPI' clientInteractionAPIClass = class'KF1_InteractionAPI'
} }

4
sources/ClientRealm/ClientGlobal.uc

@ -25,7 +25,7 @@ class ClientGlobal extends CoreGlobal;
// main instance in this variable's default value. // main instance in this variable's default value.
var protected ClientGlobal myself; var protected ClientGlobal myself;
var public ClientUnrealAPIBase unreal; var public ClientUnrealAPI unreal;
var private LoggerAPI.Definition fatBadAdapterClass, errNoInteraction; var private LoggerAPI.Definition fatBadAdapterClass, errNoInteraction;
@ -65,7 +65,7 @@ protected function Initialize()
} }
// Create APIs // Create APIs
_ = class'Global'.static.GetInstance(); _ = class'Global'.static.GetInstance();
unreal = ClientUnrealAPIBase( unreal = ClientUnrealAPI(
_.memory.Allocate(clientAdapterClass.default.clientUnrealAPIClass)); _.memory.Allocate(clientAdapterClass.default.clientUnrealAPIClass));
unreal.Initialize(clientAdapterClass); unreal.Initialize(clientAdapterClass);
// Create `AcediaInteraction` // Create `AcediaInteraction`

137
sources/CoreRealm/API/SideEffects/SideEffectAPI.uc

@ -1,6 +1,6 @@
/** /**
* Standard implementation for simple API for managing a list of * Base class for simple API for managing a list of `SideEffect` info
* `SideEffect` info objects: can add, remove, return all and by package. * objects: can add, remove, return all and by package.
* Copyright 2022 Anton Tarasenko * Copyright 2022 Anton Tarasenko
*------------------------------------------------------------------------------ *------------------------------------------------------------------------------
* This file is part of Acedia. * This file is part of Acedia.
@ -18,97 +18,58 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Acedia. If not, see <https://www.gnu.org/licenses/>. * along with Acedia. If not, see <https://www.gnu.org/licenses/>.
*/ */
class SideEffectAPI extends SideEffectAPIBase; class SideEffectAPI extends AcediaObject
abstract;
var private array<SideEffect> activeSideEffects; /**
* Returns all so far registered `SideEffect`s.
public function array<SideEffect> GetAll() *
{ * @return Array of all registered `SideEffect`s.
local int i; */
public function array<SideEffect> GetAll();
for (i = 0; i < activeSideEffects.length; i += 1) {
activeSideEffects[i].NewRef();
}
return activeSideEffects;
}
public function SideEffect GetClass(class<SideEffect> sideEffectClass)
{
local int i;
if (sideEffectClass == none) {
return none;
}
for (i = 0; i < activeSideEffects.length; i += 1)
{
if (activeSideEffects[i].class == sideEffectClass)
{
activeSideEffects[i].NewRef();
return activeSideEffects[i];
}
}
return none;
}
public function array<SideEffect> GetFromPackage(BaseText packageName)
{
local int i;
local Text nextPackage;
local array<SideEffect> result;
if (packageName == none) {
return result;
}
for (i = 0; i < activeSideEffects.length; i += 1)
{
nextPackage = activeSideEffects[i].GetPackage();
if (nextPackage.Compare(packageName, SCASE_INSENSITIVE))
{
activeSideEffects[i].NewRef();
result[result.length] = activeSideEffects[i];
}
_.memory.Free(nextPackage);
}
return result;
}
public function bool Add(SideEffect newSideEffect) /**
{ * Returns active `SideEffect` instance of the specified class
local int i; * `sideEffectClass`.
*
* @param sideEffectClass Class of side effect to return active instance of.
* @return Active `SideEffect` instance of the specified class
* `sideEffectClass`.
* `none` if either `sideEffectClass` is `none` or side effect of such
* class is not currently active.
*/
public function SideEffect GetClass(class<SideEffect> sideEffectClass);
if (newSideEffect == none) { /**
return false; * Returns all so far registered `SideEffect`s from a package `packageName`
} * (case insensitive).
for (i = 0; i < activeSideEffects.length; i += 1) *
{ * @param packageName Name of the package, in `SideEffect`s from which we are
if (activeSideEffects[i].class == newSideEffect.class) { * interested. Must be not `none`.
return false; * @return Array of all registered `SideEffect`s from a package `packageName`.
} * If `none`, returns an empty array.
} */
newSideEffect.NewRef(); public function array<SideEffect> GetFromPackage(BaseText packageName);
activeSideEffects[activeSideEffects.length] = newSideEffect;
return true;
}
public function bool RemoveClass( /**
class<SideEffect> sideEffectClass) * Registers a new `SideEffect` object as active.
{ *
local int i; * @param newSideEffect Instance of some `SideEffect` class to register as
* active side effect. Must not be `none`.
* @return `true` if new side effect was added and `false` otherwise.
*/
public function bool Add(SideEffect newSideEffect);
if (sideEffectClass == none) { /**
return false; * Removes `SideEffect` of the specified sub-class from the list of active
} * side effects.
for (i = 0; i < activeSideEffects.length; i += 1) *
{ * @param sideEffectClass Class of the side effect to remove.
if (activeSideEffects[i].class == sideEffectClass) * @return `true` if some side effect was removed as a result of this operation
{ * and `false` otherwise (even if there was no side effect of specified
_.memory.Free(activeSideEffects[i]); * class to begin with).
activeSideEffects.Remove(i, 1); */
return true; public function bool RemoveClass(class<SideEffect> sideEffectClass);
}
}
return false;
}
defaultproperties defaultproperties
{ {

76
sources/CoreRealm/API/SideEffects/SideEffectAPIBase.uc

@ -1,76 +0,0 @@
/**
* Base class for simple API for managing a list of `SideEffect` info
* objects: can add, remove, return all and by package.
* Copyright 2022 Anton Tarasenko
*------------------------------------------------------------------------------
* This file is part of Acedia.
*
* Acedia is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3 of the License, or
* (at your option) any later version.
*
* Acedia is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Acedia. If not, see <https://www.gnu.org/licenses/>.
*/
class SideEffectAPIBase extends AcediaObject
abstract;
/**
* Returns all so far registered `SideEffect`s.
*
* @return Array of all registered `SideEffect`s.
*/
public function array<SideEffect> GetAll();
/**
* Returns active `SideEffect` instance of the specified class
* `sideEffectClass`.
*
* @param sideEffectClass Class of side effect to return active instance of.
* @return Active `SideEffect` instance of the specified class
* `sideEffectClass`.
* `none` if either `sideEffectClass` is `none` or side effect of such
* class is not currently active.
*/
public function SideEffect GetClass(class<SideEffect> sideEffectClass);
/**
* Returns all so far registered `SideEffect`s from a package `packageName`
* (case insensitive).
*
* @param packageName Name of the package, in `SideEffect`s from which we are
* interested. Must be not `none`.
* @return Array of all registered `SideEffect`s from a package `packageName`.
* If `none`, returns an empty array.
*/
public function array<SideEffect> GetFromPackage(BaseText packageName);
/**
* Registers a new `SideEffect` object as active.
*
* @param newSideEffect Instance of some `SideEffect` class to register as
* active side effect. Must not be `none`.
* @return `true` if new side effect was added and `false` otherwise.
*/
public function bool Add(SideEffect newSideEffect);
/**
* Removes `SideEffect` of the specified sub-class from the list of active
* side effects.
*
* @param sideEffectClass Class of the side effect to remove.
* @return `true` if some side effect was removed as a result of this operation
* and `false` otherwise (even if there was no side effect of specified
* class to begin with).
*/
public function bool RemoveClass(class<SideEffect> sideEffectClass);
defaultproperties
{
}

2
sources/CoreRealm/API/UnrealAPI/UnrealAPIBase.uc → sources/CoreRealm/API/UnrealAPI/UnrealAPI.uc

@ -18,7 +18,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Acedia. If not, see <https://www.gnu.org/licenses/>. * along with Acedia. If not, see <https://www.gnu.org/licenses/>.
*/ */
class UnrealAPIBase extends AcediaObject class UnrealAPI extends AcediaObject
abstract; abstract;
/** /**

4
sources/CoreRealm/AcediaAdapter.uc

@ -35,9 +35,9 @@ class AcediaAdapter extends AcediaObject
* specify desired `AcediaAdapter` before loading server/client core. * specify desired `AcediaAdapter` before loading server/client core.
*/ */
var public const class<SideEffectAPIBase> sideEffectAPIClass; var public const class<SideEffectAPI> sideEffectAPIClass;
defaultproperties defaultproperties
{ {
sideEffectAPIClass = class'SideEffectAPI' sideEffectAPIClass = class'KF1_SideEffectAPI'
} }

2
sources/CoreRealm/CoreGlobal.uc

@ -24,7 +24,7 @@ class CoreGlobal extends Object;
var protected bool initialized; var protected bool initialized;
var protected class<AcediaAdapter> adapterClass; var protected class<AcediaAdapter> adapterClass;
var public SideEffectAPIBase sideEffects; var public SideEffectAPI sideEffects;
var private LoggerAPI.Definition fatNoAdapterClass; var private LoggerAPI.Definition fatNoAdapterClass;

4
sources/CoreRealm/SideEffects.uc

@ -20,7 +20,7 @@
* along with Acedia. If not, see <https://www.gnu.org/licenses/>. * along with Acedia. If not, see <https://www.gnu.org/licenses/>.
*/ */
class SideEffects extends AcediaObject class SideEffects extends AcediaObject
dependson(BroadcastAPIBase) dependson(BroadcastAPI)
abstract abstract
config(AcediaSystem); config(AcediaSystem);
@ -95,7 +95,7 @@ var public const config bool allowReplacingDamageTypes;
* Acedia and if you do not have a reason to forbid that (for example, for mod * Acedia and if you do not have a reason to forbid that (for example, for mod
* compatibility reasons), you should set this value at `BHIJ_Root`. * compatibility reasons), you should set this value at `BHIJ_Root`.
*/ */
var public const config BroadcastAPIBase.InjectionLevel broadcastHandlerInjectionLevel; var public const config BroadcastAPI.InjectionLevel broadcastHandlerInjectionLevel;
defaultproperties defaultproperties
{ {

2
sources/Gameplay/KF1Frontend/BaseImplementation/EKFInventory.uc

@ -241,7 +241,7 @@ private function KFWeapon GetByRootWithDualRole(
Inventory inventoryChain, Inventory inventoryChain,
InventoryAPI.DualWieldingRole requiredRole) InventoryAPI.DualWieldingRole requiredRole)
{ {
local InventoryAPIBase api; local InventoryAPI api;
local class<KFWeapon> nextWeaponClass; local class<KFWeapon> nextWeaponClass;
local class<KFWeaponPickup> itemRoot, nextRoot; local class<KFWeaponPickup> itemRoot, nextRoot;
api = _server.unreal.inventory; api = _server.unreal.inventory;

4
sources/KFRealm/Client/API/Unreal/InteractionAPI/InteractionAPI.uc → sources/KFRealm/Client/API/Unreal/InteractionAPI/KF1_InteractionAPI.uc

@ -1,5 +1,5 @@
/** /**
* Default Acedia implementation for `InteractionAPIBase`. * Default Acedia implementation for `InteractionAPI`.
* Copyright 2022 Anton Tarasenko * Copyright 2022 Anton Tarasenko
*------------------------------------------------------------------------------ *------------------------------------------------------------------------------
* This file is part of Acedia. * This file is part of Acedia.
@ -17,7 +17,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Acedia. If not, see <https://www.gnu.org/licenses/>. * along with Acedia. If not, see <https://www.gnu.org/licenses/>.
*/ */
class InteractionAPI extends InteractionAPIBase; class KF1_InteractionAPI extends InteractionAPI;
/* SIGNAL */ /* SIGNAL */
public function Interaction_OnRender_Slot OnPreRender(AcediaObject receiver) public function Interaction_OnRender_Slot OnPreRender(AcediaObject receiver)

4
sources/KFRealm/Client/API/Unreal/ClientUnrealAPI.uc → sources/KFRealm/Client/API/Unreal/KF1_ClientUnrealAPI.uc

@ -1,5 +1,5 @@
/** /**
* Acedia's default implementation for `ClientUnrealAPIBase`. * Acedia's default implementation for `ClientUnrealAPI.
* Copyright 2021-2022 Anton Tarasenko * Copyright 2021-2022 Anton Tarasenko
*------------------------------------------------------------------------------ *------------------------------------------------------------------------------
* This file is part of Acedia. * This file is part of Acedia.
@ -17,7 +17,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Acedia. If not, see <https://www.gnu.org/licenses/>. * along with Acedia. If not, see <https://www.gnu.org/licenses/>.
*/ */
class ClientUnrealAPI extends ClientUnrealAPIBase; class KF1_ClientUnrealAPI extends ClientUnrealAPI;
var private LoggerAPI.Definition fatalNoStalker; var private LoggerAPI.Definition fatalNoStalker;

115
sources/KFRealm/Core/KF1_SideEffectAPI.uc

@ -0,0 +1,115 @@
/**
* Standard implementation for simple API for managing a list of
* `SideEffect` info objects: can add, remove, return all and by package.
* Copyright 2022 Anton Tarasenko
*------------------------------------------------------------------------------
* This file is part of Acedia.
*
* Acedia is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3 of the License, or
* (at your option) any later version.
*
* Acedia is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Acedia. If not, see <https://www.gnu.org/licenses/>.
*/
class KF1_SideEffectAPI extends SideEffectAPI;
var private array<SideEffect> activeSideEffects;
public function array<SideEffect> GetAll()
{
local int i;
for (i = 0; i < activeSideEffects.length; i += 1) {
activeSideEffects[i].NewRef();
}
return activeSideEffects;
}
public function SideEffect GetClass(class<SideEffect> sideEffectClass)
{
local int i;
if (sideEffectClass == none) {
return none;
}
for (i = 0; i < activeSideEffects.length; i += 1)
{
if (activeSideEffects[i].class == sideEffectClass)
{
activeSideEffects[i].NewRef();
return activeSideEffects[i];
}
}
return none;
}
public function array<SideEffect> GetFromPackage(BaseText packageName)
{
local int i;
local Text nextPackage;
local array<SideEffect> result;
if (packageName == none) {
return result;
}
for (i = 0; i < activeSideEffects.length; i += 1)
{
nextPackage = activeSideEffects[i].GetPackage();
if (nextPackage.Compare(packageName, SCASE_INSENSITIVE))
{
activeSideEffects[i].NewRef();
result[result.length] = activeSideEffects[i];
}
_.memory.Free(nextPackage);
}
return result;
}
public function bool Add(SideEffect newSideEffect)
{
local int i;
if (newSideEffect == none) {
return false;
}
for (i = 0; i < activeSideEffects.length; i += 1)
{
if (activeSideEffects[i].class == newSideEffect.class) {
return false;
}
}
newSideEffect.NewRef();
activeSideEffects[activeSideEffects.length] = newSideEffect;
return true;
}
public function bool RemoveClass(
class<SideEffect> sideEffectClass)
{
local int i;
if (sideEffectClass == none) {
return false;
}
for (i = 0; i < activeSideEffects.length; i += 1)
{
if (activeSideEffects[i].class == sideEffectClass)
{
_.memory.Free(activeSideEffects[i]);
activeSideEffects.Remove(i, 1);
return true;
}
}
return false;
}
defaultproperties
{
}

4
sources/KFRealm/Server/Time/ServerTimeAPI.uc → sources/KFRealm/Server/Time/KF1_ServerTimeAPI.uc

@ -1,5 +1,5 @@
/** /**
* Acedia's default `ServerTimeAPIBase` API implementation * Acedia's default `ServerTimeAPI` API implementation
* Copyright 2021-2022 Anton Tarasenko * Copyright 2021-2022 Anton Tarasenko
*------------------------------------------------------------------------------ *------------------------------------------------------------------------------
* This file is part of Acedia. * This file is part of Acedia.
@ -17,7 +17,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Acedia. If not, see <https://www.gnu.org/licenses/>. * along with Acedia. If not, see <https://www.gnu.org/licenses/>.
*/ */
class ServerTimeAPI extends ServerTimeAPIBase; class KF1_ServerTimeAPI extends ServerTimeAPI;
public function Timer NewTimer( public function Timer NewTimer(
optional float interval, optional float interval,

4
sources/KFRealm/Server/Unreal/BroadcastsAPI/BroadcastEventsObserver.uc

@ -22,7 +22,7 @@
* along with Acedia. If not, see <https://www.gnu.org/licenses/>. * along with Acedia. If not, see <https://www.gnu.org/licenses/>.
*/ */
class BroadcastEventsObserver extends Engine.BroadcastHandler class BroadcastEventsObserver extends Engine.BroadcastHandler
dependson(BroadcastAPIBase) dependson(BroadcastAPI)
config(AcediaSystem); config(AcediaSystem);
// Forcing Acedia's own `BroadcastHandler` is rather invasive and might be // Forcing Acedia's own `BroadcastHandler` is rather invasive and might be
@ -30,7 +30,7 @@ class BroadcastEventsObserver extends Engine.BroadcastHandler
// To alleviate this issue Acedia allows server admins to control how it's // To alleviate this issue Acedia allows server admins to control how it's
// `BroadcastHandler` is injected. Do note however that anything other than // `BroadcastHandler` is injected. Do note however that anything other than
// `BHIJ_Root` can lead to issues with Acedia's features. // `BHIJ_Root` can lead to issues with Acedia's features.
var private BroadcastAPIBase.InjectionLevel usedInjectionLevel; var private BroadcastAPI.InjectionLevel usedInjectionLevel;
/** /**
* To understand how what our broadcast handler does, let us first explain * To understand how what our broadcast handler does, let us first explain

5
sources/KFRealm/Server/Unreal/BroadcastsAPI/BroadcastSideEffect.uc

@ -23,10 +23,9 @@
* along with Acedia. If not, see <https://www.gnu.org/licenses/>. * along with Acedia. If not, see <https://www.gnu.org/licenses/>.
*/ */
class BroadcastSideEffect extends SideEffect class BroadcastSideEffect extends SideEffect
dependson(BroadcastAPIBase); dependson(BroadcastAPI);
public final function Initialize( public final function Initialize(BroadcastAPI.InjectionLevel usedInjectionLevel)
BroadcastAPIBase.InjectionLevel usedInjectionLevel)
{ {
sideEffectName = sideEffectName =
_.text.FromString("AcediaCore's `BroadcastHandler` injected"); _.text.FromString("AcediaCore's `BroadcastHandler` injected");

4
sources/KFRealm/Server/Unreal/BroadcastsAPI/BroadcastAPI.uc → sources/KFRealm/Server/Unreal/BroadcastsAPI/KF1_BroadcastAPI.uc

@ -1,5 +1,5 @@
/** /**
* Acedia's default implementation for `BroadcastAPIBase`. * Acedia's default implementation for `BroadcastAPI`.
* Copyright 2021-2022 Anton Tarasenko * Copyright 2021-2022 Anton Tarasenko
*------------------------------------------------------------------------------ *------------------------------------------------------------------------------
* This file is part of Acedia. * This file is part of Acedia.
@ -17,7 +17,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Acedia. If not, see <https://www.gnu.org/licenses/>. * along with Acedia. If not, see <https://www.gnu.org/licenses/>.
*/ */
class BroadcastAPI extends BroadcastAPIBase; class KF1_BroadcastAPI extends BroadcastAPI;
// Tracks if we have already tried to add our own `BroadcastHandler` to avoid // Tracks if we have already tried to add our own `BroadcastHandler` to avoid
// wasting resources/spamming errors in the log about our inability to do so // wasting resources/spamming errors in the log about our inability to do so

4
sources/KFRealm/Server/Unreal/GameRulesAPI/GameRulesAPI.uc → sources/KFRealm/Server/Unreal/GameRulesAPI/KF1_GameRulesAPI.uc

@ -1,5 +1,5 @@
/** /**
* Acedia's default implementation for `GameRulesAPIBase` API. * Acedia's default implementation for `GameRulesAPI` API.
* Copyright 2021-2022 Anton Tarasenko * Copyright 2021-2022 Anton Tarasenko
*------------------------------------------------------------------------------ *------------------------------------------------------------------------------
* This file is part of Acedia. * This file is part of Acedia.
@ -17,7 +17,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Acedia. If not, see <https://www.gnu.org/licenses/>. * along with Acedia. If not, see <https://www.gnu.org/licenses/>.
*/ */
class GameRulesAPI extends GameRulesAPIBase; class KF1_GameRulesAPI extends GameRulesAPI;
// Tracks if we have already tried to add our own `BroadcastHandler` to avoid // Tracks if we have already tried to add our own `BroadcastHandler` to avoid
// wasting resources/spamming errors in the log about our inability to do so // wasting resources/spamming errors in the log about our inability to do so

4
sources/KFRealm/Server/Unreal/InventoryAPI/InventoryAPI.uc → sources/KFRealm/Server/Unreal/InventoryAPI/KF1_InventoryAPI.uc

@ -1,5 +1,5 @@
/** /**
* Acedia's default implementation for `InventoryAPIBase`. * Acedia's default implementation for `InventoryAPI`.
* Copyright 2022 Anton Tarasenko * Copyright 2022 Anton Tarasenko
*------------------------------------------------------------------------------ *------------------------------------------------------------------------------
* This file is part of Acedia. * This file is part of Acedia.
@ -17,7 +17,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Acedia. If not, see <https://www.gnu.org/licenses/>. * along with Acedia. If not, see <https://www.gnu.org/licenses/>.
*/ */
class InventoryAPI extends InventoryAPIBase class KF1_InventoryAPI extends InventoryAPI
config(AcediaSystem); config(AcediaSystem);
public function array<DualiesPair> GetDualiesPairs() public function array<DualiesPair> GetDualiesPairs()

4
sources/KFRealm/Server/Unreal/ServerUnrealAPI.uc → sources/KFRealm/Server/Unreal/KF1_ServerUnrealAPI.uc

@ -1,5 +1,5 @@
/** /**
* Acedia's default implementation for `ServerUnrealAPIBase`. * Acedia's default implementation for `ServerUnrealAPI`.
* Copyright 2021-2022 Anton Tarasenko * Copyright 2021-2022 Anton Tarasenko
*------------------------------------------------------------------------------ *------------------------------------------------------------------------------
* This file is part of Acedia. * This file is part of Acedia.
@ -17,7 +17,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Acedia. If not, see <https://www.gnu.org/licenses/>. * along with Acedia. If not, see <https://www.gnu.org/licenses/>.
*/ */
class ServerUnrealAPI extends ServerUnrealAPIBase; class KF1_ServerUnrealAPI extends ServerUnrealAPI;
var private LoggerAPI.Definition fatalNoStalker; var private LoggerAPI.Definition fatalNoStalker;

4
sources/KFRealm/Server/Unreal/MutatorAPI/MutatorAPI.uc → sources/KFRealm/Server/Unreal/MutatorAPI/KF1_MutatorAPI.uc

@ -1,5 +1,5 @@
/** /**
* Acedia's default implementation for `MutatorAPIBase` API. * Acedia's default implementation for `MutatorAPI` API.
* Copyright 2021 - 2022 Anton Tarasenko * Copyright 2021 - 2022 Anton Tarasenko
*------------------------------------------------------------------------------ *------------------------------------------------------------------------------
* This file is part of Acedia. * This file is part of Acedia.
@ -17,7 +17,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Acedia. If not, see <https://www.gnu.org/licenses/>. * along with Acedia. If not, see <https://www.gnu.org/licenses/>.
*/ */
class MutatorAPI extends MutatorAPIBase; class KF1_MutatorAPI extends MutatorAPI;
/* SIGNAL */ /* SIGNAL */
public function Mutator_OnCheckReplacement_Slot OnCheckReplacement( public function Mutator_OnCheckReplacement_Slot OnCheckReplacement(

2
sources/ServerRealm/API/Time/ServerTimeAPIBase.uc → sources/ServerRealm/API/Time/ServerTimeAPI.uc

@ -17,7 +17,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Acedia. If not, see <https://www.gnu.org/licenses/>. * along with Acedia. If not, see <https://www.gnu.org/licenses/>.
*/ */
class ServerTimeAPIBase extends AcediaObject class ServerTimeAPI extends AcediaObject
abstract; abstract;
/** /**

2
sources/ServerRealm/API/Unreal/BroadcastsAPI/BroadcastAPIBase.uc → sources/ServerRealm/API/Unreal/BroadcastsAPI/BroadcastAPI.uc

@ -18,7 +18,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Acedia. If not, see <https://www.gnu.org/licenses/>. * along with Acedia. If not, see <https://www.gnu.org/licenses/>.
*/ */
class BroadcastAPIBase extends AcediaObject class BroadcastAPI extends AcediaObject
abstract; abstract;
/** /**

2
sources/ServerRealm/API/Unreal/GameRulesAPI/GameRulesAPIBase.uc → sources/ServerRealm/API/Unreal/GameRulesAPI/GameRulesAPI.uc

@ -18,7 +18,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Acedia. If not, see <https://www.gnu.org/licenses/>. * along with Acedia. If not, see <https://www.gnu.org/licenses/>.
*/ */
class GameRulesAPIBase extends AcediaObject class GameRulesAPI extends AcediaObject
abstract; abstract;
/** /**

2
sources/ServerRealm/API/Unreal/InventoryAPI/InventoryAPIBase.uc → sources/ServerRealm/API/Unreal/InventoryAPI/InventoryAPI.uc

@ -19,7 +19,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Acedia. If not, see <https://www.gnu.org/licenses/>. * along with Acedia. If not, see <https://www.gnu.org/licenses/>.
*/ */
class InventoryAPIBase extends AcediaObject class InventoryAPI extends AcediaObject
config(AcediaSystem) config(AcediaSystem)
abstract; abstract;

2
sources/ServerRealm/API/Unreal/MutatorsAPI/MutatorAPIBase.uc → sources/ServerRealm/API/Unreal/MutatorsAPI/MutatorAPI.uc

@ -18,7 +18,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Acedia. If not, see <https://www.gnu.org/licenses/>. * along with Acedia. If not, see <https://www.gnu.org/licenses/>.
*/ */
class MutatorAPIBase extends AcediaObject class MutatorAPI extends AcediaObject
abstract; abstract;
/** /**

18
sources/ServerRealm/API/Unreal/ServerUnrealAPIBase.uc → sources/ServerRealm/API/Unreal/ServerUnrealAPI.uc

@ -18,15 +18,15 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Acedia. If not, see <https://www.gnu.org/licenses/>. * along with Acedia. If not, see <https://www.gnu.org/licenses/>.
*/ */
class ServerUnrealAPIBase extends UnrealAPIBase class ServerUnrealAPI extends UnrealAPI
abstract; abstract;
var protected bool initialized; var protected bool initialized;
var public MutatorAPIBase mutator; var public MutatorAPI mutator;
var public GameRulesAPIBase gameRules; var public GameRulesAPI gameRules;
var public BroadcastAPIBase broadcasts; var public BroadcastAPI broadcasts;
var public InventoryAPIBase inventory; var public InventoryAPI inventory;
public function Initialize(class<ServerAcediaAdapter> adapterClass) public function Initialize(class<ServerAcediaAdapter> adapterClass)
{ {
@ -37,13 +37,13 @@ public function Initialize(class<ServerAcediaAdapter> adapterClass)
if (adapterClass == none) { if (adapterClass == none) {
return; return;
} }
mutator = MutatorAPIBase(_.memory.Allocate( mutator = MutatorAPI(_.memory.Allocate(
adapterClass.default.serverMutatorAPIClass)); adapterClass.default.serverMutatorAPIClass));
gameRules = GameRulesAPIBase(_.memory.Allocate( gameRules = GameRulesAPI(_.memory.Allocate(
adapterClass.default.serverGameRulesAPIClass)); adapterClass.default.serverGameRulesAPIClass));
broadcasts = BroadcastAPIBase(_.memory.Allocate( broadcasts = BroadcastAPI(_.memory.Allocate(
adapterClass.default.serverBroadcastAPIClass)); adapterClass.default.serverBroadcastAPIClass));
inventory = InventoryAPIBase(_.memory.Allocate( inventory = InventoryAPI (_.memory.Allocate(
adapterClass.default.serverInventoryAPIClass)); adapterClass.default.serverInventoryAPIClass));
} }

24
sources/ServerRealm/ServerAcediaAdapter.uc

@ -22,19 +22,19 @@
class ServerAcediaAdapter extends AcediaAdapter class ServerAcediaAdapter extends AcediaAdapter
abstract; abstract;
var public const class<ServerTimeAPIBase> serverTimeAPIClass; var public const class<ServerTimeAPI> serverTimeAPIClass;
var public const class<ServerUnrealAPIBase> serverUnrealAPIClass; var public const class<ServerUnrealAPI> serverUnrealAPIClass;
var public const class<BroadcastAPIBase> serverBroadcastAPIClass; var public const class<BroadcastAPI> serverBroadcastAPIClass;
var public const class<GameRulesAPIBase> serverGameRulesAPIClass; var public const class<GameRulesAPI> serverGameRulesAPIClass;
var public const class<InventoryAPIBase> serverInventoryAPIClass; var public const class<InventoryAPI> serverInventoryAPIClass;
var public const class<MutatorAPIBase> serverMutatorAPIClass; var public const class<MutatorAPI> serverMutatorAPIClass;
defaultproperties defaultproperties
{ {
serverTimeAPIClass = class'ServerTimeAPI' serverTimeAPIClass = class'KF1_ServerTimeAPI'
serverUnrealAPIClass = class'ServerUnrealAPI' serverUnrealAPIClass = class'KF1_ServerUnrealAPI'
serverBroadcastAPIClass = class'BroadcastAPI' serverBroadcastAPIClass = class'KF1_BroadcastAPI'
serverGameRulesAPIClass = class'GameRulesAPI' serverGameRulesAPIClass = class'KF1_GameRulesAPI'
serverInventoryAPIClass = class'InventoryAPI' serverInventoryAPIClass = class'KF1_InventoryAPI'
serverMutatorAPIClass = class'MutatorAPI' serverMutatorAPIClass = class'KF1_MutatorAPI'
} }

6
sources/ServerRealm/ServerGlobal.uc

@ -26,8 +26,8 @@ class ServerGlobal extends CoreGlobal;
var protected ServerGlobal myself; var protected ServerGlobal myself;
var public KFFrontend kf; var public KFFrontend kf;
var public ServerUnrealAPIBase unreal; var public ServerUnrealAPI unreal;
var public ServerTimeAPIBase time; var public ServerTimeAPI time;
var private LoggerAPI.Definition fatBadAdapterClass; var private LoggerAPI.Definition fatBadAdapterClass;
@ -64,7 +64,7 @@ protected function Initialize()
return; return;
} }
_ = class'Global'.static.GetInstance(); _ = class'Global'.static.GetInstance();
unreal = ServerUnrealAPIBase( unreal = ServerUnrealAPI(
_.memory.Allocate(serverAdapterClass.default.serverUnrealAPIClass)); _.memory.Allocate(serverAdapterClass.default.serverUnrealAPIClass));
unreal.Initialize(serverAdapterClass); unreal.Initialize(serverAdapterClass);
time = ServerTimeAPI( time = ServerTimeAPI(

Loading…
Cancel
Save