aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/api/analytics
diff options
context:
space:
mode:
authorJordan Byrne <draknyte1@hotmail.com>2018-01-29 18:45:40 +1000
committerJordan Byrne <draknyte1@hotmail.com>2018-01-29 18:45:40 +1000
commit0828168a736692402bd621b984c2d35590ed9730 (patch)
treefb9da5ea4836544b6278364db449ed5cebf52696 /src/Java/gtPlusPlus/api/analytics
parent33a1703896cbc37b9986c71038e20c659edb7814 (diff)
downloadGT5-Unofficial-0828168a736692402bd621b984c2d35590ed9730.tar.gz
GT5-Unofficial-0828168a736692402bd621b984c2d35590ed9730.tar.bz2
GT5-Unofficial-0828168a736692402bd621b984c2d35590ed9730.zip
+ Added Trinium Titanium Cable/wires.
+ Redid material components to better use GT texture assets. % Gave all 32 ore types new TextureSets. % Doubled capacity of all fluid pipes. % Moved Item/Block creation from init() to preInit(). $ Fixed Sludge fluid texture. $ Moved Darkworld from being a child mod into it's own mod, Renamed to Toxic Everglades. $ Bundled SegmentHelper.java, for future development ease.
Diffstat (limited to 'src/Java/gtPlusPlus/api/analytics')
-rw-r--r--src/Java/gtPlusPlus/api/analytics/SegmentHelper.java81
1 files changed, 81 insertions, 0 deletions
diff --git a/src/Java/gtPlusPlus/api/analytics/SegmentHelper.java b/src/Java/gtPlusPlus/api/analytics/SegmentHelper.java
new file mode 100644
index 0000000000..6e264fe1d2
--- /dev/null
+++ b/src/Java/gtPlusPlus/api/analytics/SegmentHelper.java
@@ -0,0 +1,81 @@
+package gtPlusPlus.api.analytics;
+
+import com.segment.analytics.Analytics;
+import com.segment.analytics.Callback;
+import com.segment.analytics.messages.Message;
+import com.segment.analytics.messages.TrackMessage;
+import com.segment.analytics.messages.*;
+import java.util.Map;
+
+public class SegmentHelper implements Callback {
+
+ /**
+ * Credits to Author: FLAMINSAGANAKI/Theodore Mavrakis
+ * http://domisydev.com/2015/11/05/using-segment-analytics-in-your-java-servlet/
+ */
+
+ private static final String writeKey = "EDOWl9peleGlUqe1ZwTqKDyuTMFhyT4k";
+ private static volatile SegmentHelper segment = new SegmentHelper();
+ private Analytics analytics;
+
+ public SegmentHelper(){
+ try{
+ this.analytics = Analytics.builder(writeKey).callback(this).build();
+ }catch(Exception e){
+ SegmentAnalytics.LOG("exception while creating Analytics : " + e);
+ }
+ }
+
+ public static SegmentHelper getInstance(){
+ return segment;
+ }
+
+ public Analytics getAnalyticsClient(){
+ return segment.analytics;
+ }
+
+ public void success(Message message) {
+ SegmentAnalytics.LOG("Successfully uploaded " + message);
+ }
+
+ public void failure(Message message, Throwable throwable) {
+ SegmentAnalytics.LOG("Could not upload " + message);
+ }
+
+ public void addUser(String user_id, Map<String, Object> properties) {
+ try {
+ this.analytics.enqueue(IdentifyMessage.builder().userId(user_id).traits(properties));
+ //trackUser(user_id, "Logged In", properties);
+ } catch (Exception e) {
+ SegmentAnalytics.LOG("Exception in addUser() - " + e);
+ }
+ }
+
+ public void trackUser(String user_id, String description, Map<String, Object> properties) {
+ try {
+ this.analytics.enqueue(TrackMessage.builder(description).userId(user_id).properties(properties));
+ } catch (Exception e) {
+ SegmentAnalytics.LOG("Exception in trackUser() - " + e);
+ }
+ }
+
+ public void trackUser(String user_id, String description) {
+ try {
+ this.analytics.enqueue(TrackMessage.builder(description).userId(user_id));
+ } catch (Exception e) {
+ SegmentAnalytics.LOG("Exception in trackUser() - " + e);
+ }
+ }
+
+ public void groupUser(String group_id, String user_id) {
+ try {
+ this.analytics.enqueue(GroupMessage.builder(group_id).userId(user_id));
+ } catch (Exception e) {
+ SegmentAnalytics.LOG("Exception in groupUser() - " + e);
+ }
+ }
+
+ public static void main(String[] args){
+
+ }
+} \ No newline at end of file