`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.
Sometimes PetraAI relies on UnitAI state of an entity, but those were
not changed after modifying UnitAI.
Introduced in ea96e81098 and 3579097d95.
Differential revision: https://code.wildfiregames.com/D3976
This was SVN commit r25468.
Refs c0157d613d / D3913 which removed the 'actions' suffix. The reason
for this suffix was probably avoiding this type of conflict, but this
new solution does a better job.
Fixes (at least) Survival of the Fittest, which used an
OnOnwershipChanged trigger.
Differential Revision: https://code.wildfiregames.com/D3979
This was SVN commit r25467.
This was already effectively the case, so this change increases
coherence.
Accepted By: Freagarach
Differential Revision: https://code.wildfiregames.com/D3980
This was SVN commit r25465.
Ranged cavalry goes from a base 0.89 walkspeed multiplier to:
- 0.8 for crossbowmen
- 0.85 for archers
- 0.9 for javelineers
The intention is to nerf archers slightly.
Patch By: Nescio
Accepted By: ValihrAnt, chrstgtr
Differential Revision: https://code.wildfiregames.com/D3758
This was SVN commit r25464.
Reverts D2986 / f9f7b4d49f.
Outposts have 90 base vision, increasing to 120 with the 'Carrier
pigeon' technology.
Outposts no longer decay in neutral territory, thus not needing
garrisoning. To compensate, they decay 10x faster in enemy territory.
Differential Revision: https://code.wildfiregames.com/D3898
This was SVN commit r25463.
Avoids recreating an object and frequent casting.
Allows some optimisations.
Simplifies some calls.
Differential revision: https://code.wildfiregames.com/D3934
Comment by: @Stan
This was SVN commit r25460.
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.
This makes incremental recompilation faster when changing static
interned strings.
Differential Revision: https://code.wildfiregames.com/D3975
This was SVN commit r25457.
If a default difficulty is given by the map, use that. Else use the
default of the game.
Patch by: @JCWasmx86
Differential revision: https://code.wildfiregames.com/D3951
This was SVN commit r25455.
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.
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.
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.
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.
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.
The entity received a value modif. message while promoting, triggering a
second promotion.
Differential revision: https://code.wildfiregames.com/D3918Fixes: #6162
Comments by: @Angen, @Stan
This was SVN commit r25439.
Patch by: @nani
Liked by: @ffffffff
Tested by: me and @Langbart
Differential Revision: https://code.wildfiregames.com/D3957
This was SVN commit r25436.
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.
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.
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.
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.
Also refactors the order a bit to be more equal to other orders.
Removes the `autocontinue` because it was not useful (since that is more
about doing other tasks than the one ordered).
Follows ea96e8109897addf2aa7.
Differential revision: https://code.wildfiregames.com/D3942
Tested by: @Langbart
Fixes: #6175
This was SVN commit r25421.
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.
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.
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.
This allows easier handling of e.g. range triggers calling into the same
function.
The original trigger data is also forwarded for convenience.
Differential Revision: https://code.wildfiregames.com/D3904
This was SVN commit r25413.
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.
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.
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.