-
-
Notifications
You must be signed in to change notification settings - Fork 0
Module: Character
Аниса edited this page Jun 16, 2022
·
27 revisions
This module provides a custom character management interface to integrate w/ your resources. For servers especially Roleplay where one user can create multiple character under their account, this module mainly comes into the play.
Syntax #2 should only be used in conjunction w/ thread
local bool: state = dbify.character.fetchAll(
table: {
--These are conditional datas that has to be used for the query
{string: columnName, ~: columnValue},
},
function: callback(table: result, table: arguments),
~: ...arguments
)
--Syntax #2:
local table: result, table: arguments = self:await(dbify.character.fetchAll(
thread: self,
table: {
--These are conditional datas that has to be used for the query
{string: columnName, ~: columnValue},
},
~: ...arguments
))
--Syntax #1:
local bool: state = dbify.character.create(
function: callback(int: characterID, table: arguments),
~: ...arguments
)
--Syntax #2:
local int: characterID, table: arguments = self:await(dbify.character.create(
thread: self,
~: ...arguments
))
dbify.character.delete(characterID, callback(result, arguments)
print(tostring(result))
print(toJSON(arguments))
end, ...)
dbify.character.setData(characterID, {
--These are character datas to be updated
{dataName1, dataValue1},
{dataName2, dataValue2},
...
}, callback(result, arguments)
print(tostring(result))
print(toJSON(arguments))
end, ...)
dbify.character.getData(characterID, {
--These are character datas to be retrieved
dataName1,
dataName2,
...
}, callback(result, arguments)
print(toJSON(result))
print(toJSON(arguments))
end, ...)