Cell functions

class CellFunctions

Public Static Functions

static unsigned int GetCellStateChangesSize(unsigned short pid) noexcept

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

Parameters

pid – The player ID whose cell state changes should be used.

Returns

The number of indexes.

static unsigned int GetCellStateType(unsigned short pid, unsigned int index) noexcept

Get the cell state type at a certain index in a player’s latest cell state changes.

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

  • index – The index of the cell state.

Returns

The cell state type (0 for LOAD, 1 for UNLOAD).

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

Get the cell description at a certain index in a player’s latest cell state changes.

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

  • index – The index of the cell state.

Returns

The cell description.

static const char *GetCell(unsigned short pid) noexcept

Get the cell description of a player’s cell.

Parameters

pid – The player ID.

Returns

The cell description.

static int GetExteriorX(unsigned short pid) noexcept

Get the X coordinate of the player’s exterior cell.

Parameters

pid – The player ID.

Returns

The X coordinate of the cell.

static int GetExteriorY(unsigned short pid) noexcept

Get the Y coordinate of the player’s exterior cell.

Parameters

pid – The player ID.

Returns

The Y coordinate of the cell.

static bool IsInExterior(unsigned short pid) noexcept

Check whether the player is in an exterior cell or not.

Parameters

pid – The player ID.

Returns

Whether the player is in an exterior cell.

static const char *GetRegion(unsigned short pid) noexcept

Get the region of the player’s exterior cell.

A blank value will be returned if the player is in an interior.

Parameters

pid – The player ID.

Returns

The region.

static bool IsChangingRegion(unsigned short pid) noexcept

Check whether the player’s last cell change has involved a region change.

Parameters

pid – The player ID.

Returns

Whether the player has changed their region.

static void SetCell(unsigned short pid, const char *cellDescription) noexcept

Set the cell of a player.

This changes the cell recorded for that player in the server memory, but does not by itself send a packet.

The cell is determined to be an exterior cell if it fits the pattern of a number followed by a comma followed by another number.

Parameters
  • pid – The player ID.

  • cellDescription – The cell description.

Returns

void

static void SetExteriorCell(unsigned short pid, int x, int y) noexcept

Set the cell of a player to an exterior cell.

This changes the cell recorded for that player in the server memory, but does not by itself send a packet.

Parameters
  • pid – The player ID.

  • x – The X coordinate of the cell.

  • y – The Y coordinate of the cell.

Returns

void

static void SendCell(unsigned short pid) noexcept

Send a PlayerCellChange packet about a player.

It is only sent to the affected player.

Parameters

pid – The player ID.

Returns

void