1
0
forked from 0ad/0ad
Commit Graph

7764 Commits

Author SHA1 Message Date
8f8e29c092 Fix incompatible mods start: show both incompatible and enabled mods;
As noted by Angen in a26535d023, refs 3bcf360107
When starting with incompatible mods, the non-incompatible mods were no
longer shown. This fixes that.
I think the code looks cleaner from this new control flow that
explicitly only mounts "mod".

Tested by: Angen
Differential Revision: https://code.wildfiregames.com/D3996
This was SVN commit r25510.
2021-05-22 07:33:49 +00:00
2be76d52b5 Reduces CConsole interface and simplifies the initialization step.
This was SVN commit r25507.
2021-05-21 23:10:43 +00:00
d7ac3c6b89 Removes macOS system version include added in 7e87211d91 and forgotten in 9a2d0f803e.
This was SVN commit r25506.
2021-05-21 21:46:01 +00:00
7ae43c149e Replaces global g_VSync state by VideoMode property.
This was SVN commit r25504.
2021-05-21 21:33:43 +00:00
b2d0bd9a81 Adds a warning in case ShaderManager is trying to load an ARB shader with enabled GLSL.
This was SVN commit r25503.
2021-05-21 20:32:33 +00:00
4215533ea9 Removes inclusionPath forgotten in b469983c58.
This was SVN commit r25502.
2021-05-21 20:15:58 +00:00
78aedfcb93 Removes unused declarations of g_xres and g_yres.
This was SVN commit r25501.
2021-05-21 20:02:03 +00:00
fa44b9ae97 Removes g_ShowPathfindingOverlay forgotten in 72bd886f80.
This was SVN commit r25500.
2021-05-21 19:27:43 +00:00
312225570f Removes g_AutostartMap forgotten in c684c211a2.
This was SVN commit r25499.
2021-05-21 19:21:24 +00:00
7cf579c597 Removes g_TriPathfind forgotten in d3048906cb.
This was SVN commit r25498.
2021-05-21 19:11:12 +00:00
5be764e384 Removes outdated archive trace code forgotten in 63086f4e26.
This was SVN commit r25497.
2021-05-21 19:05:40 +00:00
b6f2dee43b Increase pushing range by 60%
Reduces the 'clumpiness' of units, particularly when ordered to move to
a single point. The minimum pushing force was increased to compensate.

Differential Revision: https://code.wildfiregames.com/D3978
This was SVN commit r25479.
2021-05-21 07:23:47 +00:00
a26535d023 Fix mistake in 3bcf360107 which stopped the incompatible mods page from showing.
I didn't quite understand what was supposed to happen here. This makes
things work as before.
While at it, fix a conversion bug & do some more tweaks.

Differential Revision: https://code.wildfiregames.com/D3990
This was SVN commit r25475.
2021-05-20 17:11:26 +00:00
3bcf360107 Mod and mod-mounting cleanup and improvements.
- Non-visual replays now automatically try to load the replay mods. This
removes the annoyance that -mod=public usually had to be passed.
- MountMods is no longer called in InitVfs but later, making it possible
to load the game in one pass & simplifying things considerably.
- Explicitly ignore duplicates when loading mods
- Interface cleanup: failed mods and incompatible mods were redundant,
only incompatible mods is kept.
- Interface cleanup: `AreModsCompatible`becomes
`CheckForIncompatibleMods`, which becomes a private pure function,
simplifying the control flow somewhat.
- Interface cleanup: `CheckAndEnableMods` is just `EnableMods`, which
explicitly updates loaded & incompatible mods.
- `CacheEnabledModVersions` becomes private and is called on behalf of
the user, removing the need to be careful about updating that (fixes my
concern at 44ec2e324e)

Overall, the logic around mounting & enabled mods should be easier to
understand.

Differential Revision: https://code.wildfiregames.com/D3982
This was SVN commit r25474.
2021-05-20 14:36:42 +00:00
1e297fe212 Fixes PCH after 7bfcd9f78b.
This was SVN commit r25473.
2021-05-20 11:47:56 +00:00
04549a081d Rework Mod into a class.
`Mod` currently modifies 4 global arrays, including some that are
'public'.

The logic flow is easier to understand if this becomes a real class with
const-correctness and public/private methods.

Differential Revision: https://code.wildfiregames.com/D3981
This was SVN commit r25469.
2021-05-20 08:32:11 +00:00
7bfcd9f78b Additional entropy when hashing match passwords.
The purpose of our client-side hashing for lobby game passwords is to
prevent malicious hosts from getting valuable passwords from clients
(e.g. accidentally typing their lobby password instead of the game, or
even their email password, etc).
However, the hashing was deterministic (and rather simple), making it
possible to compute rainbow tables and recover user passwords anyways.

