Commit Graph

15881 Commits

Author SHA1 Message Date
hiker
4b9d9cfc92 Replaced Protocol::sendMessage (which was either a send or a broadcast
depending on if the caller is a client or server) with explicitly named
functions.
2016-02-28 16:18:08 +11:00
hiker
c9d3577a13 Removed unnecessary sendMessage function in ProtocolManager. 2016-02-28 15:57:41 +11:00
hiker
58505eeb88 Started to set token in the 'lower level' functions, removing the need
to set the token in each protocol. Started to remove some of the
unnecessary send* functions.
2016-02-28 15:54:43 +11:00
hiker
9a16595261 Renamed NewNetworkString to NetworkString. 2016-02-28 14:58:15 +11:00
hiker
1e49595c53 Further improved look of NetworkString log messages. Added unit testing. 2016-02-28 14:55:48 +11:00
hiker
be815e4234 Fixed various bugs caused by switching to new NetworkString class. 2016-02-26 16:38:59 +11:00
hiker
5c32cbe1be Fixed crash (getUInt takes m_current_offset into account, which made
the indices partially invalid).
2016-02-26 09:20:13 +11:00
hiker
8621437e07 Use NetworkString's log function. 2016-02-25 17:02:51 +11:00
hiker
2357e965b4 Fixed crash, and started to improve log output. 2016-02-25 17:00:08 +11:00
hiker
6f55877e94 Fixec various crashes. 2016-02-25 16:54:31 +11:00
hiker
03f4339cee Handle error in lan connection. 2016-02-25 09:49:45 +11:00
hiker
9d546d4980 Use BareNetworkString to correctly decode requests-for-servers. 2016-02-25 09:49:09 +11:00
hiker
1655a4889d Use BareNetworkString. 2016-02-25 09:48:47 +11:00
hiker
28bb228914 Added missing initialisation. 2016-02-25 09:46:17 +11:00
hiker
2e8ddb1c50 Added a new base class 'BareNetworkString' for NetworkString,
used it for some of the messages exchanged before the ProtocolManager
is started (i.e. establishment of initia connection).
2016-02-24 20:32:11 +11:00
hiker
98ba11d9ba Started to introduce new network string. It compiles, but certainly
does not work yet.
2016-02-23 16:29:57 +11:00
hiker
05a1a8a785 Merge branch 'master' of https://github.com/supertuxkart/stk-code 2016-02-16 12:37:43 +11:00
hiker
2f0a69525a Use kart id instead of kart name to identify kart that has collected an item. 2016-02-15 18:16:31 +11:00
hiker
132ecfe409 Created separate function for handling received collectedItem messages. 2016-02-15 18:00:09 +11:00
hiker
d15a234ace Let only the server decide when a kart finished the race. Notify
all clients if this happens.
2016-02-15 17:45:24 +11:00
hiker
1ad782e6a6 Added comments. 2016-02-11 17:24:55 +11:00
Marianne Gagnon
fe6bbb80c4 Delete unused da_DK translation, closes #2435 2016-02-10 19:56:45 -05:00
hiker
7e6711e163 Renamged NetworkWorld to RaceEventManager (since this class is
not a 'world' in the sense our game modes are).
2016-02-11 09:03:51 +11:00
hiker
99bc5477a2 Use a password to authenticate the client that is allowed to
control a server (now the controlling client can reconnect in
case it gets disconnected, previously with only allowing the host
with id 1 to control, the server could not be controlled anymore).
2016-02-10 18:03:42 +11:00
hiker
bfced53aaf Started to add password support for a controlling a server. 2016-02-10 13:32:39 +11:00
hiker
cebf395939 Only allow the first connected client to control the server. 2016-02-10 08:28:15 +11:00
hiker
ee320588d5 Merge remote-tracking branch 'origin/master' into support_nw_splitscreen 2016-02-09 17:40:59 +11:00
hiker
354770f564 Added 0 number of laps to configuration to test ending a race. 2016-02-09 13:38:25 +11:00
hiker
8f492d8480 Updated documentation. 2016-02-09 13:38:06 +11:00
hiker
f5a344ccb4 Fixed voting for laps and reverse. 2016-02-09 09:41:35 +11:00
hiker
52460d02de Made start/terminate/pause/unpause-Protocol private, so that now all
calls to those functions from the ProtocolManager event loop (which
avoids locking problems).
2016-02-05 16:28:58 +11:00
hiker
af6ecfec3a Removed unused function. 2016-02-05 16:15:58 +11:00
hiker
89979a46f5 Removed unused variables. 2016-02-05 16:09:31 +11:00
hiker
2d0fd0260e Added file forgotten in previous commit. 2016-02-05 10:08:58 +11:00
hiker
6a9a8565d0 Replaced exit mutex with Synchronised. 2016-02-05 09:02:32 +11:00
hiker
89c972c316 Cosmetic changes only. 2016-02-05 08:33:35 +11:00
hiker
e392aa6ead Fixed syntax errors :( 2016-02-05 08:28:21 +11:00
hiker
0d488b916d Use Synchronised instead of mutex for next protocol id. 2016-02-05 08:24:28 +11:00
hiker
348a300c09 Use Synchronised for m_requests instead of separate mutex. 2016-02-05 08:19:26 +11:00
hiker
263e41ec1f The update messages are now handled in the main thread, which removes the
need for locking. Also only the last update event is handled, older events
are discarded.
2016-02-04 17:15:14 +11:00
hiker
4fa7a89963 Fixed (probably debug only) crash: evaluating the pointer arithmetic
left to right had invalid intermediate result (i>0; offset <0).
2016-02-04 16:56:11 +11:00
hiker
f580603c97 Cosmetic changes. 2016-02-04 16:55:42 +11:00
hiker
878760ed2d Fixed GameEventProtocol (e.g. collecting items). 2016-02-03 09:07:15 +11:00
hiker
f5897001d8 Properly lock data structure (I've seen data corruption, most likely
caused by not locking).
2016-02-03 09:05:26 +11:00
hiker
19053d8ac6 Removed unnecessary call. 2016-02-03 08:48:28 +11:00
hiker
cc017da1d6 Let only the server ping the clients (to reduce network traffic). Reduce
frequency of pings (since it appears that often esp. during loading
clients are busy loading which artificially increases latency).
2016-02-03 08:21:34 +11:00
hiker
4f12a9a66c Prevent usage of duplicated host ids (before if hosts A and B are connected,
then A disconnects and C connects, B and C would have the same host id).
2016-02-02 09:52:07 +11:00
hiker
ef8c04e117 Removed unnecessary lock. 2016-02-01 16:45:07 +11:00
hiker
d78c1b3272 Replaced array with scalar value, minor code cleanups. 2016-02-01 16:42:36 +11:00
Benau
87862c27ae Fix #2127 2016-01-31 10:16:12 +08:00