Fix and 64bit upgrade

This commit is contained in:
DESKTOP-UH65DCE\MusTanG 2017-04-29 20:47:33 -05:00
parent 39aaed2c2c
commit f26bf3031f
7 changed files with 47 additions and 7 deletions

View File

@ -1,6 +1,11 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; PTWS
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[isKnownPTWSID]
SQL1_1 = SELECT CASE WHEN EXISTS(SELECT DateID FROM ptws WHERE DateID = ?) THEN 'true' ELSE 'false' END
Number Of Inputs = 1
SQL1_INPUTS = 1
OUTPUT = 1
[createDate]
SQL1_1 = INSERT INTO ptws SET DateID = ?

29
PTWS_x64.ini Normal file
View File

@ -0,0 +1,29 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; PTWS
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[isKnownPTWSID]
SQL1_1 = SELECT CASE WHEN EXISTS(SELECT DateID FROM ptws WHERE DateID = ?) THEN 'true' ELSE 'false' END
SQL1_INPUTS = 1
OUTPUT = 1
[createDate]
SQL1_1 = INSERT INTO ptws SET DateID = ?
SQL1_INPUTS = 1
[getDate]
SQL1_1 = SELECT date FROM ptws WHERE DateID = ?
SQL1_INPUTS = 1
OUTPUT = 1
[getWeather]
SQL1_1 = SELECT weather FROM ptws WHERE DateID = ?
SQL1_INPUTS = 1
OUTPUT = 1
[setDate]
SQL1_1= UPDATE ptws SET date = ? WHERE DateID = ?
SQL1_INPUTS = 1,2
[setWeather]
SQL1_1= UPDATE ptws SET weather = ? WHERE DateID = ?
SQL1_INPUTS = 1,2

View File

@ -24,7 +24,8 @@ PTWS is a script made for Exile that allows time and weather to persist through
2) You should now have a ptws table.
3) Copy the contents of `PTWS.ini` into your `@ExileServer\extDB\sql_custom_v2\exile.ini` file at the bottom.
3) For 32bit: Copy the contents of `PTWS.ini` into your `@ExileServer\extDB\sql_custom_v2\exile.ini` file at the bottom.
3) For 64bit: Copy the contents of `PTWS_x64.ini` into your `@extdb3\sql_custom\exile.ini` file at the bottom.
##### Server
1) Take either the PTWS.pbo or the file and put it in your `@ExileServer\addons`. Use the file if you want to configure the settings and pack it after you're done.

View File

@ -11,7 +11,12 @@
diag_log "PTWS - Initialized";
// Start PTWS
[]execVM "\PTWS\scripts\insertPTWS.sqf";
//DonkeyPunch - DirtySanchez add database check for known ID if none then populate it with config setup information
_isKnownPTWSDateID = format ["isKnownPTWSID:%1", PTWS_ID] call ExileServer_system_database_query_selectSingleField;
if!(_isKnownPTWSDateID)then
{
_insertPTWSDateID = format["createDate:%1", PTWS_ID] call ExileServer_system_database_query_insertSingle;
};
sleep 1;
[]execVM "\PTWS\scripts\startPTWS.sqf";
};

View File

@ -5,8 +5,8 @@ _checkDatabaseID = profileNamespace getVariable ["PTWS_DatabaseID",false];
if !(_checkDatabaseID isEqualTo PTWS_ID) then
{
profileNamespace setVariable ["PTWS_DatabaseID",PTWS_ID];
saveProfileNamespace;
_insertDatabaseID = format["createDate:%1", PTWS_ID] call ExileServer_system_database_query_insertSingle;
_insertDatabaseID;
profileNamespace setVariable ["PTWS_DatabaseID",PTWS_ID];
saveProfileNamespace;
_insertDatabaseID = format["createDate:%1", PTWS_ID] call ExileServer_system_database_query_insertSingle;
_insertDatabaseID;
};

View File

@ -3,7 +3,7 @@ if (!isServer) exitWith {};
_saveddate = format ["getDate:%1", PTWS_ID] call ExileServer_system_database_query_selectSingleField;
_savedWeather = format ["getWeather:%1", PTWS_ID] call ExileServer_system_database_query_selectSingleField;
diag_log format["PTWSDebug:db data - date:%1 weather:%2",_saveddate,_savedWeather];
if (typeName _saveddate isEqualTo "ARRAY") then
{
diag_log format["PTWS - Loading last saved date : %1", _saveddate];