
All checks were successful
Build / Build (push) Successful in 26s
This commit refactors how organization funds and reputation are handled, updates task completion logic to use the new organization functions, and modifies player saving to include organization data. Additionally, it introduces string serialization/deserialization and fixes a player save loop. * **Organization Funds and Reputation:** Replaces direct server calls for handling funds and reputation with calls to the new organization functions (`EFUNC(org,addFunds)` and `EFUNC(org,addReputation)`). This centralizes fund and reputation management within the organization store. * **Task Completion Logic:** Updates task completion functions (`fnc_destroy.sqf`, `fnc_attack.sqf`, `fnc_hostage.sqf`, `fnc_hvt.sqf`, `fnc_defuse.sqf`) to use the new organization functions for adding funds and reputation upon task success or failure. Also adds notifications to inform the player of reputation and fund changes. * **Player Saving:** Modifies the player saving function (`fnc_playerDBSave.sqf`) to include the player's organization ID in the saved data. * **String Serialization/Deserialization:** Adds `serializeString` and `deserializeString` PREP macros to `XEH_PREP.hpp` and uses them in `fnc_handleOrgLoad.sqf` and `fnc_create.sqf` to handle special characters in organization and member names. * **Player Save Loop Fix:** Removes unnecessary brackets from the `call FUNC(playerDBSave)` in `fnc_playerSaveLoop.sqf`. * **Organization Purchase Verification:** Adds organization ownership verification to `fnc_handlePurchase.sqf` to ensure only the owner can make purchases using organization funds. * **Player Initialization:** Updates `fnc_initPlayer.sqf` to retrieve and set the player's organization upon initialization.
61 lines
2.0 KiB
Plaintext
61 lines
2.0 KiB
Plaintext
#include "..\script_component.hpp"
|
|
|
|
/*
|
|
* Function: forge_client_init_fnc_playerDBSave
|
|
* Author: Creedcoder, J.Schmidt
|
|
* Edit: 07.15.2024
|
|
* Copyright © 2024 Creedcoder, J.Schmidt, All rights reserved
|
|
*
|
|
* Do not edit without permission!
|
|
*
|
|
* This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivative 4.0 International License.
|
|
* To view a copy of this license, vist https://creativecommons.org/licenses/by-nc-nd/4.0/ or send a letter to Creative Commons,
|
|
* PO Box 1866, Mountain View, CA 94042
|
|
*
|
|
* [Description]
|
|
* Save player to DB.
|
|
*
|
|
* Arguments:
|
|
* N/A
|
|
*
|
|
* Return Value:
|
|
* N/A
|
|
*
|
|
* Examples:
|
|
* [] call forge_client_init_fnc_playerDBSave (Server or Singleplayer Only)
|
|
* [] remoteExecCall ["forge_client_init_fnc_playerDBSave", 2, false] (Multiplayer Only)
|
|
*
|
|
* Public: Yes
|
|
*/
|
|
|
|
private _default_armory_unlocks = [[],[],[],[]];
|
|
private _default_garage_unlocks = [[],[],[],[],[],[]];
|
|
|
|
private _data = [
|
|
getPlayerUID player,
|
|
"armory_unlocks", [GETVAR(player,Armory_Unlocks,_default_armory_unlocks)],
|
|
"garage_unlocks", [GETVAR(player,Garage_Unlocks,_default_garage_unlocks)],
|
|
"locker", [GETVAR(player,FORGE_Locker,[])],
|
|
"garage", [GETVAR(player,FORGE_Garage,[])],
|
|
"cash", [GETVAR(player,FORGE_Cash,0)],
|
|
"bank", [GETVAR(player,FORGE_Bank,0)],
|
|
"number", [GETVAR(player,FORGE_Phone_Number,"unknown")],
|
|
"email", [GETVAR(player,FORGE_Email,"unknown@spearnet.mil")],
|
|
"paygrade", [GETVAR(player,Paygrade,"E1")],
|
|
"organization", [GETVAR(player,FORGE_Organization,"")],
|
|
"reputation", [rating player],
|
|
"loadout", [getUnitLoadout player],
|
|
"holster", [GETVAR(player,FORGE_Holster_Weapon,true)],
|
|
"position", [getPosASLVisual player],
|
|
"direction", [getDirVisual player]
|
|
];
|
|
|
|
if (isNull objectParent player) then {
|
|
_data pushBack "currentWeapon";
|
|
_data pushBack [currentMuzzle player];
|
|
_data pushBack "stance";
|
|
_data pushBack [stance player];
|
|
};
|
|
|
|
// ["hsetBulk", "", "", -1, _data, "", false] spawn dragonfly_db_fnc_addTask;
|
|
["hsetidbulk", "", "", -1, _data, "", false, netId player] remoteExec ["dragonfly_db_fnc_addTask", 2, false]; |