mirror of
https://github.com/RYDE-WORK/ballistica.git
synced 2026-02-05 23:13:46 +08:00
Merge pull request #524 from imayushsaini/devicename-headless
changing device name for servers
This commit is contained in:
commit
fcb348845f
@ -624,6 +624,11 @@ class ServerManagerApp:
|
|||||||
# slight behavior tweaks. Hmm; should this be an argument instead?
|
# slight behavior tweaks. Hmm; should this be an argument instead?
|
||||||
os.environ['BA_SERVER_WRAPPER_MANAGED'] = '1'
|
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)
|
print(f'{Clr.CYN}Launching server subprocess...{Clr.RST}', flush=True)
|
||||||
binary_name = (
|
binary_name = (
|
||||||
'BallisticaCoreHeadless.exe'
|
'BallisticaCoreHeadless.exe'
|
||||||
|
|||||||
@ -523,7 +523,14 @@ auto Platform::GetDeviceName() -> std::string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
auto Platform::DoGetDeviceName() -> 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];
|
char nbuffer[64];
|
||||||
int ret = gethostname(nbuffer, sizeof(nbuffer));
|
int ret = gethostname(nbuffer, sizeof(nbuffer));
|
||||||
if (ret == 0) {
|
if (ret == 0) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user