Jump to content

[Server Addon] Persistence (v0.1.7)


nightmare

Recommended Posts

This addon stores all ground droped items by player, to the database.

After Server Restart it will be there again.

 

(like DayZ-SA )
 
 
NOTE: Items in Uniforms/Vests/Backpacks are currently not stored.
 
 

 

* I have no idea how this will affect the performance on high population servers.

 

 

 
Install Server

ADD  "a3_n8m4re_persistence.bpo"  TO  "@epochhive/addons"
 

 

 

Install Client Mission

ADD  "N8M4RE_Persistence_Client.sqf"  TO  "mpmissions/epoch.mapname",
if you have there a *.pbo instead of a folder, please google for "how to extract .pbo", pbo is an archive like "zip" you need a tool for that.

open the "init.sqf" inside of the "mpmissions/epoch.mapname" folder, if not exist then create an new file with an     editor like "notepad++" and name it to "init.sqf"

example for the "init.sqf"
 

// stop server loading the client script
// tutorial: http://killzonekid.com/arma-scripting-tutorials-basic-multiplayer-coding-summary/  
if (isDedicated) exitWith {};

// compile the script on mission load
// https://community.bistudio.com/wiki/compileFinal
N8M4RE_Persistence_Client=compileFinal preprocessFileLineNumbers "N8M4RE_Persistence_Client.sqf";

// wait client is ready
// https://community.bistudio.com/wiki/waitUntil
// https://community.bistudio.com/wiki/isPlayer
// https://community.bistudio.com/wiki/alive
waitUntil{(isPlayer player) && (alive player) && !isNil "EPOCH_loadingScreenDone"};

// Starts running the script
// https://community.bistudio.com/wiki/spawn
[] spawn N8M4RE_Persistence_Client;

Battleye
ADD TO "publicvariable.txt"

!="N8M4RE_(PERSISTENCE_PUT|PERSISTENCE_TAKE)"

Epoch Server Config
ADD TO "@epochhive/epochconfig.hpp"

PersistenceTablePrefix = "PERSIST";     // change will create a new table in db

PersistenceHolder = true;               // enable/disable storing of groundholder items
PersistenceHolderCanExpire = true;      // enable/disable expiring of holders
PersistenceHolderExpires = "172800";    // 1day=86400, 2days=172800, 4days=345600, 8days=691200 
PersistenceHolderLimit = 1500;          // max groundholder can stored (a groundholder can hold more than one item)

PersistenceDayTime = true;              // enable/disable storing of server daytime (StaticDateTime only)

This addon contains some bit of code lines from the Epoch server.pbo. (like the magazine/ammo count )

So also Credits to the Epochmod-Team.


Author
Nightmare - http://n8m4re.de
 

License
All the code and information provided here is provided under an Attribution Non-Commercial ShareAlike 4.0 Commons License.
http://creativecommons.org/licenses/by-nc-sa/4.0/

 

 

 

 

CHANGELOG

v0.1.7-fix-1
- [FIXED] storing of server daytime


v0.1.7
- [NEW] storing of server daytime (StaticDateTime only): PersistenceDayTime = true;
- [NEW] holder setting -> enable/disable expiring of holders: PersistenceHolderCanExpire = true;
- [NEW] holder setting -> enable/disable storing of groundholders: PersistenceHolder = true;  
- [MISC] code change

v0.1.6-fix-2
- an "any" table was created when adding items to clothing/vest/backpack  

v0.1.6-fix
- duplicate holder index

v0.1.6
- holder load/spawn and indexing reworked

v0.1.5-fix
- HolderIndex fixed

v0.1.5

   - config variable names changed
   - removed "map name" from tablename
   - decrease of load time
   - prevent cleanup of groundholders
   - disabled not needed hint message in sqf

DOWNLOAD

Link to comment
Share on other sites

 

* I have no idea how this will affect the performance on high population servers.

 

 

On a low pop server I could see it being a good addition but on a server with a reasonable amount of players on I can imagine it will cripple them.

 

I'd set the expiration time so that they only persist through one restart at the most otherwise people will just drop shit all over the place and the server will grind to a halt.

Link to comment
Share on other sites

If it were restricted to only being persistent for certain items (like mines,tripwires) and also only in the range of your own jammer then I'd be all for it.

 

With you on this.  Otherwise people would just troll high pop/high value areas with mines.

 

Edit:  But the OP says ground DROPPED, so does this even affect ground PLACED stuff like mines?

Link to comment
Share on other sites

please explain in which context?

 

I mean if i spawn some objects like a Tipi or Crate, can it be saved?

Possibly with the contents of the objects.

 

Check out this video and I think you will understand me:

 

https://www.youtube.com/watch?v=hqUHNUUE6RQ

Link to comment
Share on other sites

I'd like to see mines and claymores be persistent. No more worries about players logging out and having their bases raided. It would at least provide a small deterrent or obstacle for players wanting to steal things. Of course you can set them to have an expiry date so they don't stay on the server more than X hours. Players could pick them up and place them again to reset the timer. That way active players don't get penalized but old, unattended mines and claymores still get wiped.

Link to comment
Share on other sites

I mean if i spawn some objects like a Tipi or Crate, can it be saved?

Possibly with the contents of the objects.

 

Check out this video and I think you will understand me:

 

 

 

this is what epoch by default makes..

 

 

 

 

I'd like to see mines and claymores be persistent. No more worries about players logging out and having their bases raided. It would at least provide a small deterrent or obstacle for players wanting to steal things. Of course you can set them to have an expiry date so they don't stay on the server more than X hours. Players could pick them up and place them again to reset the timer. That way active players don't get penalized but old, unattended mines and claymores still get wiped.

 

mhmm.. i will try this

Link to comment
Share on other sites

this is what epoch by default makes..

 

No Epoch just saves builded items not spawned items, i dont know if there is any difference.

But these objects in the script of the video get not saved on a server restart, like any other spawned object.

Link to comment
Share on other sites

Salutesh you need to add into your scripts the proper code that epoch uses to send that info to the database.

Otherwise yes it will only be there for one restart. Kinda like how we have to add the vehicle to save with Epoch tokens, you have to find the code for building, try looking in the server side files for it.

Link to comment
Share on other sites

I'd like to see mines and claymores be persistent. No more worries about players logging out and having their bases raided. It would at least provide a small deterrent or obstacle for players wanting to steal things. Of course you can set them to have an expiry date so they don't stay on the server more than X hours. Players could pick them up and place them again to reset the timer. That way active players don't get penalized but old, unattended mines and claymores still get wiped.

Spot on Darth.

Link to comment
Share on other sites

  • 3 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...