tidying up PRs

This commit is contained in:
Eric 2023-10-27 10:08:56 -07:00
parent 55841a7431
commit f31087db64
No known key found for this signature in database
GPG Key ID: 89C93F0F8D6D5A98
8 changed files with 59 additions and 39 deletions

44
.efrocachemap generated
View File

@ -430,12 +430,12 @@
"build/assets/ba_data/data/languages/czech.json": "93c5fe0d884d95435da6c675f64e30e0",
"build/assets/ba_data/data/languages/danish.json": "3fd69080783d5c9dcc0af737f02b6f1e",
"build/assets/ba_data/data/languages/dutch.json": "22b44a33bf81142ba2befad14eb5746e",
"build/assets/ba_data/data/languages/english.json": "6fb6ec37e79064edb4b8864eabdd024d",
"build/assets/ba_data/data/languages/english.json": "b0c8dc8bd35a5606e5d3318d7cb52cba",
"build/assets/ba_data/data/languages/esperanto.json": "0e397cfa5f3fb8cef5f4a64f21cda880",
"build/assets/ba_data/data/languages/filipino.json": "afbda3adf14555e1567ee63c32e340e7",
"build/assets/ba_data/data/languages/french.json": "4e218dcd488fa63e7db5b4da2261b9e1",
"build/assets/ba_data/data/languages/german.json": "450fa41ae264f29a5d1af22143d0d0ad",
"build/assets/ba_data/data/languages/gibberish.json": "63c6212c774622346f3ad0d87ff31e80",
"build/assets/ba_data/data/languages/gibberish.json": "d9022a7e655da5ac41b9cef7f3b114a6",
"build/assets/ba_data/data/languages/greek.json": "287c0ec437b38772284ef9d3e4fb2fc3",
"build/assets/ba_data/data/languages/hindi.json": "8ea0c58a44a24edb131d0e53b074d1f6",
"build/assets/ba_data/data/languages/hungarian.json": "796a290a8c44a1e7635208c2ff5fdc6e",
@ -4056,26 +4056,26 @@
"build/assets/windows/Win32/ucrtbased.dll": "2def5335207d41b21b9823f6805997f1",
"build/assets/windows/Win32/vc_redist.x86.exe": "b08a55e2e77623fe657bea24f223a3ae",
"build/assets/windows/Win32/vcruntime140d.dll": "865b2af4d1e26a1a8073c89acb06e599",
"build/prefab/full/linux_arm64_gui/debug/ballisticakit": "094b4c35b814b4362548f39c606e8340",
"build/prefab/full/linux_arm64_gui/release/ballisticakit": "718ca38bd807617b717127f57b15b4db",
"build/prefab/full/linux_arm64_server/debug/dist/ballisticakit_headless": "187653e68c40efcaa7b0be472f3d0e11",
"build/prefab/full/linux_arm64_server/release/dist/ballisticakit_headless": "d83ad495c68954582533e020741e8b67",
"build/prefab/full/linux_x86_64_gui/debug/ballisticakit": "9c558719c535b6caf04bd2acc3f1d814",
"build/prefab/full/linux_x86_64_gui/release/ballisticakit": "dc81652da50da892eaa883fc51d05232",
"build/prefab/full/linux_x86_64_server/debug/dist/ballisticakit_headless": "f9f2a7e0ad4a7b0b1dc70d3d3fd87bf3",
"build/prefab/full/linux_x86_64_server/release/dist/ballisticakit_headless": "fec33beeadac82b3110384833fe468ec",
"build/prefab/full/mac_arm64_gui/debug/ballisticakit": "2ce01b857e405f5c4c8bc34ce4ceffa2",
"build/prefab/full/mac_arm64_gui/release/ballisticakit": "ec5dc2f69d87bdee515bcac8a9ed8a0c",
"build/prefab/full/mac_arm64_server/debug/dist/ballisticakit_headless": "7b581247e0dfc805bc2f9f6660fb4947",
"build/prefab/full/mac_arm64_server/release/dist/ballisticakit_headless": "ee8fd59311c5d6f394284eb35db525ae",
"build/prefab/full/mac_x86_64_gui/debug/ballisticakit": "6030bf17d98bba9e46af37262001b0b9",
"build/prefab/full/mac_x86_64_gui/release/ballisticakit": "c4664b39a64e86a56effd4e786fa3512",
"build/prefab/full/mac_x86_64_server/debug/dist/ballisticakit_headless": "5103e47d603b77a3e473abc7640887fb",
"build/prefab/full/mac_x86_64_server/release/dist/ballisticakit_headless": "543582ac07c3f388078ef84f24e85748",
"build/prefab/full/windows_x86_gui/debug/BallisticaKit.exe": "d7aaba481668cc06df15702094f85de7",
"build/prefab/full/windows_x86_gui/release/BallisticaKit.exe": "992ccd07ef6717381ecd6c8ebf84e902",
"build/prefab/full/windows_x86_server/debug/dist/BallisticaKitHeadless.exe": "25a11175b27acc766ec02dc4a4ec86be",
"build/prefab/full/windows_x86_server/release/dist/BallisticaKitHeadless.exe": "fd087e2654ba73cf4ddce328b012e23c",
"build/prefab/full/linux_arm64_gui/debug/ballisticakit": "b5f5272bf4b390ebfa144474f65d1fdc",
"build/prefab/full/linux_arm64_gui/release/ballisticakit": "1c4b400a17662dd30ca597772d1ae38d",
"build/prefab/full/linux_arm64_server/debug/dist/ballisticakit_headless": "2abf39c5efb01fb97559f8818dbd4210",
"build/prefab/full/linux_arm64_server/release/dist/ballisticakit_headless": "2d446e30ca6d2d9d65c1c2ebed2b7485",
"build/prefab/full/linux_x86_64_gui/debug/ballisticakit": "9586be74d1f801fdae227ee508ff84ee",
"build/prefab/full/linux_x86_64_gui/release/ballisticakit": "ce099f4bfbdf1c57f83b23fff97c554e",
"build/prefab/full/linux_x86_64_server/debug/dist/ballisticakit_headless": "caf89cb6fc0d745490766f2fc4982c99",
"build/prefab/full/linux_x86_64_server/release/dist/ballisticakit_headless": "fe8bfae5f47af29da1bc6a387b6fa999",
"build/prefab/full/mac_arm64_gui/debug/ballisticakit": "889737fad009958817a09c1018c56ad3",
"build/prefab/full/mac_arm64_gui/release/ballisticakit": "4c4d570c468e3f21813860311b3bf8a5",
"build/prefab/full/mac_arm64_server/debug/dist/ballisticakit_headless": "58735d1e9cf8d9beaf57a9291c4c38d2",
"build/prefab/full/mac_arm64_server/release/dist/ballisticakit_headless": "d5c3ff47f16d668a1e26c16611890767",
"build/prefab/full/mac_x86_64_gui/debug/ballisticakit": "93883b7e8933955a733f51abe07dc8ec",
"build/prefab/full/mac_x86_64_gui/release/ballisticakit": "0ca0076dc51f986ae6fad3b7bf2da507",
"build/prefab/full/mac_x86_64_server/debug/dist/ballisticakit_headless": "d4e32f23bf4a6bac11d9dc9809fac181",
"build/prefab/full/mac_x86_64_server/release/dist/ballisticakit_headless": "aad14a5bf8bbb0731cf8886967995118",
"build/prefab/full/windows_x86_gui/debug/BallisticaKit.exe": "9a99df09f0d09da7e929a8aeb4d39205",
"build/prefab/full/windows_x86_gui/release/BallisticaKit.exe": "bbbc58ea77b688f3c4b4edb406f7efbc",
"build/prefab/full/windows_x86_server/debug/dist/BallisticaKitHeadless.exe": "14f284fa6ac9e4fdcb4e0976a73c3969",
"build/prefab/full/windows_x86_server/release/dist/BallisticaKitHeadless.exe": "926ebddaa448b27b2841104b5139c83a",
"build/prefab/lib/linux_arm64_gui/debug/libballisticaplus.a": "476e9cf1fb229a023babd799a6e535f1",
"build/prefab/lib/linux_arm64_gui/release/libballisticaplus.a": "cf2a61fae8e8cd757864202a09e71255",
"build/prefab/lib/linux_arm64_server/debug/libballisticaplus.a": "476e9cf1fb229a023babd799a6e535f1",

