1
0
forked from 0ad/0ad
Commit Graph

62 Commits

Author SHA1 Message Date
333766ef1b Test all full hashes in non-visual replaymode by default and keep skipping quick-hash by default.
The previous code only tested quick hashes every 100 turns and could not
be used to confirm replay hashes matching.
The option can become used for visual replays too.

Differential Revision: https://code.wildfiregames.com/D1538
Refs #5162
Reviewed By: temple
This was SVN commit r21829.
2018-05-29 02:14:38 +00:00
44ec2e324e Alpha 23 "lobby lag" release fix.
Caches the loaded mod versions, so that GetEngineInfo doesn't read the
zip and json files everytime and returns about 1000 times faster.
Adds two missing includes.

The lobby froze multiple times every few seconds on updateGameList().
The gamesetup page was slowed down with every stanza sent and the
load savegame selection page was slowed down per savegame selection,
proportional to the number of installed zipped mods.

Introduced by: d5807cd59f and eca956a513
Differential Revision: https://code.wildfiregames.com/D1518
Reviewed By: wraitii
Comments By: Imarok (in D1512, P121), leper (in the lobby)
This was SVN commit r21823.
2018-05-24 18:08:56 +00:00
d6ae354158 Fix mod check of non-visual replays and allow conversion of a vector of vectors of strings via ScriptConversions
Reviewed by: elexis
Fixes #5044
Differential Revision: https://code.wildfiregames.com/D1316
This was SVN commit r21603.
2018-03-22 15:26:27 +00:00
ee9e677084 Simulation replay profiling graph overhaul.
Support multiple graphs with different scales, units, rounding and
descriptions and use it for memory allocation and number of garbage
collections.
Have the X axis in number of turns (instead of that divided by 20).
Don't have the legend hide part of the graph.
Add references to that hardcoded 20.
Move graph JS to a separate JS file.
Use JSON instead of JS.
Add legal html structure.

Comments By: Vladislav in irc yesterday
This was SVN commit r21602.
2018-03-22 13:53:04 +00:00
c894eeb856 Fix debug mode after d5807cd59f
Reviewed by: temple
Differential Revision: https://code.wildfiregames.com/D1315
This was SVN commit r21336.
2018-02-23 20:17:47 +00:00
d5807cd59f Check for and save mod version for savegames and replays
Reviewed by: elexis
Fixes: #4887
Differential Revision: https://code.wildfiregames.com/D955
This was SVN commit r21239.
2018-02-17 16:53:14 +00:00
9defd11440 Pass ScriptInterface as a const ref where possible.
Reviewed By: elexis
Differential Revision: https://code.wildfiregames.com/D739
This was SVN commit r20028.
2017-08-24 00:32:42 +00:00
e7ab22286e Fix the replay menu for people with non-latin characters in their username.
Use OsPath instead of CStr and CStrW where possible,
wstring_from_utf8(OsPath.string8()) to pass printable strings to the
JSAPI,
OsString when opening a filestream and
off_t instead of int for filesizes.

Fixes #4320
Differential Revision: https://code.wildfiregames.com/D518
Reviewed By: Imarok
Tested By: Imarok on Windows, wraitii on OSX
Special thanks to Philip for advice and the lib/path.h fix in
47cc447322.

This was SVN commit r19824.
2017-06-25 14:54:00 +00:00
1e07787e76 Revert 64bit number conversions added in c0ca70efd2, don't add the previous long and unsigned long conversions back and use double in the Replay menu.
64bit conversions (including the long ones) are not safe, because not
every number can be converted to the 2^53 JS numbers and pretending to
do so is asking for bugs.
Explicitly use the double type in the Replay menu, because std::time_t
is unspecified and some platforms like Ubuntu yakkety:i386 fail to
build, looking for long.
Double should work for the next 285 million years, becomes consistent
with SavedGame.cpp, is tested by test_ScriptConversions.cpp and doesn't
pretend to cover all 64bit numbers.

Patch By: echotangoecho
Differential Revision: https://code.wildfiregames.com/D205
Refs #3848 D84 D112

