ManaPlus
Public Member Functions
EAthena::BattleGroundHandler Class Reference

#include <battlegroundhandler.h>

Inheritance diagram for EAthena::BattleGroundHandler:
Net::BattleGroundHandler

Public Member Functions

 BattleGroundHandler ()
 
 ~BattleGroundHandler ()
 
void registerBg (const BattleGroundTypeT &type, const std::string &name) const
 
void rekoveRequest (const std::string &name) const
 
void beginAck (const bool result, const std::string &bgName, const std::string &gameName) const
 
void checkState (const std::string &name) const
 
- Public Member Functions inherited from Net::BattleGroundHandler
 BattleGroundHandler ()
 

Detailed Description

Definition at line 29 of file battlegroundhandler.h.

Constructor & Destructor Documentation

◆ BattleGroundHandler()

EAthena::BattleGroundHandler::BattleGroundHandler ( )

Definition at line 34 of file battlegroundhandler.cpp.

35 {
36  battleGroundHandler = this;
37 }
Net::BattleGroundHandler * battleGroundHandler
Definition: net.cpp:106

References battleGroundHandler.

◆ ~BattleGroundHandler()

EAthena::BattleGroundHandler::~BattleGroundHandler ( )
virtual

Reimplemented from Net::BattleGroundHandler.

Definition at line 39 of file battlegroundhandler.cpp.

40 {
41  battleGroundHandler = nullptr;
42 }

References battleGroundHandler.

Member Function Documentation

◆ beginAck()

void EAthena::BattleGroundHandler::beginAck ( const bool  result,
const std::string &  bgName,
const std::string &  gameName 
) const
virtual

Implements Net::BattleGroundHandler.

Definition at line 62 of file battlegroundhandler.cpp.

65 {
66  if (packetVersion < 20111005)
67  return;
68  createOutPacket(CMSG_BATTLE_BEGIN_ACK);
69  outMsg.writeInt8(CAST_S8(result ? 1 : 0), "result");
70  outMsg.writeString(bgName, 24, "bg name");
71  outMsg.writeString(gameName, 24, "game name");
72 }
#define CAST_S8
Definition: cast.h:26
int packetVersion
Definition: client.cpp:125
#define createOutPacket(name)
Definition: messageout.h:37

References CAST_S8, createOutPacket, and packetVersion.

◆ checkState()

void EAthena::BattleGroundHandler::checkState ( const std::string &  name) const
virtual

Implements Net::BattleGroundHandler.

Definition at line 74 of file battlegroundhandler.cpp.

75 {
76  if (packetVersion < 20111005)
77  return;
78  createOutPacket(CMSG_BATTLE_CHECK_STATE);
79  outMsg.writeString(name, 24, "bg name");
80 }

References createOutPacket, and packetVersion.

◆ registerBg()

void EAthena::BattleGroundHandler::registerBg ( const BattleGroundTypeT type,
const std::string &  name 
) const
virtual

Implements Net::BattleGroundHandler.

Definition at line 44 of file battlegroundhandler.cpp.

46 {
47  if (packetVersion < 20111005)
48  return;
49  createOutPacket(CMSG_BATTLE_REGISTER);
50  outMsg.writeInt16(CAST_S16(type), "type");
51  outMsg.writeString(name, 24, "bg name");
52 }
#define CAST_S16
Definition: cast.h:28

References CAST_S16, createOutPacket, and packetVersion.

◆ rekoveRequest()

void EAthena::BattleGroundHandler::rekoveRequest ( const std::string &  name) const
virtual

Implements Net::BattleGroundHandler.

Definition at line 54 of file battlegroundhandler.cpp.

55 {
56  if (packetVersion < 20111005)
57  return;
58  createOutPacket(CMSG_BATTLE_REVOKE);
59  outMsg.writeString(name, 24, "bg name");
60 }

References createOutPacket, and packetVersion.


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