Book functions

class BookFunctions

Public Static Functions

void ClearBookChanges(unsigned short pid)

Clear the last recorded book changes for a player.

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

Return
void
Parameters
  • pid: The player ID whose book changes should be used.

unsigned int GetBookChangesSize(unsigned short pid)

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

Return
The number of indexes.
Parameters
  • pid: The player ID whose book changes should be used.

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

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

Return
void
Parameters
  • pid: The player ID whose book changes should be used.
  • bookId: The bookId of the book.

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

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

Return
The bookId.
Parameters
  • pid: The player ID whose book changes should be used.
  • index: The index of the book.

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

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

Return
void
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).