Module veloren_server::persistence::character::conversions
source · Expand description
Private module for very tightly coupled database conversion methods. In general, these have many invariants that need to be maintained when they’re called–do not assume it’s safe to make these public!
Macros§
- Generates the code to deserialize a specific body variant from JSON
Structs§
Functions§
- Properly-recursive items (currently modular weapons) occupy the same inventory slot as their parent. The caller is responsible for ensuring that inventory_items and loadout_items are topologically sorted (i.e. forall i,
items[i].parent_container_item_id == x
implies exists j < i satisfyingitems[j].item_id == x
) - Returns a vector that contains all item rows to upsert; parent is responsible for deleting items from the same owner that aren’t affirmatively kept by this.
- NOTE: This does not return an error on failure, since we can partially recover from some failures. Instead, it returns the error in the second return value; make sure to handle it if present!