From 5a29a0f4f60c47010b3f84fb652e6ad144a18d46 Mon Sep 17 00:00:00 2001 From: Eric Date: Tue, 23 Aug 2022 15:06:13 -0700 Subject: [PATCH] now using gethostname() as a default device name --- .efrocachemap | 40 ++++++++++++++--------------- CHANGELOG.md | 3 ++- src/ballistica/ballistica.cc | 2 +- src/ballistica/platform/platform.cc | 11 +++++++- 4 files changed, 33 insertions(+), 23 deletions(-) diff --git a/.efrocachemap b/.efrocachemap index 0d5a0874..f1b7497f 100644 --- a/.efrocachemap +++ b/.efrocachemap @@ -3995,26 +3995,26 @@ "assets/src/ba_data/python/ba/_generated/__init__.py": "https://files.ballistica.net/cache/ba1/ee/e8/cad05aa531c7faf7ff7b96db7f6e", "assets/src/ba_data/python/ba/_generated/enums.py": "https://files.ballistica.net/cache/ba1/b2/e5/0ee0561e16257a32830645239f34", "ballisticacore-windows/Generic/BallisticaCore.ico": "https://files.ballistica.net/cache/ba1/89/c0/e32c7d2a35dc9aef57cc73b0911a", - "build/prefab/full/linux_arm64_gui/debug/ballisticacore": "https://files.ballistica.net/cache/ba1/1f/5b/1e96fb1cfe523ff4609a7c8f3689", - "build/prefab/full/linux_arm64_gui/release/ballisticacore": "https://files.ballistica.net/cache/ba1/c3/f6/daf84696c33dec4e8b95da165c5a", - "build/prefab/full/linux_arm64_server/debug/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/db/61/4f847794ba29472c82b05f0b850d", - "build/prefab/full/linux_arm64_server/release/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/f1/8b/266d3353f9b455c55c4b47e8a4bc", - "build/prefab/full/linux_x86_64_gui/debug/ballisticacore": "https://files.ballistica.net/cache/ba1/53/c8/057ff3adf8312b1e18abfca4b9f7", - "build/prefab/full/linux_x86_64_gui/release/ballisticacore": "https://files.ballistica.net/cache/ba1/a6/2a/cf9d25a49d16e710bbc2a56635e8", - "build/prefab/full/linux_x86_64_server/debug/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/00/ad/9affe6117e10a5cacacd525070d1", - "build/prefab/full/linux_x86_64_server/release/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/8a/4b/1d414e6c5f43042860b436f626ce", - "build/prefab/full/mac_arm64_gui/debug/ballisticacore": "https://files.ballistica.net/cache/ba1/40/82/72912f1df22a4f9890c12ed5f352", - "build/prefab/full/mac_arm64_gui/release/ballisticacore": "https://files.ballistica.net/cache/ba1/09/f0/bcd219616eae95c82429224ca1d9", - "build/prefab/full/mac_arm64_server/debug/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/03/da/3848433056b6adfefdf32243fb84", - "build/prefab/full/mac_arm64_server/release/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/28/1e/7536d5c7a1be317639b32c3ea989", - "build/prefab/full/mac_x86_64_gui/debug/ballisticacore": "https://files.ballistica.net/cache/ba1/17/a5/311f39e028fb4bf761f7f856bc1f", - "build/prefab/full/mac_x86_64_gui/release/ballisticacore": "https://files.ballistica.net/cache/ba1/44/b5/6c636acc47e2cb78af910b5a810c", - "build/prefab/full/mac_x86_64_server/debug/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/8d/c0/ae1dec32dc4194d26cd411a3efb7", - "build/prefab/full/mac_x86_64_server/release/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/63/b9/e4b04d4c8a94908aaa3cb8c2fcc9", - "build/prefab/full/windows_x86_gui/debug/BallisticaCore.exe": "https://files.ballistica.net/cache/ba1/db/5c/a0d28c0b89489dff2b19578450f0", - "build/prefab/full/windows_x86_gui/release/BallisticaCore.exe": "https://files.ballistica.net/cache/ba1/1c/39/23efb0c30bd06d16a4016662f6c1", - "build/prefab/full/windows_x86_server/debug/dist/BallisticaCoreHeadless.exe": "https://files.ballistica.net/cache/ba1/bf/cd/659a1b954cec6f51357cb7c18c26", - "build/prefab/full/windows_x86_server/release/dist/BallisticaCoreHeadless.exe": "https://files.ballistica.net/cache/ba1/d4/01/da8d15db28fe805780a989f95e81", + "build/prefab/full/linux_arm64_gui/debug/ballisticacore": "https://files.ballistica.net/cache/ba1/3a/30/0f971b33c3acce345b710522ddc9", + "build/prefab/full/linux_arm64_gui/release/ballisticacore": "https://files.ballistica.net/cache/ba1/ff/5a/9c88583aac88fc40bac717e5d718", + "build/prefab/full/linux_arm64_server/debug/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/e5/6e/6a4b966f13a337c9cbaab994f15c", + "build/prefab/full/linux_arm64_server/release/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/e5/26/145e375d2dcadde23ec4cb0d1a3c", + "build/prefab/full/linux_x86_64_gui/debug/ballisticacore": "https://files.ballistica.net/cache/ba1/94/1f/069265153f16ff70d6d2e9d8718a", + "build/prefab/full/linux_x86_64_gui/release/ballisticacore": "https://files.ballistica.net/cache/ba1/ec/a2/74c01ee55c1b5418162842d1a9dd", + "build/prefab/full/linux_x86_64_server/debug/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/8a/82/c26ef2a3c58f553eefde7730a03d", + "build/prefab/full/linux_x86_64_server/release/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/9b/31/7a858bd9577beb676c445279cd57", + "build/prefab/full/mac_arm64_gui/debug/ballisticacore": "https://files.ballistica.net/cache/ba1/be/73/d0f005e57bb1931ccacb5b3b0f62", + "build/prefab/full/mac_arm64_gui/release/ballisticacore": "https://files.ballistica.net/cache/ba1/b8/a9/32d3b7419d56eedccfde91663fe9", + "build/prefab/full/mac_arm64_server/debug/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/ff/aa/e868c09257c80b9d4687968e4c05", + "build/prefab/full/mac_arm64_server/release/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/8f/17/cd7f0dfda69dc078d71bb7fb40e2", + "build/prefab/full/mac_x86_64_gui/debug/ballisticacore": "https://files.ballistica.net/cache/ba1/9c/73/bc5e040210d8646723e5be45289b", + "build/prefab/full/mac_x86_64_gui/release/ballisticacore": "https://files.ballistica.net/cache/ba1/fb/47/f1a753e3ad9ae360929e56bed9e9", + "build/prefab/full/mac_x86_64_server/debug/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/26/14/06b42b23f107fa26b9cb8992cd15", + "build/prefab/full/mac_x86_64_server/release/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/03/09/174d57c89e4d16ddd53475b5989e", + "build/prefab/full/windows_x86_gui/debug/BallisticaCore.exe": "https://files.ballistica.net/cache/ba1/9f/1b/03c12a486a01ba0c393d80abdbc1", + "build/prefab/full/windows_x86_gui/release/BallisticaCore.exe": "https://files.ballistica.net/cache/ba1/e3/f1/195bb0a2f6f86105315748972519", + "build/prefab/full/windows_x86_server/debug/dist/BallisticaCoreHeadless.exe": "https://files.ballistica.net/cache/ba1/f4/b5/24e9d5292478575a3b2bd8c92551", + "build/prefab/full/windows_x86_server/release/dist/BallisticaCoreHeadless.exe": "https://files.ballistica.net/cache/ba1/e9/43/dcdfa601fb05498135642976a9be", "build/prefab/lib/linux_arm64_gui/debug/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/6a/91/ddafd190b867e23110b18ddce9ab", "build/prefab/lib/linux_arm64_gui/release/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/07/5f/246e5ef83e81f516aa82033470c5", "build/prefab/lib/linux_arm64_server/debug/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/18/04/ed17d0ac8813451038b4831dd3c1", diff --git a/CHANGELOG.md b/CHANGELOG.md index 48621e6a..c2c8ad0e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,10 @@ -### 1.7.7 (build 20706, api 7, 2022-08-23) +### 1.7.7 (build 20709, api 7, 2022-08-23) - Added `ba.app.meta.load_exported_classes()` for loading classes discovered by the meta subsystem cleanly in a background thread. - Improved logging of missing playlist game types. - Some ba.Lstr functionality can now be used in background threads. - Added simple check for incoming packets (should increase security level a bit). - Simplified logic for C++ `Platform::GetDeviceName()` and made it accessible to Python via `ba.app.device_name`. +- Default device name now uses gethostname() instead of being hard coded to 'Untitled Device' (though many platforms override this). ### 1.7.6 (build 20687, api 7, 2022-08-11) - Cleaned up da MetaSubsystem code. diff --git a/src/ballistica/ballistica.cc b/src/ballistica/ballistica.cc index 4154bebf..41f6dabc 100644 --- a/src/ballistica/ballistica.cc +++ b/src/ballistica/ballistica.cc @@ -21,7 +21,7 @@ namespace ballistica { // These are set automatically via script; don't modify them here. -const int kAppBuildNumber = 20706; +const int kAppBuildNumber = 20709; const char* kAppVersion = "1.7.7"; // Our standalone globals. diff --git a/src/ballistica/platform/platform.cc b/src/ballistica/platform/platform.cc index 1b970cfa..262197a5 100644 --- a/src/ballistica/platform/platform.cc +++ b/src/ballistica/platform/platform.cc @@ -489,7 +489,16 @@ auto Platform::GetDeviceName() -> std::string { return device_name_; } -auto Platform::DoGetDeviceName() -> std::string { return "Untitled Device"; } +auto Platform::DoGetDeviceName() -> std::string { + // Just go with hostname as a decent default. + char nbuffer[64]; + int ret = gethostname(nbuffer, sizeof(nbuffer)); + if (ret == 0) { + nbuffer[sizeof(nbuffer) - 1] = 0; // Make sure its terminated. + return nbuffer; + } + return "Untitled Device"; +} auto Platform::IsRunningOnTV() -> bool { return false; }