Jump to content
tebbbs

Persistent Database and Resupply

Recommended Posts

Hi girls,
 
we (Spackenbremse, Qwer, tulrich) were working for a couple of weeks on an addon, that gives you the following functions
 
Github
https://github.com/tebsu/pdb/
 
Functions

- Server-Only addon (no client installation required)
- Saves player position and inventory every minute to a database
- Saves vehicle position, direction, fuel, damage and inventory to database (every minute or when you exit a vehicle)
- Gives you the ability to connect it to your team-website and build a little interface to add resupply points
- Saves all of the above based on map and mission name. So you can switch without losing your progress for a specific mission
- Saves map objects into the database
- Prevent saving specific objects by putting this into the init of the object: this setVariable ["sru_disable_pdb",1,true]; (this is very important for ammoboxes and so on.. if you forget that, they will be empty after a while and not be refilled be a script)
- Saving of last driver from UAV
 
Requirements
 
- extDB3
 
Example
 
i tell you how we do it:
 
Lets say we have 50 vehicles in our base and one of them is destroyed or damaged in combat. It will stay in the database but what should we do about it? We need a replacement.. So we go to our team-website and create a resupply request. The addon will check every minute, if there is an open request and if there is, it will spawn those vehicles at a location of your choice. Our team-website is very basic and not yet ready (not even for alpha). Once we have that sorted, we will upload all the files as well so you can integrate it into your site.. or you just build your own interface right now. So without that, whats left? Well, actually the biggest part and the only reason we started this whole mod.
 
If i leave the server and come back the next day, i will spawn where i left with the inventory i had the other day. (Even if someone restarted the server in the night or changed the mission back and forth) We checked other possibilities before but ALiVE and other mods where to heavy for us so we decided to keep it very light without any additional stuff that we dont need.
 
 
 
Download
 
https://github.com/tebsu/pdb/
 
(Please dont forget to read the readme in the readme folder) 😛
 
Additional Notes
 
-we are working on a PHP based web-interface for those, who cant develop one. It will take us some time, but we will release it here as well.
- DO NOT publish this on withSix. We only want it on Armaholic / thank you
 
Upcoming addons
 
- Universal cargo script
 
 
good luck

  • Like 3
  • Thanks 2

Share this post


Link to post
Share on other sites

Congratulations on the release. Sounds like a very powerful tool.

Share this post


Link to post
Share on other sites

If someone has this running on their server, could you PM me the IP (if its a public server). I just want to check how the addon performs on some of these servers as i did not have the chance to test it with a huge amount of people

Share this post


Link to post
Share on other sites

Thanks foxhound : ) Can you edit the text on armaholic? As it still says "early alpha"

Share this post


Link to post
Share on other sites
Guest

Thanks foxhound : ) Can you edit the text on armaholic? As it still says "early alpha"

Done, I hope the newspage is now correct?

Share this post


Link to post
Share on other sites

New Version is out Version 1.1

 

- Fixed a bug that prevented the whole inventory to be loaded correctly (it only loaded parts of your inventory but should work fine now)

- Fixed cars exploding on server start

- Prepared saving of all objects (upcoming in 1.2)

 

http://sru-gaming.de/SRU_Persistant_Database_1_1.zip

Share this post


Link to post
Share on other sites

Version 1.2 is out: http://sru-gaming.de/SRU_Persistant_Database_1_2.zip

 

Changelog:

 

- Saves map objects into the database

- Prevent saving specific objects by putting this into the init of the object: this setVariable ["sru_disable_pdb",1,true]; (this is very important for ammoboxes and so on.. if you forget that, they will be empty after a server restart)

- Saving of last driver from UAV fixed

  • Like 1

Share this post


Link to post
Share on other sites

Hi,

 

sorry but at the moment, there are no plans for a non ACE version. We will publish this mod at github in a few days/weeks and then you can change that yourself if you wish

Share this post


Link to post
Share on other sites

yes, that is correct. We will make an update today or tomorrow with the most recent SQL file. Sorry for that ! To fix this quick, add a field vehicleCrew (int 1) in the vehicles list

Share this post


Link to post
Share on other sites

Here is the sql for the object table:

 

