mirror of
https://github.com/imayushsaini/Bombsquad-Ballistica-Modded-Server.git
synced 2025-11-07 17:36:15 +00:00
API update to 1.6.3 stable
This commit is contained in:
parent
463bae3913
commit
fcd8a94e81
146 changed files with 2254 additions and 510 deletions
69
dist/ba_data/python/bacommon/net.py
vendored
Normal file
69
dist/ba_data/python/bacommon/net.py
vendored
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
# Released under the MIT License. See LICENSE for details.
|
||||
#
|
||||
"""Network related data and functionality."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, Optional, List, Dict, Any, Tuple
|
||||
from dataclasses import dataclass
|
||||
|
||||
from efro import entity
|
||||
from efro.dataclassio import ioprepped
|
||||
|
||||
if TYPE_CHECKING:
|
||||
pass
|
||||
|
||||
|
||||
class ServerNodeEntry(entity.CompoundValue):
|
||||
"""Information about a specific server."""
|
||||
region = entity.Field('r', entity.StringValue())
|
||||
address = entity.Field('a', entity.StringValue())
|
||||
port = entity.Field('p', entity.IntValue())
|
||||
|
||||
|
||||
class ServerNodeQueryResponse(entity.Entity):
|
||||
"""A response to a query about server-nodes."""
|
||||
|
||||
# If present, something went wrong, and this describes it.
|
||||
error = entity.Field('e', entity.OptionalStringValue(store_default=False))
|
||||
|
||||
# The set of servernodes.
|
||||
servers = entity.CompoundListField('s',
|
||||
ServerNodeEntry(),
|
||||
store_default=False)
|
||||
|
||||
|
||||
@ioprepped
|
||||
@dataclass
|
||||
class PrivateHostingState:
|
||||
"""Combined state of whether we're hosting, whether we can, etc."""
|
||||
unavailable_error: Optional[str] = None
|
||||
party_code: Optional[str] = None
|
||||
able_to_host: bool = False
|
||||
tickets_to_host_now: int = 0
|
||||
minutes_until_free_host: Optional[float] = None
|
||||
free_host_minutes_remaining: Optional[float] = None
|
||||
|
||||
|
||||
@ioprepped
|
||||
@dataclass
|
||||
class PrivateHostingConfig:
|
||||
"""Config provided when hosting a private party."""
|
||||
session_type: str = 'ffa'
|
||||
playlist_name: str = 'Unknown'
|
||||
randomize: bool = False
|
||||
tutorial: bool = False
|
||||
custom_team_names: Optional[Tuple[str, str]] = None
|
||||
custom_team_colors: Optional[Tuple[Tuple[float, float, float],
|
||||
Tuple[float, float, float]]] = None
|
||||
playlist: Optional[List[Dict[str, Any]]] = None
|
||||
|
||||
|
||||
@ioprepped
|
||||
@dataclass
|
||||
class PrivatePartyConnectResult:
|
||||
"""Info about a server we get back when connecting."""
|
||||
error: Optional[str] = None
|
||||
addr: Optional[str] = None
|
||||
port: Optional[int] = None
|
||||
password: Optional[str] = None
|
||||
Loading…
Add table
Add a link
Reference in a new issue