changed server-wrapper back to writing to stdout instead of stderr

This commit is contained in:
Eric Froemling 2021-03-03 17:52:40 -06:00
parent 8007f7de42
commit 4bd1e12f50
No known key found for this signature in database
GPG Key ID: 89C93F0F8D6D5A98
3 changed files with 33 additions and 57 deletions

View File

@ -3932,26 +3932,26 @@
"assets/build/windows/Win32/ucrtbased.dll": "https://files.ballistica.net/cache/ba1/b5/85/f8b6d0558ddb87267f34254b1450",
"assets/build/windows/Win32/vc_redist.x86.exe": "https://files.ballistica.net/cache/ba1/1c/e1/4a1a2eddda2f4aebd5f8b64ab08e",
"assets/build/windows/Win32/vcruntime140d.dll": "https://files.ballistica.net/cache/ba1/50/8d/bc2600ac9491f1b14d659709451f",
"build/prefab/full/linux_arm64/debug/ballisticacore": "https://files.ballistica.net/cache/ba1/bd/13/4b8f2b347863747aeaab5d19ffbe",
"build/prefab/full/linux_arm64/release/ballisticacore": "https://files.ballistica.net/cache/ba1/20/00/4f13a3cf0cafd8f60a90008ce605",
"build/prefab/full/linux_arm64_server/debug/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/4d/ae/c8e188c091474324e580ec94f4e0",
"build/prefab/full/linux_arm64_server/release/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/c0/e8/e9915433922b616281694b3c903d",
"build/prefab/full/linux_x86_64/debug/ballisticacore": "https://files.ballistica.net/cache/ba1/6c/52/090604f97715740cfff85f4c3f48",
"build/prefab/full/linux_x86_64/release/ballisticacore": "https://files.ballistica.net/cache/ba1/1e/e9/9de31a86255b65d7d89a02c257b4",
"build/prefab/full/linux_x86_64_server/debug/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/da/ce/a2db4cee1c1858143214c03d3a2c",
"build/prefab/full/linux_x86_64_server/release/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/17/70/b0b4a3853c5182121325de58e224",
"build/prefab/full/mac_arm64/debug/ballisticacore": "https://files.ballistica.net/cache/ba1/e4/42/aa2626b27e0c393b50ae57406bb2",
"build/prefab/full/mac_arm64/release/ballisticacore": "https://files.ballistica.net/cache/ba1/d7/dd/4b7fb2832972f49b01101aac0ca2",
"build/prefab/full/mac_arm64_server/debug/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/d0/80/5a44a3728b56aafe499081d863b2",
"build/prefab/full/mac_arm64_server/release/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/91/13/a46a521e933e4d8dc43f4997e238",
"build/prefab/full/mac_x86_64/debug/ballisticacore": "https://files.ballistica.net/cache/ba1/88/e9/3c26f08c41f7c74db6e6495159ee",
"build/prefab/full/mac_x86_64/release/ballisticacore": "https://files.ballistica.net/cache/ba1/6f/42/49707eb374d25778fe9813963bcd",
"build/prefab/full/mac_x86_64_server/debug/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/25/45/2de5c321525af7c3f152b11f1884",
"build/prefab/full/mac_x86_64_server/release/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/ef/c1/94aab0266746ffb01fdc1cd47a08",
"build/prefab/full/windows_x86/debug/BallisticaCore.exe": "https://files.ballistica.net/cache/ba1/b3/1d/a1d6998e968d27e7eecdf2526eb1",
"build/prefab/full/windows_x86/release/BallisticaCore.exe": "https://files.ballistica.net/cache/ba1/34/47/9378839338629fe8e322a9ddb860",
"build/prefab/full/windows_x86_server/debug/dist/ballisticacore_headless.exe": "https://files.ballistica.net/cache/ba1/e0/dc/0bd676886c0a5391366edfad4bd4",
"build/prefab/full/windows_x86_server/release/dist/ballisticacore_headless.exe": "https://files.ballistica.net/cache/ba1/5d/5f/020bb8c78559871f9924042894ff",
"build/prefab/full/linux_arm64/debug/ballisticacore": "https://files.ballistica.net/cache/ba1/74/a0/05a7b24498974d9026e0545d3553",
"build/prefab/full/linux_arm64/release/ballisticacore": "https://files.ballistica.net/cache/ba1/1f/b6/fb4ee2c0b1cf3342ae48091a05e6",
"build/prefab/full/linux_arm64_server/debug/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/80/f2/e75bf97c4161a7459e56c57346f2",
"build/prefab/full/linux_arm64_server/release/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/97/52/682d50ccce888146637515de44e4",
"build/prefab/full/linux_x86_64/debug/ballisticacore": "https://files.ballistica.net/cache/ba1/ec/22/6451c38ed9cb27b12231c8d357c8",
"build/prefab/full/linux_x86_64/release/ballisticacore": "https://files.ballistica.net/cache/ba1/56/f3/394e7049de17be87b9e50bc89e43",
"build/prefab/full/linux_x86_64_server/debug/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/bf/0a/3ccd9c8d148ce21a812f85098345",
"build/prefab/full/linux_x86_64_server/release/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/1d/08/978ddd0987a9ff21e3103ad85e50",
"build/prefab/full/mac_arm64/debug/ballisticacore": "https://files.ballistica.net/cache/ba1/75/69/a3e68ae0c37936f1a4d674e7b086",
"build/prefab/full/mac_arm64/release/ballisticacore": "https://files.ballistica.net/cache/ba1/c2/1f/2600ab284e26f8fdecde11d506ef",
"build/prefab/full/mac_arm64_server/debug/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/33/c7/6e579e83ca5b916a18cff7943776",
"build/prefab/full/mac_arm64_server/release/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/8b/78/104fe2a311415bc45cf9e299dceb",
"build/prefab/full/mac_x86_64/debug/ballisticacore": "https://files.ballistica.net/cache/ba1/ae/45/868f5f1f8b77e2bd6ed58dec2871",
"build/prefab/full/mac_x86_64/release/ballisticacore": "https://files.ballistica.net/cache/ba1/33/76/642c17d5b8e5ef3bddbb0cf8ac45",
"build/prefab/full/mac_x86_64_server/debug/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/9f/ec/da10f423f46bfb87f139238a9a4f",
"build/prefab/full/mac_x86_64_server/release/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/6c/3c/d7729b71a5d1923f0f734bcbcd35",
"build/prefab/full/windows_x86/debug/BallisticaCore.exe": "https://files.ballistica.net/cache/ba1/75/7c/b9296c3f334a9b591f79c56427fc",
"build/prefab/full/windows_x86/release/BallisticaCore.exe": "https://files.ballistica.net/cache/ba1/57/7c/c83c976bdce191226a7bc00e0acb",
"build/prefab/full/windows_x86_server/debug/dist/ballisticacore_headless.exe": "https://files.ballistica.net/cache/ba1/80/ab/792aba55b142192ea2b14fb0092b",
"build/prefab/full/windows_x86_server/release/dist/ballisticacore_headless.exe": "https://files.ballistica.net/cache/ba1/84/27/fb8f969bcf8b95c4badfbafe1c3e",
"build/prefab/lib/linux_arm64/debug/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/4c/bf/393694ea67f3d590dd2706c9955e",
"build/prefab/lib/linux_arm64/release/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/78/cb/bb9ae4f896f862074057c8e36e1d",
"build/prefab/lib/linux_arm64_server/debug/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/ae/bd/39d7b885f7f01e81d0e96f0f85ce",
@ -3960,12 +3960,12 @@
"build/prefab/lib/linux_x86_64/release/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/52/d9/563a6949d2c4db5a915c54460fbc",
"build/prefab/lib/linux_x86_64_server/debug/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/d0/6a/42fe8d2e34f95e1b3282e8422344",
"build/prefab/lib/linux_x86_64_server/release/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/50/cf/bad44b07a4022aee3001002086b5",
"build/prefab/lib/mac_arm64/debug/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/8e/d8/b00361f54ae023feb88cbf0ef78c",
"build/prefab/lib/mac_arm64/release/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/42/68/fa75c5f75e97ae5214679c75bbc0",
"build/prefab/lib/mac_arm64_server/debug/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/62/b9/2e9fca8ae23035741fadd143a932",
"build/prefab/lib/mac_arm64_server/release/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/eb/b1/4a527ce50b6d52e7970efb149fbb",
"build/prefab/lib/mac_x86_64/debug/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/11/cf/3e89a9502fdec55eb218ecad26a2",
"build/prefab/lib/mac_x86_64/release/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/8a/80/2db47e59931fd4e663d4a62c0b5e",
"build/prefab/lib/mac_x86_64_server/debug/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/f0/04/ba4cd87f743c35f3db8649a62ede",
"build/prefab/lib/mac_x86_64_server/release/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/fc/4d/a37663dbf38601f3daf924065747"
"build/prefab/lib/mac_arm64/debug/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/db/c3/19f0345b92100715d311aee262fd",
"build/prefab/lib/mac_arm64/release/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/18/93/452982c95d392096f1d280e28dc7",
"build/prefab/lib/mac_arm64_server/debug/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/60/23/1ff03f98efac43c3caf5e6570610",
"build/prefab/lib/mac_arm64_server/release/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/c7/d9/0f9b4961ff2cd59f0d72339f3b76",
"build/prefab/lib/mac_x86_64/debug/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/49/15/64d42835e9c61598241c8c8fab28",
"build/prefab/lib/mac_x86_64/release/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/c7/49/a2ae3c4553cc96673f824ba42620",
"build/prefab/lib/mac_x86_64_server/debug/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/21/23/4253f9c54d69aa86459ad6c773a1",
"build/prefab/lib/mac_x86_64_server/release/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/4a/08/ff90a5d62bbadc087aab19de18cd"
}

