forge/arma/server/addons/common/functions/fnc_timeToSeconds.sqf
Jacob Schmidt ebfe77a340 feat: implement complete Forge framework with Rust/Redis backend and Arma 3 integration
Implemented features:
- High-performance Rust extension with Redis persistence
- Actor/player management with loadout, position, and state tracking
- Banking system with deposit, withdraw, and transfer operations
- Physical and virtual garage/locker systems for vehicle and equipment storage
- Organization management with member tracking and permissions
- Client-side UI with React-like state management
- Server-side event-driven architecture with CBA Events
- Security: Self-transfer prevention at multiple layers
- Logging system with per-module log files
- ICOM module for inter-server communication

Co-Authored-By: Warp <agent@warp.dev>
2026-01-04 12:52:15 -06:00

37 lines
1006 B
Plaintext

#include "..\script_component.hpp"
/*
* Author: IDSolutions
* Converts systemTime array to total seconds since midnight.
*
* Arguments:
* 0: System time array from systemTime command <ARRAY>
*
* Return Value:
* Total seconds since midnight <NUMBER>
*
* Example:
* [systemTime] call forge_server_common_fnc_timeToSeconds
* // Returns: 43200 (for 12:00:00)
*
* Public: Yes
*/
params [["_systemTime", [], [[]]]];
if (typeName _systemTime != "ARRAY") exitWith {
["WARNING", format ["timeToSeconds received %1 instead of ARRAY: %2", typeName _systemTime, _systemTime], nil, nil] call EFUNC(common,log);
0
};
if (count _systemTime < 6) exitWith {
["WARNING", format ["timeToSeconds received array with %1 elements, need at least 6: %2", count _systemTime, _systemTime], nil, nil] call EFUNC(common,log);
0
};
private _hours = _systemTime select 3;
private _minutes = _systemTime select 4;
private _seconds = _systemTime select 5;
(_hours * 3600) + (_minutes * 60) + _seconds