Cell functions

class CellFunctions

Public Static Functions

unsigned int GetCellStateChangesSize(unsigned short pid)

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

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

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

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

Return
The cell state type (0 for LOAD, 1 for UNLOAD).
Parameters
  • pid: The player ID whose cell state changes should be used.
  • index: The index of the cell state.

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

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

Return
The cell description.
Parameters
  • pid: The player ID whose cell state changes should be used.
  • index: The index of the cell state.

const char *GetCell(unsigned short pid)

Get the cell description of a player’s cell.

Return
The cell description.
Parameters
  • pid: The player ID.

int GetExteriorX(unsigned short pid)

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

Return
The X coordinate of the cell.
Parameters
  • pid: The player ID.

int GetExteriorY(unsigned short pid)

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

Return
The Y coordinate of the cell.
Parameters
  • pid: The player ID.

bool IsInExterior(unsigned short pid)

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

Return
Whether the player is in an exterior cell.
Parameters
  • pid: The player ID.

const char *GetRegion(unsigned short pid)

Get the region of the player’s exterior cell.

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

Return
The region.
Parameters
  • pid: The player ID.

bool IsChangingRegion(unsigned short pid)

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

Return
Whether the player has changed their region.
Parameters
  • pid: The player ID.

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

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.

Return
void
Parameters
  • pid: The player ID.
  • cellDescription: The cell description.

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

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.

Return
void
Parameters
  • pid: The player ID.
  • x: The X coordinate of the cell.
  • y: The Y coordinate of the cell.

void SendCell(unsigned short pid)

Send a PlayerCellChange packet about a player.

It is only sent to the affected player.

Return
void
Parameters
  • pid: The player ID.