Don't spam assertions while artillery is assigned to allied sensors.
Let CB sensors defend allies too.
Only play ID_SOUND_ARTIFACT_RECOVERED to the player picking up the artefact.

Fixes ticket:3488.
Make sockets nonblocking as workaround for socket calls unexpectedly blocking.

For some weird reason, select() sometimes returns that a socket write would not block, but the socket write does
block, anyway.

On display in the bottom of a locked manpage for select(), stuck in a disused lavatory with a sign on the door
saying "Beware of the Leopard":
BUGS
       Under Linux, select() may report a socket file descriptor as "ready for reading", while nevertheless a
       subsequent read blocks. This could for example happen when data has arrived but upon examination has wrong
       checksum and is discarded. There may be other circumstances in which a file descriptor is spuriously
       reported as ready. Thus it may be safer to use O_NONBLOCK on sockets that should not block.

This would explain a socket read unexpectedly blocking, although the issue is actually a socket write unexpectedly
blocking.

Fixes ticket:3410, or else.
Fix game mechanics bug allowing one truck to claim 10 derricks at once.

Abandoned structures with no cost now slowly deconstruct over a period of one minute.
Fix commander unit count on loading games.
Add error sound, and text when you can't add any more units to the Commander.

Fixes ticket:3513
Fixes ticket:3062
Add a work around and a assert to help out with the savegame issues described in said ticket.
Close ticket #3154
Add missing header for last commit
Assert on cyclic research dependencies instead of doing an infinite loop.

Spurious assertions are possible in the case that the research tree is excessively interconnected, such as
researches 31-40 all depending on all of researches 21-30, and researches 21-30 all depending on all researches
11-20, and so on. Although it probably shouldn't assert on excessively interconnected research trees, the loop as
written could take a ridiculously long time, anyway.
French translation update by Amiral JCDG.

Closes #3512.
Update translations.
Increase precision of sorting in generate-statistics-html.py.

Fix by Emdek, closes #3519.

Also remove unneeded "import os".
Fix some weird code that partly relied on sockets being blocking.

Exposed in 53ce0a7c38822feda52bc9ba24fd45d02a0fa7cc.
Don't use bsocket and tcp_socket at the same time.

Somehow fixes a client crash when failing to join a game. Possibly caused by deleting one of bsocket or tcp_socket,
and then using the other.
Don't continue to wait for a NET_ACCEPTED after processing a NET_REJECTED.

Don't wait for a NET_ACCEPTED after the socket is broken, either.
Fix host crash on failure in NET_CreatePlayer().

NET_CreatePlayer() should not be able to fail here, though. See following commit.

Crash was due to treating ERROR_FULL == 2 as an uint8_t pointer, and trying to dereference it.
Fix joining games with some closed slots.

Although it no longer crashed when trying to join a game with some closed slots (see previous commits), it is also
desirable to actually be able to join it.
Do not return client broadcast messages to the sender.

Instead of sending a copy of broadcast messages back to the sender, which ignores them anyway, save the bandwidth.
Don't send a value which is never read, anyway.
Simplify NETrecvGame() slightly.

No need to check for NET_* messages in game queues.