1.7.13 , client_ping, player account privacy added

added _ba.get_client_ping(113)
and _ba.hide_player_device_id(True) . to hide players device id from roster of clients.
This commit is contained in:
Ayush Saini 2022-11-06 01:04:52 +05:30
parent 59730e19b3
commit e5034cbb6f
282 changed files with 35005 additions and 23205 deletions

View file

@ -95,6 +95,7 @@ def _windows_enable_color() -> bool:
import msvcrt
import ctypes
from ctypes import wintypes
kernel32 = ctypes.WinDLL('kernel32', use_last_error=True) # type: ignore
ERROR_INVALID_PARAMETER = 0x0057
@ -111,7 +112,7 @@ def _windows_enable_color() -> bool:
kernel32.SetConsoleMode.errcheck = _check_bool
kernel32.SetConsoleMode.argtypes = (wintypes.HANDLE, wintypes.DWORD)
def set_conout_mode(new_mode: int, mask: int = 0xffffffff) -> int:
def set_conout_mode(new_mode: int, mask: int = 0xFFFFFFFF) -> int:
# don't assume StandardOutput is a console.
# open CONOUT$ instead
fdout = os.open('CONOUT$', os.O_RDWR)
@ -146,6 +147,7 @@ def _windows_enable_color() -> bool:
class ClrBase:
"""Base class for color convenience class."""
RST: ClassVar[str]
BLD: ClassVar[str]
UND: ClassVar[str]
@ -198,6 +200,7 @@ class ClrAlways(ClrBase):
This version has colors always enabled. Generally you should use Clr which
points to the correct enabled/disabled class depending on the environment.
"""
color_enabled = True
# Styles
@ -253,6 +256,7 @@ class ClrNever(ClrBase):
This version has colors disabled. Generally you should use Clr which
points to the correct enabled/disabled class depending on the environment.
"""
color_enabled = False
# Styles
@ -303,8 +307,13 @@ class ClrNever(ClrBase):
_envval = os.environ.get('EFRO_TERMCOLORS')
_color_enabled: bool = (True if _envval == '1' else
False if _envval == '0' else _default_color_enabled())
_color_enabled: bool = (
True
if _envval == '1'
else False
if _envval == '0'
else _default_color_enabled()
)
Clr: type[ClrBase]
if _color_enabled:
Clr = ClrAlways