# HG changeset patch # User Mike Becker # Date 1787575095 -7200 # Node ID 444dfdf790b8f9091113e53e4ae353e4f14991e9 # Parent bb967c8e51e99c56a79df400f03485dff9f0a8a6 rework network message codes + add NETCODE_ACCEPT_MOVE relates to #976 diff -r bb967c8e51e9 -r 444dfdf790b8 src/main.c --- a/src/main.c Mon Aug 24 14:31:37 2026 +0200 +++ b/src/main.c Mon Aug 24 14:38:15 2026 +0200 @@ -671,7 +671,7 @@ uint8_t reason; net_recieve_data(opponent, &reason, 1); eval_move_failed_msg(reason); - } else if (code == NETCODE_ACCEPT) { + } else if (code == NETCODE_ACCEPT_MOVE) { format_move(gamestate, &move); apply_move(gamestate, &move); /* switch to waiting, even when the game ended. @@ -818,7 +818,7 @@ if (code == VALID_MOVE_SEMANTICS) { format_move(gamestate, &move); apply_move(gamestate, &move); - net_send_code(opponent, NETCODE_ACCEPT); + net_send_code(opponent, NETCODE_ACCEPT_MOVE); /* send a code for ending the game, if required */ bool endgame = true; diff -r bb967c8e51e9 -r 444dfdf790b8 src/network.h --- a/src/network.h Mon Aug 24 14:31:37 2026 +0200 +++ b/src/network.h Mon Aug 24 14:38:15 2026 +0200 @@ -37,16 +37,17 @@ extern "C" { #endif -#define NETCODE_ACCEPT 0x02 -#define NETCODE_DECLINE 0x04 -#define NETCODE_DECLINE_MOVE 0x05 +#define NETCODE_ACCEPT 0x01 +#define NETCODE_DECLINE 0x02 #define NETCODE_GAMEINFO 0x10 #define NETCODE_PGNDATA 0x11 #define NETCODE_MOVE 0x20 -#define NETCODE_CHECKMATE 0x23 -#define NETCODE_STALEMATE 0x28 -#define NETCODE_NOMATERIAL 0x29 -#define NETCODE_THREEFOLD 0x30 +#define NETCODE_ACCEPT_MOVE 0x21 +#define NETCODE_DECLINE_MOVE 0x22 +#define NETCODE_CHECKMATE 0x30 +#define NETCODE_STALEMATE 0x31 +#define NETCODE_NOMATERIAL 0x32 +#define NETCODE_THREEFOLD 0x33 #define NETCODE_RESIGN 0x41 #define NETCODE_REMIS 0x42 #define NETCODE_TAUNT 0x43