More specifically, because Mix_LoadMUS() fails, e.g. because it does not
recognize the music lump's file format. Music lumps are not always in
MUS or MIDI format nowadays, so let other code handle that.
D_IdentifyVersion() as well as identifying the game version also
loads voices.wad. In order to support WADs which replace lumps from
voices.wad, this needs to be loaded before any PWADs are loaded; this
is also consistent with vanilla Strife behavior. The voices.wad file
was also being loaded after initialization of the WAD file hash table,
which was less efficient.
This fixes#906. Thanks @Catoptromancy for reporting.
When finding a server to join it helps to know if other players are
already connected. So include a player count, but because of the limited
screen space, only if there already are players. Also fix the
capitalization of the word "Internet".
This fixes#907. Thanks to @JNechaevsky for the report.
It's known now (#945) that the game is unusable with SDL 2.0.6 due to
a crash bug in the sound code. To avoid recurring bug reports about
this, add a guard in the sound startup code that will cause the game
startup to abort if the user has v2.0.6 installed.
In games which support a look/down action (Heretic, Hexen, Strife)
permit binding a joystick axis to those actions.
Altazimuth was asking me some questions on IRC about how we handle
mouse wheel actions and that got me thinking about some of the
input stuff (specifically joystick stuff) that we hadn't finished
off.
CD music support has basically been removed now, so this function
should return -1 to indicate failure. But print an error message and
provide a useful link to an alternative.
Since 29a66d7a5c we now include the port number in server
addresses if they are a nonstandard port. So a full IP+port string
can be up to 21 characters long.
If we try to connect to an incompatible server, the server will reject
the connection attempt. Now that we have a more elaborate scheme to
negotiate a common protocol than just comparing version strings, we
can be more confident about ignoring servers that we definitely won't
be able to connect to. So use the protocol list included in query
responses to exclude query responses from servers we aren't compatible
with.
This is slightly out of place because these functions aren't for
writing "structs" as such. But they still fit in better here than
in net_common.c since they aren't really just part of the common
connection code, and will be needed to include protocol list inside
query response packets.
Introduce a network protocol versioning scheme.
This will allow backwards-compatible protocol changes in future,
and also allow forks to remain compatible with Chocolate Doom.
Instead what's almost always wanted is to read a "safe" string that
cannot contain any control codes. So introduce NET_ReadSafeString()
instead as a wrapper around NET_ReadString() that does this.
The idea here is that we define a protocol versioning scheme, where we
give a symbolic (string) name to each protocol version. This allows us
to define new protocol versions in the future while retaining
compatibility between different Chocolate Doom versions. It also allows
forks of Chocolate Doom to define their own protocols while retaining
the ability to connect to Chocolate Doom servers (and vice versa, for
Chocolate Doom clients to connect to forked servers).
When a client connects to a server, we send a list of protocols that are
supported. The server compares it to its own list of protocols and
selects a common protocol that will be used. The protocol is then sent
back to the client in a reply packet.
In order to do this, we must change the way that clients connect to
servers. Previously the client sent a SYN packet, and the server would
respond with an ACK packet. Instead, get rid of ACK packets and send a
SYN packet back instead. This also simplifies the state machine when
performing a connect. Since this is a fundamental change in the
protocol, change the magic number sent when connecting, but continue to
recognize the old magic number and send a reject message to old clients.
This may not be the most sophisticated solution (i.e. I would have
preferred to use wildcards in the target rules), but it should be
good enough to fix#938.
I was really surprised today when ZeroMaster010 told me that he always
has to start Doom with the -record parameter to practice for his
record runs, because there is no other way to enable low-resolution
turning during normal play.
Why is that? I mean, we have a command line switch to enable
full-resolution turning even when recording a demo, so why shouldn't
there be a switch to force low-esolution turning even when not
recording a demo. PrBoom+ already has this switch.
This runs cppcheck static analysis as part of the travis-ci checks. The
current Travis version of cppcheck doesn't appear to support all the checks
we want, but for now should be sufficient. Identified issues that would cause
these checks to fail have been resolved in previous commits.
Thanks to @turol for doing the work to set this up.
When respawning a mobj we scan the mobjinfo[] array to find the type
that represents the object. It's possible that we don't find it and in
this case an array index overrun occurs. Handle this by exiting with an
error rather than continuing. This was detected by cppcheck static
analyses set up by @turol and blocking #939.
This function is weirdly written and the logic is hard to follow, so
clean it up. This resolves warnings about array index overruns surfaced
by cppcheck and blocking #939. Thanks @turol for discovering.
It somehow got there by cherry-picking the changes from the i_realloc
branch into the master branch and then merging the master branch into
the sdl2-branch. Sorry for the confusion.