View File

@ -1,4 +1,4 @@
### 1.7.28 (build 21523, api 8, 2023-10-27)
### 1.7.28 (build 21524, api 8, 2023-10-27)
- Massively cleaned up code related to rendering and window systems (OpenGL,
SDL, etc). This code had been growing into a nasty tangle for 15 years
@ -167,6 +167,13 @@
- Added clipboard paste support to the dev console python terminal.
- Added various text editing functionality to the dev console python terminal
(cursor movement, deleting chars and words, etc.)
- Internal on-screen-keyboard now has a cancel button (thanks vishal332008!)
- Public servers list now shows 'No servers found' if there are no servers to
show instead of just remaining mysteriously blank (thanks vishal332008!)
- Players are now prevented from rejoining a session for 10 seconds after they
leave to prevent game exploits. Note this is different than the existing
system that prevents joining a *party* for 10 seconds; this covers people
who never leave the party (Thanks EraOSBeta!).
### 1.7.27 (build 21282, api 8, 2023-08-30)

View File

@ -52,7 +52,7 @@ if TYPE_CHECKING:
# Build number and version of the ballistica binary we expect to be
# using.
TARGET_BALLISTICA_BUILD = 21523
TARGET_BALLISTICA_BUILD = 21524
TARGET_BALLISTICA_VERSION = '1.7.28'

