- Created package.json for Docus with necessary scripts and dependencies. - Implemented sync-docus-docs.mjs to automate the generation of documentation files from source markdown. - Defined mappings for generated pages and virtual routes to ensure proper linking in documentation. - Added static content files for the documentation structure, including navigation and index pages.
48 lines
1.2 KiB
Markdown
48 lines
1.2 KiB
Markdown
# Forge Server Usage Examples
|
|
|
|
These examples use the domain command surface exposed by the extension.
|
|
Persistence is handled by the server through SurrealDB.
|
|
|
|
## Status Check
|
|
|
|
```sqf
|
|
["status", []] call forge_server_extension_fnc_extCall params ["_status", "_ok"];
|
|
if (_ok && {_status isEqualTo "connected"}) then {
|
|
systemChat "Forge persistence is online.";
|
|
};
|
|
```
|
|
|
|
## Actor Fetch
|
|
|
|
```sqf
|
|
private _uid = getPlayerUID player;
|
|
["actor:get", [_uid]] call forge_server_extension_fnc_extCall params ["_payload", "_ok"];
|
|
if (_ok) then {
|
|
private _actor = fromJSON _payload;
|
|
systemChat format ["Loaded actor %1", _actor getOrDefault ["uid", _uid]];
|
|
};
|
|
```
|
|
|
|
## Store Checkout
|
|
|
|
```sqf
|
|
private _checkout = createHashMapFromArray [
|
|
["requesterUid", getPlayerUID player],
|
|
["requesterName", name player],
|
|
["orgId", "default"],
|
|
["requesterIsDefaultOrgCeo", false],
|
|
["paymentMethod", "bank"],
|
|
["items", [
|
|
createHashMapFromArray [
|
|
["classname", "FirstAidKit"],
|
|
["category", "item"],
|
|
["priceValue", 50],
|
|
["quantity", 2]
|
|
]
|
|
]],
|
|
["vehicles", []]
|
|
];
|
|
|
|
["store:checkout", [toJSON _checkout]] call forge_server_extension_fnc_extCall;
|
|
```
|