From 9e0ffe43178f6c82ab000a0a65b2c9284f2f4fe3 Mon Sep 17 00:00:00 2001 From: lotodore Date: Sun, 18 Nov 2007 12:53:42 +0000 Subject: [PATCH] Prepare to send reason for leaving a game. New protocol version as it is not compatible to the current beta. --- docs/net_protocol.txt | 9 ++++++++- src/net/common/netpacket.cpp | 2 ++ src/net/netpacket.h | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/docs/net_protocol.txt b/docs/net_protocol.txt index d0ff390f..2531565f 100644 --- a/docs/net_protocol.txt +++ b/docs/net_protocol.txt @@ -447,10 +447,17 @@ Server Notification: Player Left 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | Message Type = 53 | Message Length = 8 | + | Message Type = 53 | Message Length = 12 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Player ID | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Leave Reason | Reserved | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + +Leave Reason: + 0x0000 - On Request + 0x0001 - Kicked from the game + 0xFFFF - Other reason Server Notification: Game Admin Changed diff --git a/src/net/common/netpacket.cpp b/src/net/common/netpacket.cpp index 4f4cdaf1..daad333c 100644 --- a/src/net/common/netpacket.cpp +++ b/src/net/common/netpacket.cpp @@ -309,6 +309,8 @@ struct GCC_PACKED NetPacketPlayerLeftData { NetPacketHeader head; u_int32_t playerId; + u_int16_t leaveReason; + u_int16_t reserved; }; struct GCC_PACKED NetPacketGameAdminChangedData diff --git a/src/net/netpacket.h b/src/net/netpacket.h index 0da9158a..2ab487ab 100644 --- a/src/net/netpacket.h +++ b/src/net/netpacket.h @@ -30,7 +30,7 @@ #include #include -#define NET_VERSION_MAJOR 2 +#define NET_VERSION_MAJOR 3 #define NET_VERSION_MINOR 0 #define MIN_PACKET_SIZE 4