Skip to content
This repository has been archived by the owner on Nov 12, 2018. It is now read-only.

Commit

Permalink
Add config option to collect event data
Browse files Browse the repository at this point in the history
  • Loading branch information
RobertHerhold committed Jun 15, 2017
1 parent 796b1fd commit ee325aa
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/main/java/io/badgeup/sponge/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@ public String getBaseAPIURL() {
public int getEventPoolConnections() {
return this.eventPoolConnections;
}

@Setting("collect-event-data") private boolean collectEventData = false;

public boolean collectEventData() {
return this.collectEventData;
}

}

@Setting("badgeup") private BadgeUpConfig bUpConfig = new BadgeUpConfig();
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/io/badgeup/sponge/event/BadgeUpEvent.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.badgeup.sponge.event;

import io.badgeup.sponge.BadgeUpSponge;
import io.badgeup.sponge.util.JSONSerializable;
import io.badgeup.sponge.util.ObjectSerializers;
import org.json.JSONArray;
Expand Down Expand Up @@ -64,6 +65,10 @@ public UUID getSubject() {
*/
@SuppressWarnings("rawtypes")
public void addDataEntry(final String key, Object value) {
if (!BadgeUpSponge.getConfig().getBadgeUpConfig().collectEventData()) {
return;
}

if (value instanceof Player || value instanceof Cause || value instanceof Class) {
return;
}
Expand Down

0 comments on commit ee325aa

Please sign in to comment.