TrinityCore
Loading...
Searching...
No Matches
ChatPackets.h
Go to the documentation of this file.
1
/*
2
* This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
3
*
4
* This program is free software; you can redistribute it and/or modify it
5
* under the terms of the GNU General Public License as published by the
6
* Free Software Foundation; either version 2 of the License, or (at your
7
* option) any later version.
8
*
9
* This program is distributed in the hope that it will be useful, but WITHOUT
10
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12
* more details.
13
*
14
* You should have received a copy of the GNU General Public License along
15
* with this program. If not, see <http://www.gnu.org/licenses/>.
16
*/
17
18
#ifndef TRINITYCORE_CHAT_PACKETS_H
19
#define TRINITYCORE_CHAT_PACKETS_H
20
21
#include "
Packet.h
"
22
#include "
ObjectGuid.h
"
23
#include "
SharedDefines.h
"
24
25
class
WorldObject
;
26
27
namespace
WorldPackets
28
{
29
namespace
Chat
30
{
31
// CMSG_MESSAGECHAT
32
class
ChatMessage
final
:
public
ClientPacket
33
{
34
public
:
35
explicit
ChatMessage
(
WorldPacket
&&
packet
) :
ClientPacket
(
CMSG_MESSAGECHAT
,
std
::move(
packet
)) { }
36
37
void
Read
()
override
;
38
39
ChatMsg
SlashCmd
= { };
40
::Language
Language
=
LANG_UNIVERSAL
;
41
std::string
Text
;
42
std::string
Target
;
43
};
44
45
// SMSG_MESSAGECHAT
46
// SMSG_GM_MESSAGECHAT
47
class
TC_GAME_API
Chat
final
:
public
ServerPacket
48
{
49
public
:
50
explicit
Chat
() :
ServerPacket
(
SMSG_MESSAGECHAT
, 100) { }
51
Chat
(
Chat
const
&
chat
);
52
53
void
Initialize(
ChatMsg
chatType
,
Language
language,
WorldObject
const
* sender,
WorldObject
const
* receiver, std::string_view message,
uint32
achievementId
= 0,
54
std::string_view
channelName
=
""
,
LocaleConstant
locale
=
DEFAULT_LOCALE
, std::string_view
addonPrefix
=
""
);
55
void
SetSender(
WorldObject
const
* sender,
LocaleConstant
locale
);
56
void
SetReceiver(
WorldObject
const
* receiver,
LocaleConstant
locale
);
57
58
WorldPacket
const
* Write()
override
;
59
60
uint8
SlashCmd = 0;
61
uint32
_Language =
LANG_UNIVERSAL
;
62
ObjectGuid
SenderGUID
;
63
ObjectGuid
TargetGUID
;
64
std::string
SenderName
;
65
std::string
TargetName
;
66
std::string
_Channel
;
67
std::string
ChatText
;
68
uint32
AchievementID = 0;
69
uint8
ChatTag = 0;
70
71
std::size_t TargetGUIDPos = 0;
72
};
73
74
class
Emote
final
:
public
ServerPacket
75
{
76
public
:
77
explicit
Emote
() :
ServerPacket
(
SMSG_EMOTE
, 4 + 8) { }
78
79
WorldPacket
const
*
Write
()
override
;
80
81
ObjectGuid
Guid
;
82
uint32
EmoteID
= 0;
83
};
84
85
class
CTextEmote
final
:
public
ClientPacket
86
{
87
public
:
88
explicit
CTextEmote
(
WorldPacket
&&
packet
) :
ClientPacket
(
CMSG_TEXT_EMOTE
,
std
::move(
packet
)) { }
89
90
void
Read
()
override
;
91
92
ObjectGuid
Target
;
93
int32
EmoteID
= 0;
94
int32
SoundIndex
= 0;
95
};
96
97
class
STextEmote
final
:
public
ServerPacket
98
{
99
public
:
100
explicit
STextEmote
() :
ServerPacket
(
SMSG_TEXT_EMOTE
, 8 + 4 + 4 + 4 + 48) { }
101
102
WorldPacket
const
*
Write
()
override
;
103
104
ObjectGuid
SourceGUID
;
105
std::string_view
TargetName
;
106
int32
EmoteID
= 0;
107
int32
SoundIndex
= 0;
108
};
109
110
class
EmoteClient
final
:
public
ClientPacket
111
{
112
public
:
113
explicit
EmoteClient
(
WorldPacket
&&
packet
) :
ClientPacket
(
CMSG_EMOTE
,
std
::move(
packet
)) { }
114
115
void
Read
()
override
;
116
117
uint32
EmoteID
= 0;
118
};
119
120
class
ChatServerMessage
final
:
public
ServerPacket
121
{
122
public
:
123
explicit
ChatServerMessage
() :
ServerPacket
(
SMSG_CHAT_SERVER_MESSAGE
, 4 + 20) { }
124
125
WorldPacket
const
*
Write
()
override
;
126
127
int32
MessageID
= 0;
128
std::string
StringParam
;
129
};
130
}
131
}
132
133
#endif
// TRINITYCORE_CHAT_PACKETS_H
LocaleConstant
LocaleConstant
Definition
Common.h:48
DEFAULT_LOCALE
#define DEFAULT_LOCALE
Definition
Common.h:62
TC_GAME_API
#define TC_GAME_API
Definition
Define.h:114
uint8
uint8_t uint8
Definition
Define.h:135
int32
int32_t int32
Definition
Define.h:129
uint32
uint32_t uint32
Definition
Define.h:133
ObjectGuid.h
Packet.h
SharedDefines.h
Language
Language
Definition
SharedDefines.h:820
LANG_UNIVERSAL
@ LANG_UNIVERSAL
Definition
SharedDefines.h:821
ChatMsg
ChatMsg
Definition
SharedDefines.h:3233
ObjectGuid
Definition
ObjectGuid.h:138
WorldObject
Definition
Object.h:339
WorldPacket
Definition
WorldPacket.h:27
WorldPackets::Array
Definition
PacketUtilities.h:120
WorldPackets::Chat::CTextEmote
Definition
ChatPackets.h:86
WorldPackets::Chat::CTextEmote::Read
void Read() override
Definition
ChatPackets.cpp:213
WorldPackets::Chat::CTextEmote::Target
ObjectGuid Target
Definition
ChatPackets.h:92
WorldPackets::Chat::CTextEmote::SoundIndex
int32 SoundIndex
Definition
ChatPackets.h:94
WorldPackets::Chat::CTextEmote::CTextEmote
CTextEmote(WorldPacket &&packet)
Definition
ChatPackets.h:88
WorldPackets::Chat::CTextEmote::EmoteID
int32 EmoteID
Definition
ChatPackets.h:93
WorldPackets::Chat::ChatMessage
Definition
ChatPackets.h:33
WorldPackets::Chat::ChatMessage::Text
std::string Text
Definition
ChatPackets.h:41
WorldPackets::Chat::ChatMessage::ChatMessage
ChatMessage(WorldPacket &&packet)
Definition
ChatPackets.h:35
WorldPackets::Chat::ChatMessage::Target
std::string Target
Whisper target or channel name.
Definition
ChatPackets.h:42
WorldPackets::Chat::ChatMessage::Read
void Read() override
Definition
ChatPackets.cpp:23
WorldPackets::Chat::ChatMessage::SlashCmd
ChatMsg SlashCmd
Definition
ChatPackets.h:39
WorldPackets::Chat::ChatServerMessage
Definition
ChatPackets.h:121
WorldPackets::Chat::ChatServerMessage::ChatServerMessage
ChatServerMessage()
Definition
ChatPackets.h:123
WorldPackets::Chat::ChatServerMessage::StringParam
std::string StringParam
Definition
ChatPackets.h:128
WorldPackets::Chat::ChatServerMessage::Write
WorldPacket const * Write() override
Definition
ChatPackets.cpp:205
WorldPackets::Chat::ChatServerMessage::MessageID
int32 MessageID
Definition
ChatPackets.h:127
WorldPackets::Chat::Chat
Definition
ChatPackets.h:48
WorldPackets::Chat::Chat::Chat
Chat()
Definition
ChatPackets.h:50
WorldPackets::Chat::Chat::SenderName
std::string SenderName
Definition
ChatPackets.h:64
WorldPackets::Chat::Chat::TargetGUID
ObjectGuid TargetGUID
Definition
ChatPackets.h:63
WorldPackets::Chat::Chat::TargetName
std::string TargetName
Definition
ChatPackets.h:65
WorldPackets::Chat::Chat::ChatText
std::string ChatText
Definition
ChatPackets.h:67
WorldPackets::Chat::Chat::SenderGUID
ObjectGuid SenderGUID
Definition
ChatPackets.h:62
WorldPackets::Chat::Chat::_Channel
std::string _Channel
Channel Name.
Definition
ChatPackets.h:66
WorldPackets::Chat::EmoteClient
Definition
ChatPackets.h:111
WorldPackets::Chat::EmoteClient::EmoteID
uint32 EmoteID
Definition
ChatPackets.h:117
WorldPackets::Chat::EmoteClient::Read
void Read() override
Definition
ChatPackets.cpp:200
WorldPackets::Chat::EmoteClient::EmoteClient
EmoteClient(WorldPacket &&packet)
Definition
ChatPackets.h:113
WorldPackets::Chat::Emote
Definition
ChatPackets.h:75
WorldPackets::Chat::Emote::Write
WorldPacket const * Write() override
Definition
ChatPackets.cpp:192
WorldPackets::Chat::Emote::EmoteID
uint32 EmoteID
Definition
ChatPackets.h:82
WorldPackets::Chat::Emote::Guid
ObjectGuid Guid
Definition
ChatPackets.h:81
WorldPackets::Chat::Emote::Emote
Emote()
Definition
ChatPackets.h:77
WorldPackets::Chat::STextEmote
Definition
ChatPackets.h:98
WorldPackets::Chat::STextEmote::STextEmote
STextEmote()
Definition
ChatPackets.h:100
WorldPackets::Chat::STextEmote::Write
WorldPacket const * Write() override
Definition
ChatPackets.cpp:220
WorldPackets::Chat::STextEmote::TargetName
std::string_view TargetName
Definition
ChatPackets.h:105
WorldPackets::Chat::STextEmote::EmoteID
int32 EmoteID
Definition
ChatPackets.h:106
WorldPackets::Chat::STextEmote::SoundIndex
int32 SoundIndex
Definition
ChatPackets.h:107
WorldPackets::Chat::STextEmote::SourceGUID
ObjectGuid SourceGUID
Definition
ChatPackets.h:104
WorldPackets::ClientPacket
Definition
Packet.h:60
WorldPackets::ServerPacket
Definition
Packet.h:46
CMSG_TEXT_EMOTE
@ CMSG_TEXT_EMOTE
Definition
Opcodes.h:289
SMSG_MESSAGECHAT
@ SMSG_MESSAGECHAT
Definition
Opcodes.h:179
CMSG_EMOTE
@ CMSG_EMOTE
Definition
Opcodes.h:287
SMSG_CHAT_SERVER_MESSAGE
@ SMSG_CHAT_SERVER_MESSAGE
Definition
Opcodes.h:686
SMSG_EMOTE
@ SMSG_EMOTE
Definition
Opcodes.h:288
SMSG_TEXT_EMOTE
@ SMSG_TEXT_EMOTE
Definition
Opcodes.h:290
CMSG_MESSAGECHAT
@ CMSG_MESSAGECHAT
Definition
Opcodes.h:178
WorldPackets
Definition
AchievementMgr.h:35
std
STL namespace.
server
game
Server
Packets
ChatPackets.h
Generated by
1.9.8