mirror of
https://github.com/RYDE-WORK/ballistica.git
synced 2026-01-23 15:33:26 +08:00
Added a bit of color to server stuff
This commit is contained in:
parent
a89ee4f3ff
commit
2f52ecb54c
@ -4140,8 +4140,8 @@
|
||||
"build/prefab/mac-server/release/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/e2/ab/b22ebe07c4342beb4dba33d5f7a5",
|
||||
"build/prefab/mac/debug/ballisticacore": "https://files.ballistica.net/cache/ba1/80/24/b24a5a26ce61719456479f0c452d",
|
||||
"build/prefab/mac/release/ballisticacore": "https://files.ballistica.net/cache/ba1/13/5f/7dff6b239258c1a1151df24eec19",
|
||||
"build/prefab/windows-server/debug/dist/ballisticacore_headless.exe": "https://files.ballistica.net/cache/ba1/f1/41/8203dd42e85b8cfde0141715de3b",
|
||||
"build/prefab/windows-server/release/dist/ballisticacore_headless.exe": "https://files.ballistica.net/cache/ba1/56/46/86ea1b38475a43dc95a65db0623a",
|
||||
"build/prefab/windows/debug/BallisticaCore.exe": "https://files.ballistica.net/cache/ba1/8f/28/7d7560edfe6b862003a699cd72d9",
|
||||
"build/prefab/windows/release/BallisticaCore.exe": "https://files.ballistica.net/cache/ba1/d8/f0/03642738f87df03341a196132cc8"
|
||||
"build/prefab/windows-server/debug/dist/ballisticacore_headless.exe": "https://files.ballistica.net/cache/ba1/9b/9e/4db687b4f06579dafe4f1f9cf389",
|
||||
"build/prefab/windows-server/release/dist/ballisticacore_headless.exe": "https://files.ballistica.net/cache/ba1/16/16/ac342d48eb3964472eabb6854bd8",
|
||||
"build/prefab/windows/debug/BallisticaCore.exe": "https://files.ballistica.net/cache/ba1/c3/5e/42852af8d746f60999139e7069cd",
|
||||
"build/prefab/windows/release/BallisticaCore.exe": "https://files.ballistica.net/cache/ba1/34/d3/a51b67800857a8271d6f1d947f5a"
|
||||
}
|
||||
@ -25,6 +25,7 @@ import sys
|
||||
import time
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from efro.terminal import Clr
|
||||
from ba._enums import TimeType
|
||||
from ba._freeforallsession import FreeForAllSession
|
||||
from ba._dualteamsession import DualTeamSession
|
||||
@ -271,14 +272,13 @@ class ServerController:
|
||||
print('error on UDP port access check (internet down?)')
|
||||
else:
|
||||
if data['accessible']:
|
||||
print('UDP port', gameport, ('access check successful. Your '
|
||||
'server appears to be joinable '
|
||||
'from the internet.'))
|
||||
print(f'{Clr.SGRN}UDP port {gameport} access check successful.'
|
||||
f' Your server appears to be joinable from the'
|
||||
f' internet.{Clr.RST}')
|
||||
else:
|
||||
print('UDP port', gameport,
|
||||
('access check failed. Your server '
|
||||
'does not appear to be joinable '
|
||||
'from the internet.'))
|
||||
print(f'{Clr.SRED}UDP port {gameport} access check failed.'
|
||||
f' Your server does not appear to be joinable'
|
||||
f' from the internet.{Clr.RST}')
|
||||
|
||||
def _config_server(self) -> None:
|
||||
"""Apply server config changes that can take effect immediately.
|
||||
|
||||
@ -38,6 +38,7 @@ sys.path += [
|
||||
str(Path(os.getcwd(), 'dist', 'ba_data', 'python-site-packages'))
|
||||
]
|
||||
|
||||
from efro.terminal import Clr
|
||||
from efro.dataclassutils import dataclass_assign, dataclass_validate
|
||||
from bacommon.servermanager import (ServerConfig, ServerCommand,
|
||||
make_server_command)
|
||||
@ -123,9 +124,9 @@ class ServerManagerApp:
|
||||
|
||||
# Print basic usage info in interactive mode.
|
||||
if sys.stdin.isatty():
|
||||
print('BallisticaCore server manager starting up...\n'
|
||||
'Use the "mgr" object to make live server adjustments.\n'
|
||||
'Type "help(mgr)" for more information.')
|
||||
print(f'{Clr.SBLU}BallisticaCore server manager starting up...\n'
|
||||
f'Use the "mgr" object to make live server adjustments.\n'
|
||||
f'Type "help(mgr)" for more information.{Clr.RST}')
|
||||
|
||||
# Python will handle SIGINT for us (as KeyboardInterrupt) but we
|
||||
# need to register a SIGTERM handler so we have a chance to clean
|
||||
@ -145,6 +146,10 @@ class ServerManagerApp:
|
||||
# Enable tab-completion if possible.
|
||||
self._enable_tab_completion(locs)
|
||||
|
||||
# Give ourself a lovely color prompt.
|
||||
sys.ps1 = f'{Clr.SGRN}>>> {Clr.RST}'
|
||||
sys.ps2 = f'{Clr.SGRN}... {Clr.RST}'
|
||||
|
||||
# Now just sit in an interpreter.
|
||||
# TODO: make it possible to use IPython if the user has it available.
|
||||
try:
|
||||
@ -298,7 +303,7 @@ class ServerManagerApp:
|
||||
if self._process is None:
|
||||
return
|
||||
|
||||
print('Stopping server process...')
|
||||
print(f'{Clr.SBLU}Stopping server process...{Clr.RST}')
|
||||
|
||||
# First, ask it nicely to die and give it a moment.
|
||||
# If that doesn't work, bring down the hammer.
|
||||
@ -308,7 +313,7 @@ class ServerManagerApp:
|
||||
except subprocess.TimeoutExpired:
|
||||
self._process.kill()
|
||||
self._process = self._process_launch_time = None
|
||||
print('Server process stopped.')
|
||||
print(f'{Clr.SBLU}Server process stopped.{Clr.RST}')
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<!-- THIS FILE IS AUTO GENERATED; DO NOT EDIT BY HAND -->
|
||||
<h4><em>last updated on 2020-05-01 for Ballistica version 1.5.0 build 20001</em></h4>
|
||||
<h4><em>last updated on 2020-05-02 for Ballistica version 1.5.0 build 20001</em></h4>
|
||||
<p>This page documents the Python classes and functions in the 'ba' module,
|
||||
which are the ones most relevant to modding in Ballistica. If you come across something you feel should be included here or could be better explained, please <a href="mailto:support@froemling.net">let me know</a>. Happy modding!</p>
|
||||
<hr>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user