diff --git a/assets/src/server/ballisticacore_server.py b/assets/src/server/ballisticacore_server.py index 34289425..448e0e2d 100755 --- a/assets/src/server/ballisticacore_server.py +++ b/assets/src/server/ballisticacore_server.py @@ -624,6 +624,11 @@ class ServerManagerApp: # slight behavior tweaks. Hmm; should this be an argument instead? os.environ['BA_SERVER_WRAPPER_MANAGED'] = '1' + # Set an environment var to change the device name. + # Device name is used while making connection with master server, + # cloud-console recognize us with this name. + os.environ['BA_DEVICE_NAME'] = self._config.party_name + print(f'{Clr.CYN}Launching server subprocess...{Clr.RST}', flush=True) binary_name = ( 'BallisticaCoreHeadless.exe' diff --git a/src/ballistica/platform/platform.cc b/src/ballistica/platform/platform.cc index f3067fdd..e43bbce2 100644 --- a/src/ballistica/platform/platform.cc +++ b/src/ballistica/platform/platform.cc @@ -523,7 +523,14 @@ auto Platform::GetDeviceName() -> std::string { } auto Platform::DoGetDeviceName() -> std::string { - // Just go with hostname as a decent default. + // Check devicename in env_var + char* devicename; + devicename = getenv("BA_DEVICE_NAME"); + if (devicename != NULL) { + return devicename; + } + + // Else just go with hostname as a decent default. char nbuffer[64]; int ret = gethostname(nbuffer, sizeof(nbuffer)); if (ret == 0) {