By adding more variation, including some that cannot so easily be
controlled by the host (the client name), this becomes impractical. The
password hashing function used is rather fast, but given the base low
probability of mistypes, this seems fine.

Differential Revision: https://code.wildfiregames.com/D3459
This was SVN commit r25459.
2021-05-18 14:47:36 +00:00
0c23e595fa Include CStrInternStatic where necessary only.
This makes incremental recompilation faster when changing static
interned strings.

Differential Revision: https://code.wildfiregames.com/D3975
This was SVN commit r25457.
2021-05-18 11:09:54 +00:00
895e4e6aa6 StunClient code cleanup: use enet functions, endianness
Instead of using platform-specific sockets, use enet_socket* functions
(which ends up doing the same).
Clean up some confusing APIs, removing the distinction between finding
the public IP for the host/join.

Fix endianness support & use simpler code.

Refs D364 / 61261d14fc (and some subsequent fixing diffs).

Differential Revision: https://code.wildfiregames.com/D3970
This was SVN commit r25453.
2021-05-17 15:14:10 +00:00
f1467d10fd Make pathfinder debug rendering thread-safe.
Also cleans up the jump point cache const-correctness.

Differential Revision: https://code.wildfiregames.com/D3966
This was SVN commit r25452.
2021-05-17 09:38:24 +00:00
8b6d4233eb Disables by default Intel Mesa workaround to save video memory.
Tested By: Langbart
Differential Revision: https://code.wildfiregames.com/DD3967
This was SVN commit r25449.
2021-05-16 19:08:28 +00:00
2034136560 Implement a workaround for routers without NAT loopback.
This allows joining a lobby game hosted on the same network (behind the
same NAT gateway).
This is relatively primitive to keep things simple: if the server and
the client have the same public IP, it is assumed that they are on the
same network and the client instead requests the local IP.

Differential Revision: https://code.wildfiregames.com/D3944
This was SVN commit r25448.
2021-05-16 15:34:38 +00:00
a19dc1717f Don't include ComponentManager.h in ScriptComponent
ScriptComponent does not use ComponentManager, and its derived classes
(most ICMP*.cpp files) do not either. Therefore, we can skip a lot of
transitive inclusions and speed up recompiling by not including it
there.

Differential Revision: https://code.wildfiregames.com/D3962
This was SVN commit r25447.
2021-05-16 15:12:39 +00:00
e908733220 Speed up GetAvailableMods for archives.
Refs 64bfa089af and 44ec2e324e

When a .zip file is encountered by the VFS population, it reads the info
for all files in the archives. This is quite slow for the public archive
(400-500ms on my computer), which means calling GetEngineInfo()
repeatedly is impossible.

By only opening the external mod.json, we skip most of the work. The
archive can still be opened if needed as fallback.


Differential Revision: https://code.wildfiregames.com/D3216
This was SVN commit r25446.
2021-05-16 13:50:05 +00:00
5ff4fa19c0 Removes unused and outdated includes, replaces some includes by forward declarations.
This was SVN commit r25444.
2021-05-15 17:27:01 +00:00
41a29a590a Fixes broken PCH after wraitii commits (4f972bc623, 0f60bf3a97) and Itms (833c9f108c).
This was SVN commit r25443.
2021-05-15 14:50:24 +00:00
507f44f7f9 Remove all external usage of CmptPrivate. Header cleanup.
This removes usage of CmptPrivate outside of ScriptInterface.
ScriptRequest can now be used to safely recover the scriptInterface from
a JSContext instead of going through ScriptInterface, which allows more
code cleanup.

Follows 34b1920e7b

Differential Revision: https://code.wildfiregames.com/D3963
This was SVN commit r25442.
2021-05-15 13:54:58 +00:00
3ebff376cc Adds view bounds test for an ortho camera and removes commented code after 44f8d2c6f5.
This was SVN commit r25441.
2021-05-15 13:47:48 +00:00
44f8d2c6f5 Fixes a bounding box projection to an incorrect camera causes the red water bug.
Tested By: Langbart
Differential Revision: https://code.wildfiregames.com/D3905
This was SVN commit r25440.
2021-05-15 13:33:36 +00:00
cf5c815879 Fix 4f972bc623
Shouldn't make last-minute changes without recompiling...

This was SVN commit r25435.
2021-05-14 11:12:07 +00:00
4f972bc623 Split off JSON-related function from ScriptInterface, clean up headers.
Follows 34b1920e7b.

JSON functions and ToString are movec to their own headers.
Also clean out a few PersistentRooted usage to use the 2-phase init to
clean up scriptInterface usage.

With these functions split off, we can finally clean out headers and
remove ScriptInterface.h from most of them, in favour of smaller and
more precise headers.


