Skip to main content
Version: 1.0.0

Plugin Functions

Table service is one of the basic services and helps you to store some structural data in the game. In the following, we work with some functions that will apply to specific table.

Find Rows

This function helps to find some rows with specific conditions, if table's permission was set to 'Users rows', you can get only rows that were inserted by current user. Find functions accept some options:

Skip, Limit: Skip and limit help you to implement.

Sorts: This item accepts a dictionary of the field's name and the enum of order.

Joins: This item help you to join multiple table with specific conditions. Every Join have these items:

new JoinParams{
TableName = "Another Table ID",
foreignField = "col name",
localField = "col name"
}

Conditions: This item helps to get specific rows, conditions have two types, Single and Combiners.

  • Single: This conditions apply a logic to queries:
new Eq("player_ startid", 20).ToQuery(),
  • Combiners: And-Or conditions give ability of combining of multiple conditions.
new And(
new Eq("player_id", 20),
new Eq("status", 1)
).ToQuery(),
DynamicPixels.Table.Find<Person, FindParams>(new FindParams {
tableId = "Table Unique ID",
options = new FindOptions
{
Skip = 0,
Limit = 25,
Conditions = new Eq("playerid",20).ToQuery(),
Sorts = new Dictionary<string, Order>(),
Joins = new List<JoinParams>(new[] {}),
}
}));

Find Row By ID

this function return a row with specific id, if table's permission was set to 'Users rows', you can get only rows that were inserted by current user.

DynamicPixels.Table.FindById<T>(new FindByIdParams{
RowId = rowId,
TableId = tableId
});

Find Row By ID Then Delete

this function deletes a row with specific id and will return the last values of it, if table's permission was set to 'Users rows', you can get only rows that were inserted by current user.

DynamicPixels.Table.FindByIdAndDelete<T>(new FindByIdAndDeleteParams{
RowId = rowId,
TableId = tableId
});

Find Row By ID Then Update

this function update a row with specific id and will return the last values of it, if table's permission was set to 'Users rows', you can get only rows that were inserted by current user.

DynamicPixels.Table.FindByIdAndUpdate<T>(new FindByIdAndUpdateParams{
RowId = rowId,
TableId = tableId
Data = {}
});

Insert New Row

this function inserts a new row with passed data and return new created row.

DynamicPixels.Table.Insert<T>(new InsertParams{
TableId = tableId,
Data = new Class
{
key = value
}
});

Insert Many Rows

this function inserts multiple rows with passed data and returns new created rows.

DynamicPixels.Table.InsertMany<T>(new InsertManyParams{
TableId = tableId,
Data = [new Class
{
key = value
}]
});

Update many Rows

you can update multiple rows with specific condition with this function.

DynamicPixels.Table.UpdateMany(new UpdateManyParams());

Delete Row By ID

this function deletes a row with an specific id

DynamicPixels.Table.Delete(new DeleteParams());

Delete Many Rows

this function deletes multiple rows with specific ids

DynamicPixels.Table.DeleteMany(new DeleteManyParams());