summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
caa73e9)
In case of different network protocol versions at network client and
server, show an error message and disable networking instead of
aborting the program with a "fatal error" style message.
static byte *buffer = realbuffer + 4;
static int nread = 0, nwrite = 0;
static boolean stop_network_game = FALSE;
static byte *buffer = realbuffer + 4;
static int nread = 0, nwrite = 0;
static boolean stop_network_game = FALSE;
+static boolean stop_network_client = FALSE;
+static char stop_network_client_message[MAX_OUTPUT_LINESIZE + 1];
static void DrawNetworkTextExt(char *message, int font_nr, boolean initialize)
{
static void DrawNetworkTextExt(char *message, int font_nr, boolean initialize)
{
static void Handle_OP_BAD_PROTOCOL_VERSION()
{
Error(ERR_WARN, "protocol version mismatch");
static void Handle_OP_BAD_PROTOCOL_VERSION()
{
Error(ERR_WARN, "protocol version mismatch");
- Error(ERR_EXIT, "server expects %d.%d.x instead of %d.%d.%d",
+ Error(ERR_WARN, "server expects %d.%d.x instead of %d.%d.%d",
buffer[2], buffer[3],
PROTOCOL_VERSION_1, PROTOCOL_VERSION_2, PROTOCOL_VERSION_3);
buffer[2], buffer[3],
PROTOCOL_VERSION_1, PROTOCOL_VERSION_2, PROTOCOL_VERSION_3);
+
+ sprintf(stop_network_client_message, "Network protocol version mismatch! Server expects version %d.%d.x instead of %d.%d.%d!",
+ buffer[2], buffer[3],
+ PROTOCOL_VERSION_1, PROTOCOL_VERSION_2, PROTOCOL_VERSION_3);
+
+ stop_network_client = TRUE;
}
static void Handle_OP_YOUR_NUMBER()
}
static void Handle_OP_YOUR_NUMBER()
nread += num_bytes;
HandleNetworkingMessages();
nread += num_bytes;
HandleNetworkingMessages();
+
+ if (stop_network_client)
+ return stop_network_client_message;