gmemstr / mcpluginstats

Analytics project for Minecraft plugins

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MC Plugin Stats

[TOC]

Overview

MC Plugin Stats was originally developed as a way to track which servers use the developers plugins, and provide an easy way to view the information. However, it has since ceased development and I'm open sourcing it.

Setup

MC Plugin Stats requires a few things to work:

  1. A UserApp.io API key (replace all instances of USERAPP_API_KEY)
  2. A MySQL database named mcpluginstats.
  3. A PHP web host.

Database layout

Name: mcpluginstats

plugins

user api_key description srvnum name
text text mediumtext int(11) text

servers

srvip srvport online api_key srvname
text smallint boolean mediumtext text

Documentation

The documentation source and compiled HTML can be found in /api/. The Slate markdown is in /api/slate/source/index.md. It includes what data to send to the server, and the data returned.

Java Plugin

The Minecraft server plugin is completely optional, but helps if you are using the platform for Minecraft server plugins. It can be found in /java/plugin/src. It can be used like so:

// Main java class
int port = Bukkit.getPort();
Track track = new Track();

@Override
public void onEnable(){
	if(Bukkit.getPluginManager().getPlugin("Plugin Tracker") != null){
		track.DoIt(port, 1);
	}
}
// Track.java
import com.gabrielsimmer.tracker.Tracker;

public class Track {
	public void DoIt(int port, int online){
		try{
			Tracker tracker = new Tracker();
			tracker.Send("KEY", port, online);
		}catch(Exception e){
			System.out.println("Tracker not insralled.");
		}
	}
}

About

Analytics project for Minecraft plugins

License:MIT License


Languages

Language:PHP 84.6%Language:HTML 10.5%Language:Java 2.5%Language:CSS 1.8%Language:JavaScript 0.6%