ManaPlus
Public Member Functions
EAthena::AuctionHandler Class Reference

#include <auctionhandler.h>

Inheritance diagram for EAthena::AuctionHandler:
Net::AuctionHandler

Public Member Functions

 AuctionHandler ()
 
 ~AuctionHandler ()
 
void cancelReg () const
 
void setItem (const Item *const item, const int amount) const
 
void reg (const int currentPrice, const int maxPrice, const int hours) const
 
void cancel (const int auctionId) const
 
void close (const int auctionId) const
 
void bid (const int auctionId, const int money) const
 
void search (const AuctionSearchTypeT type, const int auctionId, const std::string &text, const int page) const
 
void buy () const
 
void sell () const
 
- Public Member Functions inherited from Net::AuctionHandler
 AuctionHandler ()
 

Detailed Description

Definition at line 29 of file auctionhandler.h.

Constructor & Destructor Documentation

◆ AuctionHandler()

EAthena::AuctionHandler::AuctionHandler ( )

Definition at line 36 of file auctionhandler.cpp.

37 {
38  auctionHandler = this;
39 }
Net::AuctionHandler * auctionHandler
Definition: net.cpp:102

References auctionHandler.

◆ ~AuctionHandler()

EAthena::AuctionHandler::~AuctionHandler ( )
virtual

Reimplemented from Net::AuctionHandler.

Definition at line 41 of file auctionhandler.cpp.

42 {
43  auctionHandler = nullptr;
44 }

References auctionHandler.

Member Function Documentation

◆ bid()

void EAthena::AuctionHandler::bid ( const int  auctionId,
const int  money 
) const
virtual

Implements Net::AuctionHandler.

Definition at line 85 of file auctionhandler.cpp.

87 {
88  createOutPacket(CMSG_AUCTION_BID);
89  outMsg.writeInt32(auctionId, "auction id");
90  outMsg.writeInt32(money, "money");
91 }
#define createOutPacket(name)
Definition: messageout.h:37

References createOutPacket.

◆ buy()

void EAthena::AuctionHandler::buy ( ) const
virtual

Implements Net::AuctionHandler.

Definition at line 105 of file auctionhandler.cpp.

106 {
107  createOutPacket(CMSG_AUCTION_BUY_SELL);
108  outMsg.writeInt16(1, "buy/sell type");
109 }

References createOutPacket.

◆ cancel()

void EAthena::AuctionHandler::cancel ( const int  auctionId) const
virtual

Implements Net::AuctionHandler.

Definition at line 73 of file auctionhandler.cpp.

74 {
75  createOutPacket(CMSG_AUCTION_CANCEL);
76  outMsg.writeInt32(auctionId, "auction id");
77 }

References createOutPacket.

◆ cancelReg()

void EAthena::AuctionHandler::cancelReg ( ) const
virtual

Implements Net::AuctionHandler.

Definition at line 46 of file auctionhandler.cpp.

47 {
48  createOutPacket(CMSG_AUCTION_CANCEL_REG);
49  outMsg.writeInt16(0, "type"); // unused
50 }

References createOutPacket.

◆ close()

void EAthena::AuctionHandler::close ( const int  auctionId) const
virtual

Implements Net::AuctionHandler.

Definition at line 79 of file auctionhandler.cpp.

80 {
81  createOutPacket(CMSG_AUCTION_CLOSE);
82  outMsg.writeInt32(auctionId, "auction id");
83 }

References createOutPacket.

◆ reg()

void EAthena::AuctionHandler::reg ( const int  currentPrice,
const int  maxPrice,
const int  hours 
) const
virtual

Implements Net::AuctionHandler.

Definition at line 63 of file auctionhandler.cpp.

66 {
67  createOutPacket(CMSG_AUCTION_REGISTER);
68  outMsg.writeInt32(currentPrice, "now money");
69  outMsg.writeInt32(maxPrice, "max money");
70  outMsg.writeInt32(hours, "delete hour");
71 }

References createOutPacket.

◆ search()

void EAthena::AuctionHandler::search ( const AuctionSearchTypeT  type,
const int  auctionId,
const std::string &  text,
const int  page 
) const
virtual

Implements Net::AuctionHandler.

Definition at line 93 of file auctionhandler.cpp.

97 {
98  createOutPacket(CMSG_AUCTION_SEARCH);
99  outMsg.writeInt16(CAST_S16(type), "search type");
100  outMsg.writeInt32(auctionId, "auction id");
101  outMsg.writeString(text, 24, "search text");
102  outMsg.writeInt16(CAST_S16(page), "page");
103 }
#define CAST_S16
Definition: cast.h:28

References CAST_S16, and createOutPacket.

◆ sell()

void EAthena::AuctionHandler::sell ( ) const
virtual

Implements Net::AuctionHandler.

Definition at line 111 of file auctionhandler.cpp.

112 {
113  createOutPacket(CMSG_AUCTION_BUY_SELL);
114  outMsg.writeInt16(0, "buy/sell type");
115 }

References createOutPacket.

◆ setItem()

void EAthena::AuctionHandler::setItem ( const Item *const  item,
const int  amount 
) const
virtual

Implements Net::AuctionHandler.

Definition at line 52 of file auctionhandler.cpp.

54 {
55  if (item == nullptr)
56  return;
57  createOutPacket(CMSG_AUCTION_SET_ITEM);
58  outMsg.writeInt16(CAST_S16(
59  item->getInvIndex() + INVENTORY_OFFSET), "index");
60  outMsg.writeInt32(amount, "amount"); // always 1
61 }
int getInvIndex() const
Definition: item.h:165
static const int INVENTORY_OFFSET
Definition: inventory.h:27

References CAST_S16, createOutPacket, Item::getInvIndex(), and INVENTORY_OFFSET.


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