CREATE TABLE `objects` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `objName` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
  `objClass` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
  `objCategory` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
  `objInit` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `objPos` varchar(30) COLLATE utf8_unicode_ci DEFAULT NULL,
  `objDir` char(3) COLLATE utf8_unicode_ci DEFAULT NULL,
  `objDamage` float DEFAULT NULL,
  `objRecDate` timestamp NULL DEFAULT NULL,
  `mission_FK` int(11) DEFAULT NULL,
  KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci

 

 

will be included as well in the next version

  • Like 1

Share this post


Link to post
Share on other sites

Will this save the inventory of supply boxes e.g. someone takes 10 magazines out of an ammo box leaving 20 in the crate. After server restarts, will the ammo box still have 20? Or will it go back to its original amount of 30?

Share this post


Link to post
Share on other sites

we do not (yet) save the inventory of boxes.. only vehicle inventories.. but we are going to implement box inventories as well. The update that i plan to release tomorrow (or maybe a bit later because i still have to test a bit here and there) will at least save object init code..

  • Like 1

Share this post


Link to post
Share on other sites

Hello this is a fantastic script and is really helping me with my dedicated server project.

 

I have it all working and have included the most recent edits as above Re: vehiclCrew (int 1) and the 'Objects' table you posted above.

 

Wen I restart the dedicated server everything works with auto-saves on the players - inventory + location and also the vehicles location too.

 

I have an problem with the Vehicle Inventory - Damage - Fual - Ammo

 

I have this error in my RPT:

 

------------------------------------------------------------------------------------------------------------------------------------------------------

15:01:07 Error in expression <;
_vehiclePosX = call compile (_sql_res select (_i+2));
_vehiclePosY = call comp>
15:01:07   Error position: <select (_i+2));
_vehiclePosY = call comp>
15:01:07   Error Zero divisor
15:01:07 File sru_pdb\functions\fn_Server_getVehicle.sqf, line 27
15:01:07 Error in expression <= _this select 1;
 
clearItemCargoGlobal _oVehicle;
clearBackpackCargoGlobal _oVe>
15:01:07   Error position: <_oVehicle;
clearBackpackCargoGlobal _oVe>
15:01:07   Error Undefined variable in expression: _ovehicle
15:01:07 File sru_pdb\functions\fn_Server_getVehicleInventory.sqf, line 4
15:01:07 Error in expression <";
waitUntil{scriptDone _vehFinal};
 
