[HowTo] Protect your MapAdditions against stealing

kikyou2

Valued Member!
Hi there,

as it was a while I posted something here in the forums, I start with something simple.

Much people know nowadays how to add own MapAddtions like new Houses and stuff like that on your DayZ Server, but if you put everything in your missionfile (in your mission.sqm or in a script which is the missionfile) it can be easily stolen from others.

This is a big problem cause everything whats in your missionfile is available for everyone who can play on your server.

Now how can we prevent that your stuff is going to be used without permission?

Here is my tutorial in 3 Steps!

Step 1 - Make your spawning script
====== ====================

You need your custom buildings as a script for spawning, but as long as you have your saves from the editor there is no problem to create this.

You just need to follow this guide

http://dayzepoch.com/forum/index.php?/topic/12-custom-buildings/page-2#entry1403

untill you get to these step
etc etc..
Add those objects left between this simple code in a new text doc editor

Don't do that and you're fine

You should have now a script with only commands like these

_vehicle_0 = objNull;
if (true) then
{
_this = createVehicle ["Land_Ind_Timbers", [4254.3887, 10755.609], [], 0, "CAN_COLLIDE"];
_vehicle_0 = _this;
_this setPos [4254.3887, 10755.609];
};


Step 2 - Put your script into your server.pbo
====== =============================

You need a tool to unpack .pbo files (e. g. http://www.armaholic.com/page.php?id=16369)

Then you go for your server folder, for my case its called "@DayZ_Epoch_Server". In this folder you open the addons folder and unpack your server.pbo. Afterwards delete or move your server.pbo to anywhere else.

Now open the new folder of your unpacking server.pbo files and open the init folder. There should be a script called like server_functions.sqf.

Open this one and search at the beginning for a code block like this one

TcyMYo9.png


Underneath these block you copy & paste these code line:

server_spawnCustomBuildings = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_spawnCustomBuildings.sqf";

After that you save your new server_functions.sqf and quit it.

Then you'll have to open the compile folder instead of the init folder. Now we need our script out of Step 1. Copy and paste it in and rename to "server_spawnCustomBuildings.sqf" without " ".

Now you can go back to the directory where your old server.pbo was and repack the unpacked folder back to .pbo format.

Its important that your old server.pbo isn't present there anymore and is called like it was called before.

Step 3 - Calling of your script in the missionfile
====== ============================

The major part is done now. We only need to add the call into the missionfile.

For that go to your MPMissions folder inside your server. There are two possible cases

Case1: There is a folder in it and no .pbo then skip Case2
Case2: There is a .pbo and no folder, so you got to unpack it and delete the old packed .pbo again (in contrast to the server.pbo it isn't needed to pack your missionfile)

Now open your folder inside the MPMissions and open the init.sqf.

Add at the end the following:

if (isServer) then {
call server_spawnCustomBuildings;
};

Now save your init.sqf and start your server. Your buildings should spawn as usual and cannot be copied anymore cause all buildings and their positions are stored in the server.pbo which is never passed to the clients.

If you have multiple different Additions you naturally can do the same steps again and just rename the names.

This is also very good to handle cause if you don't want to spawn the part anymore you can comment it out or delete the call inside the init.sqf and it will no longer spawn. If you need it again paste it in again.

I hope this helps some people, have fun with your safe Map Additions!

Regards

kikyou2
 

kikyou2

Valued Member!
It can still be stolen, just not so easily :p

Yeah, its still arma but 90% of the people won't be abe any longer to steal your work. If you put everything into the missionfile its a matter of seconds to copy and paste it out of the temporary pbo file...
 

CommanderRetra

Moderator
Staff member
I know I was just making a point, if someone really wants your files then they will always be able to get them. It's just a matter of knowing how.
 

sukkaed

Well-Known Member
What is the difference between this method and just throwing execVM at the bottom of server_functions?
 

sukkaed

Well-Known Member
Yes, but is there some benefits when it's done like that instead of loading from server.pbo?
 

Allanstrings

New Member
Yes, there are some considerable differences, depending on the other features of the map. The server.pbo is parsed before the mission, then elements of the mission are called in order.

So for example, if you call your custom buildings from the bottom of the init as described above - you could no longer park any vehicles on top of these structures, as they would spawn in mid-air and fall to the ground before the structure supporting them was created.

Also keep in mind that if you run any AI scripting, any buildings loaded after the AI is initialized will essentially not exist for those NPC's, and they will path/shoot through them.

As far as server load is concerned, the server runs both the server.pbo and the mission.pbo, so in general moving a function between them does not change the overall load. However, the mission IS the part that is starting up when a user logs in, so the more the mission has to do, the more perceived delay your players will see when logging in.

Best practice for performance, latency, functionality, and ease of use is to make individual .sqf files for localized areas of custom structures, and call them with their own compile call in the server_functions with comments, as shown here: http://opendayz.net/threads/release-avendettaforyous-custom-buildings.14054/
 

CommanderRetra

Moderator
Staff member
Yes, there are some considerable differences, depending on the other features of the map. The server.pbo is parsed before the mission, then elements of the mission are called in order.

So for example, if you call your custom buildings from the bottom of the init as described above - you could no longer park any vehicles on top of these structures, as they would spawn in mid-air and fall to the ground before the structure supporting them was created.

Also keep in mind that if you run any AI scripting, any buildings loaded after the AI is initialized will essentially not exist for those NPC's, and they will path/shoot through them.

As far as server load is concerned, the server runs both the server.pbo and the mission.pbo, so in general moving a function between them does not change the overall load. However, the mission IS the part that is starting up when a user logs in, so the more the mission has to do, the more perceived delay your players will see when logging in.

Best practice for performance, latency, functionality, and ease of use is to make individual .sqf files for localized areas of custom structures, and call them with their own compile call in the server_functions with comments, as shown here: http://opendayz.net/threads/release-avendettaforyous-custom-buildings.14054/

That's what I do but as a precaution to prevent AI from shooting through walls and such I use this file (here). Thanks to ButtFace, he has created a fix for the AI shooting through walls, regardless you have it loading serverside its basically a backup.
 

kikyou2

Valued Member!
As far as server load is concerned, the server runs both the server.pbo and the mission.pbo, so in general moving a function between them does not change the overall load. However, the mission IS the part that is starting up when a user logs in, so the more the mission has to do, the more perceived delay your players will see when logging in.

You are right except this part. Writing it to the missionfile with this statement

if (isServer) then {

can't impact on ClientSide loading time, cause only the Server executes it like in the server_functions.

The rest is right.

The most reason to put in like this is that you can easily turn the function off and on, without repacking everytime your server.pbo cause the missionfile can be left unpacked. Thats the most benefit of calling it via missionfile instead of directly in your server_functions.

Event for people who don't know much about the things happening inside the server.pbo this is a more convient way I think, but its a matter of taste.

There was just another server owner who has placed much custom Buildings and had everything in his missionfile someone picked everything out of the temporary client side missionfile and now falsely taking all the credit. So I decided to show a more secure way to stop easy access on your files.
 

Allanstrings

New Member
You are right except this part. Writing it to the missionfile with this statement

if (isServer) then {

can't impact on ClientSide loading time, cause only the Server executes it like in the server_functions.

I was more referring to the server side mission load at restart, because anything you can put in the server.pbo will run immediately at restart, anything in the mission will not begin to load until a player tries to log in, and a lot of the most popular mods (looking at YOU Epoch) have a lot of processes that need to run before they allow authentication. Anything you can do to minimize this time will make you much more likely to retain impatient players.
 
Top