mirror of
https://github.com/imayushsaini/Bombsquad-Ballistica-Modded-Server.git
synced 2025-11-07 17:36:15 +00:00
updating ba_data to 1.7.35
This commit is contained in:
parent
d6e457c821
commit
ae30ed15ec
234 changed files with 5670 additions and 2718 deletions
10
dist/ba_data/python/babase/__init__.py
vendored
10
dist/ba_data/python/babase/__init__.py
vendored
|
|
@ -79,6 +79,11 @@ from _babase import (
|
|||
native_review_request_supported,
|
||||
native_stack_trace,
|
||||
open_file_externally,
|
||||
open_url,
|
||||
overlay_web_browser_close,
|
||||
overlay_web_browser_is_open,
|
||||
overlay_web_browser_is_supported,
|
||||
overlay_web_browser_open_url,
|
||||
print_load_info,
|
||||
pushcall,
|
||||
quit,
|
||||
|
|
@ -285,6 +290,11 @@ __all__ = [
|
|||
'normalized_color',
|
||||
'NotFoundError',
|
||||
'open_file_externally',
|
||||
'open_url',
|
||||
'overlay_web_browser_close',
|
||||
'overlay_web_browser_is_open',
|
||||
'overlay_web_browser_is_supported',
|
||||
'overlay_web_browser_open_url',
|
||||
'Permission',
|
||||
'PlayerNotFoundError',
|
||||
'Plugin',
|
||||
|
|
|
|||
99
dist/ba_data/python/babase/_app.py
vendored
99
dist/ba_data/python/babase/_app.py
vendored
|
|
@ -7,11 +7,11 @@ from __future__ import annotations
|
|||
import os
|
||||
import logging
|
||||
from enum import Enum
|
||||
from typing import TYPE_CHECKING, TypeVar
|
||||
from typing import TYPE_CHECKING, TypeVar, override
|
||||
from concurrent.futures import ThreadPoolExecutor
|
||||
from functools import cached_property
|
||||
from threading import RLock
|
||||
|
||||
|
||||
from typing_extensions import override
|
||||
from efro.call import tpartial
|
||||
|
||||
import _babase
|
||||
|
|
@ -220,6 +220,13 @@ class App:
|
|||
]
|
||||
self._pool_thread_count = 0
|
||||
|
||||
# We hold a lock while lazy-loading our subsystem properties so
|
||||
# we don't spin up any subsystem more than once, but the lock is
|
||||
# recursive so that the subsystems can instantiate other
|
||||
# subsystems.
|
||||
self._subsystem_property_lock = RLock()
|
||||
self._subsystem_property_data: dict[str, AppSubsystem | bool] = {}
|
||||
|
||||
def postinit(self) -> None:
|
||||
"""Called after we've been inited and assigned to babase.app.
|
||||
|
||||
|
|
@ -227,8 +234,9 @@ class App:
|
|||
must go here instead of __init__.
|
||||
"""
|
||||
|
||||
# Hack for docs-generation: we can be imported with dummy modules
|
||||
# instead of our actual binary ones, but we don't function.
|
||||
# Hack for docs-generation: We can be imported with dummy
|
||||
# modules instead of our actual binary ones, but we don't
|
||||
# function.
|
||||
if os.environ.get('BA_RUNNING_WITH_DUMMY_MODULES') == '1':
|
||||
return
|
||||
|
||||
|
|
@ -272,10 +280,7 @@ class App:
|
|||
return self._asyncio_loop
|
||||
|
||||
def create_async_task(
|
||||
self,
|
||||
coro: Generator[Any, Any, T] | Coroutine[Any, Any, T],
|
||||
*,
|
||||
name: str | None = None,
|
||||
self, coro: Coroutine[Any, Any, T], *, name: str | None = None
|
||||
) -> None:
|
||||
"""Create a fully managed async task.
|
||||
|
||||
|
|
@ -285,6 +290,7 @@ class App:
|
|||
App.asyncio_loop.
|
||||
"""
|
||||
assert _babase.in_logic_thread()
|
||||
|
||||
# Hold a strong reference to the task until it is done.
|
||||
# Otherwise it is possible for it to be garbage collected and
|
||||
# disappear midway if the caller does not hold on to the
|
||||
|
|
@ -293,7 +299,6 @@ class App:
|
|||
task = self.asyncio_loop.create_task(coro, name=name)
|
||||
self._asyncio_tasks.add(task)
|
||||
task.add_done_callback(self._on_task_done)
|
||||
# return task
|
||||
|
||||
def _on_task_done(self, task: asyncio.Task) -> None:
|
||||
# Report any errors that occurred.
|
||||
|
|
@ -333,14 +338,66 @@ class App:
|
|||
def mode_selector(self, selector: babase.AppModeSelector) -> None:
|
||||
self._mode_selector = selector
|
||||
|
||||
def _get_subsystem_property(
|
||||
self, ssname: str, create_call: Callable[[], AppSubsystem | None]
|
||||
) -> AppSubsystem | None:
|
||||
|
||||
# Quick-out: if a subsystem is present, just return it; no
|
||||
# locking necessary.
|
||||
val = self._subsystem_property_data.get(ssname)
|
||||
if val is not None:
|
||||
if val is False:
|
||||
# False means subsystem is confirmed as unavailable.
|
||||
return None
|
||||
if val is not True:
|
||||
# A subsystem has been set. Return it.
|
||||
return val
|
||||
|
||||
# Anything else (no val present or val True) requires locking.
|
||||
with self._subsystem_property_lock:
|
||||
val = self._subsystem_property_data.get(ssname)
|
||||
if val is not None:
|
||||
if val is False:
|
||||
# False means confirmed as not present.
|
||||
return None
|
||||
if val is True:
|
||||
# True means this property is already being loaded,
|
||||
# and the fact that we're holding the lock means
|
||||
# we're doing the loading, so this is a dependency
|
||||
# loop. Not good.
|
||||
raise RuntimeError(
|
||||
f'Subsystem dependency loop detected for {ssname}'
|
||||
)
|
||||
# Must be an instantiated subsystem. Noice.
|
||||
return val
|
||||
|
||||
# Ok, there's nothing here for it. Instantiate and set it
|
||||
# while we hold the lock. Set a placeholder value of True
|
||||
# while we load so we can error if something we're loading
|
||||
# tries to recursively load us.
|
||||
self._subsystem_property_data[ssname] = True
|
||||
|
||||
# Do our one attempt to create the singleton.
|
||||
val = create_call()
|
||||
self._subsystem_property_data[ssname] = (
|
||||
False if val is None else val
|
||||
)
|
||||
|
||||
return val
|
||||
|
||||
# __FEATURESET_APP_SUBSYSTEM_PROPERTIES_BEGIN__
|
||||
# This section generated by batools.appmodule; do not edit.
|
||||
|
||||
@cached_property
|
||||
@property
|
||||
def classic(self) -> ClassicSubsystem | None:
|
||||
"""Our classic subsystem (if available)."""
|
||||
# pylint: disable=cyclic-import
|
||||
return self._get_subsystem_property(
|
||||
'classic', self._create_classic_subsystem
|
||||
) # type: ignore
|
||||
|
||||
@staticmethod
|
||||
def _create_classic_subsystem() -> ClassicSubsystem | None:
|
||||
# pylint: disable=cyclic-import
|
||||
try:
|
||||
from baclassic import ClassicSubsystem
|
||||
|
||||
|
|
@ -351,11 +408,16 @@ class App:
|
|||
logging.exception('Error importing baclassic.')
|
||||
return None
|
||||
|
||||
@cached_property
|
||||
@property
|
||||
def plus(self) -> PlusSubsystem | None:
|
||||
"""Our plus subsystem (if available)."""
|
||||
# pylint: disable=cyclic-import
|
||||
return self._get_subsystem_property(
|
||||
'plus', self._create_plus_subsystem
|
||||
) # type: ignore
|
||||
|
||||
@staticmethod
|
||||
def _create_plus_subsystem() -> PlusSubsystem | None:
|
||||
# pylint: disable=cyclic-import
|
||||
try:
|
||||
from baplus import PlusSubsystem
|
||||
|
||||
|
|
@ -366,9 +428,15 @@ class App:
|
|||
logging.exception('Error importing baplus.')
|
||||
return None
|
||||
|
||||
@cached_property
|
||||
@property
|
||||
def ui_v1(self) -> UIV1Subsystem:
|
||||
"""Our ui_v1 subsystem (always available)."""
|
||||
return self._get_subsystem_property(
|
||||
'ui_v1', self._create_ui_v1_subsystem
|
||||
) # type: ignore
|
||||
|
||||
@staticmethod
|
||||
def _create_ui_v1_subsystem() -> UIV1Subsystem:
|
||||
# pylint: disable=cyclic-import
|
||||
|
||||
from bauiv1 import UIV1Subsystem
|
||||
|
|
@ -384,6 +452,7 @@ class App:
|
|||
# reached the 'running' state. This ensures that all subsystems
|
||||
# receive a consistent set of callbacks starting with
|
||||
# on_app_running().
|
||||
|
||||
if self._subsystem_registration_ended:
|
||||
raise RuntimeError(
|
||||
'Subsystems can no longer be registered at this point.'
|
||||
|
|
|
|||
7
dist/ba_data/python/babase/_apputils.py
vendored
7
dist/ba_data/python/babase/_apputils.py
vendored
|
|
@ -8,9 +8,8 @@ import os
|
|||
import logging
|
||||
from threading import Thread
|
||||
from dataclasses import dataclass
|
||||
from typing import TYPE_CHECKING
|
||||
from typing import TYPE_CHECKING, override
|
||||
|
||||
from typing_extensions import override
|
||||
from efro.call import tpartial
|
||||
from efro.log import LogLevel
|
||||
from efro.dataclassio import ioprepped, dataclass_to_json, dataclass_from_json
|
||||
|
|
@ -107,8 +106,8 @@ def handle_v1_cloud_log() -> None:
|
|||
|
||||
info = {
|
||||
'log': _babase.get_v1_cloud_log(),
|
||||
'version': app.env.version,
|
||||
'build': app.env.build_number,
|
||||
'version': app.env.engine_version,
|
||||
'build': app.env.engine_build_number,
|
||||
'userAgentString': classic.legacy_user_agent_string,
|
||||
'session': sessionname,
|
||||
'activity': activityname,
|
||||
|
|
|
|||
4
dist/ba_data/python/babase/_devconsole.py
vendored
4
dist/ba_data/python/babase/_devconsole.py
vendored
|
|
@ -4,12 +4,10 @@
|
|||
from __future__ import annotations
|
||||
|
||||
import os
|
||||
from typing import TYPE_CHECKING
|
||||
from typing import TYPE_CHECKING, override
|
||||
from dataclasses import dataclass
|
||||
import logging
|
||||
|
||||
from typing_extensions import override
|
||||
|
||||
import _babase
|
||||
|
||||
if TYPE_CHECKING:
|
||||
|
|
|
|||
3
dist/ba_data/python/babase/_emptyappmode.py
vendored
3
dist/ba_data/python/babase/_emptyappmode.py
vendored
|
|
@ -3,9 +3,8 @@
|
|||
"""Provides AppMode functionality."""
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING
|
||||
from typing import TYPE_CHECKING, override
|
||||
|
||||
from typing_extensions import override
|
||||
from bacommon.app import AppExperience
|
||||
|
||||
import _babase
|
||||
|
|
|
|||
3
dist/ba_data/python/babase/_env.py
vendored
3
dist/ba_data/python/babase/_env.py
vendored
|
|
@ -7,9 +7,8 @@ import sys
|
|||
import signal
|
||||
import logging
|
||||
import warnings
|
||||
from typing import TYPE_CHECKING
|
||||
from typing import TYPE_CHECKING, override
|
||||
|
||||
from typing_extensions import override
|
||||
from efro.log import LogLevel
|
||||
|
||||
if TYPE_CHECKING:
|
||||
|
|
|
|||
3
dist/ba_data/python/babase/_general.py
vendored
3
dist/ba_data/python/babase/_general.py
vendored
|
|
@ -8,9 +8,8 @@ import weakref
|
|||
import random
|
||||
import logging
|
||||
import inspect
|
||||
from typing import TYPE_CHECKING, TypeVar, Protocol, NewType
|
||||
from typing import TYPE_CHECKING, TypeVar, Protocol, NewType, override
|
||||
|
||||
from typing_extensions import override
|
||||
from efro.terminal import Clr
|
||||
|
||||
import _babase
|
||||
|
|
|
|||
3
dist/ba_data/python/babase/_hooks.py
vendored
3
dist/ba_data/python/babase/_hooks.py
vendored
|
|
@ -85,6 +85,7 @@ def open_url_with_webbrowser_module(url: str) -> None:
|
|||
import webbrowser
|
||||
from babase._language import Lstr
|
||||
|
||||
assert _babase.in_logic_thread()
|
||||
try:
|
||||
webbrowser.open(url)
|
||||
except Exception:
|
||||
|
|
@ -384,7 +385,7 @@ def show_client_too_old_error() -> None:
|
|||
# a newer build.
|
||||
if (
|
||||
_babase.app.config.get('SuppressClientTooOldErrorForBuild')
|
||||
== _babase.app.env.build_number
|
||||
== _babase.app.env.engine_build_number
|
||||
):
|
||||
return
|
||||
|
||||
|
|
|
|||
4
dist/ba_data/python/babase/_language.py
vendored
4
dist/ba_data/python/babase/_language.py
vendored
|
|
@ -6,9 +6,7 @@ from __future__ import annotations
|
|||
import os
|
||||
import json
|
||||
import logging
|
||||
from typing import TYPE_CHECKING, overload
|
||||
|
||||
from typing_extensions import override
|
||||
from typing import TYPE_CHECKING, overload, override
|
||||
|
||||
import _babase
|
||||
from babase._appsubsystem import AppSubsystem
|
||||
|
|
|
|||
3
dist/ba_data/python/babase/_login.py
vendored
3
dist/ba_data/python/babase/_login.py
vendored
|
|
@ -7,9 +7,8 @@ from __future__ import annotations
|
|||
import time
|
||||
import logging
|
||||
from dataclasses import dataclass
|
||||
from typing import TYPE_CHECKING, final
|
||||
from typing import TYPE_CHECKING, final, override
|
||||
|
||||
from typing_extensions import override
|
||||
from bacommon.login import LoginType
|
||||
|
||||
import _babase
|
||||
|
|
|
|||
35
dist/ba_data/python/babase/_mgen/enums.py
vendored
35
dist/ba_data/python/babase/_mgen/enums.py
vendored
|
|
@ -1,5 +1,5 @@
|
|||
# Released under the MIT License. See LICENSE for details.
|
||||
"""Enum vals generated by batools.pythonenumsmodule; do not edit by hand."""
|
||||
"""Enum vals generated by batools.enumspython; do not edit by hand."""
|
||||
|
||||
from enum import Enum
|
||||
|
||||
|
|
@ -85,39 +85,6 @@ class UIScale(Enum):
|
|||
SMALL = 2
|
||||
|
||||
|
||||
class TimeType(Enum):
|
||||
"""Specifies the type of time for various operations to target/use.
|
||||
|
||||
Category: Enums
|
||||
|
||||
'sim' time is the local simulation time for an activity or session.
|
||||
It can proceed at different rates depending on game speed, stops
|
||||
for pauses, etc.
|
||||
|
||||
'base' is the baseline time for an activity or session. It proceeds
|
||||
consistently regardless of game speed or pausing, but may stop during
|
||||
occurrences such as network outages.
|
||||
|
||||
'real' time is mostly based on clock time, with a few exceptions. It may
|
||||
not advance while the app is backgrounded for instance. (the engine
|
||||
attempts to prevent single large time jumps from occurring)
|
||||
"""
|
||||
|
||||
SIM = 0
|
||||
BASE = 1
|
||||
REAL = 2
|
||||
|
||||
|
||||
class TimeFormat(Enum):
|
||||
"""Specifies the format time values are provided in.
|
||||
|
||||
Category: Enums
|
||||
"""
|
||||
|
||||
SECONDS = 0
|
||||
MILLISECONDS = 1
|
||||
|
||||
|
||||
class Permission(Enum):
|
||||
"""Permissions that can be requested from the OS.
|
||||
|
||||
|
|
|
|||
2
dist/ba_data/python/babase/_net.py
vendored
2
dist/ba_data/python/babase/_net.py
vendored
|
|
@ -32,6 +32,8 @@ class NetworkSubsystem:
|
|||
# For debugging.
|
||||
self.v1_test_log: str = ''
|
||||
self.v1_ctest_results: dict[int, str] = {}
|
||||
self.connectivity_state = 'uninited'
|
||||
self.transport_state = 'uninited'
|
||||
self.server_time_offset_hours: float | None = None
|
||||
|
||||
@property
|
||||
|
|
|
|||
4
dist/ba_data/python/babase/_plugin.py
vendored
4
dist/ba_data/python/babase/_plugin.py
vendored
|
|
@ -6,9 +6,7 @@ from __future__ import annotations
|
|||
|
||||
import logging
|
||||
import importlib.util
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from typing_extensions import override
|
||||
from typing import TYPE_CHECKING, override
|
||||
|
||||
import _babase
|
||||
from babase._appsubsystem import AppSubsystem
|
||||
|
|
|
|||
4
dist/ba_data/python/babase/_ui.py
vendored
4
dist/ba_data/python/babase/_ui.py
vendored
|
|
@ -3,9 +3,7 @@
|
|||
"""UI related bits of babase."""
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from typing_extensions import override
|
||||
from typing import TYPE_CHECKING, override
|
||||
|
||||
from babase._stringedit import StringEditAdapter
|
||||
import _babase
|
||||
|
|
|
|||
22
dist/ba_data/python/babase/modutils.py
vendored
22
dist/ba_data/python/babase/modutils.py
vendored
|
|
@ -133,10 +133,15 @@ def create_user_system_scripts() -> None:
|
|||
if env.python_directory_app is None:
|
||||
raise RuntimeError('app python dir unset')
|
||||
|
||||
path = f'{env.python_directory_user}/sys/{env.version}'
|
||||
path = f'{env.python_directory_user}/sys/{env.engine_version}'
|
||||
pathtmp = path + '_tmp'
|
||||
if os.path.exists(path):
|
||||
shutil.rmtree(path)
|
||||
print('Delete Existing User Scripts first!')
|
||||
_babase.screenmessage(
|
||||
'Delete Existing User Scripts first!',
|
||||
color=(1, 0, 0),
|
||||
)
|
||||
return
|
||||
if os.path.exists(pathtmp):
|
||||
shutil.rmtree(pathtmp)
|
||||
|
||||
|
|
@ -159,6 +164,7 @@ def create_user_system_scripts() -> None:
|
|||
f"'\nRestart {_babase.appname()} to use them."
|
||||
f' (use babase.quit() to exit the game)'
|
||||
)
|
||||
_babase.screenmessage('Created User System Scripts', color=(0, 1, 0))
|
||||
if app.classic is not None and app.classic.platform == 'android':
|
||||
print(
|
||||
'Note: the new files may not be visible via '
|
||||
|
|
@ -175,16 +181,18 @@ def delete_user_system_scripts() -> None:
|
|||
if env.python_directory_user is None:
|
||||
raise RuntimeError('user python dir unset')
|
||||
|
||||
path = f'{env.python_directory_user}/sys/{env.version}'
|
||||
path = f'{env.python_directory_user}/sys/{env.engine_version}'
|
||||
if os.path.exists(path):
|
||||
shutil.rmtree(path)
|
||||
print(
|
||||
f'User system scripts deleted.\n'
|
||||
f'Restart {_babase.appname()} to use internal'
|
||||
f' scripts. (use babase.quit() to exit the game)'
|
||||
print('User system scripts deleted.')
|
||||
_babase.screenmessage('Deleted User System Scripts', color=(0, 1, 0))
|
||||
_babase.screenmessage(
|
||||
f'Closing {_babase.appname()} to make changes.', color=(0, 1, 0)
|
||||
)
|
||||
_babase.apptimer(2.0, _babase.quit)
|
||||
else:
|
||||
print(f"User system scripts not found at '{path}'.")
|
||||
_babase.screenmessage('User Scripts Not Found', color=(1, 0, 0))
|
||||
|
||||
# If the sys path is empty, kill it.
|
||||
dpath = env.python_directory_user + '/sys'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue