Give the players a wand when starting to create a jail or cell.

This commit is contained in:
graywolf336 2013-12-06 15:56:46 -06:00
parent 647a4f9d17
commit e07c657a40
4 changed files with 319 additions and 278 deletions

View File

@ -1,5 +1,11 @@
package com.graywolf336.jail;
import java.util.LinkedList;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.util.Vector;
public class Util {
@ -40,4 +46,17 @@ public class Util {
public static String getColorfulMessage(String message) {
return message.replaceAll("(?i)&([0-9abcdefklmnor])", "\u00A7$1");
}
public static ItemStack getWand() {
ItemStack wand = new ItemStack(Material.WOOD_SWORD);
ItemMeta meta = wand.getItemMeta();
meta.setDisplayName(ChatColor.AQUA + "Jail Wand");
LinkedList<String> lore = new LinkedList<String>();
lore.add(ChatColor.BLUE + "The wand for creating");
lore.add(ChatColor.BLUE + "a jail or cell.");
meta.setLore(lore);
wand.setItemMeta(meta);
return wand;
}
}

View File

@ -1,135 +1,145 @@
package com.graywolf336.jail.steps;
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
import org.bukkit.util.Vector;
import com.graywolf336.jail.JailManager;
import com.graywolf336.jail.Util;
import com.graywolf336.jail.beans.Cell;
import com.graywolf336.jail.beans.CreationPlayer;
import com.graywolf336.jail.beans.Jail;
import com.graywolf336.jail.beans.SimpleLocation;
/**
* Class for stepping a player through the Cell creation process, instance is stored in {@link JailManager}.
*
* @author graywolf336
* @since 3.0.0
* @version 1.0.0
*/
public class CellCreationSteps {
/** Sends the Cell Creation message for starting out. */
public void startStepping(Player player){
player.sendMessage(ChatColor.AQUA + "---------- Jail Cell Creation ----------");
player.sendMessage(ChatColor.GREEN + "First, you must select a teleport point for the cell! Move to the teleport point and then click anywhere with your wooden sword to set it.");
player.sendMessage(ChatColor.AQUA + "----------------------------------------");
}
/**
* Applies the next step in the Cell Creation process that involves a location, null if no location is needed.
*
* @param jm The {@link JailManager} instance.
* @param player The player who is doing the creating.
* @param cp The {@link CreationPlayer} instance
* @param location The location, null if none, being set.
*/
public void step(JailManager jm, Player player, CreationPlayer cp, Location location) {
switch(cp.getStep()) {
case 1:
firstStep(jm, cp, player);
break;
case 2:
secondStep(cp, player, location.getBlock());
break;
case 3:
thirdStep(jm, cp, player, location.getBlock());
break;
default:
player.sendMessage(ChatColor.RED + "Something went wrong with the creation of the Jail, please start over");
jm.removeJailCreationPlayer(player.getName());
break;
}
}
/** Applies the first step, which is setting the teleport in location. */
private void firstStep(JailManager jm, CreationPlayer cp, Player player) {
Vector v1 = jm.getJail(cp.getJailName()).getMinPoint().toVector().clone();
Vector v2 = jm.getJail(cp.getJailName()).getMaxPoint().toVector().clone();
Vector point = player.getLocation().toVector().clone();
if(Util.isInsideAB(point, v1, v2)) {
player.sendMessage(ChatColor.AQUA + "---------- Jail Cell Creation ----------");
player.sendMessage(ChatColor.GREEN + "Teleport point selected. Now select signs associated with this cell. You may select multiple signs. After you are done with the sign selection, right click on any non-sign block.");
player.sendMessage(ChatColor.AQUA + "----------------------------------------");
cp.setTeleportIn(player.getLocation());
cp.nextStep();
}else {
player.sendMessage(ChatColor.RED + "---------- Jail Cell Creation ----------");
player.sendMessage(ChatColor.RED + "Teleport point NOT selected. Please make sure that you are setting the teleport point inside the Jail's corners.");
player.sendMessage(ChatColor.RED + "----------------------------------------");
}
}
/** Applies the second step, which is adding signs to the cell. */
private void secondStep(CreationPlayer cp, Player player, Block block) {
if (block.getType() == Material.SIGN_POST || block.getType() == Material.WALL_SIGN) {
cp.addSign(new SimpleLocation(block.getLocation()));
player.sendMessage(ChatColor.GREEN + "Sign added, if you want to select another go ahead otherwise right click on any non-sign block.");
}else {
player.sendMessage(ChatColor.AQUA + "---------- Jail Cell Creation ----------");
player.sendMessage(ChatColor.GREEN + "Sign selection completed. Now select a double chest associated with this cell. If there is no chest click on any non-chest block. (Please note that having no chest may result in players items being lost.)");
player.sendMessage(ChatColor.AQUA + "----------------------------------------");
cp.nextStep();
}
}
/** Applies the third step, which is adding a chest or select not to have a chest. */
private void thirdStep(JailManager jm, CreationPlayer cp, Player player, Block block) {
Material bpos1 = block.getLocation().add(-1, 0, 0).getBlock().getType();
Material bpos2 = block.getLocation().add(+1, 0, 0).getBlock().getType();
Material bpos3 = block.getLocation().add(0, 0, -1).getBlock().getType();
Material bpos4 = block.getLocation().add(0, 0, +1).getBlock().getType();
if (block.getType() == Material.CHEST) {
if(bpos1 == Material.CHEST || bpos2 == Material.CHEST || bpos3 == Material.CHEST || bpos4 == Material.CHEST) {
cp.setChestLocation(block.getLocation());
player.sendMessage(ChatColor.AQUA + "---------- Jail Cell Creation ----------");
player.sendMessage(ChatColor.GREEN + "Chest selected.");
player.sendMessage(ChatColor.AQUA + "----------------------------------------");
}else {
player.sendMessage(ChatColor.RED + "Chest must be a double chest, chest not selected");
return;
}
}else {
player.sendMessage(ChatColor.AQUA + "---------- Jail Cell Creation ----------");
player.sendMessage(ChatColor.RED + "No chest selected.");
player.sendMessage(ChatColor.AQUA + "----------------------------------------");
}
finalStep(jm, cp, player);
}
private void finalStep(JailManager jm, CreationPlayer cp, Player player) {
Jail j = jm.getJail(cp.getJailName());
Cell c = new Cell(cp.getCellName());
c.addAllSigns(cp.getSigns());
c.setTeleport(cp.getTeleportInSL());
c.setChestLocation(cp.getChestLocation());
j.addCell(c);
jm.removeCellCreationPlayer(player.getName());
jm.addCreatingCell(player.getName(), j.getName(), "cell_n" + (j.getCellCount() + 1));
player.sendMessage(ChatColor.AQUA + "---------- Jail Cell Creation ----------");
player.sendMessage(ChatColor.GREEN + "Cell created. Now select the teleport point of the next cell, which is going to be named '" + jm.getCellCreationPlayer(player.getName()).getCellName() + "'. If you wish to stop creating cells, type /jailstop.");
player.sendMessage(ChatColor.AQUA + "----------------------------------------");
}
}
package com.graywolf336.jail.steps;
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
import org.bukkit.util.Vector;
import com.graywolf336.jail.JailManager;
import com.graywolf336.jail.Util;
import com.graywolf336.jail.beans.Cell;
import com.graywolf336.jail.beans.CreationPlayer;
import com.graywolf336.jail.beans.Jail;
import com.graywolf336.jail.beans.SimpleLocation;
/**
* Class for stepping a player through the Cell creation process, instance is stored in {@link JailManager}.
*
* @author graywolf336
* @since 3.0.0
* @version 1.0.1
*/
public class CellCreationSteps {
/** Sends the Cell Creation message for starting out. */
public void startStepping(Player player){
player.sendMessage(ChatColor.AQUA + "---------- Jail Cell Creation ----------");
player.sendMessage(ChatColor.GREEN + "First, you must select a teleport point for the cell! Move to the teleport point and then click anywhere with your wooden sword to set it.");
player.sendMessage(ChatColor.AQUA + "----------------------------------------");
if(player.getInventory().contains(Material.WOOD_SWORD)) {
int i = player.getInventory().first(Util.getWand());
if(i != -1) {
player.getInventory().setItem(i, player.getItemInHand());
player.setItemInHand(Util.getWand());
}
}else {
player.getInventory().addItem(Util.getWand());
}
}
/**
* Applies the next step in the Cell Creation process that involves a location, null if no location is needed.
*
* @param jm The {@link JailManager} instance.
* @param player The player who is doing the creating.
* @param cp The {@link CreationPlayer} instance
* @param location The location, null if none, being set.
*/
public void step(JailManager jm, Player player, CreationPlayer cp, Location location) {
switch(cp.getStep()) {
case 1:
firstStep(jm, cp, player);
break;
case 2:
secondStep(cp, player, location.getBlock());
break;
case 3:
thirdStep(jm, cp, player, location.getBlock());
break;
default:
player.sendMessage(ChatColor.RED + "Something went wrong with the creation of the Jail, please start over");
jm.removeJailCreationPlayer(player.getName());
break;
}
}
/** Applies the first step, which is setting the teleport in location. */
private void firstStep(JailManager jm, CreationPlayer cp, Player player) {
Vector v1 = jm.getJail(cp.getJailName()).getMinPoint().toVector().clone();
Vector v2 = jm.getJail(cp.getJailName()).getMaxPoint().toVector().clone();
Vector point = player.getLocation().toVector().clone();
if(Util.isInsideAB(point, v1, v2)) {
player.sendMessage(ChatColor.AQUA + "---------- Jail Cell Creation ----------");
player.sendMessage(ChatColor.GREEN + "Teleport point selected. Now select signs associated with this cell. You may select multiple signs. After you are done with the sign selection, right click on any non-sign block.");
player.sendMessage(ChatColor.AQUA + "----------------------------------------");
cp.setTeleportIn(player.getLocation());
cp.nextStep();
}else {
player.sendMessage(ChatColor.RED + "---------- Jail Cell Creation ----------");
player.sendMessage(ChatColor.RED + "Teleport point NOT selected. Please make sure that you are setting the teleport point inside the Jail's corners.");
player.sendMessage(ChatColor.RED + "----------------------------------------");
}
}
/** Applies the second step, which is adding signs to the cell. */
private void secondStep(CreationPlayer cp, Player player, Block block) {
if (block.getType() == Material.SIGN_POST || block.getType() == Material.WALL_SIGN) {
cp.addSign(new SimpleLocation(block.getLocation()));
player.sendMessage(ChatColor.GREEN + "Sign added, if you want to select another go ahead otherwise right click on any non-sign block.");
}else {
player.sendMessage(ChatColor.AQUA + "---------- Jail Cell Creation ----------");
player.sendMessage(ChatColor.GREEN + "Sign selection completed. Now select a double chest associated with this cell. If there is no chest click on any non-chest block. (Please note that having no chest may result in players items being lost.)");
player.sendMessage(ChatColor.AQUA + "----------------------------------------");
cp.nextStep();
}
}
/** Applies the third step, which is adding a chest or select not to have a chest. */
private void thirdStep(JailManager jm, CreationPlayer cp, Player player, Block block) {
Material bpos1 = block.getLocation().add(-1, 0, 0).getBlock().getType();
Material bpos2 = block.getLocation().add(+1, 0, 0).getBlock().getType();
Material bpos3 = block.getLocation().add(0, 0, -1).getBlock().getType();
Material bpos4 = block.getLocation().add(0, 0, +1).getBlock().getType();
if (block.getType() == Material.CHEST) {
if(bpos1 == Material.CHEST || bpos2 == Material.CHEST || bpos3 == Material.CHEST || bpos4 == Material.CHEST) {
cp.setChestLocation(block.getLocation());
player.sendMessage(ChatColor.AQUA + "---------- Jail Cell Creation ----------");
player.sendMessage(ChatColor.GREEN + "Chest selected.");
player.sendMessage(ChatColor.AQUA + "----------------------------------------");
}else {
player.sendMessage(ChatColor.RED + "Chest must be a double chest, chest not selected");
return;
}
}else {
player.sendMessage(ChatColor.AQUA + "---------- Jail Cell Creation ----------");
player.sendMessage(ChatColor.RED + "No chest selected.");
player.sendMessage(ChatColor.AQUA + "----------------------------------------");
}
finalStep(jm, cp, player);
}
private void finalStep(JailManager jm, CreationPlayer cp, Player player) {
Jail j = jm.getJail(cp.getJailName());
Cell c = new Cell(cp.getCellName());
c.addAllSigns(cp.getSigns());
c.setTeleport(cp.getTeleportInSL());
c.setChestLocation(cp.getChestLocation());
j.addCell(c);
jm.removeCellCreationPlayer(player.getName());
jm.addCreatingCell(player.getName(), j.getName(), "cell_n" + (j.getCellCount() + 1));
player.sendMessage(ChatColor.AQUA + "---------- Jail Cell Creation ----------");
player.sendMessage(ChatColor.GREEN + "Cell created. Now select the teleport point of the next cell, which is going to be named '" + jm.getCellCreationPlayer(player.getName()).getCellName() + "'. If you wish to stop creating cells, type /jailstop.");
player.sendMessage(ChatColor.AQUA + "----------------------------------------");
}
}

View File

@ -1,133 +1,144 @@
package com.graywolf336.jail.steps;
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.entity.Player;
import org.bukkit.util.Vector;
import com.graywolf336.jail.JailManager;
import com.graywolf336.jail.Util;
import com.graywolf336.jail.beans.CreationPlayer;
import com.graywolf336.jail.beans.Jail;
/**
* Class for stepping a player through the Jail creation process, instance is stored in {@link JailManager}.
*
* @author graywolf336
* @since 3.0.0
* @version 1.1.0
*/
public class JailCreationSteps {
/** Sends the Jail Creation message for starting out. */
public void startStepping(Player player) {
player.sendMessage(ChatColor.AQUA + "----------Jail Zone Creation----------");
player.sendMessage(ChatColor.GREEN + "First, you must select jail cuboid. Select the first point of the cuboid by right clicking on the block with your wooden sword. DO NOT FORGET TO MARK THE FLOOR AND CEILING TOO!");
player.sendMessage(ChatColor.AQUA + "--------------------------------------");
}
/**
* Applies the next step in the Jail Creation process that involves a location, null if no location is needed.
*
* @param jm The {@link JailManager} instance.
* @param player The player who is doing the creating.
* @param cp The {@link CreationPlayer} instance
* @param location The location, null if none, being set.
*/
public void step(JailManager jm, Player player, CreationPlayer cp, Location location) {
switch(cp.getStep()) {
case 1:
firstStep(cp, player, location);
break;
case 2:
secondStep(cp, player, location);
break;
case 3:
thirdStep(cp, player);
break;
case 4:
fourthStep(jm, cp, player);
break;
default:
player.sendMessage(ChatColor.RED + "Something went wrong with the creation of the Jail, please start over");
jm.removeJailCreationPlayer(player.getName());
break;
}
}
/** Applies the first step, which is setting the first corner. */
private void firstStep(CreationPlayer cp, Player p, Location location) {
p.sendMessage(ChatColor.AQUA + "---------- Jail Zone Creation----------");
p.sendMessage(ChatColor.GREEN + "First point selected. Now select the second point.");
p.sendMessage(ChatColor.AQUA + "---------------------------------------");
cp.setCornerOne(location);
cp.nextStep();
}
/** Applies the second step, which is setting the second corner. */
private void secondStep(CreationPlayer cp, Player p, Location location) {
p.sendMessage(ChatColor.AQUA + "---------- Jail Zone Creation ----------");
p.sendMessage(ChatColor.GREEN + "Second point selected. Now go inside the jail and right click anywhere to select your current position as the teleport location for the jail.");
p.sendMessage(ChatColor.AQUA + "----------------------------------------");
cp.setCornerTwo(location);
cp.nextStep();
}
/** Applies the third step, which is setting the teleport in location. */
private void thirdStep(CreationPlayer cp, Player p) {
int[] p1 = cp.getCornerOne();
int[] p2 = cp.getCornerTwo();
Vector v1 = new Vector(p1[0], p1[1], p1[2]);
Vector v2 = new Vector(p2[0], p2[1], p2[2]);
Vector point = p.getLocation().toVector().clone();
if(Util.isInsideAB(point, v1, v2)) {
p.sendMessage(ChatColor.AQUA + "---------- Jail Zone Creation ----------");
p.sendMessage(ChatColor.GREEN + "Teleport point selected. Now go outside of the jail and right click anywhere to select your current position as the location where people will be teleported after they are released from this jail.");
p.sendMessage(ChatColor.AQUA + "----------------------------------------");
cp.setTeleportIn(p.getLocation());
cp.nextStep();
} else {
p.sendMessage(ChatColor.RED + "---------- Jail Zone Creation ----------");
p.sendMessage(ChatColor.RED + "Teleport point NOT selected. Now go inside the jail and right click anywhere to select your current position as the teleport location for the jail. Point must be INSIDE the points selected for the Jail.");
p.sendMessage(ChatColor.RED + "----------------------------------------");
}
}
private void fourthStep(JailManager jm, CreationPlayer cp, Player p) {
int[] p1 = cp.getCornerOne();
int[] p2 = cp.getCornerTwo();
Vector v1 = new Vector(p1[0], p1[1], p1[2]);
Vector v2 = new Vector(p2[0], p2[1], p2[2]);
Vector point = p.getLocation().toVector().clone();
if(Util.isInsideAB(point, v1, v2)) {
p.sendMessage(ChatColor.RED + "---------- Jail Zone Creation ----------");
p.sendMessage(ChatColor.RED + "Teleport out point NOT selected. Go outside of the jail and right click anywhere to select your current position as the location where people will be teleported after they are released from this jail.");
p.sendMessage(ChatColor.RED + "----------------------------------------");
}else {
cp.setTeleportFree(p.getLocation());
finalStep(jm, cp, p);
}
}
private void finalStep(JailManager jm, CreationPlayer cp, Player p) {
Jail jail = new Jail(jm.getPlugin(), cp.getJailName());
jail.setMinPoint(cp.getCornerOne());
jail.setMaxPoint(cp.getCornerTwo());
jail.setTeleportIn(cp.getTeleportInSL());
jail.setTeleportFree(cp.getTeleportFreeSL());
jm.addJail(jail);
p.sendMessage(ChatColor.GREEN + "Jail (" + jail.getName() + ") created successfully!");
jm.removeJailCreationPlayer(p.getName());
}
}
package com.graywolf336.jail.steps;
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.util.Vector;
import com.graywolf336.jail.JailManager;
import com.graywolf336.jail.Util;
import com.graywolf336.jail.beans.CreationPlayer;
import com.graywolf336.jail.beans.Jail;
/**
* Class for stepping a player through the Jail creation process, instance is stored in {@link JailManager}.
*
* @author graywolf336
* @since 3.0.0
* @version 1.1.1
*/
public class JailCreationSteps {
/** Sends the Jail Creation message for starting out. */
public void startStepping(Player player) {
player.sendMessage(ChatColor.AQUA + "----------Jail Zone Creation----------");
player.sendMessage(ChatColor.GREEN + "First, you must select jail cuboid. Select the first point of the cuboid by right clicking on the block with your wooden sword. DO NOT FORGET TO MARK THE FLOOR AND CEILING TOO!");
player.sendMessage(ChatColor.AQUA + "--------------------------------------");
if(player.getInventory().contains(Material.WOOD_SWORD)) {
int i = player.getInventory().first(Util.getWand());
if(i != -1) {
player.getInventory().setItem(i, player.getItemInHand());
player.setItemInHand(Util.getWand());
}
}else {
player.getInventory().addItem(Util.getWand());
}
}
/**
* Applies the next step in the Jail Creation process that involves a location, null if no location is needed.
*
* @param jm The {@link JailManager} instance.
* @param player The player who is doing the creating.
* @param cp The {@link CreationPlayer} instance
* @param location The location, null if none, being set.
*/
public void step(JailManager jm, Player player, CreationPlayer cp, Location location) {
switch(cp.getStep()) {
case 1:
firstStep(cp, player, location);
break;
case 2:
secondStep(cp, player, location);
break;
case 3:
thirdStep(cp, player);
break;
case 4:
fourthStep(jm, cp, player);
break;
default:
player.sendMessage(ChatColor.RED + "Something went wrong with the creation of the Jail, please start over");
jm.removeJailCreationPlayer(player.getName());
break;
}
}
/** Applies the first step, which is setting the first corner. */
private void firstStep(CreationPlayer cp, Player p, Location location) {
p.sendMessage(ChatColor.AQUA + "---------- Jail Zone Creation----------");
p.sendMessage(ChatColor.GREEN + "First point selected. Now select the second point.");
p.sendMessage(ChatColor.AQUA + "---------------------------------------");
cp.setCornerOne(location);
cp.nextStep();
}
/** Applies the second step, which is setting the second corner. */
private void secondStep(CreationPlayer cp, Player p, Location location) {
p.sendMessage(ChatColor.AQUA + "---------- Jail Zone Creation ----------");
p.sendMessage(ChatColor.GREEN + "Second point selected. Now go inside the jail and right click anywhere to select your current position as the teleport location for the jail.");
p.sendMessage(ChatColor.AQUA + "----------------------------------------");
cp.setCornerTwo(location);
cp.nextStep();
}
/** Applies the third step, which is setting the teleport in location. */
private void thirdStep(CreationPlayer cp, Player p) {
int[] p1 = cp.getCornerOne();
int[] p2 = cp.getCornerTwo();
Vector v1 = new Vector(p1[0], p1[1], p1[2]);
Vector v2 = new Vector(p2[0], p2[1], p2[2]);
Vector point = p.getLocation().toVector().clone();
if(Util.isInsideAB(point, v1, v2)) {
p.sendMessage(ChatColor.AQUA + "---------- Jail Zone Creation ----------");
p.sendMessage(ChatColor.GREEN + "Teleport point selected. Now go outside of the jail and right click anywhere to select your current position as the location where people will be teleported after they are released from this jail.");
p.sendMessage(ChatColor.AQUA + "----------------------------------------");
cp.setTeleportIn(p.getLocation());
cp.nextStep();
} else {
p.sendMessage(ChatColor.RED + "---------- Jail Zone Creation ----------");
p.sendMessage(ChatColor.RED + "Teleport point NOT selected. Now go inside the jail and right click anywhere to select your current position as the teleport location for the jail. Point must be INSIDE the points selected for the Jail.");
p.sendMessage(ChatColor.RED + "----------------------------------------");
}
}
private void fourthStep(JailManager jm, CreationPlayer cp, Player p) {
int[] p1 = cp.getCornerOne();
int[] p2 = cp.getCornerTwo();
Vector v1 = new Vector(p1[0], p1[1], p1[2]);
Vector v2 = new Vector(p2[0], p2[1], p2[2]);
Vector point = p.getLocation().toVector().clone();
if(Util.isInsideAB(point, v1, v2)) {
p.sendMessage(ChatColor.RED + "---------- Jail Zone Creation ----------");
p.sendMessage(ChatColor.RED + "Teleport out point NOT selected. Go outside of the jail and right click anywhere to select your current position as the location where people will be teleported after they are released from this jail.");
p.sendMessage(ChatColor.RED + "----------------------------------------");
}else {
cp.setTeleportFree(p.getLocation());
finalStep(jm, cp, p);
}
}
private void finalStep(JailManager jm, CreationPlayer cp, Player p) {
Jail jail = new Jail(jm.getPlugin(), cp.getJailName());
jail.setMinPoint(cp.getCornerOne());
jail.setMaxPoint(cp.getCornerTwo());
jail.setTeleportIn(cp.getTeleportInSL());
jail.setTeleportFree(cp.getTeleportFreeSL());
jm.addJail(jail);
p.sendMessage(ChatColor.GREEN + "Jail (" + jail.getName() + ") created successfully!");
jm.removeJailCreationPlayer(p.getName());
}
}

View File

@ -1,11 +1,12 @@
system:
configVersion: 3
debug: false
updateNotifications: true
storage:
type: 'flatfile' #can be flatfile, sqlite, or mysql
mysql:
host: 'localhost'
port: 3306
username: 'root'
system:
configVersion: 3
debug: false
language: 'en'
updateNotifications: true
storage:
type: 'flatfile' #can be flatfile, sqlite, or mysql
mysql:
host: 'localhost'
port: 3306
username: 'root'
password: 'password'