From 95f4afb27b1f518c04319bc97c584fed5ad895f3 Mon Sep 17 00:00:00 2001 From: Eric Froemling Date: Sat, 10 Apr 2021 10:17:32 -0700 Subject: [PATCH] language updates and misc cleanup --- .efrocachemap | 10 +++--- .idea/dictionaries/ericf.xml | 2 ++ assets/.asset_manifest_public.json | 2 ++ assets/Makefile | 2 ++ .../.idea/dictionaries/ericf.xml | 2 ++ docs/ba_module.md | 2 +- tools/bacommon/net.py | 31 +++++++++++++++++++ 7 files changed, 45 insertions(+), 6 deletions(-) create mode 100644 tools/bacommon/net.py diff --git a/.efrocachemap b/.efrocachemap index 7da4268a..b1bd2238 100644 --- a/.efrocachemap +++ b/.efrocachemap @@ -420,7 +420,7 @@ "assets/build/ba_data/audio/zoeOw.ogg": "https://files.ballistica.net/cache/ba1/a9/71/9286d55c45c37877f3267850f90b", "assets/build/ba_data/audio/zoePickup01.ogg": "https://files.ballistica.net/cache/ba1/2f/09/36e691de67eb8f155449a7170861", "assets/build/ba_data/audio/zoeScream01.ogg": "https://files.ballistica.net/cache/ba1/fd/a8/ad50785ce206e8dc3dcc7358b173", - "assets/build/ba_data/data/langdata.json": "https://files.ballistica.net/cache/ba1/04/05/32760bfddfc2aeac0ca250bed3b2", + "assets/build/ba_data/data/langdata.json": "https://files.ballistica.net/cache/ba1/45/a2/0571ecd64f82d00cf3022bf5b0ef", "assets/build/ba_data/data/languages/arabic.json": "https://files.ballistica.net/cache/ba1/ac/3e/c50dc4e98df47f858c3a73ac4272", "assets/build/ba_data/data/languages/belarussian.json": "https://files.ballistica.net/cache/ba1/44/ed/5b972fa848cffb73723533c2ccb7", "assets/build/ba_data/data/languages/chinese.json": "https://files.ballistica.net/cache/ba1/9d/63/d360eeff63bc64e098427498880d", @@ -440,14 +440,14 @@ "assets/build/ba_data/data/languages/indonesian.json": "https://files.ballistica.net/cache/ba1/69/cf/4a1e297b73613fd1b87fed8d2565", "assets/build/ba_data/data/languages/italian.json": "https://files.ballistica.net/cache/ba1/fb/2b/4c875a40e176079dedaacf1362c7", "assets/build/ba_data/data/languages/korean.json": "https://files.ballistica.net/cache/ba1/78/d3/16b37707d4ce4df826d0b0bc1766", - "assets/build/ba_data/data/languages/persian.json": "https://files.ballistica.net/cache/ba1/16/83/5a815f0e73dbac1d8cce337bff1b", + "assets/build/ba_data/data/languages/persian.json": "https://files.ballistica.net/cache/ba1/c1/14/b013ec0a6557533f0ff49f27d000", "assets/build/ba_data/data/languages/polish.json": "https://files.ballistica.net/cache/ba1/cd/c1/82bf70c3ee4894791506f4da1a15", "assets/build/ba_data/data/languages/portuguese.json": "https://files.ballistica.net/cache/ba1/98/45/ddeb7e797c02fb967e0c8b0dff7d", "assets/build/ba_data/data/languages/romanian.json": "https://files.ballistica.net/cache/ba1/44/3c/7cc06ca8d5475e1687d0ed05bdbf", - "assets/build/ba_data/data/languages/russian.json": "https://files.ballistica.net/cache/ba1/15/e2/08ce8831b3a6ee2a5324a4112b04", + "assets/build/ba_data/data/languages/russian.json": "https://files.ballistica.net/cache/ba1/71/db/e23447c97d40b8a0d83f185f4bba", "assets/build/ba_data/data/languages/serbian.json": "https://files.ballistica.net/cache/ba1/e1/22/5471375791f8825a63e06371df29", - "assets/build/ba_data/data/languages/slovak.json": "https://files.ballistica.net/cache/ba1/b7/0a/fab820b96e7aa587ee56427ecdc2", - "assets/build/ba_data/data/languages/spanish.json": "https://files.ballistica.net/cache/ba1/72/6a/55e4f8ce819d0c39ee6d86e8c6a0", + "assets/build/ba_data/data/languages/slovak.json": "https://files.ballistica.net/cache/ba1/15/01/cab2f74365e69216a7eeeef51f98", + "assets/build/ba_data/data/languages/spanish.json": "https://files.ballistica.net/cache/ba1/d6/2d/260aa8d8cd7050f2d9a131d062ca", "assets/build/ba_data/data/languages/swedish.json": "https://files.ballistica.net/cache/ba1/50/9f/be006ba19be6a69a57837eb6dca0", "assets/build/ba_data/data/languages/turkish.json": "https://files.ballistica.net/cache/ba1/5b/c4/2173bc10edea17ed3734f08a8c94", "assets/build/ba_data/data/languages/ukrainian.json": "https://files.ballistica.net/cache/ba1/3e/f3/4e9003c88e959d0d75a225c7a87e", diff --git a/.idea/dictionaries/ericf.xml b/.idea/dictionaries/ericf.xml index f982427e..8f6aecff 100644 --- a/.idea/dictionaries/ericf.xml +++ b/.idea/dictionaries/ericf.xml @@ -1400,6 +1400,7 @@ nearbytab neededsettings ness + netcode netlink netplay nettest @@ -1901,6 +1902,7 @@ serverget servermanager servermode + servernodes serverput serverutils sessionclass diff --git a/assets/.asset_manifest_public.json b/assets/.asset_manifest_public.json index 542c6d54..c5603603 100644 --- a/assets/.asset_manifest_public.json +++ b/assets/.asset_manifest_public.json @@ -131,9 +131,11 @@ "ba_data/python/bacommon/__pycache__/__init__.cpython-38.opt-1.pyc", "ba_data/python/bacommon/__pycache__/assets.cpython-38.opt-1.pyc", "ba_data/python/bacommon/__pycache__/err.cpython-38.opt-1.pyc", + "ba_data/python/bacommon/__pycache__/net.cpython-38.opt-1.pyc", "ba_data/python/bacommon/__pycache__/servermanager.cpython-38.opt-1.pyc", "ba_data/python/bacommon/assets.py", "ba_data/python/bacommon/err.py", + "ba_data/python/bacommon/net.py", "ba_data/python/bacommon/servermanager.py", "ba_data/python/bastd/__init__.py", "ba_data/python/bastd/__pycache__/__init__.cpython-38.opt-1.pyc", diff --git a/assets/Makefile b/assets/Makefile index 9abf9460..ac33b73b 100644 --- a/assets/Makefile +++ b/assets/Makefile @@ -636,6 +636,7 @@ SCRIPT_TARGETS_PY_PUBLIC_TOOLS = \ build/ba_data/python/bacommon/__init__.py \ build/ba_data/python/bacommon/assets.py \ build/ba_data/python/bacommon/err.py \ + build/ba_data/python/bacommon/net.py \ build/ba_data/python/bacommon/servermanager.py \ build/ba_data/python/efro/__init__.py \ build/ba_data/python/efro/call.py \ @@ -656,6 +657,7 @@ SCRIPT_TARGETS_PYC_PUBLIC_TOOLS = \ build/ba_data/python/bacommon/__pycache__/__init__.cpython-38.opt-1.pyc \ build/ba_data/python/bacommon/__pycache__/assets.cpython-38.opt-1.pyc \ build/ba_data/python/bacommon/__pycache__/err.cpython-38.opt-1.pyc \ + build/ba_data/python/bacommon/__pycache__/net.cpython-38.opt-1.pyc \ build/ba_data/python/bacommon/__pycache__/servermanager.cpython-38.opt-1.pyc \ build/ba_data/python/efro/__pycache__/__init__.cpython-38.opt-1.pyc \ build/ba_data/python/efro/__pycache__/call.cpython-38.opt-1.pyc \ diff --git a/ballisticacore-cmake/.idea/dictionaries/ericf.xml b/ballisticacore-cmake/.idea/dictionaries/ericf.xml index a43b0c33..80232a58 100644 --- a/ballisticacore-cmake/.idea/dictionaries/ericf.xml +++ b/ballisticacore-cmake/.idea/dictionaries/ericf.xml @@ -599,6 +599,7 @@ nemanja ness netclient + netcode netplay nettest newactivity @@ -815,6 +816,7 @@ seqtypestr serv serverget + servernodes serverput sessiondata sessionglobals diff --git a/docs/ba_module.md b/docs/ba_module.md index 8facfff1..e8aa148d 100644 --- a/docs/ba_module.md +++ b/docs/ba_module.md @@ -1,5 +1,5 @@ -

last updated on 2021-03-27 for Ballistica version 1.6.0 build 20328

+

last updated on 2021-04-10 for Ballistica version 1.6.0 build 20329

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 let me know. Happy modding!


diff --git a/tools/bacommon/net.py b/tools/bacommon/net.py new file mode 100644 index 00000000..c07f05c8 --- /dev/null +++ b/tools/bacommon/net.py @@ -0,0 +1,31 @@ +# Released under the MIT License. See LICENSE for details. +# +"""Network related data and functionality.""" + +from __future__ import annotations + +from typing import TYPE_CHECKING + +from efro import entity + +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)