diff --git a/Overrides/ExileServer_system_database_connect.sqf b/Overrides/ExileServer_system_database_connect.sqf index 8c10c08..5905493 100644 --- a/Overrides/ExileServer_system_database_connect.sqf +++ b/Overrides/ExileServer_system_database_connect.sqf @@ -17,14 +17,18 @@ ExileServerRconSessionID = ""; try { _result = "extDB3" callExtension "9:VERSION"; - format ["Installed extDB2 version: %1", _result] call ExileServer_util_log; + format ["Installed extDB3 version: %1", _result] call ExileServer_util_log; + if ((parseNumber _result) < 1.027) then + { + throw format ["Error Required extDB3 Version 1.027 or higher: %1", _result]; + }; _result = call compile ("extDB3" callExtension "9:ADD_DATABASE:exile"); if (_result select 0 isEqualTo 0) then { throw format ["Could not add database: %1", _result]; }; "Connected to database!" call ExileServer_util_log; - ExileServerDatabaseSessionId = str(round(random(999999))); + ExileServerDatabaseSessionId = "SQL"; //str(round(random(999999))); _result = call compile ("extDB3" callExtension "9:ADD_DATABASE_PROTOCOL:exile:SQL_CUSTOM:SQL:exile.ini"); if ((_result select 0) isEqualTo 0) then { @@ -43,7 +47,7 @@ catch if (!_error_locked) then { "MySQL connection error!" call ExileServer_util_log; - "Please have a look at @ExileServer/logs/ to find out what went wrong." call ExileServer_util_log; + "Please have a look at @extDB3/logs/ to find out what went wrong." call ExileServer_util_log; format ["MySQL Error: %1", _exception] call ExileServer_util_log; "Server will shutdown now :(" call ExileServer_util_log; //"extDB3" callExtension "9:SHUTDOWN"; Not implemented in extDB3 diff --git a/Overrides/ExileServer_util_time_uptime.sqf b/Overrides/ExileServer_util_time_uptime.sqf index 7bbf177..5a6239b 100644 --- a/Overrides/ExileServer_util_time_uptime.sqf +++ b/Overrides/ExileServer_util_time_uptime.sqf @@ -9,4 +9,4 @@ * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. */ -(call compile ("extDB3" callExtension "9:UPTIME:MINUTES")) select 1 +(parseNumber ("extDB3" callExtension "9:UPTIME:MINUTES")) diff --git a/exile.ini b/exile.ini index 81e3e9d..9371f0e 100644 --- a/exile.ini +++ b/exile.ini @@ -33,9 +33,9 @@ SQL1_1 = UPDATE account SET last_disconnect_at = NOW() WHERE uid = ? SQL1_INPUTS = 1 [getAccountStats] -SQL1_1 = SELECT score, kills, deaths, clan_id, locker, ai_kills FROM account WHERE uid = ? -SQL1_INPUTS = 1 -OUTPUT = 1,2,3,4,5,6 +SQL1_1 = SELECT score, kills, deaths, clan_id, locker FROM account WHERE uid = ? +SQL1_INPUTS = 1 +OUTPUT = 1,2,3,4,5 [addAccountKill] SQL1_1 = UPDATE account SET kills = kills + 1 WHERE uid = ? @@ -85,9 +85,11 @@ SQL1_INPUTS = 1 OUTPUT = 1 [createPlayer] -SQL1_1 = INSERT INTO player SET account_uid = ?, name = ? +SQL1_1 = DELETE FROM player WHERE account_uid = ? +SQL2_1 = INSERT INTO player SET account_uid = ?, name = ? +SQL1_INPUTS = 1 +SQL2_INPUTS = 1,2 -SQL1_INPUTS = 1,2 Return InsertID = true [insertPlayerHistory] @@ -204,10 +206,9 @@ SQL1_INPUTS = 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25, ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Vehicle related queries ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - [insertVehicle] -SQL1_1 = INSERT INTO vehicle SET -SQL1_2 = class = ?, +SQL1_1 = INSERT INTO vehicle SET +SQL1_2 = class = ?, SQL1_3 = account_uid = ?, SQL1_4 = is_locked = ?, SQL1_5 = position_x = ?, @@ -219,8 +220,7 @@ SQL1_10 = direction_z = ?, SQL1_11 = up_x = ?, SQL1_12 = up_y = ?, SQL1_13 = up_z = ?, -SQL1_14 = pin_code = ?, -SQL1_15 = ammo = '[]' +SQL1_14 = pin_code = ? SQL1_INPUTS = 1,2,3,4,5,6,7,8,9,10,11,12,13 Return InsertID = true @@ -265,7 +265,7 @@ SQL1_15 = cargo_items = ?, SQL1_16 = cargo_magazines = ?, SQL1_17 = cargo_weapons = ?, SQL1_18 = cargo_container = ?, -SQL1_19 = money = ?, +SQL1_19 = money = ? SQL1_20 = WHERE id = ? SQL1_INPUTS = 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19 @@ -424,7 +424,7 @@ SQL1_15 = cargo_container = ?, SQL1_16 = territory_id = ?, SQL1_17 = money = ? SQL1_18 = WHERE id = ? -SQL1_INPUTS = 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17 +SQL1_INPUTS = 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15-NULL,16,17 [containerSetPinCode] SQL1_1 = UPDATE container SET pin_code= ? WHERE id = ? @@ -524,11 +524,10 @@ SQL1_INPUTS = 1,2 OUTPUT = 1 [loadTerritory] -SQL1_1 = SET @connector = ?; -SQL2_1 = SELECT id,owner_uid,name,position_x,position_y,position_z,radius, level,flag_texture,flag_stolen,flag_stolen_by_uid,last_paid_at,build_rights,moderators,deleted_at,(SELECT COUNT(*)FROM construction c WHERE c.territory_id = @connector) FROM territory WHERE id = @connector +SQL1_1 = SELECT id,owner_uid,name,position_x,position_y,position_z,radius, level,flag_texture,flag_stolen,flag_stolen_by_uid,last_paid_at,build_rights,moderators,deleted_at,(SELECT COUNT(*)FROM construction c WHERE c.territory_id = ?) FROM territory WHERE id = ? -SQL1_INPUTS = 1 -OUTPUT = 1,2-STRING,3-STRING,4,5,6,7,8,9-STRING,10,11-STRING,12-STRING,13,14,15,16 +SQL1_INPUTS = 1,1 +OUTPUT = 1,2-STRING,3-STRING,4,5,6,7,8,9-STRING,10,11-STRING,12,13,14,15,16 [setTerritoryLevel] SQL1_1 = UPDATE territory SET level = ? WHERE id = ?