forge/docus/dist/raw/server-modules/owned-storage.md
2026-05-23 09:23:12 -05:00

9.9 KiB

Owned Storage Usage Guide

Owned storage covers the owned:locker and owned:garage extension command groups. These modules store unlock lists rather than physical item or vehicle instances.

Use these modules for virtual arsenal and virtual garage unlocks. Use Locker Usage Guide and Garage Usage Guide for physical inventory and stored vehicle instances.

Owned Locker Model

{
  "items": ["FirstAidKit"],
  "weapons": ["arifle_MX_F"],
  "magazines": ["30Rnd_65x39_caseless_black_mag"],
  "backpacks": ["B_AssaultPack_rgr"]
}

Supported owned locker categories:

  • items
  • weapons
  • magazines
  • backpacks

New owned lockers are created with default unlocks from the Rust model.

Owned Garage Model

{
  "cars": ["B_Quadbike_01_F"],
  "armor": [],
  "helis": [],
  "planes": [],
  "naval": [],
  "other": []
}

Supported owned garage categories:

  • cars
  • armor
  • helis
  • planes
  • naval
  • other

The durable owned:garage:remove command currently accepts heli for the helicopter category. Add, get, and hot remove accept helis.

New owned garages are created with default unlocks from the Rust model.

Owned Locker Commands

<th>
  Arguments
</th>

<th>
  Returns
</th>
<td>
  <code>
    uid
  </code>
</td>

<td>
  Full owned locker JSON.
</td>
<td>
  <code>
    uid
  </code>
</td>

<td>
  Full owned locker JSON.
</td>
<td>
  <code>
    uid
  </code>
  
  , <code>
    category
  </code>
</td>

<td>
  Category classname array JSON.
</td>
<td>
  <code>
    uid
  </code>
  
  , <code>
    category
  </code>
  
  , <code>
    classnames_json
  </code>
</td>

<td>
  Updated category array JSON.
</td>
<td>
  <code>
    uid
  </code>
  
  , <code>
    category
  </code>
  
  , <code>
    classname
  </code>
</td>

<td>
  Updated category array JSON.
</td>
<td>
  <code>
    uid
  </code>
</td>

<td>
  <code>
    OK
  </code>
  
  .
</td>
<td>
  <code>
    uid
  </code>
</td>

<td>
  <code>
    true
  </code>
  
   or <code>
    false
  </code>
  
  .
</td>
Command
owned:locker:create
owned:locker:fetch
owned:locker:get
owned:locker:add
owned:locker:remove
owned:locker:delete
owned:locker:exists

Owned Garage Commands

<th>
  Arguments
</th>

<th>
  Returns
</th>
<td>
  <code>
    uid
  </code>
</td>

<td>
  Full owned garage JSON.
</td>
<td>
  <code>
    uid
  </code>
</td>

<td>
  Full owned garage JSON.
</td>
<td>
  <code>
    uid
  </code>
  
  , <code>
    category
  </code>
</td>

<td>
  Category classname array JSON.
</td>
<td>
  <code>
    uid
  </code>
  
  , <code>
    category
  </code>
  
  , <code>
    classnames_json
  </code>
</td>

<td>
  Updated category array JSON.
</td>
<td>
  <code>
    uid
  </code>
  
  , <code>
    category
  </code>
  
  , <code>
    classname
  </code>
</td>

<td>
  Updated category array JSON.
</td>
<td>
  <code>
    uid
  </code>
</td>

<td>
  <code>
    OK
  </code>
  
  .
</td>
<td>
  <code>
    uid
  </code>
</td>

<td>
  <code>
    true
  </code>
  
   or <code>
    false
  </code>
  
  .
</td>
Command
owned:garage:create
owned:garage:fetch
owned:garage:get
owned:garage:add
owned:garage:remove
owned:garage:delete
owned:garage:exists

Add Virtual Arsenal Unlocks

private _classes = ["arifle_MX_F", "hgun_P07_F"];

private _result = "forge_server" callExtension ["owned:locker:add", [
    getPlayerUID player,
    "weapons",
    toJSON _classes
]];

Add Virtual Garage Unlocks

private _classes = ["B_Quadbike_01_F", "B_MRAP_01_F"];

private _result = "forge_server" callExtension ["owned:garage:add", [
    getPlayerUID player,
    "cars",
    toJSON _classes
]];

Remove an Unlock

"forge_server" callExtension ["owned:locker:remove", [
    getPlayerUID player,
    "weapons",
    "arifle_MX_F"
]];

"forge_server" callExtension ["owned:garage:remove", [
    getPlayerUID player,
    "cars",
    "B_Quadbike_01_F"
]];

Hot-State Commands

Both owned storage modules support hot state.

Owned locker:

<th>
  Arguments
</th>

<th>
  Returns
</th>
<td>
  <code>
    uid
  </code>
</td>

<td>
  Full owned locker JSON.
</td>
<td>
  <code>
    uid
  </code>
</td>

<td>
  Full owned locker JSON.
</td>
<td>
  <code>
    uid
  </code>
  
  , <code>
    category
  </code>
</td>

<td>
  Category array JSON.
</td>
<td>
  <code>
    uid
  </code>
  
  , <code>
    locker_json
  </code>
</td>

<td>
  Full owned locker JSON.
</td>
<td>
  <code>
    uid
  </code>
</td>

<td>
  Current hot owned locker JSON and async durable save.
</td>
<td>
  <code>
    uid
  </code>
</td>

<td>
  <code>
    OK
  </code>
  
  .
</td>
Command
owned:locker:hot:init
owned:locker:hot:fetch
owned:locker:hot:get
owned:locker:hot:override
owned:locker:hot:save
owned:locker:hot:remove

Owned garage:

<th>
  Arguments
</th>

<th>
  Returns
</th>
<td>
  <code>
    uid
  </code>
</td>

<td>
  Full owned garage JSON.
</td>
<td>
  <code>
    uid
  </code>
</td>

<td>
  Full owned garage JSON.
</td>
<td>
  <code>
    uid
  </code>
  
  , <code>
    category
  </code>
</td>

<td>
  Category array JSON.
</td>
<td>
  <code>
    uid
  </code>
  
  , <code>
    garage_json
  </code>
</td>

<td>
  Full owned garage JSON.
</td>
<td>
  <code>
    uid
  </code>
  
  , <code>
    category
  </code>
  
  , <code>
    classnames_json
  </code>
</td>

<td>
  Updated category array JSON.
</td>
<td>
  <code>
    uid
  </code>
  
  , <code>
    category
  </code>
  
  , <code>
    classname
  </code>
</td>

<td>
  Updated category array JSON.
</td>
<td>
  <code>
    uid
  </code>
</td>

<td>
  Current hot owned garage JSON and async durable save.
</td>
<td>
  <code>
    uid
  </code>
</td>

<td>
  <code>
    OK
  </code>
  
  .
</td>
Command
owned:garage:hot:init
owned:garage:hot:fetch
owned:garage:hot:get
owned:garage:hot:override
owned:garage:hot:add
owned:garage:hot:remove_item
owned:garage:hot:save
owned:garage:hot:remove

Error Handling

private _payload = _result select 0;
if (_payload find "Error:" == 0) exitWith {
    systemChat format ["Owned storage error: %1", _payload];
};