Changed Filepaths for Player Metrics #44

Merged
alisolarflare merged 1 commit from PlayerMetrics into master 2016-12-24 08:21:14 +00:00

View file

@ -11,15 +11,20 @@ import buttondevteam.alipresents.components.metrics.files.MetricsFile;
import buttondevteam.alipresents.components.metrics.output.GetLoginMetrics; import buttondevteam.alipresents.components.metrics.output.GetLoginMetrics;
public class MetricsComponent extends Component{ public class MetricsComponent extends Component{
String defaultPath = "src/alisolarflare/resources"; String defaultPath;
String defaultFilePath = (defaultPath + "/metrics.txt"); String defaultFilePath;
String playerLoginsFilePath = (defaultPath + "/playerLogins.txt"); String playerLoginsFilePath;
public MetricsFile playerLoginsFile; // DATA - STRING public MetricsFile playerLoginsFile; // DATA - STRING
public List<String> metricsList; public List<String> metricsList;
@Override @Override
public void register(JavaPlugin plugin){ public void register(JavaPlugin plugin){
defaultPath = plugin.getDataFolder().getAbsolutePath();
defaultFilePath = defaultPath + "/metrics.txt";
playerLoginsFilePath = defaultPath + "/playerLogins.txt";
playerLoginsFile = new MetricsFile(playerLoginsFilePath); playerLoginsFile = new MetricsFile(playerLoginsFilePath);
registerCommand(plugin, new GetLoginMetrics(this)); registerCommand(plugin, new GetLoginMetrics(this));
registerListener(plugin, new PlayerJoinListener(this, playerLoginsFile)); registerListener(plugin, new PlayerJoinListener(this, playerLoginsFile));