From f26bf3031f8d5e0028bbb83ece15b2a83babdb7c Mon Sep 17 00:00:00 2001 From: "DESKTOP-UH65DCE\\MusTanG" Date: Sat, 29 Apr 2017 20:47:33 -0500 Subject: [PATCH] Fix and 64bit upgrade --- PTWS.ini | 5 +++ PTWS_x64.ini | 29 ++++++++++++++++++ README.md | 3 +- Server Files/@ExileServer/addons/PTWS.pbo | Bin 8960 -> 9389 bytes .../@ExileServer/addons/PTWS/initServer.sqf | 7 ++++- .../addons/PTWS/scripts/insertPTWS.sqf | 8 ++--- .../addons/PTWS/scripts/startPTWS.sqf | 2 +- 7 files changed, 47 insertions(+), 7 deletions(-) create mode 100644 PTWS_x64.ini diff --git a/PTWS.ini b/PTWS.ini index 3acf61f..2be1fe7 100644 --- a/PTWS.ini +++ b/PTWS.ini @@ -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 = ? diff --git a/PTWS_x64.ini b/PTWS_x64.ini new file mode 100644 index 0000000..b75a6c0 --- /dev/null +++ b/PTWS_x64.ini @@ -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 diff --git a/README.md b/README.md index 6716f3d..2cd9050 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/Server Files/@ExileServer/addons/PTWS.pbo b/Server Files/@ExileServer/addons/PTWS.pbo index df6aa7dc67964bc161e15047428a64e6b75f9cb9..cdd89bfe73201c876fec0724256656f9fdf797e4 100644 GIT binary patch delta 485 zcmZp0TkAPNm*wtRmdJ^Q(hxd8oX?M$0Ss3CVu|!)o>-~_ky)z2@)#&G@uD`%Zy-I1 zQJn*%vx$*`VR9pvm=IXc3Lp;z#Lu%tu9zIoD9d|>8zOQVsOQY)M#c{u_4@iQ`FYu? zl>w!B$r%c|3ND#NC6&R6Ku&6vLSjmaLP}yuVp3vpssd0XIa?tuzepiFFTXrb!P7+{ zGfg2cKQC3GBqKFXp&-AYG$*knRUxxPp**uBLm@doFD)}&p*Xdqv_K&<52!OYu_QA; zkC%%xKC{>xWJrKgNO-UdP!rHFTaej66$;TxFj=6ar^{qV2`?kg%rr#}xGuORO_0q% z^QwUuXlPz>YEel5M0S#REE8w#<{4ZZJdB)^7l>I)auz3+r3Mt`r)B1(`X%P378fKY zr&j|M4*L5R;ory tI`JUWQb1BrW;jGL)_U^~i7%WYXX64j7`W$|JXOe=a8l@wcW{&36aXTqp#A^= delta 195 zcmZ4M+2A%omu1JC6X6pLr6F{HINwi31~34L|74t4ssoW(ssW)dYJ=%XjOt)|vNof< zz!IpIcR(#5_GEq@(aHIYth^Q62(v0SH!^m>Hsj`{QeQYlB17HXoply+Z(p^LC;im3 KO9xDM$N~V*_(qZd diff --git a/Server Files/@ExileServer/addons/PTWS/initServer.sqf b/Server Files/@ExileServer/addons/PTWS/initServer.sqf index 9f46489..7347a2e 100644 --- a/Server Files/@ExileServer/addons/PTWS/initServer.sqf +++ b/Server Files/@ExileServer/addons/PTWS/initServer.sqf @@ -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"; }; diff --git a/Server Files/@ExileServer/addons/PTWS/scripts/insertPTWS.sqf b/Server Files/@ExileServer/addons/PTWS/scripts/insertPTWS.sqf index 7ec9b37..67fb3dc 100644 --- a/Server Files/@ExileServer/addons/PTWS/scripts/insertPTWS.sqf +++ b/Server Files/@ExileServer/addons/PTWS/scripts/insertPTWS.sqf @@ -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; }; \ No newline at end of file diff --git a/Server Files/@ExileServer/addons/PTWS/scripts/startPTWS.sqf b/Server Files/@ExileServer/addons/PTWS/scripts/startPTWS.sqf index 4139b2e..dd4b7a4 100644 --- a/Server Files/@ExileServer/addons/PTWS/scripts/startPTWS.sqf +++ b/Server Files/@ExileServer/addons/PTWS/scripts/startPTWS.sqf @@ -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];