split DECLINE message into DECLINE and DECLINE_MOVE

Mon, 17 Aug 2026 12:14:51 +0200

author
Mike Becker <universe@uap-core.de>
date
Mon, 17 Aug 2026 12:14:51 +0200
changeset 176
ef8c39362342
parent 175
e0e061cf4829
child 177
18dbb0dc9cd6

split DECLINE message into DECLINE and DECLINE_MOVE

resolves #937

src/main.c file | annotate | diff | comparison | revisions
src/network.h file | annotate | diff | comparison | revisions
--- a/src/main.c	Mon Aug 17 12:01:19 2026 +0200
+++ b/src/main.c	Mon Aug 17 12:14:51 2026 +0200
@@ -619,7 +619,7 @@
                      * the network response code, but we choose not to do it */
                     gamestate->checkmate = code == NETCODE_CHECKMATE;
                     gamestate->stalemate = code == NETCODE_STALEMATE;
-                    if (code == NETCODE_DECLINE) {
+                    if (code == NETCODE_DECLINE_MOVE) {
                         uint32_t reason;
                         net_recieve_data(opponent, &reason, sizeof(uint32_t));
                         reason = ntohl(reason);
@@ -802,7 +802,7 @@
                 }
             } else {
                 uint32_t reason = htonl(code);
-                net_send_data(opponent, NETCODE_DECLINE,
+                net_send_data(opponent, NETCODE_DECLINE_MOVE,
                     &reason, sizeof(uint32_t));
             }
             break;
--- a/src/network.h	Mon Aug 17 12:01:19 2026 +0200
+++ b/src/network.h	Mon Aug 17 12:14:51 2026 +0200
@@ -39,6 +39,7 @@
     
 #define NETCODE_ACCEPT 0x02
 #define NETCODE_DECLINE 0x04
+#define NETCODE_DECLINE_MOVE 0x05
 #define NETCODE_GAMEINFO 0x10
 #define NETCODE_PGNDATA 0x11
 #define NETCODE_MOVE 0x20
@@ -54,7 +55,7 @@
 #define NETCODE_CONNLOST 0x80
 #define NETCODE_ERROR 0xFF
 
-#define NETCODE_VERSION 21
+#define NETCODE_VERSION 22
 
 typedef struct {
     int fd; /* -1, if we are the client */

mercurial