ManaPlus
Public Member Functions
EAthena::FriendsHandler Class Reference

#include <friendshandler.h>

Inheritance diagram for EAthena::FriendsHandler:
Net::FriendsHandler

Public Member Functions

 FriendsHandler ()
 
 ~FriendsHandler ()
 
void invite (const std::string &name) const
 
void inviteResponse (const int accountId, const int charId, const bool accept) const
 
void remove (const int accountId, const int charId) const
 
- Public Member Functions inherited from Net::FriendsHandler
 FriendsHandler ()
 

Detailed Description

Definition at line 29 of file friendshandler.h.

Constructor & Destructor Documentation

◆ FriendsHandler()

EAthena::FriendsHandler::FriendsHandler ( )

Definition at line 32 of file friendshandler.cpp.

33 {
34  friendsHandler = this;
35 }
Net::FriendsHandler * friendsHandler
Definition: net.cpp:111

References friendsHandler.

◆ ~FriendsHandler()

EAthena::FriendsHandler::~FriendsHandler ( )
virtual

Reimplemented from Net::FriendsHandler.

Definition at line 37 of file friendshandler.cpp.

38 {
39  friendsHandler = nullptr;
40 }

References friendsHandler.

Member Function Documentation

◆ invite()

void EAthena::FriendsHandler::invite ( const std::string &  name) const
virtual

Implements Net::FriendsHandler.

Definition at line 42 of file friendshandler.cpp.

43 {
44  createOutPacket(CMSG_FRIENDS_ADD_PLAYER);
45  outMsg.writeString(name, 24, "name");
46 }
#define createOutPacket(name)
Definition: messageout.h:37

References createOutPacket.

◆ inviteResponse()

void EAthena::FriendsHandler::inviteResponse ( const int  accountId,
const int  charId,
const bool  accept 
) const
virtual

Implements Net::FriendsHandler.

Definition at line 48 of file friendshandler.cpp.

51 {
52  createOutPacket(CMSG_FRIENDS_REQUEST_ACK);
53  outMsg.writeInt32(accountId, "account id");
54  outMsg.writeInt32(charId, "char id");
55  outMsg.writeInt32(accept ? 1 : 0, "result");
56 }
TcpNet::Socket accept(const TcpNet::Socket sock)
Definition: sdltcpnet.cpp:198

References TcpNet::accept(), and createOutPacket.

◆ remove()

void EAthena::FriendsHandler::remove ( const int  accountId,
const int  charId 
) const
virtual

Implements Net::FriendsHandler.

Definition at line 58 of file friendshandler.cpp.

59 {
60  createOutPacket(CMSG_FRIENDS_DELETE_PLAYER);
61  outMsg.writeInt32(accountId, "account id");
62  outMsg.writeInt32(charId, "char id");
63 }

References createOutPacket.


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