mirror of
https://github.com/RYDE-WORK/ballistica.git
synced 2026-01-19 21:37:57 +08:00
renamed bascenev1's screenmessage to broadcastmessage to differentiate it from local-only screenmessage
This commit is contained in:
parent
d606e6e3b5
commit
7b73f28862
56
.efrocachemap
generated
56
.efrocachemap
generated
@ -4072,26 +4072,26 @@
|
||||
"build/assets/workspace/ninjafightplug.py": "https://files.ballistica.net/cache/ba1/18/4b/787a9267e17be3c49966072581a5",
|
||||
"build/assets/workspace/onslaughtplug.py": "https://files.ballistica.net/cache/ba1/20/f6/4ce9bc3c1f3732f6adf8237fbe9b",
|
||||
"build/assets/workspace/runaroundplug.py": "https://files.ballistica.net/cache/ba1/a5/30/9058181df0b1255bf6950cbc7813",
|
||||
"build/prefab/full/linux_arm64_gui/debug/ballisticakit": "https://files.ballistica.net/cache/ba1/98/3d/59c2774d92c554917bdbd9edb743",
|
||||
"build/prefab/full/linux_arm64_gui/release/ballisticakit": "https://files.ballistica.net/cache/ba1/19/f6/8953c543e33d3f09fbd5b7c34eba",
|
||||
"build/prefab/full/linux_arm64_server/debug/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/2b/46/66ec5b8877329621369e74fc1c50",
|
||||
"build/prefab/full/linux_arm64_server/release/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/09/eb/97daa4a4840c83f0e9862e3e7fb5",
|
||||
"build/prefab/full/linux_x86_64_gui/debug/ballisticakit": "https://files.ballistica.net/cache/ba1/c8/e7/c70e60b2b59821119d12120eb104",
|
||||
"build/prefab/full/linux_x86_64_gui/release/ballisticakit": "https://files.ballistica.net/cache/ba1/ee/79/a5b6790b4d224325d8ba4a4cdc78",
|
||||
"build/prefab/full/linux_x86_64_server/debug/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/fc/cd/f1ce0b65bec1ef59aae8db3dfe04",
|
||||
"build/prefab/full/linux_x86_64_server/release/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/d6/59/78a04deb39a2242277f8f337c787",
|
||||
"build/prefab/full/mac_arm64_gui/debug/ballisticakit": "https://files.ballistica.net/cache/ba1/93/53/3503a8386b4c732003d32f89827b",
|
||||
"build/prefab/full/mac_arm64_gui/release/ballisticakit": "https://files.ballistica.net/cache/ba1/15/a3/7bf99f886870865cc6932415d2ef",
|
||||
"build/prefab/full/mac_arm64_server/debug/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/d6/22/78303e63ad4954ca5b58f5a25c7f",
|
||||
"build/prefab/full/mac_arm64_server/release/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/09/1b/7bbb9bfc39329265c3e5741d8194",
|
||||
"build/prefab/full/mac_x86_64_gui/debug/ballisticakit": "https://files.ballistica.net/cache/ba1/23/21/33f75e30409b0aaf6e29ea104d11",
|
||||
"build/prefab/full/mac_x86_64_gui/release/ballisticakit": "https://files.ballistica.net/cache/ba1/80/bb/0cd610d2073e45bdaad5ee553859",
|
||||
"build/prefab/full/mac_x86_64_server/debug/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/92/19/6288c866d989b27adda46771f0e3",
|
||||
"build/prefab/full/mac_x86_64_server/release/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/b4/eb/bd01bf247b58405e0a1810c315f7",
|
||||
"build/prefab/full/windows_x86_gui/debug/BallisticaKit.exe": "https://files.ballistica.net/cache/ba1/8f/6d/0908960ed304d38cb743e090a9af",
|
||||
"build/prefab/full/windows_x86_gui/release/BallisticaKit.exe": "https://files.ballistica.net/cache/ba1/1f/7c/f3310f6ac02db02a883893bfd6d2",
|
||||
"build/prefab/full/windows_x86_server/debug/dist/BallisticaKitHeadless.exe": "https://files.ballistica.net/cache/ba1/15/ea/3b3b51407118ef827ccd28d86540",
|
||||
"build/prefab/full/windows_x86_server/release/dist/BallisticaKitHeadless.exe": "https://files.ballistica.net/cache/ba1/89/e3/037522509a9c638209809fbe09d4",
|
||||
"build/prefab/full/linux_arm64_gui/debug/ballisticakit": "https://files.ballistica.net/cache/ba1/1f/1b/b04b31054b65e8bfdc40534d452d",
|
||||
"build/prefab/full/linux_arm64_gui/release/ballisticakit": "https://files.ballistica.net/cache/ba1/e6/34/ff4ce608cddf75f01c7eff1d21e1",
|
||||
"build/prefab/full/linux_arm64_server/debug/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/1f/0c/3a98c68eaf81fac66ae5bcc78236",
|
||||
"build/prefab/full/linux_arm64_server/release/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/23/5e/bfff34c598b06e86199fecb404c0",
|
||||
"build/prefab/full/linux_x86_64_gui/debug/ballisticakit": "https://files.ballistica.net/cache/ba1/a4/6c/c67786baba022816883f6095f0ca",
|
||||
"build/prefab/full/linux_x86_64_gui/release/ballisticakit": "https://files.ballistica.net/cache/ba1/2a/92/5ee2257569d5000a11c48ec666e0",
|
||||
"build/prefab/full/linux_x86_64_server/debug/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/f4/b9/70fdee7e0058f90cbd001051187d",
|
||||
"build/prefab/full/linux_x86_64_server/release/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/df/8e/3402bd0d7b9a30941c2a76920a1c",
|
||||
"build/prefab/full/mac_arm64_gui/debug/ballisticakit": "https://files.ballistica.net/cache/ba1/27/d6/5d60019a10d5fc40d6b26b53dba0",
|
||||
"build/prefab/full/mac_arm64_gui/release/ballisticakit": "https://files.ballistica.net/cache/ba1/20/48/d088312af59adeb596db8196d8a9",
|
||||
"build/prefab/full/mac_arm64_server/debug/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/5a/73/d4bbe844928c71aece7779fbf0ef",
|
||||
"build/prefab/full/mac_arm64_server/release/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/79/a5/cb9984a630f18d9d43be72ea22fd",
|
||||
"build/prefab/full/mac_x86_64_gui/debug/ballisticakit": "https://files.ballistica.net/cache/ba1/8a/fa/babadd97a86a505a38abc8e71f81",
|
||||
"build/prefab/full/mac_x86_64_gui/release/ballisticakit": "https://files.ballistica.net/cache/ba1/a4/4d/eb069364cb2ced2ba4bab9dc9e94",
|
||||
"build/prefab/full/mac_x86_64_server/debug/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/a4/7a/739366db05e974d46d30954879cc",
|
||||
"build/prefab/full/mac_x86_64_server/release/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/3c/80/f2fa67168ae81563b6f21b7678d9",
|
||||
"build/prefab/full/windows_x86_gui/debug/BallisticaKit.exe": "https://files.ballistica.net/cache/ba1/55/be/64590d708b8d9069f10f59c5f211",
|
||||
"build/prefab/full/windows_x86_gui/release/BallisticaKit.exe": "https://files.ballistica.net/cache/ba1/c0/2d/a02f1bd08dd91ddb861baf1be2d7",
|
||||
"build/prefab/full/windows_x86_server/debug/dist/BallisticaKitHeadless.exe": "https://files.ballistica.net/cache/ba1/df/37/b25c4f3ddd53c9c6688b4660afb9",
|
||||
"build/prefab/full/windows_x86_server/release/dist/BallisticaKitHeadless.exe": "https://files.ballistica.net/cache/ba1/e6/00/d7d194778893769a4a4d5af1dc80",
|
||||
"build/prefab/lib/linux_arm64_gui/debug/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/d9/56/b0a16db98621500b473844ec39d6",
|
||||
"build/prefab/lib/linux_arm64_gui/release/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/57/f9/f304c67d9958574b6b35de2ad13d",
|
||||
"build/prefab/lib/linux_arm64_server/debug/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/04/55/a41ad832c081ff421039827d16c1",
|
||||
@ -4108,14 +4108,14 @@
|
||||
"build/prefab/lib/mac_x86_64_gui/release/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/88/1a/1ea680450c3c9bc97147df4bf99d",
|
||||
"build/prefab/lib/mac_x86_64_server/debug/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/91/b3/31b980ca2a000871408cbc7923e3",
|
||||
"build/prefab/lib/mac_x86_64_server/release/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/67/d1/8b98ad3d0d67bf6bc23c2c9167cf",
|
||||
"build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.lib": "https://files.ballistica.net/cache/ba1/d6/cb/5a23b50c0301080fab7871b2cc5b",
|
||||
"build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.pdb": "https://files.ballistica.net/cache/ba1/a7/ab/4d5efa27ace9ab6e723b93407a82",
|
||||
"build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.lib": "https://files.ballistica.net/cache/ba1/44/a9/e159585e3d38436d371eda33de0a",
|
||||
"build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.pdb": "https://files.ballistica.net/cache/ba1/d9/2e/9220f51060965122103686234f9f",
|
||||
"build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.lib": "https://files.ballistica.net/cache/ba1/97/82/1b50c1588b38b520017652ec2d07",
|
||||
"build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.pdb": "https://files.ballistica.net/cache/ba1/18/2f/9ab3cc8b8edc51a8b8d74b082c0b",
|
||||
"build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.lib": "https://files.ballistica.net/cache/ba1/b5/4f/869073acc4b40f54c1b61488ad9d",
|
||||
"build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.pdb": "https://files.ballistica.net/cache/ba1/e3/d1/c4b05ee74e45e759dea864ba3ad7",
|
||||
"build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.lib": "https://files.ballistica.net/cache/ba1/1c/30/dbf3906b8c1bec2d72df632d6099",
|
||||
"build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.pdb": "https://files.ballistica.net/cache/ba1/c1/cc/dd517bc59c5cc0f4e3d23ac4eac6",
|
||||
"build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.lib": "https://files.ballistica.net/cache/ba1/fa/63/7a26568ee4f87c41495dfc9a97e0",
|
||||
"build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.pdb": "https://files.ballistica.net/cache/ba1/2b/1c/7394f271641c26792cfa93da8a7b",
|
||||
"build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.lib": "https://files.ballistica.net/cache/ba1/34/1b/c726dfb7e0e750399fa7ba169c84",
|
||||
"build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.pdb": "https://files.ballistica.net/cache/ba1/ff/19/62b199f7a9fbe4ec47ea15c3a234",
|
||||
"build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.lib": "https://files.ballistica.net/cache/ba1/67/80/58ceb85465bea71878893398996f",
|
||||
"build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.pdb": "https://files.ballistica.net/cache/ba1/2a/32/d36cdfc0a36804ea78e477cece0c",
|
||||
"src/assets/ba_data/python/babase/_mgen/__init__.py": "https://files.ballistica.net/cache/ba1/52/c6/c11130af7b10d6c0321add5518fa",
|
||||
"src/assets/ba_data/python/babase/_mgen/enums.py": "https://files.ballistica.net/cache/ba1/38/c3/1dedd5e74f2508efc5974c8815a1",
|
||||
"src/ballistica/base/mgen/pyembed/binding_base.inc": "https://files.ballistica.net/cache/ba1/ea/6a/6a4721b144e5e297b542d2a0eea2",
|
||||
|
||||
1
.idea/dictionaries/ericf.xml
generated
1
.idea/dictionaries/ericf.xml
generated
@ -342,6 +342,7 @@
|
||||
<w>bpresult</w>
|
||||
<w>brandassets</w>
|
||||
<w>bridgit</w>
|
||||
<w>broadcastmessage</w>
|
||||
<w>bsac</w>
|
||||
<w>bsactor</w>
|
||||
<w>bscampaign</w>
|
||||
|
||||
11
CHANGELOG.md
11
CHANGELOG.md
@ -1,4 +1,4 @@
|
||||
### 1.7.20 (build 21118, api 8, 2023-06-15)
|
||||
### 1.7.20 (build 21119, api 8, 2023-06-16)
|
||||
|
||||
- This seems like a good time for a `refactoring` release in anticipation of
|
||||
changes coming in 1.8. Basically this means that a lot of things will be
|
||||
@ -338,6 +338,15 @@
|
||||
few megs but allows us to log nice full stack traces instead of just
|
||||
addresses. Try `print(_babase.native_stack_trace())` if you want to make sure
|
||||
its working.
|
||||
- (build 21118) Fixed an issue where certain messages such as player-left
|
||||
weren't being send to clients.
|
||||
- (build 21118) renamed `bascenev1.screenmessage()` to
|
||||
`bascenev1.broadcastmessage()` to make it more clear that it behaves
|
||||
differently (sending messages to all connected clients instead of just the
|
||||
local screen). There is still a `bascenev1.screenmessage()` but that is now
|
||||
the same local-only version available in babase. Added a temporary warning if
|
||||
calling screenmessage() in a situation that in previous versions would have
|
||||
done a broadcast.
|
||||
|
||||
### 1.7.19 (build 20997, api 7, 2023-01-19)
|
||||
|
||||
|
||||
1
ballisticakit-cmake/.idea/dictionaries/ericf.xml
generated
1
ballisticakit-cmake/.idea/dictionaries/ericf.xml
generated
@ -224,6 +224,7 @@
|
||||
<w>bpresult</w>
|
||||
<w>bresult</w>
|
||||
<w>bridgit</w>
|
||||
<w>broadcastmessage</w>
|
||||
<w>broadcom</w>
|
||||
<w>bsac</w>
|
||||
<w>bscfg</w>
|
||||
|
||||
@ -60,7 +60,7 @@ def _cmd(command_data: bytes) -> None:
|
||||
# Note: we have to do transient messages if
|
||||
# clients is specified, so they won't show up
|
||||
# in replays.
|
||||
bascenev1.screenmessage(
|
||||
bascenev1.broadcastmessage(
|
||||
command.message,
|
||||
color=command.color,
|
||||
clients=command.clients,
|
||||
|
||||
@ -28,7 +28,7 @@ if TYPE_CHECKING:
|
||||
|
||||
# Build number and version of the ballistica binary we expect to be
|
||||
# using.
|
||||
TARGET_BALLISTICA_BUILD = 21118
|
||||
TARGET_BALLISTICA_BUILD = 21119
|
||||
TARGET_BALLISTICA_VERSION = '1.7.20'
|
||||
|
||||
_g_env_config: EnvConfig | None = None
|
||||
|
||||
@ -48,6 +48,7 @@ from babase import (
|
||||
Plugin,
|
||||
pushcall,
|
||||
safecolor,
|
||||
screenmessage,
|
||||
set_analytics_screen,
|
||||
storagename,
|
||||
timestring,
|
||||
@ -113,7 +114,7 @@ from _bascenev1 import (
|
||||
release_gamepad_input,
|
||||
release_keyboard_input,
|
||||
reset_random_player_names,
|
||||
screenmessage,
|
||||
broadcastmessage,
|
||||
SessionData,
|
||||
SessionPlayer,
|
||||
set_admins,
|
||||
@ -386,11 +387,12 @@ __all__ = [
|
||||
'release_keyboard_input',
|
||||
'reset_random_player_names',
|
||||
'safecolor',
|
||||
'screenmessage',
|
||||
'SceneV1AppMode',
|
||||
'ScoreConfig',
|
||||
'ScoreScreenActivity',
|
||||
'ScoreType',
|
||||
'screenmessage',
|
||||
'broadcastmessage',
|
||||
'Session',
|
||||
'SessionData',
|
||||
'SessionPlayer',
|
||||
|
||||
@ -10,6 +10,7 @@ import logging
|
||||
from typing import TYPE_CHECKING, TypeVar
|
||||
|
||||
import babase
|
||||
|
||||
import _bascenev1
|
||||
from bascenev1._activity import Activity
|
||||
from bascenev1._player import PlayerInfo
|
||||
@ -1315,7 +1316,7 @@ class GameActivity(Activity[PlayerT, TeamT]):
|
||||
if m not in unowned_maps
|
||||
]
|
||||
if not valid_maps:
|
||||
babase.screenmessage(
|
||||
_bascenev1.broadcastmessage(
|
||||
babase.Lstr(resource='noValidMapsErrorText')
|
||||
)
|
||||
raise RuntimeError('No valid maps')
|
||||
|
||||
@ -242,7 +242,7 @@ class Session:
|
||||
# Print a rejection message *only* to the client trying to
|
||||
# join (prevents spamming everyone else in the game).
|
||||
_bascenev1.getsound('error').play()
|
||||
_bascenev1.screenmessage(
|
||||
_bascenev1.broadcastmessage(
|
||||
babase.Lstr(
|
||||
resource='playerLimitReachedText',
|
||||
subs=[('${COUNT}', str(self.max_players))],
|
||||
@ -283,7 +283,7 @@ class Session:
|
||||
sessionteam = sessionplayer.sessionteam
|
||||
assert sessionteam is not None
|
||||
|
||||
babase.screenmessage(
|
||||
_bascenev1.broadcastmessage(
|
||||
babase.Lstr(
|
||||
resource='playerLeftText',
|
||||
subs=[('${PLAYER}', sessionplayer.getname(full=True))],
|
||||
@ -655,7 +655,7 @@ class Session:
|
||||
# Get our next activity going.
|
||||
self._complete_end_activity(activity, {})
|
||||
else:
|
||||
babase.screenmessage(
|
||||
_bascenev1.broadcastmessage(
|
||||
babase.Lstr(
|
||||
resource='notEnoughPlayersText',
|
||||
subs=[('${COUNT}', str(min_players))],
|
||||
@ -721,7 +721,7 @@ class Session:
|
||||
):
|
||||
pass_to_activity = False
|
||||
with self.context:
|
||||
babase.screenmessage(
|
||||
_bascenev1.broadcastmessage(
|
||||
babase.Lstr(
|
||||
resource='playerDelayedJoinText',
|
||||
subs=[
|
||||
|
||||
@ -437,7 +437,7 @@ class Stats:
|
||||
# Report non-kill scorings.
|
||||
try:
|
||||
if screenmessage and not kill:
|
||||
_bascenev1.screenmessage(
|
||||
_bascenev1.broadcastmessage(
|
||||
babase.Lstr(
|
||||
resource='nameScoresText', subs=[('${NAME}', name)]
|
||||
),
|
||||
@ -475,7 +475,7 @@ class Stats:
|
||||
try:
|
||||
if killed and _bascenev1.getactivity().announce_player_deaths:
|
||||
if killer is player:
|
||||
_bascenev1.screenmessage(
|
||||
_bascenev1.broadcastmessage(
|
||||
babase.Lstr(
|
||||
resource='nameSuicideText', subs=[('${NAME}', name)]
|
||||
),
|
||||
@ -485,7 +485,7 @@ class Stats:
|
||||
)
|
||||
elif killer is not None:
|
||||
if killer.team is player.team:
|
||||
_bascenev1.screenmessage(
|
||||
_bascenev1.broadcastmessage(
|
||||
babase.Lstr(
|
||||
resource='nameBetrayedText',
|
||||
subs=[
|
||||
@ -498,7 +498,7 @@ class Stats:
|
||||
image=killer.get_icon(),
|
||||
)
|
||||
else:
|
||||
_bascenev1.screenmessage(
|
||||
_bascenev1.broadcastmessage(
|
||||
babase.Lstr(
|
||||
resource='nameKilledText',
|
||||
subs=[
|
||||
@ -511,7 +511,7 @@ class Stats:
|
||||
image=killer.get_icon(),
|
||||
)
|
||||
else:
|
||||
_bascenev1.screenmessage(
|
||||
_bascenev1.broadcastmessage(
|
||||
babase.Lstr(
|
||||
resource='nameDiedText', subs=[('${NAME}', name)]
|
||||
),
|
||||
|
||||
@ -278,7 +278,7 @@ class Spaz(bs.Actor):
|
||||
)
|
||||
self._turbo_filter_times[source] = t_ms
|
||||
# (uncomment to debug; prints what this count is at)
|
||||
# bs.screenmessage( str(source) + " "
|
||||
# bs.broadcastmessage( str(source) + " "
|
||||
# + str(self._turbo_filter_counts[source]))
|
||||
if self._turbo_filter_counts[source] == 15:
|
||||
# Knock 'em out. That'll learn 'em.
|
||||
@ -290,7 +290,7 @@ class Spaz(bs.Actor):
|
||||
assert bs.app.classic is not None
|
||||
if now > bs.app.classic.last_spaz_turbo_warn_time + 30.0:
|
||||
bs.app.classic.last_spaz_turbo_warn_time = now
|
||||
bs.screenmessage(
|
||||
bs.broadcastmessage(
|
||||
bs.Lstr(
|
||||
translate=(
|
||||
'statements',
|
||||
|
||||
@ -260,7 +260,7 @@ class RaceGame(bs.TeamGameActivity[Player, Team]):
|
||||
if player.is_alive():
|
||||
assert player.actor
|
||||
player.actor.handlemessage(bs.DieMessage())
|
||||
bs.screenmessage(
|
||||
bs.broadcastmessage(
|
||||
bs.Lstr(
|
||||
translate=(
|
||||
'statements',
|
||||
@ -392,7 +392,7 @@ class RaceGame(bs.TeamGameActivity[Player, Team]):
|
||||
isinstance(self.session, bs.DualTeamSession)
|
||||
and self._entire_team_must_finish
|
||||
):
|
||||
bs.screenmessage(
|
||||
bs.broadcastmessage(
|
||||
bs.Lstr(
|
||||
translate=(
|
||||
'statements',
|
||||
|
||||
@ -459,7 +459,7 @@ class TutorialActivity(bs.Activity[Player, Team]):
|
||||
assert isinstance(tval, int)
|
||||
diff = tval
|
||||
a.cycle_times.append(diff)
|
||||
bs.screenmessage(
|
||||
bs.broadcastmessage(
|
||||
'cycle time: '
|
||||
+ str(diff)
|
||||
+ ' (average: '
|
||||
|
||||
@ -35,6 +35,34 @@ static auto PyScreenMessage(PyObject* self, PyObject* args, PyObject* keywds)
|
||||
&color_obj, &log)) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// TEMP - we used to have a single ba.screenmessage() call that would
|
||||
// broadcast messages to all clients when called by a server in a game context
|
||||
// and simply print them locally in other cases. In 1.7.20 the broadcast form
|
||||
// has been moved to bascenev1.broadcastmessage(). But there's probably lots
|
||||
// of code out there using screenmessage() not realizing it won't do what they
|
||||
// intended anymore. So for now let's issue a warning when it *would* have
|
||||
// done the broadcast thing. (just assuming that's the case any time there's a
|
||||
// non-empty context)
|
||||
static bool did_warning{};
|
||||
if (!did_warning && !g_base->CurrentContext().IsEmpty()) {
|
||||
did_warning = true;
|
||||
auto* envval = getenv("BA_SUPPRESS_SCREEN_MESSAGE_WARNING");
|
||||
bool suppress = (envval && strcmp(envval, "1") == 0);
|
||||
if (!suppress) {
|
||||
Log(LogLevel::kWarning,
|
||||
"FIXME! screenmessage() is being called in a gameplay situation.\n"
|
||||
"The screenmessage call used to send messages to all players but now "
|
||||
"only prints them locally.\n"
|
||||
"Please change your code to use bascenev1.broadcastmessage() to get "
|
||||
"the old behavior.\n"
|
||||
"You can set env var BA_SUPPRESS_SCREEN_MESSAGE_WARNING=1 to "
|
||||
"suppress "
|
||||
"this warning.");
|
||||
g_base->PrintPythonStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
std::string message_str = g_base->python->GetPyLString(message_obj);
|
||||
Vector3f color{1, 1, 1};
|
||||
if (color_obj != Py_None) {
|
||||
@ -66,8 +94,8 @@ static PyMethodDef PyScreenMessageDef = {
|
||||
"Category: **General Utility Functions**\n"
|
||||
"\n"
|
||||
"Note that this version of the function is purely for local display.\n"
|
||||
"To broadcast screen messages in network play, see the versions of\n"
|
||||
"this call provided by the scene-version packages.",
|
||||
"To broadcast screen messages in network play, look for methods such as\n"
|
||||
"broadcastmessage() provided by the scene-version packages.",
|
||||
};
|
||||
|
||||
// -------------------------- get_camera_position ------------------------------
|
||||
|
||||
@ -29,21 +29,6 @@ namespace ballistica::base {
|
||||
/// extra functionality.
|
||||
class ContextRef {
|
||||
public:
|
||||
/// The current global context-ref;
|
||||
// static auto Current() -> const ContextRef& {
|
||||
// assert(g_base);
|
||||
// assert(g_base->InLogicThread()); // Up to caller to ensure this.
|
||||
// return *g_base->context_ref;
|
||||
// }
|
||||
|
||||
/// Set the current global context from this one.
|
||||
// static void SetCurrent(const ContextRef& context) {
|
||||
// assert(g_base);
|
||||
// // Context system is currently limited to logic-thread.
|
||||
// BA_PRECONDITION(g_base->InLogicThread());
|
||||
// g_base->context_ref->SetTarget(context.Get());
|
||||
// }
|
||||
|
||||
/// Return a description of the context we're pointing at.
|
||||
auto GetDescription() const -> std::string;
|
||||
|
||||
|
||||
@ -621,9 +621,9 @@ static PyMethodDef PyGetActivityDef = {
|
||||
"If doraise is False, None will be returned instead in that case.",
|
||||
};
|
||||
|
||||
// ---------------------------- screenmessage ----------------------------------
|
||||
// -------------------------- broadcastmessage ---------------------------------
|
||||
|
||||
static auto PyScreenMessage(PyObject* self, PyObject* args, PyObject* keywds)
|
||||
static auto PyBroadcastMessage(PyObject* self, PyObject* args, PyObject* keywds)
|
||||
-> PyObject* {
|
||||
BA_PYTHON_TRY;
|
||||
const char* message = nullptr;
|
||||
@ -732,6 +732,7 @@ static auto PyScreenMessage(PyObject* self, PyObject* args, PyObject* keywds)
|
||||
texture = SceneV1Python::GetPySceneTexture(image_obj);
|
||||
}
|
||||
}
|
||||
|
||||
if (output_stream) {
|
||||
// FIXME: for now we just do bottom messages.
|
||||
if (texture == nullptr && !top) {
|
||||
@ -766,12 +767,12 @@ static auto PyScreenMessage(PyObject* self, PyObject* args, PyObject* keywds)
|
||||
BA_PYTHON_CATCH;
|
||||
}
|
||||
|
||||
static PyMethodDef PyScreenMessageDef = {
|
||||
"screenmessage", // name
|
||||
(PyCFunction)PyScreenMessage, // method
|
||||
METH_VARARGS | METH_KEYWORDS, // flags
|
||||
static PyMethodDef PyBroadcastMessageDef = {
|
||||
"broadcastmessage", // name
|
||||
(PyCFunction)PyBroadcastMessage, // method
|
||||
METH_VARARGS | METH_KEYWORDS, // flags
|
||||
|
||||
"screenmessage(message: str | babase.Lstr,\n"
|
||||
"broadcastmessage(message: str | babase.Lstr,\n"
|
||||
" color: Sequence[float] | None = None,\n"
|
||||
" top: bool = False,\n"
|
||||
" image: dict[str, Any] | None = None,\n"
|
||||
@ -780,7 +781,7 @@ static PyMethodDef PyScreenMessageDef = {
|
||||
" transient: bool = False)"
|
||||
" -> None\n"
|
||||
"\n"
|
||||
"Print a message to the local client's screen, in a given color.\n"
|
||||
"Broadcast a screen-message to clients in the current session.\n"
|
||||
"\n"
|
||||
"Category: **General Utility Functions**\n"
|
||||
"\n"
|
||||
@ -1730,7 +1731,7 @@ auto PythonMethodsScene::GetMethods() -> std::vector<PyMethodDef> {
|
||||
PyRegisterActivityDef,
|
||||
PyRegisterSessionDef,
|
||||
PyIsInReplayDef,
|
||||
PyScreenMessageDef,
|
||||
PyBroadcastMessageDef,
|
||||
PyGetRandomNamesDef,
|
||||
PyResetRandomPlayerNamesDef,
|
||||
PySetReplaySpeedExponentDef,
|
||||
|
||||
@ -39,7 +39,7 @@ auto main(int argc, char** argv) -> int {
|
||||
namespace ballistica {
|
||||
|
||||
// These are set automatically via script; don't modify them here.
|
||||
const int kEngineBuildNumber = 21118;
|
||||
const int kEngineBuildNumber = 21119;
|
||||
const char* kEngineVersion = "1.7.20";
|
||||
|
||||
auto MonolithicMain(const core::CoreConfig& core_config) -> int {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user