Epoch Base Maintenance CLI

Parabola949

New Member
I've been running an Epoch server for a little while now. Myself and my admins have built a rather large base using the Epoch building tools - but, as we all surely know - maintenance is horrible. So, I wrote a quick and simple CLI tool that will allow you to backup and maintain your base quickly and easily, with minimal data gathering.

Code:
Maintain Admin Base command line
 
Usage:
maintain.exe server port [database username] database_password xMin xMax yMin yM
ax
 
Server: IP Address to server
Port: Your servers mySql port
UserName: OPTIONAL - your database username, default is root
Password: Database password
xMin: Minimum value on the X Axis in Worldspace
xMax: Maximum value on the X axis in Worldspace
yMin: Minimum value on the Y axis in Worldspace
xMax: Maximum value on the Y axis in Worldspace
 
A note about axis values: These are not the same as in game coordinates.  Check
your database for the values:
Worldspace is as such: [direction[x,y,z]]
 
Examples:
maintain.exe 000.000.000.000 2353 dayz myPassw0rd 9200 10000 13460 13960
maintain.exe 000.000.000.000 2353 myPassw0rd 9200 10000 13460 13960
The coordinates used for the examples are a 500m x 700m area around Pobeda Dam

It's fairly simple - using the database, figure out the boundaries of the area your base is in. Technically, you could select the entire map if you used 0 100000 0 100000 and it would maintain every single item on your map.... but that could be a little pointless.

As shown, you just enter your server ip, port, username (optional, defaults to root), password, and the coordinates you want to "save". The script will go into your epoch database and grab the objects that lie within those boundaries (this includes vehicles), replaces the Datestamp on them (how Epoch knows when to "decay" an object), and also backs them up to a file on your computer. The file is in a format like this (for each object):
Code:
REPLACE INTO `object_data` (`ObjectID`, `ObjectUID`, `Instance`, `Classname`, `Datestamp`, `CharacterID`, `Worldspace`, `Inventory`, `Hitpoints`, `Fuel`, `Damage`) VALUES (12986, 96951135897590, 11, 'CinderWall_DZ', '2013-12-08 21-58-17', 811, '[90.098,[9695.12,13589.7,-0.047]]', '[]', '[]', 0, 0);
The reason is that if some troll comes onto your server and blows up all of your hard work.. no problem, you have it saved. You can copy and paste the entire file into HeidiSQL and it will put your base back. The user of REPLACE INTO means that it won't duplicate any items that weren't destroyed - it will replace them, and insert the items that are missing - no mess.
Concerned I may be using some hidden code to steal your information? Completely understandable:
http://www.jetbrains.com/decompiler/download/download_thanks.jsp?os=msi
Use JetBrains dotPeek, open my application, and view the source code for yourself. I have nothing to hide, I'm not interested in stealing information.

I'll work on an actual UI later, I was just hashing this out real fast because I needed to get to bed. Future version will have an actual UI, and you'll be able to create base locations / save them individually (Donator perk- donate for a base that will be maintained / backed up!)

I also plan on creating an addon for Epoch later that will auto maintain all objects within the 30m Plot object - players will only need to "rent" the land using the 30m plot sign, which will decay after x days. They will have the option to pay the "rent" directly at the plot signs in their base, rather than going to have to buy more plots.

Download link: https://db.tt/6mQBbXFh
Requires .NET Framework 4.0
Images:
maintain%201.png


maintain%202.png
 
Back
Top