1
0
forked from 0ad/0ad
Commit Graph

128 Commits

Author SHA1 Message Date
6f9da85d9f Improve performance of full state hash computation, by skipping script components that are known to have no data.
Switch to much quicker (and less comprehensive) per-turn hashing in
multiplayer games.

This was SVN commit r9036.
2011-03-05 22:30:32 +00:00
e16681f0e5 Fix destruction queue warnings when using some GUI features with time-warp enabled
This was SVN commit r8976.
2011-02-24 02:05:06 +00:00
d75d9c3b75 Make the script profiler more useful, by giving the filename/line for anonymous functions.
Fix the turn-based profiler a bit.

This was SVN commit r8964.
2011-02-21 02:16:12 +00:00
1c7e33b528 Remove a load of implicit CStr type conversions, since they're error-prone and can cause silent data loss.
Handle most CStr8/CStrW conversions via UTF-8 instead of effectively
assuming Latin-1.
Return UTF-8 strings from Xeromyces API.

This was SVN commit r8929.
2011-02-17 20:08:20 +00:00
3d997365d8 Fix CStr numeric constructors on 32-bit platforms.
Remove unnecessary assignment operators.

This was SVN commit r8926.
2011-02-16 21:14:08 +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
19548a7379 Fix use of uninitialised variable.
This was SVN commit r8861.
2011-01-12 12:11:31 +00:00
2fd6e2e8cc Fix some more warnings
This was SVN commit r8835.
2010-12-11 12:35:50 +00:00
2540e17f45 Fix non-PCH builds
This was SVN commit r8816.
2010-12-08 18:54:05 +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
81f5e0ac5f Allow continuing playing when a client leaves a multiplayer game (fixes #620).
Fix multiplayer autostart.
Make NETTURN_LOG syntax differently ugly.

This was SVN commit r8525.
2010-11-03 00:21:52 +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
6a15b78c98 Increase multiplayer turn length to mask the effects of latency.
This was SVN commit r8400.
2010-10-17 16:07:43 +00:00
8a98102195 Fix serialize/deserialize API asymmetry.
Add serialization support to more components.

This was SVN commit r8122.
2010-09-17 17:53:26 +00:00
2e7436434d warning fixes: mostly size_t vs. specialized API type and other type conversion.
added player_id_t typedef and INVALID_PLAYER, use that instead of -1.
also added sanity checks to cpu.cpp to ensure ARCH_* is correct (see
http://www.wildfiregames.com/forum/index.php?showtopic=13327&hl=)
and further predefined macros to arch.h just to be sure.

This was SVN commit r8079.
2010-09-05 09:38:30 +00:00
64daef95df Fix chat to use GUID instead of host ID.
Fix randomly incorrect player names.
Fix script errors when connecting to an invalid IP address.
Adjust the server/client disconnection messages to be a bit more
accurate.

This was SVN commit r7946.
2010-08-14 19:45:22 +00:00
8967395da6 Made chat messages send a GUID rather than a user name
This was SVN commit r7943.
2010-08-14 15:34:36 +00:00
0ebe3486b6 Add setTurnLength() function for hacky fixing of network lag.
This was SVN commit r7936.
2010-08-13 16:42:53 +00:00
3e6df25f10 Bump the network protocol version, to prevent confusion if someone uses the old release.
This was SVN commit r7934.
2010-08-13 14:29:27 +00:00
4f1b7bb0e6 Complain more informatively about incorrect ENet versions
This was SVN commit r7897.
2010-08-10 21:49:33 +00:00
91cd032827 Add basic replay recorder/player to help debugging and performance testing.
This was SVN commit r7863.
2010-08-06 22:16:05 +00:00
b292a32505 Add JS memory usage to profiler.
Add dumpHeaps() console function for debugging JS memory usage.
Increase default JS heap size.
Make call-time profile table appear first when toggling.
Remove some unused script functions.

This was SVN commit r7842.
2010-08-02 19:23:58 +00:00
ac9412458a Disable unnecessary state hash check in single-player games.
This was SVN commit r7768.
2010-07-19 22:57:04 +00:00
1eb64ebb26 Fix non-PCH builds
This was SVN commit r7711.
2010-07-07 10:39:41 +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
018f3d71d9 Partially fix network tests
This was SVN commit r7693.
2010-07-04 19:59:05 +00:00
7cef282d06 Fix some printf string formatting
This was SVN commit r7688.
2010-07-04 16:52:14 +00:00
56b836f58d Call enet_initialize (see previous commit message). Fixes #509.
This was SVN commit r7681.
2010-07-03 19:31:14 +00:00
c59e2c572b Add ENet stats to profile viewer.
This was SVN commit r7671.
2010-07-03 13:15:01 +00:00
051aa70940 Basic disconnection handling.
Pre-game chat.
Fix dynamic updates of focused input controls.
Allow scrollable texts to automatically scroll to the bottom.
Force usernames to be unique.

This was SVN commit r7664.
2010-07-02 21:28:48 +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
0172c99b93 Windows build fix
This was SVN commit r7624.
2010-06-08 18:58:03 +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
01bec7a454 Convert serialization code to use less virtuals and allow more inlining.
This was SVN commit r7582.
2010-05-25 19:01:30 +00:00
1e228d8c17 Fix typo that breaks network after OOS
This was SVN commit r7568.
2010-05-22 15:46:12 +00:00
94e5d88169 # Add out-of-sync multiplayer checks.
Change CStr8 serialization to allow \0 in strings.

This was SVN commit r7565.
2010-05-22 14:05:56 +00:00
56bb858802 # Delete a lot of obsolete simulation code.
This was SVN commit r7555.
2010-05-20 18:09:23 +00:00
a78e6dbe26 # Delete a lot of obsolete networking code.
Remove the -sim1 flag since it no longer works.

This was SVN commit r7554.
2010-05-20 17:58:37 +00:00
08e383235b Fix message serialisation to be 64-bit-safe and more efficient
This was SVN commit r7553.
2010-05-20 17:46:07 +00:00
605e5c75bb Windows build fix
This was SVN commit r7552.
2010-05-20 16:02:20 +00:00
c684c211a2 # Basic experimental multiplayer integration with new simulation system.
Add new turn manager that should be more correct and potentially more
efficient.
Remove evil CNetServer/CNetClient multiple inheritance of CTurnManager.
Add multiplayer autostart.
Various minor cleanups.

This was SVN commit r7551.
2010-05-20 00:59:01 +00:00
1ebebc4338 Avoid -Wnon-virtual-dtor warnings
This was SVN commit r7416.
2010-03-31 08:36:46 +00:00
a7484933e7 wchar.h -> utf8.h (see previous change)
This was SVN commit r7341.
2010-03-01 14:55:34 +00:00
4d891117c5 Refactor the NetMessageType system to work in unity builds and remove BLOCK_SIZE macro that caused conflicts and wasn't really used anyway.
This was SVN commit r7327.
2010-02-17 23:38:50 +00:00
7c2e9027c2 # Rewrite of the game's simulation system
Giant merge from
http://svn.wildfiregames.com/hg-source/file/5fb522019d5e
Infrastructure is largely complete, gameplay is largely missing
Disabled by default; use command-line flag "-sim2"
(Second attempt at commit...)

This was SVN commit r7259.
2010-01-09 19:20:14 +00:00
ff15c522fe implement changes suggested by Philip:
- add self-test
- allow decoding UTF8 values beyond BMP (and replace them later)
- quietly replace invalid bytes

This was SVN commit r7187.
2009-11-09 20:53:48 +00:00
450da0aaf7 rename [w]string_to_[w]string UTF8
add safer/more portable/less dependent on locale implementation of
wchar_t <-> UTF8

This was SVN commit r7185.
2009-11-09 14:52:51 +00:00
f432d9d18b fix dehydra warnings (some of which were dangerous pass-user-string-as-format-string vulnerabilities)
This was SVN commit r7177.
2009-11-07 09:32:19 +00:00