summaryrefslogtreecommitdiff
path: root/src/map/packets_struct.h
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2016-03-28 13:11:40 +0200
committerHaru <haru@dotalux.com>2016-04-23 09:52:30 +0200
commitccfd0549ce64e84e41069ec8e040ce9806b963f2 (patch)
tree73fbb4a27b02e1807cd71678ace972921b5dca81 /src/map/packets_struct.h
parent235a8d18f8cbbb5aaf7563566ff68f15fc1054c1 (diff)
downloadhercules-ccfd0549ce64e84e41069ec8e040ce9806b963f2.tar.gz
hercules-ccfd0549ce64e84e41069ec8e040ce9806b963f2.tar.bz2
hercules-ccfd0549ce64e84e41069ec8e040ce9806b963f2.tar.xz
hercules-ccfd0549ce64e84e41069ec8e040ce9806b963f2.zip
Refactored the chat message packet processing functions
- Split the processing of public chat messages and whisper messages in two functions, to make them more straightforward. Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/map/packets_struct.h')
-rw-r--r--src/map/packets_struct.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/map/packets_struct.h b/src/map/packets_struct.h
index 25b20cddf..888d893b6 100644
--- a/src/map/packets_struct.h
+++ b/src/map/packets_struct.h
@@ -1215,6 +1215,19 @@ struct packet_quest_list_header {
//struct packet_quest_list_info list[]; // Variable-length
} __attribute__((packed));
+struct packet_chat_message {
+ uint16 packet_id;
+ int16 packet_len;
+ char message[];
+} __attribute__((packed));
+
+struct packet_whisper_message {
+ uint16 packet_id;
+ int16 packet_len;
+ char name[NAME_LENGTH];
+ char message[];
+} __attribute__((packed));
+
#if !defined(sun) && (!defined(__NETBSD__) || __NetBSD_Version__ >= 600000000) // NetBSD 5 and Solaris don't like pragma pack but accept the packed attribute
#pragma pack(pop)
#endif // not NetBSD < 6 / Solaris