Files
DayZ-Epoch/SQF/dayz_server/compile/server_tradeObject.sqf
oiad d0257b3c7d Add logging failed safe/lockbox and door lock/unlock/failed code attempts (#1853)
* Add logging failed safe/lockbox and door lock/unlock/failed code attempts

This adds logging for both safes and lockboxes for failed code attempts.

Also adds logging for locking, unlocking and failed code attempts for
doors.

"salival (playerUID) FAILED unlocking LockBox with code: Red11 (actual:
Red57) @110069 [11044.4,8438.32,0.652]"
"salival (playerUID) UNLOCKED LockBox with code: Green22 @110069
[11040.6,8438.91,0.834]"
"salival (playerUID) PACKED LockBox with code: Green22 @110069
[11040.6,8438.91,0.834]"
"salival (playerUID) UNLOCKED CinderWallDoorSmallLocked_DZ with code:
559 @110069 [11015.4,8458.74,5.272]"
"salival (playerUID) LOCKED CinderWallDoorSmallLocked_DZ with code: 559
@110069 [11015.4,8458.74,5.272]"
"salival (playerUID) FAILED unlocking CinderWallDoorSmallLocked_DZ with
code: EYESCAN (actual: 559) @110069 [11015.4,8458.74,5.272]"
"salival (playerUID) FAILED unlocking CinderWallDoorSmallLocked_DZ with
code: 100 (actual: 559) @110069 [11015.4,8458.74,5.272]"
"salival (playerUID) UNLOCKED CinderWallDoorSmallLocked_DZ with code:
559 @110069 [11015.4,8458.74,5.272]"
"salival (playerUID) LOCKED CinderWallDoorSmallLocked_DZ with code: 559
@110069 [11015.4,8458.74,5.272]"

* Revert wrong hinge type

* Remove unused DZE_Lock_Door

* Rework

* Remove redundant code, Make single currency costs use BIS_fnc_numberText

* Rework

* Add changelog line
2017-01-05 16:45:10 -05:00

52 lines
1.6 KiB
Plaintext

private ["_player","_playerUID","_name","_traderid","_buyorsell","_data","_result","_key","_outcome","_clientID","_price","_quantity","_container","_return","_classname","_traderCity","_currency","_message"];
_player = _this select 0;
_traderID = _this select 1;
_buyorsell = _this select 2; //0 > Buy // 1 > Sell
_classname = _this select 3;
_traderCity = _this select 4;
_currency = _this select 5;
_price = _this select 6;
_clientID = owner _player;
_playerUID = getPlayerUID _player;
_name = if (alive _player) then {name _player} else {"Dead Player"};
if (count _this > 7) then {
_quantity = _this select 7;
_container = _this select 8;
_return = false;
} else {
_quantity = 1;
_container = "gear";
_return = true;
};
if (typeName _currency == "STRING") then {_price = format ["%1 %2",_price,_currency];};
if (_buyorsell == 0) then { // Buy
_message = format["%1: %2 (%3) purchased %4x %5 into %6 at %7 for %8",localize "STR_EPOCH_PLAYER_289",_name,_playerUID,_quantity,_classname,_container,_traderCity,_price];
} else { // Sell
_message = format["%1: %2 (%3) sold %4x %5 from %6 at %7 for %8",localize "STR_EPOCH_PLAYER_289",_name,_playerUID,_quantity,_classname,_container,_traderCity,_price];
};
diag_log _message;
if (DZE_ConfigTrader) then {
_outcome = "PASS";
} else {
//Send request
_key = format["CHILD:398:%1:%2:",_traderID,_buyorsell];
_data = "HiveEXT" callExtension _key;
_result = call compile format ["%1",_data];
// diag_log ("TRADE: RES: "+ str(_result));
_outcome = _result select 0;
};
if (_return) then {
dayzTradeResult = _outcome;
if (!isNull _player) then {
_clientID publicVariableClient "dayzTradeResult";
};
};