Advertisement
Guest User

Untitled

a guest
May 7th, 2015
263
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.39 KB | None | 0 0
  1. /*
  2. File: fn_wantedFetch.sqf
  3. Author: Bryan "Tonic" Boardwine"
  4. Database Persistence By: ColinM
  5. Assistance by: Paronity
  6. Stress Tests by: Midgetgrimm
  7. Description:
  8. Displays wanted list information sent from the server.
  9. */
  10. private["_ret","_list","_result","_queryResult","_units","_inStatement"];
  11. _ret = [_this,0,ObjNull,[ObjNull]] call BIS_fnc_param;
  12. if(isNull _ret) exitWith {};
  13. _ret = owner _ret;
  14. _inStatement = "";
  15. _list = [];
  16. _units = [];
  17. _tickTime = diag_tickTime;
  18. {if((side _x) == civilian) then {_units pushBack (getPlayerUID _x)};} foreach playableUnits;
  19.  
  20. {
  21. if(_inStatement == "") then
  22. {
  23. _inStatement = _x;
  24. }
  25. else
  26. {
  27. _inStatement = _inStatement + "','" + _x;
  28. };
  29. } forEach _units;
  30.  
  31. _result = format["wantedFetchID:%1",_inStatement];
  32. waitUntil{!DB_Async_Active};
  33. _queryResult = [_result,2,true] call DB_fnc_asyncCall;
  34.  
  35. {
  36. _list pushBack (_x);
  37. }
  38. forEach _queryResult;
  39.  
  40. if(count _list == 0) exitWith {[[_list],"life_fnc_wantedList",_ret,false] spawn life_fnc_MP;};
  41.  
  42. diag_log "------------- Client Query Request -------------";
  43. diag_log format["QUERY: %1",_result];
  44. diag_log format["Time to complete: %1 (in seconds)",(diag_tickTime - _tickTime)];
  45. diag_log format["Result: %1",_list];
  46. diag_log "------------------------------------------------";
  47.  
  48. [[_list],"life_fnc_wantedList",_ret,false] spawn life_fnc_MP;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement