mirror of
https://github.com/RYDE-WORK/ballistica.git
synced 2026-01-27 17:33:13 +08:00
more logger wiring
This commit is contained in:
parent
96a4c16605
commit
a97119b37a
88
.efrocachemap
generated
88
.efrocachemap
generated
@ -4099,50 +4099,50 @@
|
||||
"build/assets/windows/Win32/ucrtbased.dll": "2def5335207d41b21b9823f6805997f1",
|
||||
"build/assets/windows/Win32/vc_redist.x86.exe": "b08a55e2e77623fe657bea24f223a3ae",
|
||||
"build/assets/windows/Win32/vcruntime140d.dll": "865b2af4d1e26a1a8073c89acb06e599",
|
||||
"build/prefab/full/linux_arm64_gui/debug/ballisticakit": "acf25c2f0b4590116ce672d3d01b2a10",
|
||||
"build/prefab/full/linux_arm64_gui/release/ballisticakit": "f0616f14d9954f20f600f7d004550fad",
|
||||
"build/prefab/full/linux_arm64_server/debug/dist/ballisticakit_headless": "1680e59f8fd4411b3903f0049c435a59",
|
||||
"build/prefab/full/linux_arm64_server/release/dist/ballisticakit_headless": "d02b65452261018ce2c6b7701db0ce1b",
|
||||
"build/prefab/full/linux_x86_64_gui/debug/ballisticakit": "ca8f19db9d17a0e6d3173150078cc6d6",
|
||||
"build/prefab/full/linux_x86_64_gui/release/ballisticakit": "30b4086f7f100a9ec3f2d2c41dc3a906",
|
||||
"build/prefab/full/linux_x86_64_server/debug/dist/ballisticakit_headless": "cac729b2077108eaa7499b6ca8a5d812",
|
||||
"build/prefab/full/linux_x86_64_server/release/dist/ballisticakit_headless": "c878ae8465a1eaf0d50121dea91a61bf",
|
||||
"build/prefab/full/mac_arm64_gui/debug/ballisticakit": "71f4ff6839406cd14d8fd4c878ae4142",
|
||||
"build/prefab/full/mac_arm64_gui/release/ballisticakit": "8127d0ecff652a3b0b8f9d66bd95d1fe",
|
||||
"build/prefab/full/mac_arm64_server/debug/dist/ballisticakit_headless": "7f5197bc4864632a3138b5c812a03818",
|
||||
"build/prefab/full/mac_arm64_server/release/dist/ballisticakit_headless": "5e1f115140306cf51c97df11618de088",
|
||||
"build/prefab/full/mac_x86_64_gui/debug/ballisticakit": "4b78329eec1d588d7def8e76ee5d8c15",
|
||||
"build/prefab/full/mac_x86_64_gui/release/ballisticakit": "931ada78d6e283b55c94a44a08ff1ee4",
|
||||
"build/prefab/full/mac_x86_64_server/debug/dist/ballisticakit_headless": "970b98f4b7aa42f6ca12dbb88035315d",
|
||||
"build/prefab/full/mac_x86_64_server/release/dist/ballisticakit_headless": "241e26801373958babe60fccf3a3c650",
|
||||
"build/prefab/full/windows_x86_gui/debug/BallisticaKit.exe": "2af0e30a4594fbe2f04799137fddad1f",
|
||||
"build/prefab/full/windows_x86_gui/release/BallisticaKit.exe": "8b81104944ec4e64a4fb270be09f1c50",
|
||||
"build/prefab/full/windows_x86_server/debug/dist/BallisticaKitHeadless.exe": "359ab73709b87325ecdff059455986f3",
|
||||
"build/prefab/full/windows_x86_server/release/dist/BallisticaKitHeadless.exe": "b0401184660350ad7150d83a537e4d23",
|
||||
"build/prefab/lib/linux_arm64_gui/debug/libballisticaplus.a": "0908fb0b2bd96bf6430203e96e47e1ff",
|
||||
"build/prefab/lib/linux_arm64_gui/release/libballisticaplus.a": "1f2f03992b403171ad4027a3fa6bfa1c",
|
||||
"build/prefab/lib/linux_arm64_server/debug/libballisticaplus.a": "0908fb0b2bd96bf6430203e96e47e1ff",
|
||||
"build/prefab/lib/linux_arm64_server/release/libballisticaplus.a": "1f2f03992b403171ad4027a3fa6bfa1c",
|
||||
"build/prefab/lib/linux_x86_64_gui/debug/libballisticaplus.a": "c1b8b4263516bd5f722e87387a665f96",
|
||||
"build/prefab/lib/linux_x86_64_gui/release/libballisticaplus.a": "e90f9ec3e2fc4f18283d37500df8220e",
|
||||
"build/prefab/lib/linux_x86_64_server/debug/libballisticaplus.a": "c1b8b4263516bd5f722e87387a665f96",
|
||||
"build/prefab/lib/linux_x86_64_server/release/libballisticaplus.a": "e90f9ec3e2fc4f18283d37500df8220e",
|
||||
"build/prefab/lib/mac_arm64_gui/debug/libballisticaplus.a": "4fc0e5a14b173e2ed6151e5ead7c0e35",
|
||||
"build/prefab/lib/mac_arm64_gui/release/libballisticaplus.a": "f727e1126463bdd256abab321d7261dd",
|
||||
"build/prefab/lib/mac_arm64_server/debug/libballisticaplus.a": "4fc0e5a14b173e2ed6151e5ead7c0e35",
|
||||
"build/prefab/lib/mac_arm64_server/release/libballisticaplus.a": "f727e1126463bdd256abab321d7261dd",
|
||||
"build/prefab/lib/mac_x86_64_gui/debug/libballisticaplus.a": "ec10904ac6e96dabbee7c9835db10be0",
|
||||
"build/prefab/lib/mac_x86_64_gui/release/libballisticaplus.a": "18fbad7b38a25994e370c01b85499e47",
|
||||
"build/prefab/lib/mac_x86_64_server/debug/libballisticaplus.a": "14fd7fa596120ad0b1cbfdfb32b79f2c",
|
||||
"build/prefab/lib/mac_x86_64_server/release/libballisticaplus.a": "18fbad7b38a25994e370c01b85499e47",
|
||||
"build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.lib": "77871bca2a7987786817d79390c439d7",
|
||||
"build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.pdb": "bd39727002a3f4094160649f18deca49",
|
||||
"build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.lib": "f3735462e3292ac07df74dbabe8ed994",
|
||||
"build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.pdb": "50e2c0293621bf058dcf0960c929cdb3",
|
||||
"build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.lib": "48dd1eb95e6ef511ba828221101df0bc",
|
||||
"build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.pdb": "2a97fbd995d7abb7e215b756d851ff6d",
|
||||
"build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.lib": "f4f0363f6ab65c664db2e50b651d6585",
|
||||
"build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.pdb": "6ad1fbc86d593db1653b64ba40ab1da6",
|
||||
"build/prefab/full/linux_arm64_gui/debug/ballisticakit": "7cadc07c2e5165362692d3383646237a",
|
||||
"build/prefab/full/linux_arm64_gui/release/ballisticakit": "f349db0463adbf2fe3b11fa3000c1792",
|
||||
"build/prefab/full/linux_arm64_server/debug/dist/ballisticakit_headless": "01aacff8e2dc1f65af828e17422134b5",
|
||||
"build/prefab/full/linux_arm64_server/release/dist/ballisticakit_headless": "bf2c2faeaa2e28c07a8459d624786d22",
|
||||
"build/prefab/full/linux_x86_64_gui/debug/ballisticakit": "60dab3e475bbba7e936ce7c2b52559e1",
|
||||
"build/prefab/full/linux_x86_64_gui/release/ballisticakit": "548f01033d5a93bb49036302ace281e2",
|
||||
"build/prefab/full/linux_x86_64_server/debug/dist/ballisticakit_headless": "1571cdae20fa989bc07239150f83d869",
|
||||
"build/prefab/full/linux_x86_64_server/release/dist/ballisticakit_headless": "95780363ec0aea90f5d67f6ba756cf00",
|
||||
"build/prefab/full/mac_arm64_gui/debug/ballisticakit": "93e70445cf1456edabe1869499f8f226",
|
||||
"build/prefab/full/mac_arm64_gui/release/ballisticakit": "388f3e04bdb917102a9b6f0e231b78c8",
|
||||
"build/prefab/full/mac_arm64_server/debug/dist/ballisticakit_headless": "0390bc7f493ade35164142dc8649b3f6",
|
||||
"build/prefab/full/mac_arm64_server/release/dist/ballisticakit_headless": "445c881f3bf3f15ee18b9f2851d539a1",
|
||||
"build/prefab/full/mac_x86_64_gui/debug/ballisticakit": "24448c4f51332f9b26bbb45122558378",
|
||||
"build/prefab/full/mac_x86_64_gui/release/ballisticakit": "17d7bd762d07d42fca435a8af6313489",
|
||||
"build/prefab/full/mac_x86_64_server/debug/dist/ballisticakit_headless": "2e3c4e3d0f2cc6b2f9380c1e85d1a9bc",
|
||||
"build/prefab/full/mac_x86_64_server/release/dist/ballisticakit_headless": "4996a4ab92124ee8217f044c7294b5f7",
|
||||
"build/prefab/full/windows_x86_gui/debug/BallisticaKit.exe": "664c2f20b66222a73caf467c03ab64d3",
|
||||
"build/prefab/full/windows_x86_gui/release/BallisticaKit.exe": "0e8e3deae9c657022c4ccb419744420e",
|
||||
"build/prefab/full/windows_x86_server/debug/dist/BallisticaKitHeadless.exe": "dc511e79e8c4713aeadda840ec3e6eee",
|
||||
"build/prefab/full/windows_x86_server/release/dist/BallisticaKitHeadless.exe": "c982c13f6664640c3d1c768112064116",
|
||||
"build/prefab/lib/linux_arm64_gui/debug/libballisticaplus.a": "4e0f966529a69bf8da66cb2ee1c39aeb",
|
||||
"build/prefab/lib/linux_arm64_gui/release/libballisticaplus.a": "5d5c02fb0a49991b0d1d987666e47702",
|
||||
"build/prefab/lib/linux_arm64_server/debug/libballisticaplus.a": "4e0f966529a69bf8da66cb2ee1c39aeb",
|
||||
"build/prefab/lib/linux_arm64_server/release/libballisticaplus.a": "5d5c02fb0a49991b0d1d987666e47702",
|
||||
"build/prefab/lib/linux_x86_64_gui/debug/libballisticaplus.a": "6dd00a2f521e1bb12f1c7d92ce6b28e6",
|
||||
"build/prefab/lib/linux_x86_64_gui/release/libballisticaplus.a": "c6fdeeca50279426b474b9cd1a3afd2b",
|
||||
"build/prefab/lib/linux_x86_64_server/debug/libballisticaplus.a": "6dd00a2f521e1bb12f1c7d92ce6b28e6",
|
||||
"build/prefab/lib/linux_x86_64_server/release/libballisticaplus.a": "c6fdeeca50279426b474b9cd1a3afd2b",
|
||||
"build/prefab/lib/mac_arm64_gui/debug/libballisticaplus.a": "296b14a0b2bccf309e314ec1f2175318",
|
||||
"build/prefab/lib/mac_arm64_gui/release/libballisticaplus.a": "7296cb71fc42baece5e1bc23121104be",
|
||||
"build/prefab/lib/mac_arm64_server/debug/libballisticaplus.a": "296b14a0b2bccf309e314ec1f2175318",
|
||||
"build/prefab/lib/mac_arm64_server/release/libballisticaplus.a": "7296cb71fc42baece5e1bc23121104be",
|
||||
"build/prefab/lib/mac_x86_64_gui/debug/libballisticaplus.a": "19dfba8beca806f8155f952bbfab583d",
|
||||
"build/prefab/lib/mac_x86_64_gui/release/libballisticaplus.a": "076f47790cb474f2aaf18417c0c8f803",
|
||||
"build/prefab/lib/mac_x86_64_server/debug/libballisticaplus.a": "cfc62fad488ae4033175f3b1ad022e6f",
|
||||
"build/prefab/lib/mac_x86_64_server/release/libballisticaplus.a": "076f47790cb474f2aaf18417c0c8f803",
|
||||
"build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.lib": "1b5a88065df858440c5c80f274c0f735",
|
||||
"build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.pdb": "35329f3c346807358b04100826d9d8aa",
|
||||
"build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.lib": "68a26ca4930f3559121dc7c8495d0b73",
|
||||
"build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.pdb": "d4e13a16abf9ace1c358b5f1889e2087",
|
||||
"build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.lib": "f3f9a07fd501e22a9646cd4815278c29",
|
||||
"build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.pdb": "a214f5e09f1c7b4d0674998ba0f8f3e9",
|
||||
"build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.lib": "a46e145296dfa7691dd415ba9309398d",
|
||||
"build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.pdb": "3d77b8e9feb58884fdefe0f5047d6480",
|
||||
"src/assets/ba_data/python/babase/_mgen/__init__.py": "f885fed7f2ed98ff2ba271f9dbe3391c",
|
||||
"src/assets/ba_data/python/babase/_mgen/enums.py": "794d258d59fd17a61752843a9a0551ad",
|
||||
"src/ballistica/base/mgen/pyembed/binding_base.inc": "3a583e7e03bd4907b21adc3bf5729d15",
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
### 1.7.37 (build 22076, api 9, 2024-11-06)
|
||||
### 1.7.37 (build 22077, api 9, 2024-11-07)
|
||||
- Bumping api version to 9. As you'll see below, there's some UI changes that
|
||||
will require a bit of work for any UI mods to adapt to. If your mods don't
|
||||
touch UI stuff at all you can simply bump your api version and call it a day.
|
||||
|
||||
@ -506,7 +506,7 @@ class DevConsoleTabLogging(DevConsoleTab):
|
||||
size=(bwidth - 2.0, height - 10),
|
||||
label_scale=btextscale,
|
||||
style=(
|
||||
'blue_bright'
|
||||
'white_bright'
|
||||
if level == logging.DEBUG
|
||||
else 'blue' if effectivelevel <= logging.DEBUG else 'black'
|
||||
),
|
||||
@ -536,7 +536,7 @@ class DevConsoleTabLogging(DevConsoleTab):
|
||||
size=(bwidth - 2.0, height - 10),
|
||||
label_scale=btextscale,
|
||||
style=(
|
||||
'yellow_bright'
|
||||
'white_bright'
|
||||
if level == logging.WARNING
|
||||
else 'yellow' if effectivelevel <= logging.WARNING else 'black'
|
||||
),
|
||||
@ -551,7 +551,7 @@ class DevConsoleTabLogging(DevConsoleTab):
|
||||
size=(bwidth - 2.0, height - 10),
|
||||
label_scale=btextscale,
|
||||
style=(
|
||||
'red_bright'
|
||||
'white_bright'
|
||||
if level == logging.ERROR
|
||||
else 'red' if effectivelevel <= logging.ERROR else 'black'
|
||||
),
|
||||
@ -566,7 +566,7 @@ class DevConsoleTabLogging(DevConsoleTab):
|
||||
size=(bwidth - 2.0, height - 10),
|
||||
label_scale=btextscale,
|
||||
style=(
|
||||
'purple_bright'
|
||||
'white_bright'
|
||||
if level == logging.CRITICAL
|
||||
else (
|
||||
'purple' if effectivelevel <= logging.CRITICAL else 'black'
|
||||
|
||||
@ -53,7 +53,7 @@ if TYPE_CHECKING:
|
||||
|
||||
# Build number and version of the ballistica binary we expect to be
|
||||
# using.
|
||||
TARGET_BALLISTICA_BUILD = 22076
|
||||
TARGET_BALLISTICA_BUILD = 22077
|
||||
TARGET_BALLISTICA_VERSION = '1.7.37'
|
||||
|
||||
|
||||
|
||||
@ -33,10 +33,18 @@ if TYPE_CHECKING:
|
||||
from types import FrameType
|
||||
from bacommon.servermanager import ServerCommand
|
||||
|
||||
VERSION_STR = '1.3.2'
|
||||
VERSION_STR = '1.3.3'
|
||||
|
||||
# Version history:
|
||||
#
|
||||
# 1.3.3
|
||||
#
|
||||
# - Added log_levels dict in server config for setting levels on
|
||||
# individual loggers within the server binary. Can be useful for
|
||||
# debugging issues or just keeping better track of what the server is
|
||||
# up to. Check the logging tab in the dev console in the graphical
|
||||
# client to learn which loggers are available.
|
||||
#
|
||||
# 1.3.2
|
||||
#
|
||||
# - Updated to use Python 3.12.
|
||||
|
||||
@ -2,6 +2,10 @@
|
||||
|
||||
#include "ballistica/base/assets/asset.h"
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "ballistica/core/platform/core_platform.h" // IWYU pragma: keep.
|
||||
|
||||
namespace ballistica::base {
|
||||
|
||||
Asset::Asset() {
|
||||
@ -10,10 +14,42 @@ Asset::Asset() {
|
||||
last_used_time_ = g_core->GetAppTimeMillisecs();
|
||||
}
|
||||
|
||||
auto Asset::AssetTypeName(AssetType assettype) -> const char* {
|
||||
const char* asset_type_name{"unknown"};
|
||||
switch (assettype) {
|
||||
case AssetType::kCollisionMesh:
|
||||
asset_type_name = "collision-mesh";
|
||||
break;
|
||||
case AssetType::kMesh:
|
||||
asset_type_name = "mesh";
|
||||
break;
|
||||
case AssetType::kData:
|
||||
asset_type_name = "data";
|
||||
break;
|
||||
case AssetType::kSound:
|
||||
asset_type_name = "sound";
|
||||
break;
|
||||
case AssetType::kTexture:
|
||||
asset_type_name = "texture";
|
||||
break;
|
||||
case AssetType::kLast:
|
||||
break;
|
||||
}
|
||||
return asset_type_name;
|
||||
}
|
||||
|
||||
void Asset::ObjectPostInit() {
|
||||
g_core->Log(LogName::kBaAssets, LogLevel::kInfo, [this] {
|
||||
return std::string("allocating ") + AssetTypeName(GetAssetType()) + " "
|
||||
+ GetName();
|
||||
});
|
||||
Object::ObjectPostInit();
|
||||
}
|
||||
|
||||
Asset::~Asset() {
|
||||
// at the moment whoever owns the last reference to us
|
||||
// needs to make sure to unload us before we die..
|
||||
// I feel like there should be a more elegant solution to that.
|
||||
// at the moment whoever owns the last reference to us needs to make sure
|
||||
// to unload us before we die. I feel like there should be a more elegant
|
||||
// solution to that.
|
||||
assert(g_base && g_base->assets);
|
||||
assert(!locked());
|
||||
assert(!loaded());
|
||||
@ -25,6 +61,10 @@ void Asset::Preload(bool already_locked) {
|
||||
if (!preloaded_) {
|
||||
assert(!loaded_);
|
||||
BA_PRECONDITION(locked());
|
||||
g_core->Log(LogName::kBaAssets, LogLevel::kDebug, [this] {
|
||||
return std::string("preloading ") + AssetTypeName(GetAssetType()) + " "
|
||||
+ GetName();
|
||||
});
|
||||
preload_start_time_ = g_core->GetAppTimeMillisecs();
|
||||
DoPreload();
|
||||
preload_end_time_ = g_core->GetAppTimeMillisecs();
|
||||
@ -43,6 +83,10 @@ void Asset::Load(bool already_locked) {
|
||||
assert(preloaded_ && !loaded_);
|
||||
BA_DEBUG_FUNCTION_TIMER_BEGIN();
|
||||
BA_PRECONDITION(locked());
|
||||
g_core->Log(LogName::kBaAssets, LogLevel::kDebug, [this] {
|
||||
return std::string("loading ") + AssetTypeName(GetAssetType()) + " "
|
||||
+ GetName();
|
||||
});
|
||||
load_start_time_ = g_core->GetAppTimeMillisecs();
|
||||
DoLoad();
|
||||
load_end_time_ = g_core->GetAppTimeMillisecs();
|
||||
|
||||
@ -7,7 +7,6 @@
|
||||
#include <string>
|
||||
|
||||
#include "ballistica/base/base.h"
|
||||
#include "ballistica/core/platform/core_platform.h"
|
||||
#include "ballistica/shared/foundation/object.h"
|
||||
|
||||
namespace ballistica::base {
|
||||
@ -19,10 +18,14 @@ namespace ballistica::base {
|
||||
class Asset : public Object {
|
||||
public:
|
||||
Asset();
|
||||
void ObjectPostInit() override;
|
||||
~Asset() override;
|
||||
|
||||
virtual auto GetAssetType() const -> AssetType = 0;
|
||||
|
||||
/// Get a human readable name for an AssetType.
|
||||
static auto AssetTypeName(AssetType assettype) -> const char*;
|
||||
|
||||
void Preload(bool already_locked = false);
|
||||
void Load(bool already_locked = false);
|
||||
void Unload(bool already_locked = false);
|
||||
|
||||
@ -23,6 +23,7 @@
|
||||
#include "ballistica/base/logic/logic.h"
|
||||
#include "ballistica/base/python/base_python.h"
|
||||
#include "ballistica/base/ui/ui.h"
|
||||
#include "ballistica/core/platform/core_platform.h"
|
||||
#include "ballistica/shared/foundation/event_loop.h"
|
||||
#include "ballistica/shared/generic/json.h"
|
||||
#include "ballistica/shared/python/python.h"
|
||||
|
||||
@ -10,6 +10,7 @@
|
||||
#include "ballistica/base/assets/assets.h"
|
||||
#include "ballistica/base/graphics/graphics.h"
|
||||
#include "ballistica/base/support/huffman.h"
|
||||
#include "ballistica/core/platform/core_platform.h"
|
||||
#include "ballistica/shared/foundation/event_loop.h"
|
||||
|
||||
namespace ballistica::base {
|
||||
@ -21,23 +22,23 @@ void AssetsServer::OnMainThreadStartApp() {
|
||||
event_loop_ = new EventLoop(EventLoopID::kAssets);
|
||||
g_core->suspendable_event_loops.push_back(event_loop_);
|
||||
|
||||
event_loop_->PushCallSynchronous([this] { OnAppStartInThread(); });
|
||||
event_loop_->PushCallSynchronous([this] { OnAppStartInThread_(); });
|
||||
}
|
||||
|
||||
void AssetsServer::OnAppStartInThread() {
|
||||
void AssetsServer::OnAppStartInThread_() {
|
||||
assert(g_base->InAssetsThread());
|
||||
// Ask our thread to give us periodic processing time (close to but
|
||||
// not *exactly* one second; try to avoid aliasing with similar updates).
|
||||
// Ask our thread to give us periodic processing time (close to but not
|
||||
// *exactly* one second; try to avoid aliasing with similar updates).
|
||||
process_timer_ = event_loop()->NewTimer(
|
||||
987 * 1000, true, NewLambdaRunnable([this] { Process(); }).Get());
|
||||
987 * 1000, true, NewLambdaRunnable([this] { Process_(); }).Get());
|
||||
}
|
||||
|
||||
void AssetsServer::PushPendingPreload(Object::Ref<Asset>* asset_ref_ptr) {
|
||||
event_loop()->PushCall([this, asset_ref_ptr] {
|
||||
assert(g_base->InAssetsThread());
|
||||
|
||||
// Add our pointer to one of the preload lists and shake our preload thread
|
||||
// to wake it up
|
||||
// Add our pointer to one of the preload lists and shake our preload
|
||||
// thread to wake it up
|
||||
if ((**asset_ref_ptr).GetAssetType() == AssetType::kSound) {
|
||||
pending_preloads_audio_.push_back(asset_ref_ptr);
|
||||
} else {
|
||||
@ -59,7 +60,7 @@ void AssetsServer::PushBeginWriteReplayCall(uint16_t protocol_version) {
|
||||
g_core->Log(
|
||||
LogName::kBaAssets, LogLevel::kError,
|
||||
"AssetsServer got BeginWriteReplayCall while already writing");
|
||||
WriteReplayMessages();
|
||||
WriteReplayMessages_();
|
||||
if (replay_out_file_) {
|
||||
fclose(replay_out_file_);
|
||||
}
|
||||
@ -96,8 +97,8 @@ void AssetsServer::PushBeginWriteReplayCall(uint16_t protocol_version) {
|
||||
replay_bytes_written_ = 5;
|
||||
}
|
||||
|
||||
// Trigger our process timer to go off immediately
|
||||
// (we may need to wake it up).
|
||||
// Trigger our process timer to go off immediately (we may need to wake
|
||||
// it up).
|
||||
g_base->assets_server->process_timer_->SetLength(0);
|
||||
});
|
||||
}
|
||||
@ -150,7 +151,7 @@ void AssetsServer::PushEndWriteReplayCall() {
|
||||
replays_broken_ = true;
|
||||
return;
|
||||
}
|
||||
WriteReplayMessages();
|
||||
WriteReplayMessages_();
|
||||
|
||||
// Whether or not we actually have a file has no impact on our
|
||||
// writing_replay_ status.
|
||||
@ -162,7 +163,7 @@ void AssetsServer::PushEndWriteReplayCall() {
|
||||
});
|
||||
}
|
||||
|
||||
void AssetsServer::WriteReplayMessages() {
|
||||
void AssetsServer::WriteReplayMessages_() {
|
||||
if (replay_out_file_) {
|
||||
for (auto&& i : replay_messages_) {
|
||||
std::vector<uint8_t> data_compressed = g_base->huffman->compress(i);
|
||||
@ -189,7 +190,7 @@ void AssetsServer::WriteReplayMessages() {
|
||||
return;
|
||||
}
|
||||
}
|
||||
// write 16 bit val if need be..
|
||||
// write 16 bit val if need be.
|
||||
if (len32 >= 254) {
|
||||
if (len32 <= 65535) {
|
||||
auto len16 = static_cast_check_fit<uint16_t>(len32);
|
||||
@ -230,20 +231,20 @@ void AssetsServer::WriteReplayMessages() {
|
||||
}
|
||||
}
|
||||
|
||||
void AssetsServer::Process() {
|
||||
void AssetsServer::Process_() {
|
||||
// Make sure we don't do any loading until we know what kind/quality of
|
||||
// textures we'll be loading.
|
||||
|
||||
// FIXME - we'll need to revisit this when adding support for
|
||||
// renderer switches, since this is not especially thread-safe.
|
||||
// FIXME - we'll need to revisit this when adding support for renderer
|
||||
// switches, since this is not especially thread-safe.
|
||||
|
||||
if (!g_base->graphics->has_client_context()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Process exactly 1 preload item. Empty out our non-audio list first
|
||||
// (audio is less likely to cause noticeable hitches if it needs to be loaded
|
||||
// on-demand, so that's a lower priority for us).
|
||||
// (audio is less likely to cause noticeable hitches if it needs to be
|
||||
// loaded on-demand, so that's a lower priority for us).
|
||||
if (!pending_preloads_.empty()) {
|
||||
(**pending_preloads_.back()).Preload();
|
||||
// Pass the ref-pointer along to the load queue.
|
||||
@ -258,11 +259,11 @@ void AssetsServer::Process() {
|
||||
|
||||
// If we're writing a replay, dump anything we've got built up.
|
||||
if (writing_replay_) {
|
||||
WriteReplayMessages();
|
||||
WriteReplayMessages_();
|
||||
}
|
||||
|
||||
// If we've got nothing left, set our timer to go off every now and then if
|
||||
// we're writing a replay.. otherwise just sleep indefinitely.
|
||||
// If we've got nothing left, set our timer to go off every now and then
|
||||
// if we're writing a replay.. otherwise just sleep indefinitely.
|
||||
if (pending_preloads_.empty() && pending_preloads_audio_.empty()) {
|
||||
if (writing_replay_) {
|
||||
process_timer_->SetLength(1000 * 1000);
|
||||
|
||||
@ -23,19 +23,20 @@ class AssetsServer {
|
||||
auto event_loop() const -> EventLoop* { return event_loop_; }
|
||||
|
||||
private:
|
||||
void OnAppStartInThread();
|
||||
void Process();
|
||||
void WriteReplayMessages();
|
||||
EventLoop* event_loop_{};
|
||||
FILE* replay_out_file_{};
|
||||
size_t replay_bytes_written_{};
|
||||
bool writing_replay_{};
|
||||
bool replays_broken_{};
|
||||
void OnAppStartInThread_();
|
||||
void Process_();
|
||||
void WriteReplayMessages_();
|
||||
|
||||
std::list<std::vector<uint8_t> > replay_messages_;
|
||||
size_t replay_message_bytes_{};
|
||||
Timer* process_timer_{};
|
||||
std::vector<Object::Ref<Asset>*> pending_preloads_;
|
||||
std::vector<Object::Ref<Asset>*> pending_preloads_audio_;
|
||||
EventLoop* event_loop_{};
|
||||
FILE* replay_out_file_{};
|
||||
Timer* process_timer_{};
|
||||
size_t replay_bytes_written_{};
|
||||
size_t replay_message_bytes_{};
|
||||
bool writing_replay_{};
|
||||
bool replays_broken_{};
|
||||
};
|
||||
|
||||
} // namespace ballistica::base
|
||||
|
||||
@ -7,6 +7,7 @@
|
||||
|
||||
#include "ballistica/base/assets/assets.h"
|
||||
#include "ballistica/core/core.h"
|
||||
#include "ballistica/core/platform/core_platform.h"
|
||||
|
||||
namespace ballistica::base {
|
||||
|
||||
@ -23,11 +24,7 @@ auto CollisionMeshAsset::GetAssetType() const -> AssetType {
|
||||
}
|
||||
|
||||
auto CollisionMeshAsset::GetName() const -> std::string {
|
||||
if (!file_name_full_.empty()) {
|
||||
return file_name_full_;
|
||||
} else {
|
||||
return "invalid CollisionMesh";
|
||||
}
|
||||
return (!file_name_.empty()) ? file_name_ : "invalid collision mesh";
|
||||
}
|
||||
|
||||
void CollisionMeshAsset::DoPreload() {
|
||||
|
||||
@ -22,11 +22,7 @@ DataAsset::DataAsset(const std::string& file_name_in)
|
||||
auto DataAsset::GetAssetType() const -> AssetType { return AssetType::kData; }
|
||||
|
||||
auto DataAsset::GetName() const -> std::string {
|
||||
if (!file_name_full_.empty()) {
|
||||
return file_name_full_;
|
||||
} else {
|
||||
return "invalid data";
|
||||
}
|
||||
return (!file_name_.empty()) ? file_name_ : "invalid data";
|
||||
}
|
||||
|
||||
void DataAsset::DoPreload() {
|
||||
|
||||
@ -10,6 +10,7 @@
|
||||
#include "ballistica/base/graphics/graphics_server.h"
|
||||
#include "ballistica/base/graphics/renderer/renderer.h"
|
||||
#include "ballistica/core/core.h"
|
||||
#include "ballistica/core/platform/core_platform.h"
|
||||
|
||||
namespace ballistica::base {
|
||||
|
||||
@ -23,11 +24,7 @@ MeshAsset::MeshAsset(const std::string& file_name_in)
|
||||
auto MeshAsset::GetAssetType() const -> AssetType { return AssetType::kMesh; }
|
||||
|
||||
auto MeshAsset::GetName() const -> std::string {
|
||||
if (!file_name_full_.empty()) {
|
||||
return file_name_full_;
|
||||
} else {
|
||||
return "invalid mesh";
|
||||
}
|
||||
return (!file_name_.empty()) ? file_name_ : "invalid mesh";
|
||||
}
|
||||
|
||||
void MeshAsset::DoPreload() {
|
||||
|
||||
@ -19,6 +19,7 @@
|
||||
#include "ballistica/base/audio/audio_server.h"
|
||||
#include "ballistica/base/python/base_python.h"
|
||||
#include "ballistica/core/core.h"
|
||||
#include "ballistica/core/platform/core_platform.h"
|
||||
|
||||
// Need to move away from OpenAL on Apple stuff.
|
||||
#if __clang__
|
||||
@ -260,11 +261,7 @@ SoundAsset::SoundAsset(const std::string& file_name_in)
|
||||
auto SoundAsset::GetAssetType() const -> AssetType { return AssetType::kSound; }
|
||||
|
||||
auto SoundAsset::GetName() const -> std::string {
|
||||
if (!file_name_full_.empty()) {
|
||||
return file_name_full_;
|
||||
} else {
|
||||
return "invalid sound";
|
||||
}
|
||||
return (!file_name_.empty()) ? file_name_ : "invalid sound";
|
||||
}
|
||||
|
||||
void SoundAsset::DoPreload() {
|
||||
|
||||
@ -19,6 +19,7 @@
|
||||
#include "ballistica/base/graphics/texture/dds.h"
|
||||
#include "ballistica/base/graphics/texture/ktx.h"
|
||||
#include "ballistica/base/graphics/texture/pvr.h"
|
||||
#include "ballistica/core/platform/core_platform.h"
|
||||
#include "external/qr_code_generator/QrCode.hpp"
|
||||
|
||||
namespace ballistica::base {
|
||||
@ -88,7 +89,7 @@ TextureAsset::TextureAsset(const std::string& qr_url) : is_qr_code_(true) {
|
||||
valid_ = true;
|
||||
}
|
||||
|
||||
TextureAsset::~TextureAsset() = default;
|
||||
TextureAsset::~TextureAsset() {}
|
||||
|
||||
auto TextureAsset::GetName() const -> std::string {
|
||||
return (!file_name_.empty()) ? file_name_ : "invalid texture";
|
||||
|
||||
@ -15,6 +15,7 @@ class TextureAsset : public Asset {
|
||||
public:
|
||||
TextureAsset();
|
||||
~TextureAsset() override;
|
||||
|
||||
// Pass a newly allocated TextPacker pointer here; TextureData takes ownership
|
||||
// and handles cleaning it up.
|
||||
explicit TextureAsset(TextPacker* packer);
|
||||
|
||||
@ -8,6 +8,7 @@
|
||||
#include "ballistica/base/audio/audio_source.h"
|
||||
#include "ballistica/base/graphics/graphics.h"
|
||||
#include "ballistica/base/support/app_config.h"
|
||||
#include "ballistica/core/platform/core_platform.h" // IWYU pragma: keep.
|
||||
#include "ballistica/shared/foundation/event_loop.h"
|
||||
|
||||
namespace ballistica::base {
|
||||
|
||||
@ -27,6 +27,7 @@
|
||||
#include "ballistica/base/audio/ogg_stream.h"
|
||||
#include "ballistica/base/logic/logic.h"
|
||||
#include "ballistica/core/core.h"
|
||||
#include "ballistica/core/platform/core_platform.h"
|
||||
#include "ballistica/shared/foundation/event_loop.h"
|
||||
#include "ballistica/shared/math/vector3f.h"
|
||||
|
||||
|
||||
@ -6,6 +6,7 @@
|
||||
#include "ballistica/base/audio/audio.h"
|
||||
#include "ballistica/base/audio/audio_server.h"
|
||||
#include "ballistica/core/core.h"
|
||||
#include "ballistica/core/platform/core_platform.h" // IWYU pragma: keep.
|
||||
#include "ballistica/shared/math/vector3f.h"
|
||||
|
||||
namespace ballistica::base {
|
||||
|
||||
@ -31,6 +31,7 @@
|
||||
#include "ballistica/base/support/plus_soft.h"
|
||||
#include "ballistica/base/support/stdio_console.h"
|
||||
#include "ballistica/base/ui/ui_delegate.h"
|
||||
#include "ballistica/core/platform/core_platform.h"
|
||||
#include "ballistica/shared/foundation/event_loop.h"
|
||||
#include "ballistica/shared/foundation/logging.h"
|
||||
#include "ballistica/shared/generic/utils.h"
|
||||
|
||||
@ -18,6 +18,7 @@
|
||||
#include "ballistica/base/graphics/mesh/mesh_indexed_simple_full.h"
|
||||
#include "ballistica/base/graphics/mesh/mesh_indexed_smoke_full.h"
|
||||
#include "ballistica/base/graphics/mesh/sprite_mesh.h"
|
||||
#include "ballistica/core/platform/core_platform.h" // IWYU pragma: keep.
|
||||
#include "ballistica/shared/foundation/event_loop.h"
|
||||
|
||||
namespace ballistica::base {
|
||||
|
||||
@ -16,6 +16,7 @@
|
||||
#include "ballistica/base/dynamics/collision_cache.h"
|
||||
#include "ballistica/base/graphics/graphics.h"
|
||||
#include "ballistica/base/logic/logic.h"
|
||||
#include "ballistica/core/platform/core_platform.h" // IWYU pragma: keep.
|
||||
#include "ballistica/shared/foundation/event_loop.h"
|
||||
#include "ballistica/shared/generic/utils.h"
|
||||
|
||||
|
||||
@ -10,6 +10,7 @@
|
||||
#include "ballistica/base/graphics/graphics.h"
|
||||
#include "ballistica/base/graphics/renderer/renderer.h"
|
||||
#include "ballistica/base/logic/logic.h"
|
||||
#include "ballistica/core/platform/core_platform.h"
|
||||
#include "ballistica/shared/foundation/event_loop.h"
|
||||
|
||||
namespace ballistica::base {
|
||||
|
||||
@ -18,6 +18,7 @@
|
||||
#include "ballistica/base/python/base_python.h"
|
||||
#include "ballistica/base/ui/dev_console.h"
|
||||
#include "ballistica/base/ui/ui.h"
|
||||
#include "ballistica/core/platform/core_platform.h"
|
||||
#include "ballistica/shared/foundation/event_loop.h"
|
||||
#include "ballistica/shared/generic/utils.h"
|
||||
|
||||
|
||||
@ -21,6 +21,7 @@
|
||||
#include "ballistica/base/support/stdio_console.h"
|
||||
#include "ballistica/base/ui/dev_console.h"
|
||||
#include "ballistica/base/ui/ui.h"
|
||||
#include "ballistica/core/platform/core_platform.h"
|
||||
#include "ballistica/shared/foundation/event_loop.h"
|
||||
|
||||
namespace ballistica::base {
|
||||
|
||||
@ -16,6 +16,7 @@
|
||||
#include "ballistica/base/python/support/python_context_call_runnable.h"
|
||||
#include "ballistica/base/ui/dev_console.h"
|
||||
#include "ballistica/base/ui/ui.h"
|
||||
#include "ballistica/core/platform/core_platform.h"
|
||||
#include "ballistica/shared/foundation/event_loop.h"
|
||||
#include "ballistica/shared/foundation/logging.h"
|
||||
#include "ballistica/shared/python/python.h"
|
||||
|
||||
@ -18,8 +18,9 @@
|
||||
#include "ballistica/base/support/app_config.h"
|
||||
#include "ballistica/base/ui/dev_console.h"
|
||||
#include "ballistica/base/ui/ui.h"
|
||||
#include "ballistica/core/platform/core_platform.h"
|
||||
#include "ballistica/shared/foundation/macros.h"
|
||||
#include "ballistica/shared/generic/native_stack_trace.h"
|
||||
#include "ballistica/shared/generic/native_stack_trace.h" // IWYU pragma: keep.
|
||||
#include "ballistica/shared/generic/utils.h"
|
||||
|
||||
namespace ballistica::base {
|
||||
|
||||
@ -372,9 +372,9 @@ class DevConsole::Button_ : public DevConsole::Widget_ {
|
||||
break;
|
||||
case DevButtonStyle_::kWhiteBright:
|
||||
fgcolor =
|
||||
pressed ? Vector3f{1.0f, 1.0f, 1.0f} : Vector3f{0.0f, 0.0f, 0.0f};
|
||||
pressed ? Vector3f{0.0f, 0.0f, 0.0f} : Vector3f{0.0f, 0.0f, 0.0f};
|
||||
bgcolor =
|
||||
pressed ? Vector3f{0.4f, 0.4f, 0.4f} : Vector3f{0.8, 0.7f, 0.8f};
|
||||
pressed ? Vector3f{1.0f, 1.0f, 1.0f} : Vector3f{0.9, 0.85f, 0.95f};
|
||||
break;
|
||||
case DevButtonStyle_::kBlack:
|
||||
fgcolor =
|
||||
|
||||
@ -15,6 +15,7 @@
|
||||
#include "ballistica/base/support/app_config.h"
|
||||
#include "ballistica/base/ui/dev_console.h"
|
||||
#include "ballistica/base/ui/ui_delegate.h"
|
||||
#include "ballistica/core/platform/core_platform.h"
|
||||
#include "ballistica/shared/foundation/event_loop.h"
|
||||
#include "ballistica/shared/foundation/macros.h"
|
||||
#include "ballistica/shared/generic/utils.h"
|
||||
|
||||
@ -15,6 +15,7 @@
|
||||
#include "ballistica/base/networking/networking.h"
|
||||
#include "ballistica/base/support/app_config.h"
|
||||
#include "ballistica/base/support/plus_soft.h"
|
||||
#include "ballistica/core/platform/core_platform.h"
|
||||
#include "ballistica/scene_v1/connection/connection_set.h"
|
||||
#include "ballistica/scene_v1/connection/connection_to_client.h"
|
||||
#include "ballistica/scene_v1/connection/connection_to_host.h"
|
||||
|
||||
@ -82,11 +82,6 @@ void CoreConfig::ApplyEnvVars() {
|
||||
// controlling log-levels via env-vars we should come up with a unified
|
||||
// system for that.
|
||||
|
||||
// if (auto* envval = getenv("BA_LIFECYCLE_LOG")) {
|
||||
// if (!strcmp(envval, "1")) {
|
||||
// lifecycle_log = true;
|
||||
// }
|
||||
// }
|
||||
if (auto* envval = getenv("BA_DEBUGGER_ATTACHED")) {
|
||||
if (!strcmp(envval, "1")) {
|
||||
debugger_attached = true;
|
||||
|
||||
@ -4,6 +4,7 @@
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "ballistica/base/assets/assets.h"
|
||||
#include "ballistica/scene_v1/python/class/python_class_scene_mesh.h"
|
||||
#include "ballistica/scene_v1/support/scene.h"
|
||||
#include "ballistica/scene_v1/support/session_stream.h"
|
||||
|
||||
@ -4,14 +4,9 @@
|
||||
#define BALLISTICA_SCENE_V1_ASSETS_SCENE_MESH_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "ballistica/base/assets/asset.h"
|
||||
#include "ballistica/base/assets/assets.h"
|
||||
#include "ballistica/base/assets/mesh_asset.h"
|
||||
#include "ballistica/base/assets/mesh_asset_renderer_data.h"
|
||||
#include "ballistica/scene_v1/assets/scene_asset.h"
|
||||
#include "ballistica/shared/ballistica.h"
|
||||
#include "ballistica/shared/foundation/object.h"
|
||||
|
||||
namespace ballistica::scene_v1 {
|
||||
|
||||
@ -5,6 +5,7 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "ballistica/base/assets/assets.h"
|
||||
#include "ballistica/base/graphics/component/simple_component.h"
|
||||
#include "ballistica/core/core.h"
|
||||
#include "ballistica/scene_v1/node/node_attribute.h"
|
||||
|
||||
@ -12,6 +12,7 @@
|
||||
#include "ballistica/base/python/base_python.h"
|
||||
#include "ballistica/base/python/support/python_context_call.h"
|
||||
#include "ballistica/classic/support/classic_app_mode.h"
|
||||
#include "ballistica/core/platform/core_platform.h"
|
||||
#include "ballistica/scene_v1/assets/scene_data_asset.h"
|
||||
#include "ballistica/scene_v1/assets/scene_mesh.h"
|
||||
#include "ballistica/scene_v1/assets/scene_sound.h"
|
||||
|
||||
@ -39,7 +39,7 @@ auto main(int argc, char** argv) -> int {
|
||||
namespace ballistica {
|
||||
|
||||
// These are set automatically via script; don't modify them here.
|
||||
const int kEngineBuildNumber = 22076;
|
||||
const int kEngineBuildNumber = 22077;
|
||||
const char* kEngineVersion = "1.7.37";
|
||||
const int kEngineApiVersion = 9;
|
||||
|
||||
|
||||
@ -85,6 +85,14 @@ Object::~Object() {
|
||||
}
|
||||
}
|
||||
|
||||
void Object::ObjectPostInit() {
|
||||
#if BA_DEBUG_BUILD
|
||||
// Flag this here in the top level post-init so we can ensure that classes
|
||||
// are properly calling parent class post-inits.
|
||||
object_is_post_inited_ = true;
|
||||
#endif
|
||||
}
|
||||
|
||||
auto Object::GetObjectTypeName() const -> std::string {
|
||||
// Default implementation just returns type name.
|
||||
if (g_core) {
|
||||
|
||||
@ -50,6 +50,12 @@ class Object {
|
||||
|
||||
#endif
|
||||
|
||||
/// Called on newly constructed objects by the various New() methods. This
|
||||
/// allows classes to run code after their full class heirarchy has been
|
||||
/// constructed, meaning things like virtual functions will work as
|
||||
/// expected.
|
||||
virtual void ObjectPostInit();
|
||||
|
||||
/// Called by the default ObjectThreadCheck() to determine ownership for
|
||||
/// an Object. By default, an object is owned by a specific thread,
|
||||
/// defaulting to the logic thread.
|
||||
@ -567,6 +573,7 @@ class Object {
|
||||
template <typename TRETURN, typename TALLOC = TRETURN, typename... ARGS>
|
||||
[[nodiscard]] static auto New(ARGS&&... args) -> Object::Ref<TRETURN> {
|
||||
auto* ptr = new TALLOC(std::forward<ARGS>(args)...);
|
||||
|
||||
#if BA_DEBUG_BUILD
|
||||
/// Objects assume they are statically allocated by default; it's up
|
||||
/// to us to tell them when they're not.
|
||||
@ -579,7 +586,16 @@ class Object {
|
||||
+ ptr->GetObjectDescription());
|
||||
}
|
||||
ptr->object_is_ref_counted_ = true;
|
||||
assert(!ptr->object_is_post_inited_);
|
||||
#endif
|
||||
|
||||
ptr->ObjectPostInit();
|
||||
|
||||
#if BA_DEBUG_BUILD
|
||||
// Make sure top level post-init was called.
|
||||
assert(ptr->object_is_post_inited_);
|
||||
#endif
|
||||
|
||||
return Object::Ref<TRETURN>(ptr);
|
||||
}
|
||||
|
||||
@ -595,6 +611,7 @@ class Object {
|
||||
template <typename T, typename... ARGS>
|
||||
[[nodiscard]] static auto NewDeferred(ARGS&&... args) -> T* {
|
||||
T* ptr = new T(std::forward<ARGS>(args)...);
|
||||
|
||||
#if BA_DEBUG_BUILD
|
||||
/// Objects assume they are statically allocated by default; it's up
|
||||
/// to us to tell them when they're not.
|
||||
@ -608,7 +625,16 @@ class Object {
|
||||
+ ptr->GetObjectDescription());
|
||||
}
|
||||
ptr->object_is_pending_deferred_ = true;
|
||||
assert(!ptr->object_is_post_inited_);
|
||||
#endif
|
||||
|
||||
ptr->ObjectPostInit();
|
||||
|
||||
#if BA_DEBUG_BUILD
|
||||
// Make sure top level post-init was called.
|
||||
assert(ptr->object_is_post_inited_);
|
||||
#endif
|
||||
|
||||
return ptr;
|
||||
}
|
||||
|
||||
@ -636,6 +662,7 @@ class Object {
|
||||
"deferred: "
|
||||
+ ptr->GetObjectDescription());
|
||||
}
|
||||
assert(ptr->object_is_post_inited_);
|
||||
ptr->object_is_pending_deferred_ = false;
|
||||
ptr->object_is_ref_counted_ = true;
|
||||
#endif
|
||||
@ -645,17 +672,28 @@ class Object {
|
||||
|
||||
/// Allocate an Object with no ref-counting; for use when an object
|
||||
/// will be manually managed/deleted.
|
||||
///
|
||||
/// In debug builds, these objects will complain if attempts are made to
|
||||
/// create strong references to them.
|
||||
template <typename T, typename... ARGS>
|
||||
[[nodiscard]] static auto NewUnmanaged(ARGS&&... args) -> T* {
|
||||
T* ptr = new T(std::forward<ARGS>(args)...);
|
||||
|
||||
#if BA_DEBUG_BUILD
|
||||
/// Objects assume they are statically allocated by default; it's up
|
||||
/// to us to tell them when they're not.
|
||||
ptr->object_is_static_allocated_ = false;
|
||||
ptr->object_is_unmanaged_ = true;
|
||||
assert(!ptr->object_is_post_inited_);
|
||||
#endif
|
||||
|
||||
ptr->ObjectPostInit();
|
||||
|
||||
#if BA_DEBUG_BUILD
|
||||
// Make sure top level post-init was called.
|
||||
assert(ptr->object_is_post_inited_);
|
||||
#endif
|
||||
|
||||
return ptr;
|
||||
}
|
||||
|
||||
@ -675,6 +713,7 @@ class Object {
|
||||
bool object_is_static_allocated_{true};
|
||||
bool object_has_been_strong_reffed_{};
|
||||
bool object_is_ref_counted_{};
|
||||
bool object_is_post_inited_{};
|
||||
bool object_is_pending_deferred_{};
|
||||
bool object_is_unmanaged_{};
|
||||
bool object_is_dead_{};
|
||||
|
||||
@ -11,6 +11,7 @@
|
||||
#include "ballistica/base/graphics/component/empty_component.h"
|
||||
#include "ballistica/base/graphics/component/simple_component.h"
|
||||
#include "ballistica/base/python/support/python_context_call.h"
|
||||
#include "ballistica/core/platform/core_platform.h"
|
||||
|
||||
namespace ballistica::ui_v1 {
|
||||
|
||||
|
||||
@ -8,6 +8,7 @@
|
||||
#include "ballistica/base/graphics/component/empty_component.h"
|
||||
#include "ballistica/base/graphics/component/simple_component.h"
|
||||
#include "ballistica/base/support/app_timer.h"
|
||||
#include "ballistica/core/platform/core_platform.h"
|
||||
#include "ballistica/shared/foundation/inline.h"
|
||||
|
||||
namespace ballistica::ui_v1 {
|
||||
|
||||
@ -8,6 +8,7 @@
|
||||
#include "ballistica/base/graphics/component/empty_component.h"
|
||||
#include "ballistica/base/graphics/component/simple_component.h"
|
||||
#include "ballistica/base/support/app_timer.h"
|
||||
#include "ballistica/core/platform/core_platform.h"
|
||||
|
||||
namespace ballistica::ui_v1 {
|
||||
|
||||
|
||||
@ -21,6 +21,7 @@
|
||||
#include "ballistica/base/platform/base_platform.h"
|
||||
#include "ballistica/base/python/base_python.h"
|
||||
#include "ballistica/base/python/support/python_context_call.h"
|
||||
#include "ballistica/core/platform/core_platform.h"
|
||||
#include "ballistica/shared/generic/utils.h"
|
||||
#include "ballistica/shared/python/python.h"
|
||||
#include "ballistica/ui_v1/python/ui_v1_python.h"
|
||||
|
||||
@ -186,6 +186,11 @@ class ServerConfig:
|
||||
# involving leaving and rejoining or switching teams rapidly.
|
||||
player_rejoin_cooldown: float = 10.0
|
||||
|
||||
# Log levels for particular loggers, overriding the engine's
|
||||
# defaults. Valid values are NOTSET, DEBUG, INFO, WARNING, ERROR, or
|
||||
# CRITICAL.
|
||||
log_levels: dict[str, str] | None = None
|
||||
|
||||
|
||||
# NOTE: as much as possible, communication from the server-manager to
|
||||
# the child-process should go through these and not ad-hoc Python string
|
||||
|
||||
@ -461,8 +461,8 @@ def _get_server_config_template_toml(projroot: str) -> str:
|
||||
|
||||
cfg = ServerConfig()
|
||||
|
||||
# Override some defaults with values we want to display commented
|
||||
# out instead.
|
||||
# Override some defaults with dummy values we want to display
|
||||
# commented out instead.
|
||||
cfg.playlist_code = 12345
|
||||
cfg.stats_url = 'https://mystatssite.com/showstats?player=${ACCOUNT}'
|
||||
cfg.clean_exit_minutes = 60
|
||||
@ -476,6 +476,7 @@ def _get_server_config_template_toml(projroot: str) -> str:
|
||||
cfg.team_colors = ((0.1, 0.25, 1.0), (1.0, 0.25, 0.2))
|
||||
cfg.public_ipv4_address = '123.123.123.123'
|
||||
cfg.public_ipv6_address = '123A::A123:23A1:A312:12A3:A213:2A13'
|
||||
cfg.log_levels = {'ba.lifecycle': 'DEBUG', 'ba.assets': 'DEBUG'}
|
||||
|
||||
lines_in = _get_server_config_raw_contents(projroot).splitlines()
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user