90 Commits

Author SHA1 Message Date
Dave White
6702a9c129 made error check slightly more thorough in networking code 2005-09-05 13:51:15 +00:00
Dave White
c04984c3b9 fixed bug where the program could freeze up when networked
-- happened especially on windows
2005-09-04 03:35:32 +00:00
Jon Daniel
33fe7d8a6b remove bytes_to_send == res check.
It seems to cause trouble with mini campaign game creation.
2005-08-19 15:31:50 +00:00
Jon Daniel
a62bc00107 make send non-blocking aware 2005-08-18 17:39:36 +00:00
Jon Daniel
7b4152fe86 Use non-blocking IO for TCP sockets...
...in order to be able to receive more then 1 byte at a time while
still being able to cancel a receive.
2005-08-17 20:37:20 +00:00
Jon Daniel
8ae764677e use errno to get a more meaningful message...
...in case SDLNet_CheckSockets returns -1
2005-08-07 12:49:08 +00:00
Jon Daniel
4d9652f8b2 small changes to receive_buf 2005-08-06 10:03:34 +00:00
Jon Daniel
2632c1cbbe Remove unused variable 2005-08-05 21:54:00 +00:00
Jon Daniel
86b3dd06e4 Improved socket statistics with separate send and receive stats for each socket 2005-08-05 21:53:03 +00:00
Jon Daniel
166e87d053 Fix some spelling in a comment 2005-08-05 13:13:30 +00:00
Jon Daniel
352af9d571 Fix receive_buf to receive only one byte at a time...
,,,so we can check with timeout if there was an error

timeout should be 15s now.
2005-08-05 13:00:58 +00:00
Jon Daniel
1da2a02a62 fix send stats 2005-08-04 22:47:58 +00:00
Jon Daniel
8375b7da50 Factor send_buf code. 2005-08-04 22:43:19 +00:00
Jon Daniel
c48523d3bf Fix send and receives not being stopped...
...when trying to close a socket which caused it wait until everything
is finished.
2005-08-04 22:05:12 +00:00
András Salamon
cc1b0aecf0 add copyright notices (please change as appropriate), and deDOSify 2005-07-20 08:22:37 +00:00
Dave White
ae70ea1435 attempt to fix assertion failure in network_worker.cpp 2005-06-14 22:56:35 +00:00
András Salamon
8bd9bc98a5 ran codeclean against files 2005-06-04 19:16:06 +00:00
Philippe Plantier
ba195ecd8a [[Attack some problems with data serialization in saves]]
* Made serialized data be saved as untranslated. To achieve this, added the
  t_string class, which encapsulates a translatable string.

* Completely rewrote the (text) WML parser, making it use a tokenizer / parser
  architecture. The parser is now much more strict and validates a WML grammar.

  - Change to the WML syntax: pluses are now ignored, spaces are now forbidden
    in WML keys

* Rewrote the way the variables are interpolated. There is no more default
  interpolation, however, the vconfig class was added, which provides a
  variable-interpolating proxy to config objects.

* There is still an important known bug: this is impossible to load textmode
  save games now, because the statistics module saves some WML with spaces in
  keys, which the parser refuses. I am commiting anyway to respect the string
  freeze; the fix for this bug will come tomorrow

Hoping I do not break everything...
2005-03-27 23:06:17 +00:00
Guillaume Melquiond
d501297a65 Switch to the new logging macro. 2005-03-26 17:10:32 +00:00
Guillaume Melquiond
67d9e6b7fe Accessing the size of a buffer after having destroyed it is plain bad. 2005-03-26 15:51:05 +00:00
Guillaume Melquiond
ef733b8b81 LF@EOF. 2005-03-24 08:31:09 +00:00
Dave White
222adf9ee6 fixed network crashes 2005-03-21 01:33:36 +00:00
Guillaume Melquiond
4235114fe0 Incorrect format argument qualifier. 2005-03-13 10:32:21 +00:00
Dave White
f28f7a52fd fixed bug where sockets wouldn't be correctly locked 2005-03-02 22:13:53 +00:00
Dave White
f844f7fc42 fixed bug where packets could be corrupted in network transfer 2005-02-27 20:25:53 +00:00
Dave White
920f5b467d change to network code to make receives threaded;
changes to make the game compile on VC++
2005-02-26 22:16:34 +00:00
Dave White
e6ceaa4cd5 attempt to fix bug where an assertion would fail in network_worker.cpp 2005-01-23 22:04:20 +00:00
Isaac Clerencia Perez
a1214b626d Added wassert(), a assert()-like function forcing a crash.
Replaced every assert() with wassert()
2004-12-31 21:01:38 +00:00
Dave White
c661b3043a reduced warnings to 0 on VC++ 2004-11-18 04:08:33 +00:00
Guillaume Melquiond
be87370d13 A few changes to the network threading code.
Don't rely too much on iterator validity property of associative
containers; in fact, remove them and use a vector of pointed buffers
to increase performance. Correctly use conditions: a mutex should not
be freed just after it has been acquired through a condition wait; and
don't send a condition with the mutex being hold (it kind of defeats
the purpose of a condition). These changes require testing!
2004-10-30 08:46:28 +00:00
Dave White
009dc54817 fixed threading bugs 2004-10-29 22:03:46 +00:00
Dave White
1334566d95 fixed threading bugs 2004-10-29 22:01:23 +00:00
Dave White
cad79b21bf fixed threading bugs 2004-10-29 21:56:20 +00:00
Dave White
d05ccd5838 fixed compile error on 64 bit systems 2004-10-17 21:38:05 +00:00
Dave White
4a328f6802 fixed compile error on 64 bit systems 2004-10-17 21:29:07 +00:00
Guillaume Melquiond
fbe5cd3618 Switched networking code to new logging system. Also fix #10674, I hope. 2004-10-17 20:54:18 +00:00
Dave White
690bdfcf17 made work in Windows 2004-10-15 20:24:02 +00:00
Cédric Duval
44fe2b070e Reordered #include. 2004-10-12 23:13:17 +00:00
Pauli Manninen
f54ca92b80 network.[ch]pp and thread.[ch]pp fixes by Cedric 2004-10-12 22:38:20 +00:00
Dave White
a242eede5a added experimental threading code 2004-10-11 23:46:44 +00:00