This was SVN commit r19367.
2017-04-01 21:06:55 +00:00
5130bb69d3 Use std::time_t in the replay menu (as 64bit integer conversion are implemented now) and remove the unused filemoddate fallback.
Differential Revision: https://code.wildfiregames.com/D112
Reviewed By: echotangoecho
This was SVN commit r19200.
2017-02-05 02:18:33 +00:00
2bf1dbfd13 An awesome Rejoin-test tool by wraitii and Itms, fixes #4242, refs #3460.
Contrary to the serializationtest, initializes the secondary simstate
only once
before progressively applying updates.
Thus reproducing actual multiplayer rejoining, enabling developers to
analyze OOS reports solely from the replay file of the rejoined and a
non-rejoined client.

This was SVN commit r18940.
2016-11-15 13:26:58 +00:00
bb1f86f515 Remove duplication of the Hexify function.
Remove the useless extern keyword from function declarations in
ps/Util.h.

Patch by echotangoecho, refs #4095

This was SVN commit r18591.
2016-08-08 12:50:39 +00:00
69b3c5871b Print warnings when no or the wrong list of mods is passed when starting non-visual replays. Patch by ArnH, fixes #2807.
This was SVN commit r18574.
2016-08-02 11:11:10 +00:00
f4e69b7c07 Cleanup of #3255, fixes #3966.
Don't create an empty oos_logs directory when starting the game.
Rename getDateIndexSubdirectory to createDateIndexSubdirectory.
Add a comment for the breakpoint argument of CreateDirectories.

This was SVN commit r18183.
2016-05-16 00:56:07 +00:00
a32ed75bff Fix a race-condition when two games have been started simultaneously and attempt to create the same replay directory, refs #3255.
Instead of triggering a debug-breakpoint, print a warning to stdout and
succeed in the N'th retry when having started N processes
simultaneously.
Previously the problem had been addressed by using the processID in the
directory name.

This was SVN commit r17776.
2016-02-19 11:22:32 +00:00
5998d13442 Use date and sequential ID for replay-directorynames, fixes #3255.
Save replays in userdata (screenshots, savegames)  and create one
subdirectory for every release.

This was SVN commit r17761.
2016-02-15 15:57:23 +00:00
bb8ceba632 completes f34dc412b6 for non visual replays, refs #3751
This was SVN commit r17711.
2016-01-25 20:37:26 +00:00
5747619c39 Don't create replays without commands in case of running non-visual replay or an atlas simulation.
Remove trailing whitespace.

This was SVN commit r17689.
2016-01-23 01:02:57 +00:00
05547bf36f Fix an oversight.
This was SVN commit r17182.
2015-11-05 16:52:19 +00:00
8f1853b8d8 Prevent accidental overwriting of replays in very rare cases while we wait for a better solution.
Refs #3255

This was SVN commit r17177.
2015-11-04 19:26:40 +00:00
d64b95b28c An awesome Visual Replay menu, made by elexis. Fixes #3258.
This was SVN commit r17054.
2015-09-21 17:00:21 +00:00
8507a7bc27 Create commands.txt only when actually starting the game. Patch by elexis. Fixes #3408.
This was SVN commit r17004.
2015-09-11 17:44:50 +00:00
0868d03e74 Fix previous commit.
This was SVN commit r16898.
2015-07-30 17:27:27 +00:00
2238a18aee Close and free replay streams. Based on patch by elexis.
This was SVN commit r16897.
2015-07-30 16:43:22 +00:00
8e44687ae3 Properly fix #3223.
The previous commit destroyed the context while it was still in use.

