mirror of
https://github.com/RYDE-WORK/ballistica.git
synced 2026-02-07 16:13:23 +08:00
changing device name for servers
This commit is contained in:
parent
ad06b244a0
commit
81f76c44a8
@ -573,6 +573,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_HOST_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 = ('BallisticaCoreHeadless.exe'
|
binary_name = ('BallisticaCoreHeadless.exe'
|
||||||
if os.name == 'nt' else './ballisticacore_headless')
|
if os.name == 'nt' else './ballisticacore_headless')
|
||||||
|
|||||||
@ -499,7 +499,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 hostname in env_var
|
||||||
|
char* hostname;
|
||||||
|
hostname = getenv("BA_HOST_NAME");
|
||||||
|
if (hostname != NULL) {
|
||||||
|
return hostname;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 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