Book functions

class BookFunctions

Public Static Functions

static void ClearBookChanges(unsigned short pid) noexcept

Clear the last recorded book changes for a player.

This is used to initialize the sending of new PlayerBook packets.

Parameters

pid – The player ID whose book changes should be used.

Returns

void

static unsigned int GetBookChangesSize(unsigned short pid) noexcept

Get the number of indexes in a player’s latest book changes.

Parameters

pid – The player ID whose book changes should be used.

Returns

The number of indexes.

static void AddBook(unsigned short pid, const char *bookId) noexcept

Add a new book to the book changes for a player.

Parameters
  • pid – The player ID whose book changes should be used.

  • bookId – The bookId of the book.

Returns

void

static const char *GetBookId(unsigned short pid, unsigned int index) noexcept

Get the bookId at a certain index in a player’s latest book changes.

Parameters
  • pid – The player ID whose book changes should be used.

  • index – The index of the book.

Returns

The bookId.

static void SendBookChanges(unsigned short pid, bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept

Send a PlayerBook packet with a player’s recorded book changes.

Parameters
  • pid – The player ID whose book changes should be used.

  • sendToOtherPlayers – Whether this packet should be sent to players other than the player attached to the packet (false by default).

  • skipAttachedPlayer – Whether the packet should skip being sent to the player attached to the packet (false by default).

Returns

void