-
Notifications
You must be signed in to change notification settings - Fork 0
API Cookbook
If you are reading this document, good luck. Making proper documentation takes time, we don't have such time. Hence this minimized and barely organized version of API usage guide. Theoretically it should be enough to start designing an application that utilizes the said API.
The most important data type. Fetches config entries from numerous game configs, such as item.
Parameters:
-
configName- Name of the config in which we are searching for, i.e "item", "actor" -
configEntryPath- Path of the entry in the selected config, i.e "Weapon/Sword/Troika"
Response:
-
ConfigEntry [200]- Entry matching the input path. -
null [404]- configEntryPath or configName incorrect.
Parameters:
-
realName- In-game name of the config entry, i.e "Brandish", for now costume names such as "Lovely Bolted Vee" are not working.
Response:
-
List<ConfigEntry> [200]- One or more entries that match the said name (in case multiple entries exist utilizing the same name) -
null [404]- No configs matching the name.
Resolves and reverse-searches names from i18n properties (basically, variables from configs resolved to actual strings). Structured as a hashmap mapping keys (m.brandish) to values (Brandish)
Parameters:
-
value- Reverse search for property value, i.e "Brandish"
Response:
-
Stream<StringResult> [200]- List of property names matching the value, i.e[{"value":"m.brandish"}, {"value" : "m.sword_base"}] -
null [404]- No properties matching the value.
Parameters:
-
key- Resolve property name, i.e "m.brandish"
Response:
-
String [200]- Property value, i.e{"value":"Oni Helm"} -
null [404]- No such property
Standard Config Index entry holding parameters and references to other entries. The base for holding config data. Fields:
-
implementationType [String]- String pointing to client class implementing the said config. -
derivedImplementationType [String]- String pointing to effective implementation, if the entry is a config derived from other config. (First non-derived parent entry implementation) -
path [Path]- Path identifying the entry in its config. -
derivedPath [Path]- Path identifying the parent entry from which this entry derives. Empty value if entry is not derived. -
sourceConfig [String]- String identifying the config where this entry is located. -
derived [Boolean]- Bool asserting whether entry is derived or not. -
parameters [ParameterArray]- ParameterArray of parameters resulting from derivation with parent entries (entry overriding some parameters of its parents, contains just own parameters, if not derived). The default array of parameters to be displayed if full parameters are desired. -
routedParameters [ParameterArray]- ParameterArray of select parameters fromparameters. Usually not nested, exposes direct ParameterValue, may be nested if value is a ConfigReference. The default array of parameters if brief human-readable parameters are desired. -
derivedParameters [ParameterArray]- ParameterArray of just derived parameters from this entry's parents. (Excluding this entry's parameters). Usually unnecessary. -
ownParameters [ParameterArray]- ParameterArray of parameters directly belonging to this entry. Usually unnecessary.
A HashMap wrapper for holding parameters and implementing path resolution and parameter derivation.
Fields:
-
hashmap [HashMap<String, ParameterValue>]- Hashmap holding mappings of Strings to ParameterValue. -
empty [Boolean]- Bool asserting whether ParameterArray is empty.
An Object wrapper for most (all) types that can be found in config entries values.
Fields:
-
value [Object]- The value itself, can be of any type, implemented proper handling for types such as: String, Integer, Double, Float, Boolean, List, ConfigReference or ParameterArray. -
nested [Boolean]- Do not confuse. Asserts whether value is a ParameterArray, and hence should be iterated over during path resolution. -
reference [Boolean]- Asserts whether value is a ConfigReference.
A reference to a ConfigEntry, may override some of its parameters. May also be a reference to an entry stored in a .dat file, if that's the case the path will specify a filepath relative to Spiral Knights/rsrc folder.
Fields:
-
implementationType [String]- String that is constant across all references. -
sourceConfig [String]- String identifying the config where the referenced entry is located. -
path [Path]- Path identifying the referenced entry in its config. -
parameters [ParameterArray]- ParameterArray of parameters overriding the referenced entry parameters.
A wrapper for String denouncing a path in either Config Index or in ParameterArray
Fields:
-
path [String]- String containing the path, i.e "Weapon/Sword/Brandish" -
delimiter [String]- String containing the path delimiter, i.e "/"