Help me please with altis life 3.1.4.8 and extdb3.
this my files
Spoiler anzeigen
Code
/*
File: fn_asyncCall.sqf
Modified: DeadP4xel
Description:
Calls an async request to extDB
*/
private["_queryStmt","_result","_key","_mode","_return","_loop"];
// CONVERT DATA
_queryStmt = [_this,0,"",[""]] call BIS_fnc_param;
_mode = [_this,1,1,[0]] call BIS_fnc_param;
_multiarr = [_this,2,false,[false]] call BIS_fnc_param;
_return = false;
_result = "";
// SEND EXTDB REQUEST AND COLLECT DATA
_key = "extDB2" callExtension format["%1:%2:%3",_mode,(call life_sql_id),_queryStmt];
if(_mode isEqualTo 1) exitWith {true};
_key = call compile format ["%1",_key];
_key = _key select 1;
// DATA COLLECTED NOW SEND MULTI / SOLO DATA
_loop = true;
while{_loop} do {
_result = "extDB2" callExtension format ["4:%1",_key];
if(_result isEqualTo "[5]") then {
_result = "";
while {true} do {
_pipe = "extDB2" callExtension format ["5:%1",_key];
if(_pipe isEqualTo "") exitWith {_loop = false};
_result = _result + _pipe;
};
} else {
if(_result isEqualTo "[3]") then {
uiSleep 0.1;
} else {
_loop = false;
};
};
};
// DATA CONVERTED FROM QUERY REQUEST
_result = call compile _result;
if(count (_result select 1) isEqualTo 0) exitWith {[]};
_return = _result select 1;
if(!_multiarr && (count _return) > 0) then {
_return = _return select 0;
};
_return;
Alles anzeigen
Code
#define __CONST__(var1,var2) var1 = compileFinal (if(typeName var2 == "STRING") then {var2} else {str(var2)})
DB_Async_Active = false;
DB_Async_ExtraLock = false;
life_server_isReady = false;
publicVariable "life_server_isReady";
[] execVM "\life_server\functions.sqf";
[] execVM "\life_server\eventhandlers.sqf";
//I am aiming to confuse people including myself, ignore the ui checks it's because I test locally.
// DATABASE INIT
if(isNil {uiNamespace getVariable "life_sql_id"}) then {
life_sql_id = round(random(999999));
__CONST__(life_sql_id,life_sql_id);
uiNamespace setVariable ["life_sql_id",life_sql_id];
_version = "extDB2" callExtension "9:VERSION";
if(_version isEqualTo "") exitWith {diag_log text "EXTDB ERROR:: DLL FILE NOT FOUND ! CHECK THE INSTALLATION !"};
if((parseNumber _version) < 64) exitWith {diag_log text format["EXTDB ERROR:: ALTIS-LIFE NEED VERSION 64 OR HIGHER ! CURRENT VERSION: %1",_version]};
"extDB2" callExtension "9:ADD_DATABASE:LIFE";
"extDB2" callExtension format ["9:ADD_DATABASE_PROTOCOL:LIFE:SQL_RAW_v2:%1:ADD_QUOTES",(call life_sql_id)];
"extDB2" callExtension "9:LOCK";
_lockStatus = "extDB2" callExtension "9:LOCK_STATUS";
if(_lockStatus isEqualTo "[1]") then {
diag_log text "EXTDB:: LOCK SUCCESSFULL";
} else {
diag_log text "EXTDB:: LOCK FAILED";
};
} else {
life_sql_id = uiNamespace getVariable "life_sql_id";
__CONST__(life_sql_id,life_sql_id);
};
//Run procedures for SQL cleanup on mission start.
["CALL resetLifeVehicles",1] spawn DB_fnc_asyncCall;
["CALL deleteDeadVehicles",1] spawn DB_fnc_asyncCall;
["CALL deleteOldHouses",1] spawn DB_fnc_asyncCall;
["CALL deleteOldGangs",1] spawn DB_fnc_asyncCall; //Maybe delete old gangs
["CALL resetLife",1] spawn DB_fnc_asyncCall; //Maybe delete old gangs
["CALL deleteOldMessages",1] call DB_fnc_asyncCall;
life_adminlevel = 0;
life_medicLevel = 0;
life_coplevel = 0;
life_civlevel = 0;
life_adaclevel = 0;
//Null out harmful things for the server.
__CONST__(JxMxE_PublishVehicle,"No");
//[] execVM "\life_server\fn_initHC.sqf";
life_radio_west = radioChannelCreate [[0, 0.95, 1, 0.8], "Side Channel", "%UNIT_NAME", []];
life_radio_civ = radioChannelCreate [[0, 0.95, 1, 0.8], "Side Channel", "%UNIT_NAME", []];
life_radio_indep = radioChannelCreate [[0, 0.95, 1, 0.8], "Side Channel", "%UNIT_NAME", []];
life_radio_east = radioChannelCreate [[0, 0.95, 1, 0.8], "Side Channel", "%UNIT_NAME", []];
serv_sv_use = [];
fed_bank setVariable["safe",(count playableUnits),true];
server_warzones = [];
//General cleanup for clients disconnecting.
addMissionEventHandler ["HandleDisconnect",{_this call TON_fnc_clientDisconnect; false;}]; //Do not second guess this, this can be stacked this way.
[] spawn TON_fnc_cleanup;
life_gang_list = [];
publicVariable "life_gang_list";
life_wanted_list = [];
client_session_list = [];
[] execFSM "\life_server\cleanup.fsm";
[] spawn
{
private["_logic","_queue"];
while {true} do
{
sleep (30 * 60);
_logic = missionnamespace getvariable ["bis_functions_mainscope",objnull];
_queue = _logic getvariable "BIS_fnc_MP_queue";
_logic setVariable["BIS_fnc_MP_queue",[],TRUE];
};
};
[] spawn TON_fnc_federalUpdate;
[] spawn
{
while {true} do
{
sleep (30 * 60);
{
_x setVariable["sellers",[],true];
} foreach [Dealer_1,Dealer_2,Dealer_3];
};
};
//Strip NPC's of weapons
{
if(!isPlayer _x) then {
_npc = _x;
{
if(_x != "") then {
_npc removeWeapon _x;
};
} foreach [primaryWeapon _npc,secondaryWeapon _npc,handgunWeapon _npc];
};
} foreach allUnits;
[] spawn TON_fnc_initHouses;
//Lockup the dome
private["_dome","_rsb"];
_dome = nearestObject [[16019.5,16952.9,0],"Land_Dome_Big_F"];
_rsb = nearestObject [[16019.5,16952.9,0],"Land_Research_house_V1_F"];
for "_i" from 1 to 3 do {_dome setVariable[format["bis_disabled_Door_%1",_i],1,true]; _dome animate [format["Door_%1_rot",_i],0];};
_rsb setVariable["bis_disabled_Door_1",1,true];
_rsb allowDamage false;
_dome allowDamage false;
life_server_isReady = true;
publicVariable "life_server_isReady";
[] execVM "\life_server\Functions\DynMarket\fn_config.sqf";
life_attachment_point = "Land_HelipadEmpty_F" createVehicle [0,0,0];
life_attachment_point setPosASL [0,0,0];
life_attachment_point setVectorDirAndUp [[0,1,0], [0,0,1]];
publicVariable "life_attachment_point";
/* Initialize hunting zone(s) */
["hunting_zone",30] spawn TON_fnc_huntingZone;
Alles anzeigen
how to change? help plsease. I do not want to lose my server