if(_vehicleCrew == 1)then{
createVehicleCre>
15:01:07   Error position: <_vehicleCrew == 1)then{
createVehicleCre>
15:01:07   Error Undefined variable in expression: _vehiclecrew
15:01:07 File sru_pdb\functions\fn_Server_getVehicle.sqf, line 58
15:03:08 Client: Object 3:6 (type Type_119) not found.
15:03:08 Client: Object 3:6 (type Type_91) not found.
15:03:08 Client: Object 3:6 (type Type_413) not found.
15:03:26 Server: Object 2:347 not found (message Type_91)
15:03:26 Server: Object 2:346 not found (message Type_91)
15:03:42 Server: Object 2:347 not found (message Type_119)
15:03:42 Server: Object 2:346 not found (message Type_119)
15:03:50 Server: Object 2:346 not found (message Type_91)
15:03:50 Server: Object 2:347 not found (message Type_91)
15:04:10 Server: Object 2:347 not found (message Type_91)
15:04:10 Server: Object 2:346 not found (message Type_91)
15:04:18 Server: Object 2:347 not found (message Type_119)
15:04:19 Server: Object 2:346 not found (message Type_119)
15:04:25 Admin logged in, player: Dane, playerUID: 76561198082126891, IP: 192.168.0.27:2304.
15:04:30 Server: Object 2:347 not found (message Type_91)
15:04:30 Server: Object 2:346 not found (message Type_91)
15:04:31 Mission test2.Altis: Number of roles (7) is different from 'description.ext::Header::maxPlayer' (2)
15:04:31 Starting mission:
15:04:31  Mission file: test2 (__cur_mp)
15:04:31  Mission world: Altis
15:04:31  Mission directory: mpmissions\__cur_mp.Altis\
15:04:31 Attempt to override final function - bis_functions_list
15:04:31 Attempt to override final function - bis_functions_listpreinit
15:04:31 Attempt to override final function - bis_functions_listpostinit
15:04:31 Attempt to override final function - bis_functions_listrecompile
15:04:32 Attempt to override final function - bis_fnc_missiontaskslocal
 
15:04:32 Attempt to override final function - bis_fnc_missionconversationslocal
15:04:32 Attempt to override final function - bis_fnc_missionflow
15:04:32 [28892,268.275,0,"XEH: PreInit Started. v2.2.0.151130. MISSINIT: missionName=test2, worldName=Altis, isMultiplayer=true, isServer=true, isDedicated=true"]
15:04:38 [28892,274.408,0,"XEH: PreInit Finished."]
15:04:38 c:\w\stable\futura\lib\network\networkserver.cpp NetworkServer::OnClientStateChanged:NOT IMPLEMENTED - briefing!
15:04:38 [28893,275.098,0,"XEH: PostInit Started"]
15:04:39 [28893,275.11,0,"CBA_VERSIONING: cba=2.2.0.151130, "]
15:04:39 [ACE] (common) INFO: ACE is version 3.4.2.0.
15:04:39 [ACE] (common) INFO: Extension version: ace_break_line: 3.2.0-bf4e95e
15:04:39 [ACE] (common) INFO: Extension version: ace_parse_imagepath: 3.2.0-bf4e95e
15:04:39 [ACE] (common) INFO: Extension version: ace_clipboard: 3.2.0-bf4e95e
15:04:39 [ACE] (common) INFO: Extension version: ace_fcs: 3.2.0-bf4e95e
15:04:39 [ACE] (common) INFO: Extension version: ace_advanced_ballistics: 3.4.1-4d041c3
15:04:39 [28893,275.502,0,"XEH: PostInit Finished. State: _isClient=false, _isJip=false, _isDedClient=false, _isServer=true, _isDedServer=true, _playerCheckDone=true, _sp=false, _startInitDone=true, _postInitDone=true, _mpRespawn=true, _machineType=0, _sessionId=2, _level=0, _timeOut=false, _game=3, BIS_functions=<NULL-object>, group=<NULL-group>"]
15:04:39 [ACE] (common) INFO: Settings received from server.
15:04:39 [ACE] (cargo) INFO: Cargo Module Initialized.
15:04:39 [ACE]: Rearm Module Initialized on level: 2
15:04:39 [ACE]: Refuel Module Initialized with flow rate: 10
15:04:39 [ACE] (repair) INFO: Repair Module Initialized.
15:04:39 [ACE] (viewdistance) INFO: View Distance Limit Module Initialized. Limit set by module: 2300
15:04:39 [ACE] (interaction) INFO: Interaction Module Initialized.
15:04:39 [ACE] (explosives) INFO: Explosive Module Initialized.
15:04:39 [ACE] (respawn) INFO: Friendly Fire Messages Module Initialized.
15:04:39 [ACE] (modules) WARNING: Module [ACE_ModuleInteraction] - More than 1 singular module placed
15:04:39 [ACE] (common) INFO: SetSetting [ace_interaction_EnableTeamManagement] Trying to set forced setting
15:04:39 [ACE] (interaction) INFO: Interaction Module Initialized.
15:04:39 [ACE] (hearing) INFO: Hearing Module Initialized.
15:04:39 [ACE] (map) INFO: Map Module Initialized.
15:04:39 [ACE] (map_gestures) INFO: Map Gestures Module Initialized.
15:04:39 [ACE] (nametags) INFO: Nametags Module Initialized.
15:04:39 [ACE] (respawn) INFO: Respawn Module Initialized.
15:04:39 [ACE] (common) INFO: Settings initialized.
15:04:39 [ACE] (common) INFO: 10 delayed functions running.
15:04:52 Client: Object 3:17 (type Type_119) not found.
15:04:52 Client: Object 3:17 (type Type_91) not found.
15:04:52 Client: Object 3:17 (type Type_413) not found.
15:04:52 Error in expression <;
_vehiclePosX = call compile (_sql_res select (_i+2));
_vehiclePosY = call comp>
15:04:52   Error position: <select (_i+2));
_vehiclePosY = call comp>
15:04:52   Error Zero divisor
15:04:52 File sru_pdb\functions\fn_Server_getVehicle.sqf, line 27
15:04:52 Error in expression <= _this select 1;
 
