Jump to content

[Release] - A Plot for life v2.5. Keep your buildables on death. Take plot ownership


Recommended Posts

Ok i'm kind of confused with the whole server_monitor business. Why not just leave it under server pbo\system\?

Can do and just change the call in the init. Sqf.

This way means people don't need to unpack the server pbo or load the server_monitor. Sqf back in and I don't need to write a tutorial for people who have not done it before, don't have the software and don't have to troubleshoot that going wrong.

This way is simpler for new admins and easier to support.

Link to comment
Share on other sites

Ok, I am sorting out a solution to keep the server_monitor.sqf on the server only.

 

Does everyone have access to the main server directory (the one with @Dayz_Epoch & @Dayz_epoch_server in) ?.

 

I suspect some people do not but would like clarification.  

 

For those with dedicated machine and full access I have sorted out the mod so the server_monitor.sqf does not need to be updated in the dayz_server.pbo but still only needs to sit on the server.

 

For people with with hosting that does not allow access to the main server directory, the mod will have to have the server_monitor.sqf as part of the mission file.  I do not currently see any big issue with this as the version run will be from the mpmission folder on the server not on the client.

 

Feedback welcome.

Hi Rimblock, from my experience of two hosts, some will give access to those files and some won't. For instance, Vert let you get back to that level but, a previous hoster didn't when I used to use them.....

Link to comment
Share on other sites

A suggestion for the files for this mod. Instead of including an entire compiles.sqf, just have a compiles.sqf with the new lines, then in init.sqf, set up a custom line for your second compiles.sqf. I do this for variables.sqf as well.

 

For example, (init.sqf):

call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\compiles.sqf"; //Compile regular functions
progressLoadingScreen 0.5;
call compile preprocessFileLineNumbers "server_traders.sqf"; //Compile trader configs
call compile preprocessFileLineNumbers "custom\compiles.sqf"; //Compile custom compiles

This will load the default compiles.sqf, then load a second compiles.sqf that has values that need to be overwritten by the mod. This is how I've always done it. It saves you a step with updating the server too, so you don't have to copy the newest compiles.sqf and edit it.

 

Here's what would go in the custom compiles.sqf:

fnc_usec_damageActions = compile preprocessFileLineNumbers "Custom\PlotForLifev2\fn_damageActions.sqf"; //Checks which actions for nearby casualty
fnc_usec_selfActions = compile preprocessFileLineNumbers "Custom\PlotForLifev2\fn_selfActions.sqf"; //Checks which actions for selfplayer_packTent = compile preprocessFileLineNumbers "Custom\PlotForLifev2\player_packTent.sqf";
player_packVault = compile preprocessFileLineNumbers "Custom\PlotForLifev2\player_packVault.sqf";
player_unlockVault = compile preprocessFileLineNumbers "Custom\PlotForLifev2\player_unlockVault.sqf";
player_removeObject = compile preprocessFileLineNumbers "Custom\PlotForLifev2\remove.sqf";
player_lockVault = compile preprocessFileLineNumbers "Custom\PlotForLifev2\player_lockVault.sqf";
player_updateGui = compile preprocessFileLineNumbers "Custom\PlotForLifev2\player_updateGui.sqf";
player_tentPitch = compile preprocessFileLineNumbers "Custom\PlotForLifev2\tent_pitch.sqf";
player_vaultPitch = compile preprocessFileLineNumbers "Custom\PlotForLifev2\vault_pitch.sqf";
player_build = compile preprocessFileLineNumbers "Custom\PlotForLifev2\player_build.sqf";
Link to comment
Share on other sites

I'm not sure what you done is related to 

 

Causes some players to not be able to connect  and some base objects dissapearing

 

Nope on the first one.  Looks like you do not have the British Armed Forces (BAF) expansion resources on the Server.  

 

For base objects disappearing, it sounds like some sort of housekeeping.  Epoch has this and it can be majorly annoying but without any sort of housekeeping the object_data table will just grow and grow with peoples base parts never being removed.  You could write a custom script / sql event to clear them up to replace the Epoch SQL triggers that currently do it.

 

Hi Rimblock, from my experience of two hosts, some will give access to those files and some won't. For instance, Vert let you get back to that level but, a previous hoster didn't when I used to use them.....

Thanks for the info ReDBaroN.  Hopefully most people can use the dedicated version of the mod and keep the server_monitor code on just the server.

 

 

A suggestion for the files for this mod. Instead of including an entire compiles.sqf, just have a compiles.sqf with the new lines, then in init.sqf, set up a custom line for your second compiles.sqf. I do this for variables.sqf as well.

 