View File

@ -121,7 +121,6 @@ class ServerManagerApp:
print(
f'{Clr.CYN}{Clr.BLD}BallisticaCore server manager {VERSION_STR}'
f' starting up ({dbgstr} mode)...{Clr.RST}',
file=sys.stderr,
flush=True)
# Python will handle SIGINT for us (as KeyboardInterrupt) but we
@ -141,14 +140,11 @@ class ServerManagerApp:
def _postrun(self) -> None:
"""Common code at the end of any run."""
print(f'{Clr.CYN}Server manager shutting down...{Clr.RST}',
file=sys.stderr,
flush=True)
print(f'{Clr.CYN}Server manager shutting down...{Clr.RST}', flush=True)
assert self._subprocess_thread is not None
if self._subprocess_thread.is_alive():
print(f'{Clr.CYN}Waiting for subprocess exit...{Clr.RST}',
file=sys.stderr,
flush=True)
# Mark ourselves as shutting down and wait for the process to wrap up.
@ -193,7 +189,6 @@ class ServerManagerApp:
f"{Clr.CYN}Interactive mode enabled; use the 'mgr' object"
f' to interact with the server.\n'
f"Type 'help(mgr)' for more information.{Clr.RST}",
file=sys.stderr,
flush=True)
context = {'__name__': '__console__', '__doc__': None, 'mgr': self}
@ -215,7 +210,6 @@ class ServerManagerApp:
print(
f'{Clr.SRED}Unexpected interpreter exception:'
f' {exc} ({type(exc)}){Clr.RST}',
file=sys.stderr,
flush=True)
self._postrun()
@ -466,13 +460,11 @@ class ServerManagerApp:
raise CleanError(
f'Error loading config file:\n{exc}') from exc
print(f'{Clr.RED}Error loading config file:\n{exc}.{Clr.RST}',
file=sys.stderr,
flush=True)
if trynum == maxtries - 1:
print(
f'{Clr.RED}Max-tries reached; giving up.'
f' Existing config values will be used.{Clr.RST}',
file=sys.stderr,
flush=True)
break
print(
@ -480,7 +472,6 @@ class ServerManagerApp:
f' Will re-attempt load in {retry_seconds}'
f' seconds. (attempt {trynum+1} of'
f' {maxtries-1}).{Clr.RST}',
file=sys.stderr,
flush=True)
for _j in range(retry_seconds):
@ -505,7 +496,6 @@ class ServerManagerApp:
f'{Clr.YLW}Default config file not found'
f' (\'{self._config_path}\'); using default'
f' settings.{Clr.RST}',
file=sys.stderr,
flush=True)
self._config_mtime = None
self._last_config_mtime_check_time = time.time()
@ -533,7 +523,6 @@ class ServerManagerApp:
if print_confirmation:
print(f'{Clr.CYN}Valid server config file loaded.{Clr.RST}',
file=sys.stderr,
flush=True)
return out
@ -577,9 +566,7 @@ class ServerManagerApp:
# slight behavior tweaks. Hmm; should this be an argument instead?
os.environ['BA_SERVER_WRAPPER_MANAGED'] = '1'
print(f'{Clr.CYN}Launching server subprocess...{Clr.RST}',
file=sys.stderr,
flush=True)
print(f'{Clr.CYN}Launching server subprocess...{Clr.RST}', flush=True)
binary_name = ('ballisticacore_headless.exe'
if os.name == 'nt' else './ballisticacore_headless')
assert self._ba_root_path is not None
@ -595,7 +582,6 @@ class ServerManagerApp:
self._subprocess_exited_cleanly = False
print(
f'{Clr.RED}Error launching server subprocess: {exc}{Clr.RST}',
file=sys.stderr,
flush=True)
# Do the thing.
@ -603,7 +589,6 @@ class ServerManagerApp:
self._run_subprocess_until_exit()
except Exception as exc:
print(f'{Clr.RED}Error running server subprocess: {exc}{Clr.RST}',
file=sys.stderr,
flush=True)
self._kill_subprocess()
@ -730,7 +715,6 @@ class ServerManagerApp:
if (self._subprocess_force_kill_time is not None
and time.time() > self._subprocess_force_kill_time):
print(f'{Clr.CYN}Force-killing subprocess...{Clr.RST}',
file=sys.stderr,
flush=True)
break
@ -742,7 +726,6 @@ class ServerManagerApp:
print(
f'{clr}Server subprocess exited'
f' with code {code}.{Clr.RST}',
file=sys.stderr,
flush=True)
self._subprocess_exited_cleanly = (code == 0)
break
@ -771,7 +754,6 @@ class ServerManagerApp:
print(
f'{Clr.CYN}Config-file change detected;'
f' requesting immediate restart.{Clr.RST}',
file=sys.stderr,
flush=True)
self.restart(immediate=True)
self._subprocess_sent_config_auto_restart = True
@ -791,7 +773,6 @@ class ServerManagerApp:
f' ({clean_exit_minutes})'
f' elapsed; requesting soft'
f' {opname}.{Clr.RST}',
file=sys.stderr,
flush=True)
if self._auto_restart:
self.restart(immediate=False)
@ -814,7 +795,6 @@ class ServerManagerApp:
f' ({unclean_exit_minutes})'
f' elapsed; requesting immediate'
f' {opname}.{Clr.RST}',
file=sys.stderr,
flush=True)
if self._auto_restart:
self.restart(immediate=True)
@ -837,9 +817,7 @@ class ServerManagerApp:
if self._subprocess is None:
return
print(f'{Clr.CYN}Stopping subprocess...{Clr.RST}',
file=sys.stderr,
flush=True)
print(f'{Clr.CYN}Stopping subprocess...{Clr.RST}', flush=True)
# First, ask it nicely to die and give it a moment.
# If that doesn't work, bring down the hammer.
@ -851,9 +829,7 @@ class ServerManagerApp:
except subprocess.TimeoutExpired:
self._subprocess_exited_cleanly = False
self._subprocess.kill()
print(f'{Clr.CYN}Subprocess stopped.{Clr.RST}',
file=sys.stderr,
flush=True)
print(f'{Clr.CYN}Subprocess stopped.{Clr.RST}', flush=True)
def main() -> None:

View File

@ -21,7 +21,7 @@
namespace ballistica {
// These are set automatically via script; don't change here.
const int kAppBuildNumber = 20321;
const int kAppBuildNumber = 20323;
const char* kAppVersion = "1.6.0";
// Our standalone globals.