clearItemCargoGlobal _oVehicle;
clearBackpackCargoGlobal _oVe>
15:04:52   Error position: <_oVehicle;
clearBackpackCargoGlobal _oVe>
15:04:52   Error Undefined variable in expression: _ovehicle
15:04:52 File sru_pdb\functions\fn_Server_getVehicleInventory.sqf, line 4
15:04:52 Error in expression <";
waitUntil{scriptDone _vehFinal};
 
if(_vehicleCrew == 1)then{
createVehicleCre>
15:04:52   Error position: <_vehicleCrew == 1)then{
createVehicleCre>
15:04:52   Error Undefined variable in expression: _vehiclecrew
15:04:52 File sru_pdb\functions\fn_Server_getVehicle.sqf, line 58
15:05:19 Server: Object 2:652 not found (message Type_91)

119)

15:05:54 Server: Object 2:653 not found (message Type_119)
15:05:59 Server: Object 2:653 not found (message Type_91)
15:06:39 Server: Object 2:653 not found (message Type_91)
15:06:39 Server: Object 2:652 not found (message Type_91)

-------------------------------------------------------------------------------------------------------------------------------------------------------

 

Any help would be greatly appreciated, this is the best persitent addon I have seen, congrats on the release :)

Share this post


Link to post
Share on other sites

So the inventory, ammo and fuel is not saving? Do you only have those errors at the server start?

 

small update: we had to rework a certain part of the code and are looking forward to release the update this week. It should include object saving (including inventory) and loading, saving of init code of objects and a few fixes.

Share this post


Link to post
Share on other sites

So the inventory, ammo and fuel is not saving? Do you only have those errors at the server start?

 

small update: we had to rework a certain part of the code and are looking forward t;

 

o release the update this week. It should include object saving (including inventory;

) and loading, saving of init code of objects and a few fixes.

 

Hello again, yeah after the initial error, the RPT just gets spammed with this message all the way through the game:

15:05:54 Server: Object 2:653 not found (message Type_119)

But your right it doesn't save Inventory,Ammo,Fuel and minor Damage - although strangely the vehicle (object) remains in it's last position where you left it. Another thing for me is that if you completely destroy the said vehicle it stays destroyed after a server restart but just doesn't record any minor damage and so on as above.

 

Hope you can fix this - looking forward to the release!

 

P/S just for the record this is the BEST SCRIPT there is available - :)

Share this post


Link to post
Share on other sites

Excuse me, but I have been scripting for the past 6 years! I wouldn't say my post is useless, because many of us don't even use ACE3 at all. Secondly, 'most mods do not run on vanilla Arma 3' is entirely not true. CBA is only an extension which you can use to help develop your mod/addon even further, as it provides scripts, functions and other features. Therefore, it is not a mandatory requirement when creating your mod/addon, and the possibility of a vanilla version is highly plausible.

 

 

I first looked at this addon/mod and it looked promising, until when I saw the fact that it only runs on ACE3. The post may look threatening to you, but it is from my opinion of what disappointed me. And if I recall this:

 
 

 

 

Which disappointed me the most. But again, this is my review for those who don't use/like ACE3.

 

You wrote "No point downloading this because it's not compatible with vanilla Arma 3". Maybe you should have written "For me, there is no point downloading this because it's not compatible with vanilla Arma 3", which would still be useless because we develop this mod and we decided to have ACE3 as a requirement. Do you complain about other mods as well with Requirements? We didnt even plan to release it as a mod here but we did, so others can maybe improve it. I dont have the time nor the ability to redevelop the wheel. If you are so good and develop for 6 years, it should be no problem for you, to figure out why it requires ACE3 and how to rewrite it so it doesnt. We didnt even binarize the mod so its super easy.. Even for me. I wonder why its a problem for you.

 

ps: i develop for more than 15 years, but not for Arma 3 and i am not going to spend that time for this weird and buggy script language

  • Like 2

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×