1
0
forked from 0ad/0ad
Commit Graph

28 Commits

Author SHA1 Message Date
89e339dd16 Remove VFS cache, because it is less effective and less efficient than the OS cache (and partially redundant with higher level application caches).
Patch By: Sandarac
Discussed with: Philip, echotangoecho, Bezerra
Fixes #4072.
Differential Revision: https://code.wildfiregames.com/D587
This was SVN commit r20639.
2017-12-10 17:33:03 +00:00
4f01db4831 Split TurnManager classes into individual files per class. Patch by echotangoecho, fixes #4095.
Remove the "Net" prefix from the non-networked classes.
Use variadic macros and mark the client turnmanager as NONCOPYABLE.

Differential Revision: D16
Reviewed By: leper
This was SVN commit r19165.
2017-01-24 02:04:50 +00:00
b18f74da44 Remove trailing whitespace and whitespace in empty lines of source/ except source/third_party/.
This was SVN commit r18987.
2016-11-23 11:18:37 +00:00
62061557db Host on arbitrary UDP ports. Patch in cooperation with Imarok, fixes #3575.
This was SVN commit r18372.
2016-06-13 16:56:14 +00:00
1a3fb29ff3 Network cleanup, fixes #3953.
Don't compare for "127.0.0.1" to identify the host, but check for a new
boolean flag that is set by the client, refs #2854.
Remove an unneeded IP address conversion from u32 to string, refs #3241.

This was SVN commit r18140.
2016-05-08 11:46:19 +00:00
bb9de80dd4 Convert CConsole to take UTF-8 strings.
This avoids vswprintf failures when printing non-ASCII char* strings
from CLogger into the console.

Also convert ScriptInterface::ToString to return UTF-8, to avoid some
utf8_from_wstring calls.

Also remove some unused and redundant CConsole functions.

This was SVN commit r16333.
2015-02-14 01:49:34 +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
2b7e9728b6 Fix failure in TestNetComms::test_basic_DISABLED. Patch by Echelon9. Fixes #2426.
This was SVN commit r15672.
2014-08-24 12:02:52 +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
5c07a25ddc More exact stack rooting (CallFunction object).
Changes CallFunction and CallFunctionVoid to use a HandleValue as object
parameter. Also changes some JS serialization/deserialization functions
to only support the JSAPI rooted types (drop support for CScriptVal and
CScriptValRooted there). Some other functions got changed too because
they were closely related.

Refs #2415
Refs #2462

This was SVN commit r15592.
2014-07-31 19:18:40 +00:00
7acdde5c86 Changes tests to use global g_ScriptRuntime instead of creating a new JSRuntime for each test.
The tests crashed on my Debian systems but not on my Ubuntu system.
The crash happened in line 142 of SpiderMonkey's ThreadLocal.h.

I know that I had to use a workarounnd for contexts to avoid destroying
the context that was created first. I also had in mind that in newer
versions a JS_Init function got introduced which presumably solves this
kind of issues.
Based on this experience I assumed runtimes could have a similar problem
and this patch indeed fixes the issues.
Unfortunately the correct usage of JSRuntimes in that regard is not
documented.
There's only a rater misterious comment in JSAPI.h which hasn't been
cleared up so far and is most likely completely outdated
(https://bugzilla.mozilla.org/show_bug.cgi?id=992641).

This was SVN commit r14995.
2014-04-25 21:19:51 +00:00
ef888367aa Cleanup tex_codec, fixes #2456, patch by IronNerd.
This was SVN commit r14836.
2014-03-13 04:16:20 +00:00
893cb2668e Renames our sdl.h to libsdl.h, to avoid case sensitivity errors when it includes SDL.h.
This was SVN commit r10904.
2012-01-12 23:32:27 +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
bfe2126a17 # Support rejoining multiplayer games after disconnection.
This was SVN commit r10437.
2011-10-27 16:46:48 +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
6d25329412 # towards locale-independent pathnames on Linux
c.f.
http://www.wildfiregames.com/forum/index.php?showtopic=14541&st=0&p=217250&#entry217250
and 2011-03-19 meeting

This was SVN commit r9090.
2011-03-21 17:53:13 +00:00
f39f279132 Add AI script code to provide a cleaner API around the engine interface.
Handle AIProxy entirely through scripts.
Support structured clones of script values.
Improve performance.
Support multiple script contexts sharing a runtime.
Use a separate context per AI player.

This was SVN commit r8866.
2011-01-15 23:35:20 +00:00
8ddef2fee0 Add fast-forward/rewind commands, to help with testing.
This was SVN commit r8803.
2010-12-06 19:58:06 +00:00
5d764f1435 Run network server in a separate thread, to minimise latency.
Make some parts of logger and console thread-safe.
Simplify console: remove special commands; remove prefix for script
commands.
Remove LOG_ONCE, to simplify logger.
Change some code to use the new logger interface.
Fix OOS when revealing map.
Clean up some formatting.

This was SVN commit r8511.
2010-10-31 22:00:28 +00:00
4f1b7bb0e6 Complain more informatively about incorrect ENet versions
This was SVN commit r7897.
2010-08-10 21:49:33 +00:00
31699e830d Handle disconnections better.
Remove local sessions (just use ENet for everything instead) because
they add far too much complexity.
Fix memory leaks.

This was SVN commit r7706.
2010-07-06 19:54:17 +00:00
20c50d32d4 Windows fixes.
Avoid Boost.Random since it adds a dependency on a new library.

This was SVN commit r7654.
2010-06-30 23:40:51 +00:00
1c0536bf08 # Refactored the networking code, and redesigned the game setup screen.
Major updates to most network classes.
Simplify CNetServer so it doesn't duplicate any client behaviour; all
players now run CNetClient.
Remove most player/slot management from networking code.
Wait for all players to finish loading before starting the simulation.
Remove CGameAttributes; attributes are now just a JS object.
Remove CPlayer; they are now just simulation entities.
Handle player colours via simulation system.
Add a default map for Atlas, so it always has something to load.
Move network documentation to Doxygen.
Remove lots of now-unused code.

This was SVN commit r7653.
2010-06-30 21:41:04 +00:00
dfb10c8209 # Various networking code cleanups.
Don't flush network queue after every message.
Desingletonify CGameAttributes to allow testing.
Make network server/client basically testable.
Add very basic tests for network server/client.
Fix FsmActionCtx memory leak.
Split CNetHost into a separate file.
Convert CNetHost, CNetSession to a more conventional coding style.
Delete CNetLogger, since it's a lot of complexity and is barely used and
is redundant with CLogger.
Other minor simplifications.

This was SVN commit r7623.
2010-06-07 22:19:05 +00:00
42bcb175ff Add test for network simulation message serialization.
Fix network simulation message serialization.

This was SVN commit r7586.
2010-05-25 20:48:06 +00:00