Whilst I am dead set against repeated code due to efficiency reasons, the big advantage of your suggestion is that the mission file will be smaller and as we all know, smaller mission file is generally better.  It will also make it clearer for people to install with other scripts. I am all for simplicity, especially when supporting the mod  :D .

 

I reconfigure to use this method.  Thanks for the suggestion.

Link to comment
Share on other sites

Rimblock,

 

Do you have instructions available so I can make the changes to the files individually? I don't want to have to reinstall all my scripts after installing your amazing mod!

 

Hi Tricks,

 

Yes I will produce the step by step set of instructions but there are a few other priorities I need to get done first listed in

Link to comment
Share on other sites

I used the old Plot Pole for Life so maybe something has changed, but after installing this, I placed some items and they all have my Character ID in the CharacterID field. I thought the UID (Steam ID) was supposed to go there or are the items tracked some other way to determine ownership?

Link to comment
Share on other sites

I used the old Plot Pole for Life so maybe something has changed, but after installing this, I placed some items and they all have my Character ID in the CharacterID field. I thought the UID (Steam ID) was supposed to go there or are the items tracked some other way to determine ownership?

 

PlayerUID (i.e. SteamID) is now stored as an extra field in the worldspace field in the DB allowing the characterID to be stored in the characterID field so you can switch back and forth (between vanilla or this mod) and need no change in the DB.  It also means there is no clash with any other usage of the characterID field in the DB (keys, safe codes, or other mods) and there is no need to truncate the steamID to fit.

 

This is what I wanted to do for v2 anyway but Steam just forced my hand.

 

