Skip to content

Module: Character

Аниса edited this page Dec 16, 2022 · 27 revisions

━ What's the Objective?

This module provides a custom character management interface to integrate w/ your resources.

For servers such as DayZ, Roleplay, RPG, Arenas where clients are essentially expected to create multiple character under their account, this module comes into the play!

━ APIs

━ dbify.module.character.fetchAll() (Server)

@Objective: Fetches all existing characters.
local table: result, table: arguments = dbify.module.character.fetchAll(
  table: {
    --Conditional datas to be used for the query
    {string: columnName, ~: columnValue},
    ...
  },
  bool: isSoloFetch, --Enabling this returns only first row of the retrieved result
  ~: ...arguments
)

━ dbify.module.character.create() (Server)

@Objective: Creates a new character.
local int: characterID, table: arguments = dbify.module.character.create(
  ~: ...arguments
)

━ dbify.module.character.delete() (Server)

@Objective: Deletes an existing character.
local bool: result, table: arguments = dbify.module.character.delete(
  int: characterID,
  ~: ...arguments
)

━ dbify.module.character.setData() (Server)

@Objective: Sets character datas of a valid character.
local bool: result, table: arguments = dbify.module.character.setData(
  int: characterID,
  table: {
    --Columns to be updated w/ their respective values
    {string: columnName, ~: columnValue},
    ...
  },
  ~: ...arguments
)

━ dbify.module.character.getData() (Server)

@Objective: Retrieves character datas of a valid character.
local table: result, table: arguments = dbify.module.character.getData(
  int: characterID,
  table: {
    --Columns whose values are to be retrieved
    string: columnName,
    ...
  },
  ~: ...arguments
)