Skip to content

Commit

Permalink
Now using MCStats.
Browse files Browse the repository at this point in the history
  • Loading branch information
jamierocks committed Dec 14, 2014
1 parent ccf97ac commit da41278
Show file tree
Hide file tree
Showing 2 changed files with 85 additions and 52 deletions.
127 changes: 75 additions & 52 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,58 +1,81 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>unomodding.canary</groupId>
<artifactId>playtimelimiter</artifactId>

<name>PlayTimeLimiter</name>
<url>https://github.com/UnoModding/Canary-PlayTimeLimiter</url>
<description>PlayTimeLimiter is a CanaryLib plugin for Minecraft servers to only allow players to limit the amount of time players spend on your server.</description>
<version>0.3</version>
<inceptionYear>2014</inceptionYear>
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<repositories>
<repository>
<id>vi-repo</id>
<url>http://repo.visualillusionsent.net/repository/public</url>
</repository>
</repositories>
<groupId>unomodding.canary</groupId>
<artifactId>playtimelimiter</artifactId>

<dependencies>
<dependency>
<groupId>net.canarymod</groupId>
<artifactId>CanaryLib</artifactId>
<version>1.1.2</version>
<scope>provided</scope>
</dependency>
</dependencies>
<name>PlayTimeLimiter</name>
<url>https://github.com/UnoModding/Canary-PlayTimeLimiter</url>
<description>PlayTimeLimiter is a CanaryLib plugin for Minecraft servers to only allow players to limit the amount of time players spend on your server.</description>
<version>0.3</version>
<inceptionYear>2014</inceptionYear>

<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>vi-repo</id>
<url>http://repo.visualillusionsent.net/repository/public</url>
</repository>
<repository>
<id>Plugin Metrics</id>
<url>http://repo.mcstats.org/content/repositories/public</url>
</repository>
</repositories>

<dependencies>
<dependency>
<groupId>net.canarymod</groupId>
<artifactId>CanaryLib</artifactId>
<version>1.1.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.mcstats.canary</groupId>
<artifactId>metrics</artifactId>
<version>R8-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
</dependencies>

<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<configuration>
<artifactSet>
<includes>
<include>org.mcstats.*:*</include>
</includes>
</artifactSet>
<relocations>
<relocation>
<pattern>org.mcstats</pattern>
<shadedPattern>unomodding.canary.playtimelimiter.mcstats</shadedPattern>
</relocation>
</relocations>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
import java.util.Map;
import java.util.Timer;

import org.mcstats.Metrics;

import net.canarymod.Canary;
import net.canarymod.chat.Colors;
import net.canarymod.commandsys.CommandDependencyException;
Expand Down Expand Up @@ -100,6 +102,14 @@ public boolean enable() {
this.checkPlayTimeTimer.scheduleAtFixedRate(new PlayTimeCheckerTask(this), 30000, getConfig()
.getInt("secondsBetweenPlayTimeChecks") * 1000);
}

// Metrics
try {
Metrics metrics = new Metrics(this);
metrics.start();
} catch (IOException e) {
getLogman().info("Failed to send data to Metrics", e);
}
return true;
}

Expand Down

0 comments on commit da41278

Please sign in to comment.