This was SVN commit r16631.
2015-05-06 20:28:28 +00:00
4db041e3c6 Stop leaking g_ScriptStatsTable in replay mode. Fixes #3223.
This was SVN commit r16627.
2015-05-05 22:34:41 +00:00
b6bcfdbb2e Fixes missing newlines in debug_printf, patch by elexis, fixes #3056
This was SVN commit r16534.
2015-04-12 19:38:31 +00:00
01673b4c58 Add the -ooslog support for replays. Refs #3169, see also a7b18d02bf.
This was SVN commit r16531.
2015-04-11 18:12:35 +00:00
e06a7b37d8 Convert debug_printf to take UTF-8 strings instead of wchar_t.
This fixes the problem where passing a non-ASCII string to
debug_printf(L"%hs", s) caused vswprintf_s to fail on Linux (because it
doesn't know what encoding the char* is meant to have). Now debug
messages will remain as UTF-8 until they reach the OS.

Fixes #3021.

This was SVN commit r16332.
2015-02-14 01:45:13 +00:00
c02a7e1a7b SpiderMonkey 31 upgrade
This upgrade also introduces exact stack rooting (see to the wiki:
JSRootingGuide) and fixes problems with moving GC. This allows us to
enable generational garbage collection (GGC).
Measurements a few months ago have shown a performance improvement of a
non-visual replay of around 13.5%. This probably varies quite a bit, but
it should be somewhere between 5-20%. Memory usage has also been
improved. Check the forum thread for details.

Thanks to everyone from the team who helped with this directly or
indirectly (review, finding and fixing issues, the required C++11
upgrade, the new autobuilder etc.)! Also thanks to the SpiderMonkey
developers who helped on the #jsapi channel or elsewhere!

Fixes #2462, #2415, #2428, #2684, #1374
Refs #2973, #2669

This was SVN commit r16214.
2015-01-24 14:46:52 +00:00
6e788fb15e Clean up JSON parsing code. Refs #1374.
Fix Engine.ReadJSONFile() which did throw a JS exception that was not
caught. Discovered by s0600204.
Expose Engine.ReadJSONFile() to the gui scripts.

This was SVN commit r15959.
2014-11-13 01:26:22 +00:00
3b49576fa6 Tunes GC scheduling a bit to reduce memory usage.
The main problem was that GC was only called from the simulation before
this patch. This means when you were waiting in the multiplayer lobby or
just had the GUI open, it only called GC when getting close to the JS
runtime size limit (I assume). Another problem was the Net Server
runtime which didn't GC either. Here the runtime size limit is 16 MB
though, so it's not too terrible. These issues have both been addressed
and GC has been given a bit more time per incremental slice to make sure
it gets done in time. It's still far from perfect, but there are too
many changes in SpiderMonkey related to GC, so I don't want to spend too
much time on this yet.

Refs #2808

This was SVN commit r15787.
2014-09-22 20:13:04 +00:00
a2bd44b23a Exact stack rooting for JSON related ScriptInterface functions.
Refs #2415
Refs #2462

This was SVN commit r15603.
2014-08-02 22:21:50 +00:00
a7b18d02bf Add serialization test support for replays.
This was SVN commit r15547.
2014-07-22 19:41:49 +00:00
e9e05f4efc Second (main) commit for the SpiderMonkey upgrade.
This commit contains all the required changes to our source files and
build scripts (hopefully).
A next commit will remove the old stuff of SpiderMonkey 1.8.5.

Spcial thanks to:
 - H4writer who helped a lot mainly with the performance issues we
had/have, but also with other problems or questions.
 - Leper for the review.
 - Historic_bruno for implementing the build scripts on Mac OS X and
testing on the Mac.
 - The people from the #jsapi channel and from
mozilla.dev.tech.js-engine who answered a lot of questions and helped
solving problems.
 - All the other people who helped

Refs #1886
Fixes #2442
Fixes #2416

This was SVN commit r14877.
2014-03-28 20:26:32 +00:00
ef888367aa Cleanup tex_codec, fixes #2456, patch by IronNerd.
This was SVN commit r14836.
2014-03-13 04:16:20 +00:00
4b1297b328 Removes g_ScriptingHost and implements global to compartment 1 to 1 relation.
Each GUI Page gets its own compartment and all ScriptInterfaces in the
same thread should now use the same JS Runtime.
This is required for the SpiderMonkey upgrade.
Check the ticket for details.

Closes #2241
Refs #1886
Refs #1966

This was SVN commit r14496.
2014-01-04 10:14:53 +00:00
b3391ebe39 Fix build warnings. Patch by Markus. Refs #1851.
This was SVN commit r13469.
2013-06-11 00:05:57 +00:00
75a23856cf Fix some static analysis warnings
This was SVN commit r13101.
2013-01-21 20:33:25 +00:00
0ec4242962 Detect and fix printf signedness errors. Fixes #1086, #1087.
This was SVN commit r10846.
2012-01-01 16:43:10 +00:00
8492426a14 Rough support for profiling replay mode and scripts
This was SVN commit r10634.
2011-11-29 20:32:43 +00:00
7064565ff6 # Allow saving and loading single-player games.
Support writing zip files based on in-memory data.
Fix menu sliding animations to be framerate independent.

This was SVN commit r10454.
2011-10-30 00:07:28 +00:00
b59e27f678 Fix assertion failure in replay mode
This was SVN commit r10443.
2011-10-27 21:22:41 +00:00
a7152270f4 Path now goes to some trouble to prevent mixing / and \ slashes (causes trouble when hotloading, and some Windows APIs can't handle it, either)
WARNING: that means stuff like Path(nativeDataPath/"art/") is forbidden
and will raise errors on Windows when nativeDataPath contains \. always
use /"" to add a trailing slash. never embed "/" in OsPath component
strings (it's OK for VFS strings since they consistently use /).

wdir_watch, CmdLineArgs: avoid mixed separators
wutil: remove overzealous assertion (infinite recursion if an error
arose before we create a window)

refs #781

This was SVN commit r9424.
2011-05-04 12:16:51 +00:00
4663ac0fe7 split debug_assert into ENSURE and ASSERT as discussed in a previous meeting.
the old debug_assert always ran and tested the expression, which slows
down release builds. wrapping them in #ifndef NDEBUG is clumsy. the new
ASSERT behaves like assert and ENSURE like the old debug_assert. Let's
change any time-critical but not-super-important ENSURE to ASSERT to
speed up release builds. (already done in bits.h and unique_range.h)

This was SVN commit r9362.
2011-04-30 13:01:45 +00:00
2b138f47db Handle map loading errors in autostart and normal setup modes. Adds TODOs for Atlas and Replay modes. See #764.
Fixes loading screen 'title'.
Fixes broken autostart behavior for random maps and multiplayer games.

This was SVN commit r9193.
2011-04-07 02:32:16 +00:00
588bfa11bf remove unnecessary utf8 includes
This was SVN commit r9110.
2011-03-23 16:32:44 +00:00
64a02932e3 refactor headers: path_util -> path, native_path -> os_path, remove where unnecessary
This was SVN commit r9108.
2011-03-23 14:43:35 +00:00
dcd192cb60 refactor path interface:
- use wrapper class instead of std::wstring (reduces mixing of
strings/paths; allows safe+easy join via operator/ and convenient
case-insensitive comparison via operator==, avoids NativePathFromString,
similar to boost::filesystem)
- NativePath -> OsPath
- add hash and To/FromJSVal for Path
- add TS_ASSERT_PATH_EQUALS
- replace _wfopen_s with sys_OpenFile
- remove obsolete SortFiles/Directories

This was SVN commit r9107.
2011-03-23 13:36:20 +00:00
c3405e6f50 path improvements/fixes:
- replace more std::wstring with Native or VfsPath; wstring_from_utf8 ->
NativePathFromString
- replace sequences of Join(Path(), Basename+extension) with
ChangeExtension in wsdl, CacheLoader
- add Path::IsDirectory to replace .empty() / path_is_dir_sep(.back()).
also changed behavior to reflect the fact that "" is the VFS root
_directory_
- Path::Join now allows 2 identical path types (e.g. VfsPath) or one
char* literal (prevents inadvertently introducing non-safe characters).
to convert from wstring or wchar_t, use an explicit ctor (e.g.
VfsPath(wchar_t_string))

This was SVN commit r9091.
2011-03-21 19:54:08 +00:00