Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix queryrequest #739

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 26 additions & 26 deletions life_hc/MySQL/General/fn_queryRequest.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/*
File: fn_queryRequest.sqf
Author: Bryan "Tonic" Boardwine

This file is for Nanou's HeadlessClient.

Description:
Expand Down Expand Up @@ -32,7 +32,7 @@ private _query = switch (_side) do {
};

private _tickTime = diag_tickTime;
private _queryResult = [_query,2] call DB_fnc_asyncCall;
private _queryResult = [_query,2] call HC_fnc_asyncCall;

if (EXTDB_SETTING(getNumber,"DebugMode") isEqualTo 1) then {
diag_log "------------- Client Query Request -------------";
Expand All @@ -56,29 +56,29 @@ for "_i" from 0 to (count _licenses) -1 do {
private "_playTimes";

switch (_side) do {
case civilian: {
_queryResult set[7, [false, true] select (_queryResult select 7)];
_queryResult set[10, [false, true] select (_queryResult select 10)];

_playTimes = _queryResult select 12;

/* Make sure nothing else is added under here */
_houseData = _uid spawn TON_fnc_fetchPlayerHouses;
waitUntil {scriptDone _houseData};
_queryResult pushBack (missionNamespace getVariable [format ["houses_%1",_uid],[]]);
_gangData = _uid spawn TON_fnc_queryPlayerGang;
waitUntil {scriptDone _gangData};
_queryResult pushBack (missionNamespace getVariable [format ["gang_%1",_uid],[]]);
};

case west: {
_queryResult set[9, [false, true] select (_queryResult select 9)];
_playTimes = _queryResult select 11;
};

case independent: {
_playTimes = _queryResult select 10;
};
case civilian: {
_queryResult set[7, [false, true] select (_queryResult select 7)];
_queryResult set[10, [false, true] select (_queryResult select 10)];

_playTimes = _queryResult select 12;

/* Make sure nothing else is added under here */
_houseData = _uid spawn HC_fnc_fetchPlayerHouses;
waitUntil {scriptDone _houseData};
_queryResult pushBack (missionNamespace getVariable [format ["houses_%1",_uid],[]]);
_gangData = _uid spawn HC_fnc_queryPlayerGang;
waitUntil {scriptDone _gangData};
_queryResult pushBack (missionNamespace getVariable [format ["gang_%1",_uid],[]]);
};

case west: {
_queryResult set[9, [false, true] select (_queryResult select 9)];
_playTimes = _queryResult select 11;
};

case independent: {
_playTimes = _queryResult select 10;
};
};

_index = TON_fnc_playtime_values_request find [_uid, _playTimes];
Expand All @@ -91,7 +91,7 @@ if (_index != -1) then {
TON_fnc_playtime_values_request pushBack [_uid, _playTimes];
};

[_uid, _playTimes select 2] call TON_fnc_setPlayTime;
[_uid, _playTimes select 2] call HC_fnc_setPlayTime;
publicVariable "TON_fnc_playtime_values_request";

life_keyreceived = false;
Expand Down