Take the opportunity to clarify some comments regarding Mutability.

Differential Revision: https://code.wildfiregames.com/D3961
This was SVN commit r25434.
2021-05-14 10:18:03 +00:00
f368e1a69e Remove unused m_rng member from ScriptInterface.
The one in ScriptInterface_Impl is actually used.
Introduced in e9e05f4efc and from what I can tell never actually used.

Differential Revision: https://code.wildfiregames.com/D3960
This was SVN commit r25433.
2021-05-14 09:27:12 +00:00
0f60bf3a97 Split off Object-related functions from ScriptInterface
Follows 34b1920e7b.

This splits off the object-related functions, such as
[Set/Get/Has]Property, CreateObject, CreateArray, FreezeObject.

It also puts the definitions in the header itself, which might end up
with faster code here & there, though perhaps slower compilation time
(somewhat doubtful since we already included most things anyways).

Differential Revision: https://code.wildfiregames.com/D3956
This was SVN commit r25430.
2021-05-13 17:23:52 +00:00
61e0aef0b4 Split JS conversions from ScriptInterface.
All ToJSVal/FromJSVal definitions are put in a separate header.
Remove AssignOr[To/From]JSVal duplication.

The functions were already static so this is rather straightforward.

Follows 34b1920e7b and 2bae30c454

Differential Revision: https://code.wildfiregames.com/D3953
This was SVN commit r25428.
2021-05-13 09:43:33 +00:00
d798a2ec0e Fix crash in Atlas.
Fixes 6fbf036ae4

Reported by: Stan
Differential Revision: https://code.wildfiregames.com/D3954
This was SVN commit r25425.
2021-05-12 19:25:09 +00:00
dd19cc3444 Major improvements to the lobby bots XpartaMuPP and EcheLOn.
Reviewers: elexis, Dunedan

Fixes: #5914

Differential Revision: https://code.wildfiregames.com/D2630
This was SVN commit r25424.
2021-05-12 15:40:50 +00:00
4ad78018f9 Fix no-pch build. Potentially fixes bb49fbe793, 0198942a79, 34b1920e7b, 8b08f4ae7a 0dbf417171, 3af1fc64d2, 5fbdbaa3bc, 6fbf036ae4.
Comments by: @vladislavbelov, @wraitii.
Differential Revision: https://code.wildfiregames.com/D3948
This was SVN commit r25423.
2021-05-12 13:48:55 +00:00
6fbf036ae4 Split off StructuredClone from ScriptInterface
Follows 34b1920e7b.

This separates StructuredClone & DeepCopy logic into its own header,
reducing the size of the monolithic ScriptInterface header.

Differential Revision: https://code.wildfiregames.com/D3922
This was SVN commit r25419.
2021-05-10 11:51:32 +00:00
5fbdbaa3bc Fix 3af1fc64d2 - incorrect texture path on Windows.
sizeof(const char*) returns the pointer size and not the string size,
and 'texture:' happend to be 8 characters long, which is the same as a
64-bit pointer but not a 32-bit pointer.

Reported by: Stan
Differential Revision: https://code.wildfiregames.com/D3947
This was SVN commit r25415.
2021-05-09 17:29:50 +00:00
Angen
b4d11bda89 Fix warnings and missing break from f1acd22455
make linter happy
add missing break to loop if correct comparator has been found, reported
by @Langbart

Differential revision: D3945
Tested by: @Langbart
This was SVN commit r25414.
2021-05-09 17:05:02 +00:00
f653541e2c Fix warnings in 3af1fc64d2
Differential Revision: https://code.wildfiregames.com/D3946
This was SVN commit r25412.
2021-05-09 16:24:13 +00:00
Angen
f1acd22455 Do not allow to start pyrogenesis with incompatible mods
Fixing following problems:
Issue number one:
Enable mod with a23 compatibility in a23b.
Save configuration.
Start a24.
Better result:
Mod will be enabled and invisible in mod selection screen producing
various errors.
Worse result:
Game will crash and refuse to start.

Issue number two:
Mods can silently set loaded mods without restarting the engine, so mods
can unlist themselves from compatibility detection.

Solution:
Enable necessary mods instead if running with gui and open mod page.
Open information window on top of mod page to infom why mod page is
showing up.
On mod page show mods which failed in compatibility check and color the
resposnible ones.
Disable start button without enabled mods.
Show non existed mods if they failed in compatibility check.

Else just log to mainlog and close.

Another fixes:
Display in enabled mods really enabled mods as current logic confuses
players about which mods they have enabled and is not helpful (ref
#4881)

Note:
this will not solve issue with mods claiming being compatible with
engine version while in fact being incompatible.

Comments by: @vladislavbelov, @Stan, @Imarok
Tested by: @wraitii
Differential revision: D3592
Fixes: #6044 #4881

This was SVN commit r25410.
2021-05-09 13:53:25 +00:00
3af1fc64d2 Allow GUI elements to define custom mouse event mask shapes.
This allows GUI elements to use a texture as their "mouse event mask",
making it possible to have arbitrarily-shaped GUI elements with regards
to mouse interactions.

Used for the minimap idle worker button as a proof-of-concept.

Differential Revision: https://code.wildfiregames.com/D3814
This was SVN commit r25408.
2021-05-09 13:08:07 +00:00
e94faf7827 Don't hardcode the "0ad" resource into lobby XMPP & hosting
XMPP JID has a concept of 'resources', which can be used to
differentiate multiple clients of the same account.

We currently hardcode this 'resource' to '0ad' in two places:
- The 0 A.D. client always uses '0ad'
- The network code expects a host resource to be '0ad' when connecting.

As noted in 0fd8aa2a77#31215, it is less effort to store the JI
D directly. This patch does that. It also makes 0 A.D. use a different
resource each time.
Note that resources ought not contain particular information, as the
XMPP server is free to
 clobber it. I keep '0ad-' here for debug purposes.

This allows:
- multiple 0 A.D. instances to log on the lobby at the same time (not
massively useful, but good for debugging sometimes)
- hosting a game with a custom resource, which will potentially make it
easier to have dedi
cated servers on one account.

Note that hosting multiple games on one account is currently not
supported and will have weird behaviour on the lobbybots side. They
should be upgraded independently of this.

Refs #3556

Differential Revision: https://code.wildfiregames.com/D3500
This was SVN commit r25407.
2021-05-09 12:51:32 +00:00
abb124a36f Fix cpuid call with -fPIC on i386 architectures.
GCC < 5 used to reserve the ebx register for PIC (position-independent
code) metadata. This meant that we needed to save the state of ebx
before calling cpuid (fixed in #2675)
However, the original patch from 03eaf9b461 did not force a particular
register to store this value in. Following the GCC 5 upgrade, GCC
stopped reserving ebx, and that register silently got used instead. The
code became non-sensical, and our ASM __cpuidex started returning random
garbage in edx.

Since we now only support GCC7 and above, the PIC-specific branch is no
longer necessary and is removed.

Fixes #6028. The assertion was a result of random data in ebx.
Refs #2675 / reverts 6334ee3f8b and reverts 03eaf9b461.

Patch by: nwtour
Comments by: vladislavbelov
Differential Revision: https://code.wildfiregames.com/D3575
This was SVN commit r25405.
2021-05-09 12:41:45 +00:00
0dbf417171 Fix 8b08f4ae7a - CGUIColor setting
Reported by: langbart
Fixes #6173

Differential Revision: https://code.wildfiregames.com/D3937
This was SVN commit r25401.
2021-05-07 11:34:20 +00:00
64b475b390 Fix Profiler1 "time per turn".
Actually call Turn() when a turn is processed.

Fixes #6144

Differential Revision: https://code.wildfiregames.com/D3885
This was SVN commit r25394.
2021-05-06 16:49:34 +00:00
8b08f4ae7a Change GUI settings to explicitly be member variables.
Completes work starting in D2313 / a33fd55e81:
- Make C++ mistakes where values can be changed without messages being
sent easier to notice / harder to do.
- Make the IGUISetting interface more flexible, allowing custom settings
implementing their own logic. This is used to clean up hotkey code
introduced in 33af6da5e1.

Side effects:
- FromJSVal_Vector clears the vector being passed in. I have some vague
memory of not doing that in D24 / 2bae30c454 as an optimisation, but it
seems more like a footgun to me.
- Most usage of SetSettingFromString is replaced by direct method calls,
as we can generally cast to the proper GUI object type. Where we can't,
it is kept as a poor's man virtual dispatch.
- It moves a few member variables elsewhere, e.g. TextOwner now gets its
own member variable settings.

Differential Revision: https://code.wildfiregames.com/D3892
This was SVN commit r25392.
2021-05-06 08:22:37 +00:00
4db5467717 Fix mistake in 100159548c
I last-minuted a "X = X * Y" into a "X *= Y" but that turns out to map
to "X = Y * X" with our matrix overloads.

Reported by: langbart
This was SVN commit r25391.
2021-05-06 07:42:49 +00:00
100159548c Fix bounding boxes after f73fa05542
Skinning calculations must happen in bone-space.

Fixes f73fa05542

Reported by: langbart
Fixes #6168

Differential Revision: https://code.wildfiregames.com/D3927
This was SVN commit r25387.
2021-05-05 16:20:33 +00:00