The network used to cast GetTime() to int, but GetTime() is an unsigned long. This might cause problems if GetTime() returns big integers (see #251). To solve this, the StdSchedulerProc interface had to be extended with another function in order to eliminate the magic return value -1 of GetNextTick for "no scheduled execution".
Direct3D hasn't worked for more than a year now, and there don't seem to
be any efforts to revive it. Remove it and concentrate on better OpenGL
support.
Instead of sending pre-composed C4Script code across the network, make
player self-management (surrendering, team changes etc.) send a
dedicated control packet. This means less network traffic, and also a
smaller attack vector for malicions C4Script injection.
Part of #936.
MsgBoard commands used to be evaluated on the issuing client. Malicious
clients would be able to insert arbitrary C4Script code to be executed
instead of the scenario-defined command; other clients would not be able
to tell the difference.
Instead, we now only send the command identifier, issuing player and
command parameter. This is still not perfect because clients can
insert any player they want, but it's better than before.
Part of #936.
Given that SimpleUDP makes no promises on delivering data anyway, it's okay
to just drop packets silently.
While I'm at it, it's probably a good idea for non-Windows system to
set sockets as non-blocking too, as well as C4NetIOUDP to be more
consistent with its handling of errors along these lines.
I am still completely mystified why this seems to happen so often in
practice. Hopefully the extra logging will give us some clues in
future. And closing the connection immediately gives us a small chance
at recovering from this situation.
Most of the processing was already done by C4MessageInput::ProcessInput and
C4MessageInput::ProcessCommand. Simply move the Lobby-only commands there,
too, and make them work without a Lobby MainDlg. This required almost only
cosmetic changes.
OR'ing an enum value and a char with its highest bit set sign-extends the char.
On compilers with signed chars, this means you end up with a negative integer,
which can't be narrowed to uint8_t at initialization (which is what PacketHdr's
first member is).
This fixes joining games in local networks where the PID_ConnRe
packet can arrive earlier than the main thread manages to flag
the connection as accepted.
Although the code already uses boost, boost/uuid hides the sha1
implementation in a deeply nested namespace, which is just too bizarre to
use. Also the name of that namespace suggests that it is just an
implementation detail that could go away without notice.
rand() returns a signed integer, while the PacketHdr structure
has an unsigned packet number field. According to ISO/IEC 14882,
implicitly narrowing a value type in an initializer list is not
allowed [dcl.init.aggr p2].
+ CustomMessage now uses a normal picture of a definition/object
+ BigIcon is now the small (and only) "Portrait" the player chan choose
+ In future, one could of course make the max size of the BigIcon bigger
A few windows headers are still included, but not the big offenders
rpcndr.h, wingdi.h and winuser.h. Unfortunately, the latter two need to be
included from StdWindow.h, so still wind up in a lot files, which means
some of the #defines in them need to be undone. To avoid doing that in
multiple places, a few more files include StdWindow.h now.
PeterW changed some stuff about the INI parser. I adjusted the parsing of the version info from the masterserver to fit his change
and let the C4Network2RefClient inherit from the C4Network2UpdateClient (as refclient does the same as updateclient only more) while I was at it.
This time with more manual checking and using git blame -M -C, so that
a few cases of copied code get a copyright notice corresponding to
their initial introduction.
+ Now can join #play-clonk. Anything that adheres the pattern #*clonk*
+ /help actually works now
+ /query nickname message - does not create a chat with "nickname message"
Hardcode the few remaining palette references instead. We might want to
include some method to customize some colors again, but not for debug
display and such things.
Both classes did the same thing at the same time, with the only difference
that C4GUI::Resource was vaguely more associated with GUI stuff. Some
time ago, C4GUI::Resource could be freed during the game, but not anymore.
This saves some lines of code and one redundant class, but shouldn't change
anything besides progress bar being textured a little earlier during
startup.
This is a whitespace-only patch. Hopefully, it'll only affect rarely-changed
parts of the engine, since all regularly maintained pieces should already
use tabs.
Lobby: Desaturation filter and watermark on unregistered players gone
Startup: Doesn't show "Unregistered" anymore
About: No "register now button"
Network: /regjoinonly switch removed
Most files using it weren't used by c4group-the-application anymore, and
the remaining stuff can be dealt with by using stubs or the same code in
both cases.
The non-winsock part of the code was making some funny assumptions about
the the connection/peer lists staying consistent with the pollfd array,
so we use a pollfd map instead.
---
src/network/C4NetIO.cpp | 32 ++++++++++++++++----------------
1 files changed, 16 insertions(+), 16 deletions(-)
In the not-STDSCHEDULER_USE_EVENTS case, the fds pointer will point to
the elements of a vector with automatic storage duration and then
outlive its lifetime, causing undefined behaviour.
---
src/network/C4NetIO.cpp | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)