Here is some select SQL that will display any object ownerships that can be changed automatically (i.e. where the objects characterID matches a playerUID in the characterID table.  It is limited to 15 character playerUIDs so should only pick out the SteamID matches.  This will just report and will not change anything.

select CD.playerUID, OD.characterID as Characters_characterID, OD.characterID as Objects_characterID, OD.worldspace as Current_worldspace, INSERT(OD.worldspace, (char_length(OD.worldspace)), (char_length(concat('\,\"', CD.playerUID, '\"\]'))), (concat('\,\"', CD.playerUID, '\"\]'))) as new_worldspace from object_data as OD, character_data as CD
where CD.characterID = OD.characterID
and not locate('"', OD.worldspace)
and char_length(CD.playerUID) > 15;

If that looks good the following code will insert the ownership values to the worldspace field for this mod.  

 

Please test first.  It works for me but your config may be different.  Always backup the DB first (see the end of this post for a Windows .bat script to do a backup).

 

If you are in triple figure characterIDs this may cause problems with safe / door code or vehicle key clashes.  Check the precheck above carefully.

SET SQL_SAFE_UPDATES=0;

start transaction;

Update object_data
inner join character_data as CD on (CD.characterID = object_data.characterID)
set object_data.worldspace = INSERT(object_data.worldspace, (char_length(object_data.worldspace)), (char_length(concat('\,\"', CD.playerUID, '\"\]'))), (concat('\,\"', CD.playerUID, '\"\]')))
where CD.characterID = object_data.characterID
and not locate('"', object_data.worldspace)
and char_length(CD.playerUID) > 15;

Check the results and if they look good

Select * from object_data where locate('"', object_data.worldspace);

If something looks wrong

rollback;

SET SQL_SAFE_UPDATES=1;

If all looks good 

commit;

SET SQL_SAFE_UPDATES=1;

Mysql generally defaults to safe updates which means you need to specify, in this case, each objectID you want to update.  As we are updating many objects we turn it off before the update and then turn it on after.  If you are happy to leave it off then don't run the "SET SQL_SAFE_UPDATES=1;" command at the end.

 

If you want to update just one characterID then you can add "and characterID = [characterID to affect here];" before the last ';'

 

i.e.

SET SQL_SAFE_UPDATES=0;

start transaction;

Update object_data
inner join character_data as CD on (CD.characterID = object_data.characterID)
set object_data.worldspace = INSERT(object_data.worldspace, (char_length(object_data.worldspace)), (char_length(concat('\,\"', CD.playerUID, '\"\]'))), (concat('\,\"', CD.playerUID, '\"\]')))
where CD.characterID = object_data.characterID
and not locate('"', object_data.worldspace)
and char_length(CD.playerUID) > 15
and object_data.characterID = 5;

The above code would only affect items in the object_data field with a characterID of 5.

 

If you know the players steamID and old value in the object_data.characterID field (maybe the old playerUID) then the following code should work.

 

Change [steamID of player] x 2 and [Current value of object_data.characterID field] x 1 to actual values without the [].  Search for '[' to make sure you have changed them all. 

SET SQL_SAFE_UPDATES=0;

start transaction;

Update object_data
set object_data.worldspace = INSERT(object_data.worldspace, (char_length(object_data.worldspace)), (char_length(concat('\,\"', [SteamID of player], '\"\]'))), (concat('\,\"', [SteamID of player], '\"\]')))
where not locate('"', object_data.worldspace)
and object_data.characterID = [Current value of object_data.characterID field];

After you check using the above check code then just commit or rollback as above.

 
Put the following in to a Windows batch file on your server (.bat file), amend the details and run it to backup the DB.  I have put a read at the end so the cmd box stays and you can see any errors.  You can take it out if you want once the backup is running ok.  You can also add it to Windows scheduler once working for automatic DB dumps.  You may need to check with your provider for the Mysqldir path where "mysqldump " is located.
 

The backups will be in the form of a .sql file that you can load and run from a SQL client to rebuild your tables and data.  The files will be housekept.  Any older than 5 days will be removed (I have this backing up every 15 minutes).  To change this, just change the "-5" in the forfiles line at the bottom to a number of days you prefer.

@REM *** PARAMETERS/VARIABLES ***
SET BackupDir="[Put the path to dump the DB to here]"
SET DatabaseName="[Put your DB name in here]"
SET mysqldir="C:\Program Files\MySQL\MySQL Server 5.6\bin"
SET mysqluser=[Put your MySQL userid in here]
SET mysqlpassword=[Put your MySQL password in here]
SET datestamp=%date:~-10,2%-%date:~-7,2%-%date:~-4,4%_%time:~0,2%.%time:~3,2%.%time:~6,2%
@REM *** EXECUTION ***
@REM Change to mysqldir
c:
cd %mysqldir%
@REM dump/backup ALL database, this is all in one line
mysqldump -u %mysqluser% -p%mysqlpassword% --databases %DatabaseName% >%BackupDir%\%DatabaseName%_backup.%datestamp%.sql

@REM - YOU ARE DONE!


forfiles -p %BackupDir% -s -m *.* -d -5 -c "cmd /c del @path"

The code above can be changed in may ways to do a DB dump every day and then just specific table dumps every 15 minutes or so but as my DB is quite small, this seems to work fine for me.

 

Backup first, be careful and enjoy.  Report any issues and I will re-examine and revise the code.
Link to comment
Share on other sites

Ladies and gentlemen.

 

vbawol will allow it to be included as part of the standard Epoch build after I have converted it so it can be turned on or off via a variable  :D .

 

I need to finish the debugging, add the maintenance, optionise it (turn it on or off via a config variable), testing etc and then I will push it to the DayZ Epoch build so everyone will have it as standard and can choose to turn it on or off as they prefer.

 

There is a bit of work to do so don't hold your breath and please continue with this mod build for now.  It will also help to iron out some of the bugs before merging.

Link to comment
Share on other sites

Ok, from looking through the building maintenance code, I do not believe this mod will affect it at all.  It just grabs any valid buildings (listed in DZE_maintainClasses) within range (DZE_maintainRange) that have a damage equal to or more than DZE_DamageBeforeMaint.

 

 

Neither of the two scripts used for this function call the characterID object variable to check.

Link to comment
Share on other sites

What version are you using ?

 

Laterst vesion was made available under 24 hours ago.  Are you seeing the problem with that one (v2.1) ?.

 

Hi Hardened,

 

Thanks for your reply. I am running 2.2.1 now and I am still getting the issue.

 

can you point me in the right direction to fix this.

 

Thanks again,

 

Mike.

Link to comment
Share on other sites

Nope on the first one.  Looks like you do not have the British Armed Forces (BAF) expansion resources on the Server.  

 

For base objects disappearing, it sounds like some sort of housekeeping.  Epoch has this and it can be majorly annoying but without any sort of housekeeping the object_data table will just grow and grow with peoples base parts never being removed.  You could write a custom script / sql event to clear them up to replace the Epoch SQL triggers that currently do it.

 

 

 

 

How would i get that expansion working on the server? I am using Vilayer

 

If you get time to answer it would be appreciated

Link to comment
Share on other sites

Ladies and gentlemen.

 

vbawol will allow it to be included as part of the standard Epoch build after I have converted it so it can be turned on or off via a variable  :D .

 

I need to finish the debugging, add the maintenance, optionise it (turn it on or off via a config variable), testing etc and then I will push it to the DayZ Epoch build so everyone will have it as standard and can choose to turn it on or off as they prefer.

 

There is a bit of work to do so don't hold your breath and please continue with this mod build for now.  It will also help to iron out some of the bugs before merging.

 

Well this will be a most welcome addition to patch notes, can't wait to see it listed.  I wouldn't be surprised if pretty much everyone has this switched on as soon as it's available.

Link to comment
Share on other sites

Ladies and gentlemen.

 

vbawol will allow it to be included as part of the standard Epoch build after I have converted it so it can be turned on or off via a variable  :D .

 

I need to finish the debugging, add the maintenance, optionise it (turn it on or off via a config variable), testing etc and then I will push it to the DayZ Epoch build so everyone will have it as standard and can choose to turn it on or off as they prefer.

 

There is a bit of work to do so don't hold your breath and please continue with this mod build for now.  It will also help to iron out some of the bugs before merging.

 

Great news! This mod deserves to be in it :)

