Faction functions

class FactionFunctions

Public Static Functions

void ClearFactionChanges(unsigned short pid)

Clear the last recorded faction changes for a player.

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

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

unsigned int GetFactionChangesSize(unsigned short pid)

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

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

unsigned char GetFactionChangesAction(unsigned short pid)

Get the action type used in a player’s latest faction changes.

Return
The action type (0 for RANK, 1 for EXPULSION, 2 for REPUTATION).
Parameters
  • pid: The player ID whose faction changes should be used.

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

Get the factionId at a certain index in a player’s latest faction changes.

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

int GetFactionRank(unsigned short pid, unsigned int index)

Get the rank at a certain index in a player’s latest faction changes.

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

bool GetFactionExpulsionState(unsigned short pid, unsigned int index)

Get the expulsion state at a certain index in a player’s latest faction changes.

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

int GetFactionReputation(unsigned short pid, unsigned int index)

Get the reputation at a certain index in a player’s latest faction changes.

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

void SetFactionChangesAction(unsigned short pid, unsigned char action)

Set the action type in a player’s faction changes.

Return
void
Parameters
  • pid: The player ID whose faction changes should be used.
  • action: The action (0 for RANK, 1 for EXPULSION, 2 for REPUTATION).

void SetFactionId(const char *factionId)

Set the factionId of the temporary faction stored on the server.

Return
void
Parameters
  • factionId: The factionId.

void SetFactionRank(unsigned int rank)

Set the rank of the temporary faction stored on the server.

Return
void
Parameters
  • rank: The rank.

void SetFactionExpulsionState(bool expulsionState)

Set the expulsion state of the temporary faction stored on the server.

Return
void
Parameters
  • expulsionState: The expulsion state.

void SetFactionReputation(int reputation)

Set the reputation of the temporary faction stored on the server.

Return
void
Parameters
  • reputation: The reputation.

void AddFaction(unsigned short pid)

Add the server’s temporary faction to the faction changes for a player.

In the process, the server’s temporary faction will automatically be cleared so a new one can be set up.

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

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

Send a PlayerFaction packet with a player’s recorded faction changes.

Return
void
Parameters
  • pid: The player ID whose faction 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).