- Shift store catalog initialization from client addon to server addon - Rebuild/minify bank, garage, org, and store WebUI site assets - Update webui build tooling and npm metadata; ignore node_modules
40 lines
1.4 KiB
Plaintext
40 lines
1.4 KiB
Plaintext
#include "script_component.hpp"
|
|
|
|
PREP_RECOMPILE_START;
|
|
#include "XEH_PREP.hpp"
|
|
PREP_RECOMPILE_END;
|
|
|
|
// private _category = [QUOTE(MOD_NAME), LLSTRING(displayName)];
|
|
|
|
[QGVAR(requestCategory), {
|
|
params [["_uid", "", [""]], ["_category", "", [""]]];
|
|
|
|
if (_uid isEqualTo "" || { _category isEqualTo "" }) exitWith {
|
|
diag_log "[FORGE:Server:Store] Invalid category request payload."
|
|
};
|
|
|
|
private _player = [_uid] call EFUNC(common,getPlayer);
|
|
if (_player isEqualTo objNull) exitWith {};
|
|
|
|
if (isNil QGVAR(StoreCatalogService)) exitWith {
|
|
diag_log "[FORGE:Server:Store] Store catalog service is unavailable."
|
|
};
|
|
|
|
private _result = GVAR(StoreCatalogService) call ["buildCategoryResponse", [_category]];
|
|
[CRPC(store,responseCategory), [_result], _player] call CFUNC(targetEvent);
|
|
}] call CFUNC(addEventHandler);
|
|
|
|
[QGVAR(requestCheckout), {
|
|
params [["_uid", "", [""]], ["_payloadJson", "", [""]]];
|
|
|
|
if (_uid isEqualTo "" || { _payloadJson isEqualTo "" }) exitWith {
|
|
diag_log "[FORGE:Server:Store] Invalid checkout request payload."
|
|
};
|
|
|
|
private _player = [_uid] call EFUNC(common,getPlayer);
|
|
if (_player isEqualTo objNull) exitWith {};
|
|
|
|
private _result = GVAR(StoreStore) call ["checkout", [_uid, _player, _payloadJson]];
|
|
[CRPC(store,responseCheckout), [_result], _player] call CFUNC(targetEvent);
|
|
}] call CFUNC(addEventHandler);
|