ManaPlus
Public Member Functions
EAthena::ClanHandler Class Reference

#include <clanhandler.h>

Inheritance diagram for EAthena::ClanHandler:
Net::ClanHandler

Public Member Functions

 ClanHandler ()
 
 ~ClanHandler ()
 
void chat (const std::string &text) const
 
- Public Member Functions inherited from Net::ClanHandler
 ClanHandler ()
 

Detailed Description

Definition at line 30 of file clanhandler.h.

Constructor & Destructor Documentation

◆ ClanHandler()

EAthena::ClanHandler::ClanHandler ( )

Definition at line 36 of file clanhandler.cpp.

36  :
38 {
39  clanHandler = this;
40 }
Net::ClanHandler * clanHandler
Definition: net.cpp:87

References clanHandler.

◆ ~ClanHandler()

EAthena::ClanHandler::~ClanHandler ( )
virtual

Reimplemented from Net::ClanHandler.

Definition at line 42 of file clanhandler.cpp.

43 {
44  clanHandler = nullptr;
45 }

References clanHandler.

Member Function Documentation

◆ chat()

void EAthena::ClanHandler::chat ( const std::string &  text) const
virtual

Implements Net::ClanHandler.

Definition at line 47 of file clanhandler.cpp.

48 {
49  if (localPlayer == nullptr)
50  return;
51 
52  if (packetVersion < 20120716)
53  return;
54 
55  const std::string mes = std::string(localPlayer->getName()).append(
56  " : ").append(text);
57 
58  createOutPacket(CMSG_CLAN_MESSAGE);
59  if (packetVersion >= 20151001)
60  {
61  outMsg.writeInt16(CAST_S16(mes.length() + 4), "len");
62  outMsg.writeString(mes, CAST_S32(mes.length()), "message");
63  }
64  else
65  {
66  // Added + 1 in order to let eAthena parse admin commands correctly
67  outMsg.writeInt16(CAST_S16(mes.length() + 4 + 1), "len");
68  outMsg.writeString(mes, CAST_S32(mes.length() + 1), "message");
69  }
70 }
#define CAST_S16
Definition: cast.h:28
#define CAST_S32
Definition: cast.h:30
const std::string & getName() const
Definition: being.h:232
int packetVersion
Definition: client.cpp:125
LocalPlayer * localPlayer
#define createOutPacket(name)
Definition: messageout.h:37

References CAST_S16, CAST_S32, createOutPacket, Being::getName(), localPlayer, and packetVersion.


The documentation for this class was generated from the following files: