Jump to content
tebbbs

SRU - Persistent Database and Resupply

Recommended Posts

Hi,

 

this is our (Spackbremse and tulrich from sru-gaming.de) first addon and its pretty much alpha, but we wanted to have some feedback. Here is, what it does:

 

- Saves player position and inventory every minute to a database

- Saves vehicle position, direction, fuel, damage 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

 

Required addons: extDB2, ACE3, CBA

 

To give you an 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.

 

You can download the first version of it here: http://sru-gaming.de/sru_pdb.rar

Addon released here: https://forums.bistudio.com/topic/187092-sru-persistent-database-and-resupply/

  • Like 2

Share this post


Link to post
Share on other sites

Looks very interesting, look forward to testing it. I feel this may be a nice alternative to those who do not want to have to use a full ALiVE style setup.

Share this post


Link to post
Share on other sites

I edited my first post and added 2 important points:

 

-Saves all of the above based on map and mission name. So you can switch without losing your progress for a specific mission

-Forgot to put in ACE3 as requirement. This is to load/save the inventory. If you dont use ACE3 and want to use this mod, we can make a special version for you, or you wait until we are further down the line and made it optional

 

Also please report if it works for you. I hope i didnt forget anything when creating the mod

Share this post


Link to post
Share on other sites

First update already (which would be 0.2 alpha):

-changed some things in the db structure and query's

 

 

Just a short addition: If you are using Zeus and add vehicles, which you later remove again, they will still be stored in the database (and respawn if you restart the server). To prevent that, you can add a cronjob like this with PHP or wait until we include it into our addon (which is the plan). The code below is just an example that works with PDO, but you can rewrite it to your needs.

$sql = "SELECT COUNT(*) as cntInactive FROM vehicles WHERE rec_date < NOW() - INTERVAL 20 MINUTE";
$qGet = $dbc->prepare($sql);
$qGet->execute();
$aGet = $qGet->fetch(PDO::FETCH_ASSOC);
$iCntInactive = $aGet["cntInactive"];


$sql = "SELECT COUNT(*) as cntTotal FROM vehicles";
$qGet = $dbc->prepare($sql);
$qGet->execute();
$aGet = $qGet->fetch(PDO::FETCH_ASSOC);
$iCntTotal = $aGet["cntTotal"];

if($iCntTotal != $iCntInactive){
	$sql = "DELETE FROM vehicles WHERE rec_date < NOW() - INTERVAL 20 MINUTE";
	$qDelete = $dbc->prepare($sql);
	$qDelete->execute();
}

Share this post


Link to post
Share on other sites

Very interested to see how this can work with ALiVE.  Can this be a SP miracle?  :)

 

Of course there are other benefits to playing ALiVE on a dedi...(HCs)

 

Anyways thanks for sharing and looking forward to peoples feedback.

Share this post


Link to post
Share on other sites

Very interested to see how this can work with ALiVE.  Can this be a SP miracle?  :)

 

Of course there are other benefits to playing ALiVE on a dedi...(HCs)

 

Anyways thanks for sharing and looking forward to peoples feedback.

 

Well, of course alive has its benefits. But for not using most of its features and just wanting a persistent battlefield on a server, alive is way to huge. For those who just wanted to save and load the data mentioned above, this should be the lightweight solution. I guess tebbbs never compared this mod with alive as these are (in most features) complete different things. I would not dare to mess with mod-teams like the alive one :D.

 

Looks very interesting, I'm kind of working on something similar, but it's still very far from finished, just working on the website portion of it now. http://innovationstudios101.net/armalog/

 

Looks interesting as well. Correct me if I'm wrong, but does this only track and log player's statistics? It slightly reminds me of battlefields "battlelog" - at least a little bit caused by the placeholders on your site.

 

 

Anyway, there are some ideas being forged right now to extend the mod's featurelist. Stay tuned!

Merry christmas everyone!

Share this post


Link to post
Share on other sites

To the ALiVE thing... well this was actually the reason why we started this. We wanted to have a persistent battlefield, but somehow, it didnt really work with ALiVE and it took too much performance and was too big. We thought, we can do it in one little mod and a day later, it was done. So this is not an ALiVE replacement or anything, its just this one function that ALiVE also has (i guess.. at least for us it didnt work)

  • Like 1

Share this post


Link to post
Share on other sites

@Spackenbremse, Yes it is intended to track and log player's statistics, just like battlelog and ArmA Aftermath, using a mission framework. I stumbled across Kevinp058's recreation of AltisWebmin by Jarrrk, and really liked the modern look and feel that Kevinp058 was/is aiming for, so I thought it would be cool if I went a bit further. By this I mean creating a whole website from scratch while learning website design along the way. I have a few books I'm going through to learn website design, and SQL/MySQL databases, while working on this. So in essence I'm creating something similar to battlelog, while incorporating a modern looking/feeling website with an admin panel that not only allows an admin to manage the website, but also manage players that have signed up to track their stats from ArmA 3 if they or their community uses the mission framework.

Share this post


Link to post
Share on other sites