Link to comment
Share on other sites

I used to have the old Plot pole for life installed.

Since moving to this one I can't login, I get this error:

 

13:00:14 "ERROR: Cannot Sync Character [u.M.P] Cannon as no characterID"

 

I've Deleted the old characters out the DB and tried removing the old function I had added to the DB (text to digit conversion) but still no joy...any idea what I'm doing wrong.

Link to comment
Share on other sites

Ladies and gentlemen.

 

vbawol will allow it to be included as part of the standard Epoch build after I have converted it so it can be turned on or off via a variable  :D .

 

I need to finish the debugging, add the maintenance, optionise it (turn it on or off via a config variable), testing etc and then I will push it to the DayZ Epoch build so everyone will have it as standard and can choose to turn it on or off as they prefer.

 

There is a bit of work to do so don't hold your breath and please continue with this mod build for now.  It will also help to iron out some of the bugs before merging.

 

Fantastic news! It will make things so much easier for server admins and will allow you to relax and concentrate on other things once this is in!

Link to comment
Share on other sites

Ladies and gentlemen.

 

vbawol will allow it to be included as part of the standard Epoch build after I have converted it so it can be turned on or off via a variable  :D .

 

I need to finish the debugging, add the maintenance, optionise it (turn it on or off via a config variable), testing etc and then I will push it to the DayZ Epoch build so everyone will have it as standard and can choose to turn it on or off as they prefer.

 

There is a bit of work to do so don't hold your breath and please continue with this mod build for now.  It will also help to iron out some of the bugs before merging.

Awesome, really great news. Thx Rim for your amazing work. Best new feature in 1.0.5.2.

Link to comment
Share on other sites

Thanks everyone but I need to get a bit of work done before it can go in. 

 

Awesome, really great news. Thx Rim for your amazing work. Best new feature in 1.0.5.2.

 

 I know vbawol wanted to get 1.0.5.2 out ASAP so would not look for it going in to that one.  Possibly the next if I can get it all working as an option.

Link to comment
Share on other sites

I used to have the old Plot pole for life installed.

Since moving to this one I can't login, I get this error:

 

13:00:14 "ERROR: Cannot Sync Character [u.M.P] Cannon as no characterID"

 

I've Deleted the old characters out the DB and tried removing the old function I had added to the DB (text to digit conversion) but still no joy...any idea what I'm doing wrong.

 

Interestingly I resorted my DB to v1.1 in order to test the conversion sql and got the same error.

 

I reinstalled the mod again and it just worked.  What I saw at the end of the client RPT file was "mission ended" which usually indicates an issue reading the server_monitor.sqf file.

 

If using the dedicated install, have a look in the server RPT file and search for "Plot".  Debug is still on at the moment in those files to help with debugging any issues.  You should be able to find something like...

12:33:09 APlotForLife
12:33:09 "[_serverMonitor: custom\APlotForLifev2.2.1\server_monitor.sqf]"

I left that in to make sure the server side custom server_monitor.sqf is found.  

Link to comment
Share on other sites

How would i get that expansion working on the server? I am using Vilayer

 

If you get time to answer it would be appreciated

 

Ok, I have all the expansions and when installing I just copied over the ARMA II AO folder and then copied the ARMA II\Addons folder in to it.  That got rid of all my errors like that.

 

You have bought the BAF expansion for ARMA II OA haven't you ?.

Link to comment
Share on other sites

Hi Hardened,

 

Thanks for your reply. I am running 2.2.1 now and I am still getting the issue.

 

can you point me in the right direction to fix this.

 

Thanks again,

 

Mike.

 

Can you post up the DB entires for the current plot pole and what you get when you place a new plot pole.

 

That will help to try and work out what the scripts are using.

 

Thanks

Link to comment
Share on other sites

Ok, I have all the expansions and when installing I just copied over the ARMA II AO folder and then copied the ARMA II\Addons folder in to it.  That got rid of all my errors like that.

 

You have bought the BAF expansion for ARMA II OA haven't you ?.

 

I have bought it yes aswell as PMC

 

Also any ETA on the tagging and what about the whole only the owner can acces their safe as my players do not like that

 

Thanks

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...