Skip to content

Commit

Permalink
more final tweaks for imminent mac app store update
Browse files Browse the repository at this point in the history
  • Loading branch information
efroemling committed Nov 15, 2023
1 parent f06ad6b commit e377f0b
Show file tree
Hide file tree
Showing 6 changed files with 72 additions and 35 deletions.
56 changes: 28 additions & 28 deletions .efrocachemap

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
### 1.7.28 (build 21588, api 8, 2023-11-13)
### 1.7.28 (build 21596, api 8, 2023-11-14)

- Turning off ticket continues on all platforms. I'll be moving the game towards
a new monetization scheme mostly based on cosmetics and this has always felt a
Expand Down
2 changes: 1 addition & 1 deletion src/assets/ba_data/python/baenv.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@

# Build number and version of the ballistica binary we expect to be
# using.
TARGET_BALLISTICA_BUILD = 21588
TARGET_BALLISTICA_BUILD = 21596
TARGET_BALLISTICA_VERSION = '1.7.28'


Expand Down
43 changes: 39 additions & 4 deletions src/ballistica/core/platform/apple/core_platform_apple.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include "ballistica/core/platform/apple/core_platform_apple.h"

#if BA_XCODE_BUILD
#include <CoreServices/CoreServices.h>
#include <unistd.h>
#endif

Expand Down Expand Up @@ -37,11 +38,30 @@ auto CorePlatformApple::GetDeviceV1AccountUUIDPrefix() -> std::string {

auto CorePlatformApple::DoGetDeviceName() -> std::string {
#if BA_OSTYPE_MACOS && BA_XCODE_BUILD
// Ask swift for a pretty name if possible.
auto val = BallisticaKit::CocoaFromCpp::getDeviceName();
if (val) {
return val.get();

#pragma clang diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"

CFStringRef machineName = CSCopyMachineName();
if (machineName != nullptr) {
char buffer[256];
std::string out;
if (CFStringGetCString(machineName, buffer, sizeof(buffer),
kCFStringEncodingUTF8)) {
out = buffer;
}
CFRelease(machineName);
return out;
}

#pragma clang diagnostic pop

// FIXME - This code currently hangs if there is an apostrophe in the
// device name. Should hopefully be fixed in Swift 5.10.
// https://github.com/apple/swift/issues/69870

// Ask swift for a pretty name if possible.
// return BallisticaKit::CocoaFromCpp::getDeviceName();
#elif BA_OSTYPE_IOS_TVOS && BA_XCODE_BUILD
return BallisticaKit::UIKitFromCpp::getDeviceName();
#endif
Expand Down Expand Up @@ -442,6 +462,21 @@ auto CorePlatformApple::GetLocale() -> std::string {
#endif
}

auto CorePlatformApple::CanShowBlockingFatalErrorDialog() -> bool {
if (g_buildconfig.xcode_build() && g_buildconfig.ostype_macos()) {
return true;
}
return false;
}

void CorePlatformApple::BlockingFatalErrorDialog(const std::string& message) {
#if BA_XCODE_BUILD && BA_OSTYPE_MACOS
BallisticaKit::CocoaFromCpp::blockingFatalErrorDialog(message);
#else
CorePlatform::BlockingFatalErrorDialog(message);
#endif
}

} // namespace ballistica::core

#endif // BA_OSTYPE_MACOS || BA_OSTYPE_IOS_TVOS
2 changes: 2 additions & 0 deletions src/ballistica/core/platform/apple/core_platform_apple.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ class CorePlatformApple : public CorePlatform {
auto DoGetDeviceName() -> std::string override;
auto DoGetDeviceDescription() -> std::string override;
auto GetOSVersionString() -> std::string override;
auto CanShowBlockingFatalErrorDialog() -> bool override;
void BlockingFatalErrorDialog(const std::string& message) override;

protected:
auto DoGetDataDirectoryMonolithicDefault() -> std::string override;
Expand Down
2 changes: 1 addition & 1 deletion src/ballistica/shared/ballistica.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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 = 21588;
const int kEngineBuildNumber = 21596;
const char* kEngineVersion = "1.7.28";
const int kEngineApiVersion = 8;

Expand Down

0 comments on commit e377f0b

Please sign in to comment.