Ah okay, well we do not really do any statistics in our project. It could be a side task and would require us to transfer some more data into the database, but that shouldnt be a big problem. The main purpose of our addon is to save a battlefield situation and return to it on the next day or whenever you want

 

by the way, anyone got out addon up and running?

Share this post


Link to post
Share on other sites

@Tebbbs, Understood, I was just clarify what I'm working on, but I really do like where you and your team/community are taking this. I think I'm going to go test your mod now, just have to find a mission that I can add this to. Can't wait, it sounds like you guys are working on the new PersistentDB like the one  firefly2442, Jman, Tupolov created in ArmA 2 CO and MSO. If you like I can help you guys with embedding and/or creating the static page for the front-end resupply request, but you guys probably have started work on this already, lol.

Share this post


Link to post
Share on other sites

Hi tebbs,

Really keen to get this working. First time installing the mysql database and extdb2 but i think i have done it all correctly.

When i load into the mission on dedicated the mission hangs (serverside) and nothing initializes properly.

This is from RPT

 

23:44:48 Error in expression <') WHERE p.playerUID = '%1'",_playerUID,sru_pdb_mission_fk];
_sql_res2 = call co>
23:44:48   Error position: <sru_pdb_mission_fk];
_sql_res2 = call co>
23:44:48   Error Undefined variable in expression: sru_pdb_mission_fk
23:44:48 File sru_pdb\functions\fn_Server_getUnit.sqf, line 10
23:44:48 Error in expression <mission_fk]);


[ [[_playerUID,_sql_res,_sql_res2],"\sru_pdb\functions\fn_Client>
23:44:48   Error position: <_sql_res2],"\sru_pdb\functions\fn_Client>
23:44:48   Error Undefined variable in expression: _sql_res2
23:44:48 File sru_pdb\functions\fn_Server_getUnit.sqf, line 14
23:44:48 Error in expression <g "[,]";
sru_pdb_mission_fk = (_sql_res select 1);
publicVariable "sru_pdb_missi>
23:44:48   Error position: <select 1);
publicVariable "sru_pdb_missi>
23:44:48   Error Zero divisor
23:44:48 File sru_pdb\init_pdb.sqf, line 18

Share this post


Link to post
Share on other sites

Hi Foxhound, have you downloaded the latest version?

 

Can you tell me if any of the tables from the database are filled with some data?

 

Please also go to your @extDB2 directory, then navifate to the latest log. It could look like this: \@extDB2\extDB\logs\2015\12\26. There are a couple of log files there usually (depending on how often you restarted the server). Please check the last one and write the content here.

 

If everything is okay with your connection, it should look like this:

 

[18:10:04:152653 +02:00] [Thread 3836] extDB2: Database Type: MySQL
[18:10:04:156215 +02:00] [Thread 3836] extDB2: Database Session Pool Started
[18:10:04:156470 +02:00] [Thread 3836] extDB2: SQL_RAW_V2: Initialized: ADD_QUOTES False

 

and sometimes also

 

[18:13:36:871695 +02:00] [Thread 3836] extDB2: Stopping ...
 

if you stopped the server

Share this post


Link to post
Share on other sites

yep downloaded today.

not very familiar with mysql. here is a screeny. have also provided my extb-conf.ini

please let me know if i should change any of the settings in extb-conf.ini. we only want to use this mod for very basic functions of save player gear and location.

http://imgur.com/YmR8bZ9

very strange behaviour when loading into mission, the player spawns in at respawn point instead of start point, and like i said before the mission does not initialise init, initserver or initplayerlocal properly.

Share this post


Link to post
Share on other sites

ahh i see already one problem which was my mistake.

 

in your extdb_conf.ini, search for "MySQL_Example" and replace it with "SRU_DB". If you want, you can also add me on steam (http://steamcommunity.com/id/tebse) and we can run through this fast

Share this post


Link to post
Share on other sites

thanks for the updates you both.. but we just have a new version which i just uploaded. Its 0.4 Alpha. Here is the changelog

 

- saves and loads vehicle inventory

- better performance

- resupply script works better now

 

next version will contain the following new functions

 

- mod only needs to be installed on the server (no need for the client to have that mod anymore)

- saving and loading vehicle hitpoint damage

- extDB2 will be integrated (thanks torndeco)

 

Link: http://sru-gaming.de/sru_pdb.rar

WARNING: if you have installed an old version of our addon, you might consider reimporting the database as we made changes to several tables. Until this mod is released, there wont be any "Update-SQL-files".

 

@Sonsalt: not sure if its a good idea to have it on play withsix, as it will be a serverside only mod in the future but its up to you to decide

  • Like 1

Share this post


Link to post
Share on other sites

question, is it possible to save data only on a specific part of a map?  Within a trigger for example?  Got some ideas and wondering if this would work in the future with this concept.

 

Thanks

Share this post


Link to post
Share on other sites

it would be possible but would take some time. i would consider to do something like this once i am at version 1.0 which will be in the next 2 weeks maybe

  • Like 1

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.

×