A shell utilities function library starting with a first utility
function for getting the number of online CPUs.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Theere is now an `Engine.startAtlas` property that will start Atlas
when it's returned from the root page. The `Engine.RestartInAtlas`
function is removed.
There are a few version of boost which deprecated global placeholders
but do not yet support std placeholders. Simply suppress warning for
those cases.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Use the single Debian 12 container image and inject CC, CXX and LDFLAGS
instead.
Further do the lfs checkout on the agent instead of inside the container
avoiding full rebuilds due to version mismatch.
Then split the debug and release builds using separate workspaces and
record warnings by build preventing gcc warnings leaking into clang
warnings.
Based on zero warning policy and incremental builds using a reference
build doesn't make sense. Removing that we can also drop an additional
generic workspace.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Debian 12 (bookworm) will soon be oldstable.
Most importantly this version comes with cmake-3.25, which will allow us
to use SDL3, cpp-httplib, fcollada fork and possibly others in the
future.
This also comes with gcc-12 and clang-14 by default, both implementing
almost all of c++17 and most of c++20.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
The most notable changes are:
- improved performance thanks to using `lxml` instead of `xmllint` for
validating the templates
- improved performance by parallelizing the validation across multiple
threads
- more meaningful output for detected validation errors
- easier to call from other scripts (like checkrefs.py)
When TLS for XMPP connections to the multiplayer lobby got implemented,
there was a bug in gloox [1] preventing the certificate verification to
succeed. This bug got fixed in gloox 1.0.22 five years ago, so it's safe
to enable certificate verification by default now.
[1]: https://web.archive.org/web/20200522184941/https://bugs.camaya.net/ticket/?id=280
Since 40762c257d there is a callback passed to the "onPress" function of
the `g_MainMenuItems`. If the "onPress" function is a bound
`Engine.OpenChildPage` with only the filename bound to it, the callback
becomes the second argument.
The second argument is cloned to pass it to the child page. Cloning the
callback crashed the engine.
Users may generate key presses that don't map to a distinct SDL scancode
and will be mapped SDL_SCANCODE_UNKNOWN instead. Using the same ID for
unmapped hotkeys means any such key press will execute unset hotkeys. As
luck would have it in #7644 this leads to calling "Custom exit to
desktop" if the hotkey is unbound as is the default.
So simply use a code for unused hotkeys that doesn't map to any SDL
scancodes.
Fixes: #7644
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Add a unique disconnect reason for timeouts of connection attempts.
Rewrite the displayed error message and provide a link directly to the FAQ entry.
(The old message was very misleading and only brought players on the
wrong track during troubleshooting)
When the root page gets closed the engine quits instead or crashing.
The root pages are changed to use that mechanism to quit the engine.
This removes the need of `Engine.Exit` for the GUI.
Don't hardcode the number of parallel jobs in Windows based pipelines
but allow setting the desired number in the environment.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Allow the number of concurrent build jobs in Unix build pipelines be
specified in the environment via the JOBS variable.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Remove the world population setting from the game setup.
Add a dropdown for choosing the "Population Cap Type".
(-> containing Player Population, World Population, Team Population)
Use a single "Population Cap" dropdown adapting to the pop cap types.
Move all population data into a single .json file.
New system component "PopulationCapManager" for distributing pop caps.
Resolves: #6918
The xmlvalidator logic is only used by the checkrefs.py script, so this
moves it to the same directory to have it co-located and avoid having to
modify sys.path to import it.
By default ruff excludes all files in directories named "dist" from
linting (https://docs.astral.sh/ruff/settings/#exclude). This caused the
Python scripts in `source/tools/dist/` to not get linted. This commit
fixes that and adjusts their style to fit our ruff rules.
The Linux agent now runs Docker in rootless mode for additional
security. Operations inside containers must be run as root to match the
underprivileged user running Docker.
If you run as root then created files will be owned by root, this is
expected behaviour and not messing with permissions as stated in the
error message.
Running in a container the root user may map to the user starting the
container while all other users would need mapping to be able to work
with a bind mounted a checkout.
Further Debian patches out the root check to be able to build on their
builder.
Given the above remove the check.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Add checks for sprites, styles, scrollbars, tooltips, and colors.
And too for entire objects referenced by the "use_object" attribute.
(even though that is currently unused)
The UPnP implementation included a combination of two subtle bugs, which
resulted in failure to create port forwardings every time after the
first one.
When using UPnP, the internet gateway to create the port forwardings at
needs to discovered. As that takes a while, the its root descriptor URL
was supposed to be cached after successful discovery in the user config
in "network.upnprootdescurl". However, instead of caching the root
descriptor URL, the control URL got cached. That caused following
requests to the root descriptor URL to fail, as they ended up at the
control URL instead. As such requests might also fail when the network
topology changed, the code was supposed to fall back to discovering the
internet gateway again when the cached one didn't work. However, due to
the inner workings of miniupnpc the request using the cached root
descriptor URL didn't result in an error, so the new discovery was never
triggered. As the wrong value was persisted in the user config there was
also no way to get out of this situation again.
This commit fixes both of these bugs.
As far as I can tell these bugs existed since the introduction of the
caching of the root descriptor URL in 0ba25e9968, which means creating
port forwardings using UPnP has been broken since Alpha 15.
When adding a port forwarding via UPnP, pyrogenesis first needs to
discover the internet gateway to create the forwarding at. To do so, it
utilizes miniupnpc to send an SSDP request and waits 10 seconds until it
processes the responses and continues to add the port forwarding.
As that happens asynchronously it means if players hosting games rely on
UPnP for port forwarding and if their pyrogenesis instance doesn't have
the address of their internet gateway cached, it takes more than 10
seconds after starting to host a game, before players can join. However,
waiting for 10 seconds is completely unnecessary, because the internet
gateway responds immediately to the SSDP request. Therefore, this commit
reduces the time to wait for responses from 10 seconds to 2 seconds,
which is the timeout miniupnpc uses internally as well, when discovering
internet gateways.
Up to know the UPnP logic ignored the port a user was hosting a game on
and always added a port forwarding for the default port UDP 20595. This
commit fixes that, so a port forwarding is added for the actual port a
game is hosted on.
As it turns out we don't need that special logic for handling the "long"
locale properly and everything continues to work as before without it.
The only difference is that the number format not being the one from
en_us anymore when using the "long" locale, but the one of the
system-wide configured language, which should be an even better user
experience than before.
The debug serializer currently outputs data even for components where `Serialize = null`.
This leads to useless data being output, especially in OOS debug states which makes diffing more annoying.
Noted in #7634
Move the lines from the .txt to the .xml .
Add separate objects for each paragraph and icon.
Position the icons depending on the paragraph length in the current
language.
This eliminates potential for breakage during translation.
Fixes#7484
Gcc-14 triggers a warning for substitute_esc_chars in
json_spirit_reader_template.h if optimizations are enabled.
../../../source/third_party/jsonspirit/json_spirit_reader_template.h:138:62:
/usr/lib/gcc/x86_64-pc-linux-gnu/14/include/g++-v14/bits/char_traits.h:427:56: warning: ‘void* __builtin_memcpy(void*, const void*, long unsigned int)’ accessing 9223372036854775808 or more bytes at offsets 0 and 0 may overlap up to 9223372036854775809 bytes at offset -1 [-Wrestrict]
427 | return static_cast<char_type*>(__builtin_memcpy(__s1, __s2, __n));
for with lto enabled
/usr/lib/gcc/x86_64-pc-linux-gnu/14/include/g++-v14/bits/char_traits.h:427:56: warning: ‘__builtin_memcpy’ specified bound between 9223372036854775808 and 18446744073709551615 exceeds maximum object size 9223372036854775807 [-Wstringop-overflow=]
427 | return static_cast<char_type*>(__builtin_memcpy(__s1, __s2, __n));
This looks like another incarnation of bugs like:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105329https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100366
Add quirk to avoid the warning
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Premake v5.0.0-beta4 replaces the LinkTimeOptimization flag with a
function linktimeoptimization, use it if available to avoid deprecation
warning.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>