Kit static tables module.

Handles client requests only on game servers.

Constructor

Methods

find (table:String, params:Dynamic):List<Dynamic>

Returns all rows from a loaded static table that have given fields set to the given values.

Parameters:

table

Table name.

params

Search fields anonymous object.

Returns:

A list of table rows that match the criteria. Returns empty list if no rows were found.

findRow (table:String, params:Dynamic):Dynamic

Returns the first row from a loaded static table that have given fields set to the given values.

Parameters:

table

Table name.

params

Search fields anonymous object.

Returns:

A single table row that matches the criteria. Returns null if no rows were found.

getCall (c:ClientInfo, params:Params):{tableID:String, list:List<Unknown>, errorCode:String}

kit/table.get

Returns static table contents. That includes ingame items table which is not technically a Kit static table and has a different format (id, name, note, type, typeID, stringID, slotID, groupID, attrs - anonymous object of item attributes).

Note: This call will only return public tables (ingame items is always public). If the table is private, no response will be given.

Input:

  • tableID - String. Table string ID.

Output:

Error codes:

  • ok - Operation successful.

getItem (table:String, id:Int):TableItem

Returns a table item wrapper on top of a row from a loaded static table.

Parameters:

table

Table name.

id

Table row ID.

Returns:

Table item.

getIterator (table:String):Iterator<Dynamic>

Returns an iterator for loaded static table rows.

Parameters:

table

Table name.

Returns:

Iterator of table rows.

getList (table:String):List<Dynamic>

Returns a list for loaded static table rows.

Note: Do not modify its contents!

Parameters:

table

Table name.

Returns:

List of table rows.

getRow (table:String, id:Int):Dynamic

Returns a row from a loaded static table.

Parameters:

table

Table name.

id

Table row ID.

Returns:

Table row.

length (table:String):Int

Registers a new static table.

Intended to be called in a module constructor.

Parameters:

t

Table type description.

random (table:String, params:Dynamic):Dynamic

Returns a random row from a loaded static table that have given fields set to the given values.

Parameters:

table

Table name.

params

Search fields anonymous object.

Returns:

A single table row that matches the criteria. Returns null if no rows were found.