View File

@ -18,7 +18,10 @@ if TYPE_CHECKING:
import bascenev1
TIMEOUT = 10
# How long someone who left the session (but not the party) must
# wait to rejoin the session again. Intended to prevent game exploits
# such as skipping respawn waits.
REJOIN_COOLDOWN = 10
class Session:
@ -206,6 +209,7 @@ class Session:
# Instantiate our session globals node which will apply its settings.
self._sessionglobalsnode = _bascenev1.newnode('sessionglobals')
# Rejoin cooldown stuff.
self._players_on_wait: dict = {}
self._player_requested_identifiers: dict = {}
self._waitlist_timers: dict = {}
@ -260,11 +264,14 @@ class Session:
)
return False
# Rejoin cooldown.
identifier = player.get_v1_account_id()
if identifier:
leave_time = self._players_on_wait.get(identifier)
if leave_time:
diff = str(math.ceil(TIMEOUT - babase.apptime() + leave_time))
diff = str(
math.ceil(REJOIN_COOLDOWN - babase.apptime() + leave_time)
)
_bascenev1.broadcastmessage(
babase.Lstr(
translate=(
@ -297,12 +304,13 @@ class Session:
activity = self._activity_weak()
# Rejoin cooldown.
identifier = self._player_requested_identifiers.get(sessionplayer.id)
if identifier:
self._players_on_wait[identifier] = babase.apptime()
with babase.ContextRef.empty():
self._waitlist_timers[identifier] = babase.AppTimer(
TIMEOUT,
REJOIN_COOLDOWN,
babase.Call(self._remove_player_from_waitlist, identifier),
)

View File

@ -361,7 +361,7 @@ class PublicGatherTab(GatherTab):
self._last_server_list_query_time: float | None = None
self._join_list_column: bui.Widget | None = None
self._join_status_text: bui.Widget | None = None
self._no_servers_text: bui.Widget | None = None
self._no_servers_found_text: bui.Widget | None = None
self._host_max_party_size_value: bui.Widget | None = None
self._host_max_party_size_minus_button: (bui.Widget | None) = None
self._host_max_party_size_plus_button: (bui.Widget | None) = None
@ -659,7 +659,7 @@ class PublicGatherTab(GatherTab):
color=(0.6, 0.6, 0.6),
position=(c_width * 0.5, c_height * 0.5),
)
self._no_servers_text = bui.textwidget(
self._no_servers_found_text = bui.textwidget(
parent=self._container,
text='',
size=(0, 0),
@ -979,7 +979,7 @@ class PublicGatherTab(GatherTab):
edit=self._host_scrollwidget,
claims_up_down=(len(self._parties_displayed) > 0),
)
bui.textwidget(edit=self._no_servers_text, text='')
bui.textwidget(edit=self._no_servers_found_text, text='')
# Clip if we have more UI rows than parties to show.
clipcount = len(self._ui_rows) - len(self._parties_displayed)
@ -995,8 +995,8 @@ class PublicGatherTab(GatherTab):
and cast(str, bui.textwidget(query=text)) == ''
):
bui.textwidget(
edit=self._no_servers_text,
text=bui.Lstr(resource='noServerFoundText'),
edit=self._no_servers_found_text,
text=bui.Lstr(resource='noServersFoundText'),
)
return

View File

@ -600,7 +600,7 @@ void Graphics::DrawMiscOverlays(FrameDef* frame_def) {
} else {
a = 1;
}
a *= 0.8f;
a *= 0.7f;
// if (vr) {
// a *= 0.8f;
@ -631,6 +631,8 @@ void Graphics::DrawMiscOverlays(FrameDef* frame_def) {
if (age < 100) {
fade = 1.0f;
} else {
// Don't fade ALL the way to black; leaves a tiny bit of color
// showing which looks nice.
fade = std::max(0.07f, (200.0f - static_cast<float>(age)) / 100.0f);
}
c.SetColor(r * fade, g * fade, b * fade, a);
@ -1969,7 +1971,7 @@ auto Graphics::ScreenMessageEntry::GetText() -> TextGroup& {
if (!top_style) {
float x_extend = 40.0f;
float y_extend = 40.0f;
float y_offset = -10.0f;
float y_offset = -5.0f;
float corner_radius = 60.0f;
float width_fin = str_width + x_extend * 2.0f;
float height_fin = str_height + y_extend * 2.0f;

View File

@ -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 = 21523;
const int kEngineBuildNumber = 21524;
const char* kEngineVersion = "1.7.28";
const int kEngineApiVersion = 8;

View File

@ -468,6 +468,11 @@ void TextWidget::set_res_scale(float res_scale) {
void TextWidget::SetText(const std::string& text_in_raw) {
std::string text_in = Utils::GetValidUTF8(text_in_raw.c_str(), "twst1");
// Ignore redundant sets.
if (text_in == text_raw_) {
return;
}
// In some cases we want to make sure this is a valid resource-string
// since catching the error here is much more useful than if we catch
// it at draw-time. However this is expensive so we only do it for debug
@ -510,10 +515,6 @@ void TextWidget::SetText(const std::string& text_in_raw) {
Python::PrintStackTrace();
}
}
if (text_in != text_raw_) {
text_translation_dirty_ = true;
}
text_raw_ = text_in;
// Do our clamping in unicode-space.
if (Utils::UTF8StringLength(text_raw_.c_str()) > max_chars_) {
@ -522,6 +523,8 @@ void TextWidget::SetText(const std::string& text_in_raw) {
uni.resize(static_cast<size_t>(max_chars_));
text_raw_ = Utils::UTF8FromUnicode(uni);
}
text_translation_dirty_ = true;
text_raw_ = text_in;
carat_position_ = 9999;
}