/*! \mainpage Katana API Java library
*
* \section intro_sec Introduction
* The Ninja Metrics JSON API allows you to push your
* application's user data into our pipeline.
*/
/*
* Ninja Metrics
* Copyright 2012
* Build-Id: EMPTY
*/
package com.ninjametrics.kapi;
import java.net.URISyntaxException;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;
import com.ninjametrics.constants.AuthRequestConstants;
import com.ninjametrics.constants.DataMapKeys;
import com.ninjametrics.constants.EventCodes;
import com.ninjametrics.constants.LocationConstants;
import com.ninjametrics.models.DateObj;
import com.ninjametrics.models.EventObj;
import com.ninjametrics.thread.LazyProcessingThread;
/**
* KApi Java library object definition
*
* @author Moumita Biswas
*/
public class KApi {
private final long myApiClientId;
private final long myApiAppId;
private final String accessToken;
private static LazyProcessingThread<EventObj> myEventThread = null;
/**
* create a KApi object with a certain client_id and app_id
*
* @param theClientId long
* @param theAppId long
* @param accessToken String
*/
public KApi(final long theClientId, final long theAppId, final String accessToken) {
this.myApiClientId = theClientId;
this.myApiAppId = theAppId;
this.accessToken = accessToken;
JsonPost<EventObj> aJsonPostEvent;
try {
aJsonPostEvent = new JsonPost<EventObj>(LocationConstants.API_BASE
+ LocationConstants.EVENT_BASE + "?"
+ AuthRequestConstants.API_PARAM_CLIENT_ID + "="
+ this.myApiClientId + "&"
+ AuthRequestConstants.API_PARAM_APP_ID + "="
+ this.myApiAppId + "&"
+ AuthRequestConstants.API_TOKEN + "="
+ this.accessToken + "&"
+ AuthRequestConstants.API_PARAM_CLIENT_USER_AGENT
+ "=" + AuthRequestConstants.API_LIBRARY_USER_AGENT);
} catch (final URISyntaxException ex) {
Logger.getLogger(KApi.class.getName()).log(Level.SEVERE, null, ex);
return;
}
KApi.myEventThread = new LazyProcessingThread<EventObj>(aJsonPostEvent);
}
/**
* stops and removes LazyProcessingThread. once this is called, must create
* a new KApi object.
*/
private void destroy() {
if (KApi.myEventThread != null) {
try {
KApi.myEventThread.interrupt();
} catch (final SecurityException ex) {
Logger.getLogger(KApi.class.getName()).log(Level.WARNING, null,
ex);
}
KApi.myEventThread = null;
}
}
/**
* should only be used by the Garbage Collector
*/
@Override
public void finalize() throws Throwable {
//this.destroy();
super.finalize();
}
/**
* load Account creation data. this must be run once per Account Id, before
* referencing said Account Id in any other logging statements.
*
* @param theDate Date - when was the Account created?
* @param theAccountId String - the Account UUID to initialize
* @param theAccountType String - acceptable values: Free, Paid, Premium
* @param theAccLang String - case sensitive IETF language tag - RFC 4646.
* from geonames.org/countries
* @param theAccCountry String - ISO-3166 alpha2 from geonames.org/countries
* @param theAccGender String - acceptable values: M, F, T
* @param theAccDateOfBirth Date - the reported DOB of the Account user
* @param theAccCurrencyBal float - OPTIONAL: insert 0 if unused.
* @param thePlatform String - what platform was the Account created on?
* user-agent string, "mobile" or, "desktop". open-ended, but
* should be used consistently.
* @return boolean - added to the log queue successfully?
*/
@Deprecated
public boolean loadAccountCreate(final Date theDate,
final String theAccountId, final String theAccountType,
final String theAccLang, final String theAccCountry,
final String theAccGender, final Date theAccDateOfBirth,
final float theAccCurrencyBal, final String thePlatform) {
return loadAccountCreate(theDate, theAccountId, theAccountType, theAccLang, theAccCountry, theAccGender, theAccDateOfBirth, theAccCurrencyBal, thePlatform, null);
}
/**
* Logs an Account Create event- Information regarding when the account was created as well as information
* about the demographics of the account and the balance at the time of account
* creation. This must be run once per Account Id, before referencing
* said Account Id in any other logging statements.
*
*
* @param theDate Date - when was the Account created?
* @param theAccountId String (MANDATORY Field) - the Account UUID to initialize
* @param theAccountType String (MANDATORY Field) - acceptable values are: "Free", "Paid", "Premium"
* Default set = "Free"
* @param theAccLang String (MANDATORY Field) - case sensitive IETF language tag - RFC 4646.
* from geonames.org/countries
* Default set = "N0"
* @param theAccCountry String (MANDATORY Field) - ISO-3166 alpha2 from geonames.org/countries
* Default set = "N0"
* @param theAccGender String (MANDATORY Field) - acceptable values are: "M", "F", "N".
* Default set = "N"
* @param theAccDateOfBirth Date (MANDATORY Field) - the reported DOB of the Account user.
* Default - '1900-01-01 00:00:00.0000000'
* @param theAccCurrencyBal Float (OPTIONAL Field) - Default set = 0.00
* @param thePlatform String (MANDATORY Field) - What platform was the Account created on, Acceptable values are : Web-Facebook
* Mobile-Facebook, Android-Facebook, iOS-Facebook, Web-GooglePlus, Mobile-GooglePlus,
* Android-GooglePlus, iOS-GooglePlus,PC, Desktop, Other-Social, Other .
* Default set = "Other"
* @param theOldAccountId (OPTIONAL Field) - String, Default = "".
*
*
*/
public boolean loadAccountCreate(final Date theDate,
final String theAccountId, final String theAccountType,
final String theAccLang, final String theAccCountry,
final String theAccGender, final Date theAccDateOfBirth,
final float theAccCurrencyBal, final String thePlatform,
final String theOldAccountId) {
final HashMap<String, String> aDataMap = new HashMap<String, String>();
aDataMap.put(DataMapKeys.TYPE,
String.valueOf(EventCodes.ACCOUNT_CREATE));
aDataMap.put(DataMapKeys.ACCOUNT_ID, theAccountId);
aDataMap.put(DataMapKeys.ACCOUNT_SUBSCRIPTION_TYPE, theAccountType);
aDataMap.put(DataMapKeys.ACCOUNT_LANGUAGE, theAccLang);
aDataMap.put(DataMapKeys.ACCOUNT_COUNTRY, theAccCountry);
aDataMap.put(DataMapKeys.ACCOUNT_GENDER, theAccGender);
aDataMap.put(DataMapKeys.ACCOUNT_DATE_OF_BIRTH,
EventObj.getISO8601Str(theAccDateOfBirth));
aDataMap.put(DataMapKeys.ACCOUNT_CURRENCY_BALANCE,
String.valueOf(theAccCurrencyBal));
aDataMap.put(DataMapKeys.PLATFORM, thePlatform);
aDataMap.put(DataMapKeys.OLD_ACCOUNT_ID, theOldAccountId);
return this.logEvent(aDataMap, theDate);
}
/**
* load Account deletion data. this must be run once per Account Id life
* cycle, to properly keep application metrics in-sync.
*
* @param theDate Date - when did the Account deletion occur?
* @param theAccountId String - the Account UUID that was deleted
* @param theChurnType String - acceptable values: Stopped, Expired, Failed,
* Cancelled
* @param isFarmer boolean - was this deleted Account a gold farmer?
* @param isIntegrity boolean - was this deleted Account's integrity
* compromised?
* @return boolean - added to the log queue successfully?
*/
@Deprecated
public boolean loadAccountDelete(final Date theDate,
final String theAccountId, final String theChurnType,
final boolean isFarmer, final boolean isIntegrity) {
return loadAccountDelete(theDate, theAccountId, theChurnType);
}
/**
* Logs a Delete Account event- Information regarding account delete as well as reason regarding account
* deletion in terms of churn, farming or account compromise. This must be run
* once per Account Id life cycle, to properly keep application metrics in-sync.
*
*
* @param theDate Date - when did the Account deletion occur?
* @param theAccountId String (MANDATORY Field) - the Account UUID that was deleted - MANDATORY Field
* @param theChurnType String (MANDATORY Field) - acceptable values are: Active, Stopped, Expired, Failed, Cancelled
* Default - "Stopped"
*
**/
public boolean loadAccountDelete(final Date theDate,
final String theAccountId, final String theChurnType) {
final HashMap<String, String> aDataMap = new HashMap<String, String>();
aDataMap.put(DataMapKeys.TYPE,
String.valueOf(EventCodes.ACCOUNT_DELETE));
aDataMap.put(DataMapKeys.ACCOUNT_ID, theAccountId);
aDataMap.put(DataMapKeys.ACCOUNT_STATUS, theChurnType);
return this.logEvent(aDataMap, theDate);
}
/**
* Logs a Character Create event- Many games allow the user to create multiple characters or aliases.
* The attributes of these characters need not be the same as the attributes of the person
* in the real world e.g., age or gender. The attributes of the characters are usually fixed
* once created. This event captures information regarding the creation time and the attributes
* of a user's character. This must be run once per Character Id before referencing said
* Character Id in any other logging statements.
*
* @param theDate Date - when did the character creation happen?
* @param theAccountId String (MANDATORY Field) - previously initialized Account UUID
* @param theCharacterId String (MANDATORY Field) - the Account unique Character Id to initialize
* Default: AccountId should be used as default if there's no CharacterId
* @param theCharClass String (MANDATORY Field) - higher-level Character Class. open-ended, but be consistent
* Default - NA
* @param theCharSubClass String (MANDATORY Field) - further specific classification
* Default - NA
* @param theCharGender String (MANDATORY Field) - the Character's gender acceptable values are: "M", "F", "T".
* Default should be "NA"
* @param theCharRace String (MANDATORY Field) - Character's in-game race
* Default - NA
* @param theCharName String (MANDATORY Field) - the name of the in-game Character
* Default - NA
* @param theShardId long (OPTIONAL Field) - a particular db the Character is associated with.
* Default - Use 0 if unused or does not have a value
*
**/
public boolean loadCharacterCreate(final Date theDate,
final String theAccountId, final String theCharacterId,
final String theCharClass, final String theCharSubClass,
final String theCharGender, final String theCharRace,
final String theCharName, final long theShardId) {
final HashMap<String, String> aDataMap = new HashMap<String, String>();
aDataMap.put(DataMapKeys.TYPE,
String.valueOf(EventCodes.CHARACTER_CREATE));
aDataMap.put(DataMapKeys.ACCOUNT_ID, theAccountId);
aDataMap.put(DataMapKeys.CHARACTER_ID, theCharacterId);
aDataMap.put(DataMapKeys.CHARACTER_CLASS, theCharClass);
aDataMap.put(DataMapKeys.CHARACTER_SUB_CLASS, theCharSubClass);
aDataMap.put(DataMapKeys.CHARACTER_GENDER, theCharGender);
aDataMap.put(DataMapKeys.CHARACTER_RACE, theCharRace);
aDataMap.put(DataMapKeys.CHARACTER_NAME, theCharName);
aDataMap.put(DataMapKeys.SHARD_ID, String.valueOf(theShardId));
return this.logEvent(aDataMap, theDate);
}
/**
* Logs a Character Delete event- This event refers to the character deletion info and
* the characters that are referred to here are the same as in event (11).
* This must be at the end of a Character lifecycle, to properly keep application metrics in-sync.
*
* @param theDate Date - when was the Character deleted?
* @param theAccountId String (MANDATORY Field) - previously initialized Account UUID
* @param theCharacterId String (MANDATORY Field) - identifier of Character that was deleted from the Account
* Default: No default value
*
**/
public boolean loadCharacterDelete(final Date theDate,
final String theAccountId, final String theCharacterId) {
final HashMap<String, String> aDataMap = new HashMap<String, String>();
aDataMap.put(DataMapKeys.TYPE,
String.valueOf(EventCodes.CHARACTER_DELETE));
aDataMap.put(DataMapKeys.ACCOUNT_ID, theAccountId);
aDataMap.put(DataMapKeys.CHARACTER_ID, theCharacterId);
return this.logEvent(aDataMap, theDate);
}
/**
* Logs an Item Initialize event- This event capture information regarding virtual items in the game.
* These items may be available by non-player characters in the game or they may
* be created by other players. Since this event initializes the items it can be thought
* of as initializing the dimension table for the items which is then referred to by all
* other item related events. This must be used before referencing an item id in any other command.
*
* @param theDate Date - when was the item created?
* @param theItemId long (MANDATORY Field) - the item's application unique id
* Default - Use 0 for default value
* @param theItemName String (MANDATORY Field) - examples: "the ban hammer", "FISH", "KITTEN"
* Default - send "NA", if does not have a meaningful value
* @param theItemType String (MANDATORY Field) - examples: Raw Materials, Mounts And Pets, Weapons, Armor, Upgrades,
* Buffs And Enchantments, Display Items, Aesthetic Items, Housing, Vehicle, Vendor Trash,
* Containers, Tools, Other
* Default - "Other" *
* @param theItemSegment String (MANDATORY Field) - acceptable values are : "UGC" or "INGAME"
* @param createAccountId String (OPTIONAL Field) - if theItemSegment = "UGC", set this must
* @param createCharacterId String (OPTIONAL Field) - if a particular character created the item.
* Default: theItemSegment = "UGC", createAccountId should be used as default
*/
public boolean loadItem(final Date theDate,
final long theItemId, final String theItemName,
final String theItemType, final String theItemSegment,
final String createAccountId, final String createCharacterId) {
final HashMap<String, String> aDataMap = new HashMap<String, String>();
aDataMap.put(DataMapKeys.TYPE,
String.valueOf(EventCodes.ITEM_INIT));
aDataMap.put(DataMapKeys.ITEM_ID, String.valueOf(theItemId));
aDataMap.put(DataMapKeys.ITEM_NAME, theItemName);
aDataMap.put(DataMapKeys.ITEM_TYPE, theItemType);
aDataMap.put(DataMapKeys.ITEM_SEGMENT, theItemSegment);
aDataMap.put(DataMapKeys.ACCOUNT_ID, createAccountId);
aDataMap.put(DataMapKeys.CHARACTER_ID, createCharacterId);
return this.logEvent(aDataMap, theDate);
}
/**
* Logs Shard Initialize event- Many games and environment have multiple instances of the games
* which are running in parallel. These are referred to as shard in our schema.
* These are the same as running multiple instances of the game or other environments
* on different servers. This must occur before any logger or load command references the Shard Id.
*
* @param theDate Date - when was the Shard created?
* @param theShardId long (MANDATORY Field) - numeric UUID of the Shard
* @param theShardDesc String (MANDATORY Field) - text description of the Shard
* Default - NA
*/
public boolean loadShardCreate(final Date theDate, final long theShardId,
final String theShardDesc) {
final HashMap<String, String> aDataMap = new HashMap<String, String>();
aDataMap.put(DataMapKeys.TYPE, String.valueOf(EventCodes.SHARD_INIT));
aDataMap.put(DataMapKeys.SHARD_ID, String.valueOf(theShardId));
aDataMap.put(DataMapKeys.SHARD_DESCRIPTION, theShardDesc);
return this.logEvent(aDataMap, theDate);
}
/**
* Logs Virtual Currency Set event- Many games have one or more virtual currencies which the
* players can use to exchange in game virtual items or other in-game resources.
* In most cases these virtual currencies have an exchange rate that captures their
* corresponding value in real world currency e.g., US Dollar, Yen, Euro etc.initialize
* a virtual currency for application reporting. This can be used to create a virtual currency
* and update an exchange rate of an existing currency.
* @param theDate Date - when was this created?
* @param theCurrencyLabel String (MANDATORY Field) - application unique string identifier
*
*/
public boolean loadVirtualCurrency(final Date theDate, final String theCurrencyLabel) {
final HashMap<String, String> aDataMap = new HashMap<String, String>();
aDataMap.put(DataMapKeys.TYPE, String.valueOf(EventCodes.VIRTUAL_CURRENCY_SET));
aDataMap.put(DataMapKeys.CURRENCY_VIRTUAL_LABEL, theCurrencyLabel);
return this.logEvent(aDataMap, theDate);
}
/**
* Logs a Currency Transaction event- Covers all types of transaction in the game or any other environment where
* real world money was used
*
* @param theDate Date - when did the transaction happen?
* @param theAccountId String (MANDATORY Field) - previously initialized Account UUID
* @param theCharacterId String (MANDATORY Field) - does an account have multiple characters associated with it?
* use this field to track such identifiers.
* Default - AccountId should be used as default if there's no CharacterId
* @param theShardId long (OPTIONAL Field) - a particular db the Character is associated with.
* Default - Use 0 if unused or does not have a value
* @param theTransactionType Integer (MANDATORY Field) - acceptable values are: 0 = SPENT or 1 = ACQUIRED currency
* @param theCurrencyType Integer (MANDATORY Field) - acceptable values are: 0 = real world, 1 = virtual
* @param theVirtualCurrencyLbl String (OPTIONAL Field) - a virtual currency previously initialized from Event #14.
* If theCurrencyType = 1, set this Mandatory, else send " ".
* @param theCurrencyValue float (OPTIONAL Field) - how much of a particular currency was used for this transaction *
* @param theTransactionDesc String (OPTIONAL Field) - maximum of 200 characters
* Default - Use "NA" if not used or does not have a description
* @param theVirtualCurrencyCount Integer (OPTIONAL Field) - Default - NULL
*/
public boolean logCurrencyTransaction(final Date theDate, final String theAccountId,
final String theCharacterId, final long theShardId,
final int theTransactionType, final int theCurrencyType,
final String theVirtualCurrencyLbl, final float theCurrencyValue,
final String theTransactionDesc, final int theVirtualCurrencyCount) {
final HashMap<String, String> aDataMap = new HashMap<String, String>();
aDataMap.put(DataMapKeys.TYPE, String.valueOf(EventCodes.CURRENCY_TRANSACTION));
aDataMap.put(DataMapKeys.ACCOUNT_ID, theAccountId);
aDataMap.put(DataMapKeys.CHARACTER_ID, theCharacterId);
aDataMap.put(DataMapKeys.SHARD_ID, String.valueOf(theShardId));
aDataMap.put(DataMapKeys.TRANSACTION_TYPE, String.valueOf(theTransactionType));
aDataMap.put(DataMapKeys.CURRENCY_TYPE, String.valueOf(theCurrencyType));
aDataMap.put(DataMapKeys.CURRENCY_VIRTUAL_LABEL, theVirtualCurrencyLbl);
aDataMap.put(DataMapKeys.CURRENCY_VALUE, String.valueOf(theCurrencyValue));
aDataMap.put(DataMapKeys.TRANSACTION_DESCRIPTION, theTransactionDesc);
aDataMap.put(DataMapKeys.CURRENCY_VIRTUAL_COUNT, String.valueOf(theVirtualCurrencyCount));
return this.logEvent(aDataMap, theDate);
}
/**
* Logs a UGC Rating event- Some games allow players to create in-game items or other artifacts.
* This event covers such items and how such items are rated by other players.
*
* @param theDate Date - when did the rating occur?
* @param theAccountId String (MANDATORY Field) - the UUID associated with a particular user/player - email, number
* @param theCharacterId String (MANDATORY Field) - does an account have multiple characters associated with it?
* use this field to track such identifiers.
* Default - AccountId should be used as default if there's no CharacterId
* @param theShardId long (OPTIONAL Field) - a particular db the Character is associated with.
* Default - Use 0 if unused or does not have a value
* @param theItemId long (MANDATORY Field) - the application unique numeric id
* Default - Use 0 for default value
* @param theItemName String (MANDATORY Field) - example: "crafty button", "GMO grain"
* Default - "NA"
* @param theUgcRating VOID (MANDATORY Field) - score given to UGC item by other players. Player may rate any item,
* owned or not - similar to FB like.
* Default - 1
*/
public boolean loadUgcRating(final Date theDate, final String theAccountId,
final String theCharacterId, final long theShardId,
final long theItemId, final String theItemName,
final int theUgcRating) {
final HashMap<String, String> aDataMap = new HashMap<String, String>();
aDataMap.put(DataMapKeys.TYPE, String.valueOf(EventCodes.ITEM_INIT_UGC_RATING));
aDataMap.put(DataMapKeys.ACCOUNT_ID, theAccountId);
aDataMap.put(DataMapKeys.CHARACTER_ID, theCharacterId);
aDataMap.put(DataMapKeys.SHARD_ID, String.valueOf(theShardId));
aDataMap.put(DataMapKeys.ITEM_ID, String.valueOf(theItemId));
aDataMap.put(DataMapKeys.ITEM_NAME, theItemName);
aDataMap.put(DataMapKeys.RATING_USER_GENERATED_CONTENT, String.valueOf(theUgcRating));
return this.logEvent(aDataMap, theDate);
}
/**
* Logs a Group Entry event- The time at which a user joins a group. The group in this case are likely to be impermanent.
* Grouping is not applicable to solo games
*
* @param theDate Date - when did the user/player enter the Group?
* @param theAccountId String (MANDATORY Field) - the UUID associated with a particular user/player - email, number
* @param theCharacterId String (MANDATORY Field) - does an account have multiple characters associated with it?
* use this field to track such identifiers.
* Default - AccountId should be used as default if there's no CharacterId
* @param theCharacterLvl long (MANDATORY Field) - the numeric level identifier the character currently is at.
* Default - '0'
* @param theShardId long (OPTIONAL Field) - a particular db the Character is associated with
* Default - Use 0 if unused or does not have a value
* @param theGroupId long (MANDATORY Field) - the id number of the group that was entered
*/
public boolean logEnterGroup(final Date theDate,
final String theAccountId, final String theCharacterId,
final long theCharacterLvl, final long theShardId,
final long theGroupId) {
final HashMap<String, String> aDataMap = new HashMap<String, String>();
aDataMap.put(DataMapKeys.TYPE, String.valueOf(EventCodes.GROUP_ENTER));
aDataMap.put(DataMapKeys.ACCOUNT_ID, theAccountId);
aDataMap.put(DataMapKeys.CHARACTER_ID, theCharacterId);
aDataMap.put(DataMapKeys.CHARACTER_LEVEL, String.valueOf(theCharacterLvl));
aDataMap.put(DataMapKeys.SHARD_ID, String.valueOf(theShardId));
aDataMap.put(DataMapKeys.GROUP_ID, String.valueOf(theGroupId));
return this.logEvent(aDataMap, theDate);
}
/**
* Logs a Group Exit event- The time at which a user leaves a group. The semantics of the group are the
* same as event (4)
*
* @param theDate Date - when did the user/player exit the Group?
* @param theAccountId String (MANDATORY Field) - the UUID associated with a particular user/player - email, number
* @param theCharacterId String (MANDATORY Field) - does an account have multiple characters associated with it?
* use this field to track such identifiers.
* Default - AccountId should be used as default if there's no CharacterId
* @param theCharacterLvl long (MANDATORY Field) - the numeric level identifier the character currently is at.
* Default - '0'
* @param theShardId long (MANDATORY Field) - a particular db the Character is associated with
* Default - Use 0 if unused or does not have a value
* @param theGroupId long (MANDATORY Field) - the id number of the group that was left
*/
public boolean logExitGroup(final Date theDate,
final String theAccountId, final String theCharacterId,
final long theCharacterLvl, final long theShardId,
final long theGroupId) {
final HashMap<String, String> aDataMap = new HashMap<String, String>();
aDataMap.put(DataMapKeys.TYPE, String.valueOf(EventCodes.GROUP_EXIT));
aDataMap.put(DataMapKeys.ACCOUNT_ID, theAccountId);
aDataMap.put(DataMapKeys.CHARACTER_ID, theCharacterId);
aDataMap.put(DataMapKeys.CHARACTER_LEVEL, String.valueOf(theCharacterLvl));
aDataMap.put(DataMapKeys.SHARD_ID, String.valueOf(theShardId));
aDataMap.put(DataMapKeys.GROUP_ID, String.valueOf(theGroupId));
return this.logEvent(aDataMap, theDate);
}
/**
* Logs an Item Used event- This item captures usage of items in the game, additional information regarding
* the account and character of the user who used the item as well as location of the
* character that used the item is also recorded.
*
* @param theDate Date - when was the item used?
* @param theAccountId String (MANDATORY Field) - the UUID associated with a particular user/player - email, number
* @param theCharacterId String (MANDATORY Field) - does an account have multiple characters associated with it?
* use this field to track such identifiers.
* Default - AccountId should be used as default if there's no CharacterId
* @param theCharacterLvl long (MANDATORY Field) - the numeric level identifier the character currently is at.
* Default - '0'
* @param theShardId long (OPTIONAL Field) - a particular db the Character is associated with
* Default - Use 0 if unused or does not have a value
* @param theItemId long (MANDATORY Field) - the item's application unique id
* Default - theItemId or theItemName, any one has to be defined
* Use 0 for default value
* @param theItemName String (MANDATORY Field) - example: "crafty button", "GMO grain"
* Default - theItemId or theItemName, any one has to be defined
* send "NA", as default value
* @param theItemCount Integer (MANDATORY Field) - number of times the item is used in this particular location. useful for spells, bullets.
* @param theAreaId long (MANDATORY Field) - Default - use '0'
* @param theAreaName String (MANDATORY Field) - Default - use "NA"
* @param theX float (MANDATORY Field) - Default - use '0'
* @param theY float (MANDATORY Field) - Default - use '0'
* @param theZ float (MANDATORY Field) - Default - use '0'
*/
public boolean logItem(final Date theDate,
final String theAccountId, final String theCharacterId,
final long theCharacterLvl, final long theShardId,
final long theItemId, final String theItemName,
final int theItemCount, final long theAreaId,
final String theAreaName, final float theX,
final float theY, final float theZ) {
final HashMap<String, String> aDataMap = new HashMap<String, String>();
aDataMap.put(DataMapKeys.TYPE, String.valueOf(EventCodes.ITEM_USED));
aDataMap.put(DataMapKeys.ACCOUNT_ID, theAccountId);
aDataMap.put(DataMapKeys.CHARACTER_ID, theCharacterId);
aDataMap.put(DataMapKeys.CHARACTER_LEVEL, String.valueOf(theCharacterLvl));
aDataMap.put(DataMapKeys.SHARD_ID, String.valueOf(theShardId));
aDataMap.put(DataMapKeys.ITEM_ID, String.valueOf(theItemId));
aDataMap.put(DataMapKeys.ITEM_NAME, theItemName);
aDataMap.put(DataMapKeys.ITEM_COUNT, String.valueOf(theItemCount));
aDataMap.put(DataMapKeys.AREA_ID, String.valueOf(theAreaId));
aDataMap.put(DataMapKeys.AREA_NAME, theAreaName);
aDataMap.put(DataMapKeys.POSITION_X, String.valueOf(theX));
aDataMap.put(DataMapKeys.POSITION_Y, String.valueOf(theY));
aDataMap.put(DataMapKeys.POSITION_Z, String.valueOf(theZ));
return this.logEvent(aDataMap, theDate);
}
/**
* Logs an Item Transaction event- Information regarding purchase of items in the game. Depending upon the game,
* an item may be bought using real world money or virtual currency which may be exclusive
* to the game.
* Multiple logItemTransaction events might need to be called for a single transaction if
* multiple currencies are used, example: 4 gold, 5 silver, 3 copper for a fish trap.
*
* @param theDate Date - when did the transaction occur?
* @param theAccountId String (MANDATORY Field) - the UUID associated with a particular user/player - email, number
* @param theCharacterId String (MANDATORY Field) - does an account have multiple characters associated with it?
* use this field to track such identifiers.
* Default - AccountId should be used as default if there's no CharacterId
* @param theShardId long (OPTIONAL Field) - a particular db the Character is associated with
* Default - Use 0 if unused or does not have a value
* @param theItemId long (MANDATORY Field) - the item's application unique id
* Default - theItemId or theItemName - any one is must
* Use 0 for default value
* @param theItemName String (MANDATORY Field) - example: "crafty button", "GMO grain"
* Default - theItemId or theItemName - any one is must
* send "NA", if does not have a value
* @param theItemPrice float (MANDATORY Field)
* @param theTransactionType Integer (MANDATORY Field) - acceptable values are: 0 = SPENT or 1 = ACQUIRED currency
* @param theCurrencyType Integer (MANDATORY Field) - acceptable values are: 0 = real world, 1 = virtual
* @param theVirtualCurrencyLbl String (OPTIONAL Field) - a virtual currency previously initialized from Event #14.
* Default - If theCurrencyType = 1, setting this is MANDATORY else
* send "" as default
* @param theCurrencyValue float (MANDATORY Field) - how much of a particular currency was used for this transaction
* @param theVirtualCurrencyCount Integer (OPTIONAL Field) - Default - NULL
*/
public boolean logItemTransaction(final Date theDate,
final String theAccountId, final String theCharacterId,
final long theShardId, final long theItemId,
final String theItemName, final float theItemPrice,
final int theTransactionType, final int theCurrencyType,
final String theVirtualCurrencyLbl, final float theCurrencyValue,
final int theVirtualCurrencyCount) {
final HashMap<String, String> aDataMap = new HashMap<String, String>();
aDataMap.put(DataMapKeys.TYPE, String.valueOf(EventCodes.ITEM_TRANSACTION));
aDataMap.put(DataMapKeys.ACCOUNT_ID, theAccountId);
aDataMap.put(DataMapKeys.CHARACTER_ID, theCharacterId);
aDataMap.put(DataMapKeys.SHARD_ID, String.valueOf(theShardId));
aDataMap.put(DataMapKeys.ITEM_ID, String.valueOf(theItemId));
aDataMap.put(DataMapKeys.ITEM_NAME, theItemName);
aDataMap.put(DataMapKeys.ITEM_PRICE, String.valueOf(theItemPrice));
aDataMap.put(DataMapKeys.TRANSACTION_TYPE, String.valueOf(theTransactionType));
aDataMap.put(DataMapKeys.CURRENCY_TYPE, String.valueOf(theCurrencyType));
aDataMap.put(DataMapKeys.CURRENCY_VIRTUAL_LABEL, theVirtualCurrencyLbl);
aDataMap.put(DataMapKeys.CURRENCY_VALUE, String.valueOf(theCurrencyValue));
aDataMap.put(DataMapKeys.CURRENCY_VIRTUAL_COUNT, String.valueOf(theVirtualCurrencyCount));
return this.logEvent(aDataMap, theDate);
}
/**
* log that a Login event occurred
*
* @param theDate Date - what time did the login occur at?
* @param theAccountId String - the UUID associated with a particular
* user/player - email, number
* @param theCharacterId String - does an account have multiple characters
* associated with it? use this field to track such identifiers.
* OPTIONAL: "" when not used.
* @param theShardId long - a particular db the Character is associated
* with. OPTIONAL: insert 0 if unused.
* @param thePlatform String - what platform did the Event happen on?
* user-agent string, "mobile" or, "desktop". open-ended, but
* should be used consistently.
* @param theAreaId long - an in-app/game location id the user/player
* started in. OPTIONAL: insert 0 if unused.
* @return boolean - added to the log queue successfully?
*/
@Deprecated
public boolean logLogin(final Date theDate, final String theAccountId,
final String theCharacterId, final long theShardId,
final String thePlatform, final long theAreaId) {
return logLogin(theDate, theAccountId, theCharacterId, theShardId, thePlatform, theAreaId, null);
}
/**
* Logs a Login event- The time at which the user logged into the system where the
* system may be a website, game, software etc
*
* @param theDate Date - what time did the login occur at?
* @param theAccountId String (MANDATORY Field) - the UUID associated with a particular user/player - email, number
* @param theCharacterId String (MANDATORY Field) - does an account have multiple characters associated with it?
* use this field to track such identifiers.
* Default - AccountId should be used as default if there's no CharacterId
* @param theShardId long (OPTIONAL Field) - a particular db the Character is associated with
* Default - Use 0 if unused or does not have a value
* @param thePlatform String (MANDATORY Field) - What platform was the Account created on, Acceptable values are
* user-agent string: "mobile" or, "desktop".
* Default should be "Other"
*
* @param theAreaId long (OPTIONAL Field) - an in-app/game location id the user/player started in.
* Default - Use NULL if unused or does not have a AreaId
* @param theAreaName String (OPTIONAL Field) - Login Area Name
* Default - Null
*/
public boolean logLogin(final Date theDate, final String theAccountId,
final String theCharacterId, final long theShardId,
final String thePlatform, final long theAreaId,
final String theAreaName) {
final HashMap<String, String> aDataMap = new HashMap<String, String>();
aDataMap.put(DataMapKeys.TYPE, String.valueOf(EventCodes.LOGIN));
aDataMap.put(DataMapKeys.ACCOUNT_ID, theAccountId);
aDataMap.put(DataMapKeys.CHARACTER_ID, theCharacterId);
aDataMap.put(DataMapKeys.SHARD_ID, String.valueOf(theShardId));
aDataMap.put(DataMapKeys.PLATFORM, thePlatform);
aDataMap.put(DataMapKeys.AREA_ID, String.valueOf(theAreaId));
aDataMap.put(DataMapKeys.AREA_NAME, theAreaName);
return this.logEvent(aDataMap, theDate);
}
/**
* log that a Logout event occurred
*
* @param theDate Date - what time did the logout occur at?
* @param theAccountId String - the UUID associated with a particular
* user/player - email, number
* @param theCharacterId String - does an account have multiple characters
* associated with it? use this field to track such identifiers.
* OPTIONAL: "" when not used.
* @param theShardId long - a particular db the Character is associated
* with. OPTIONAL: insert 0 if unused.
* @param thePlatform String - what platform did the Event happen on?
* user-agent string, "mobile" or, "desktop". open-ended, but
* should be used consistently.
* @param theAreaId long - an in-app/game location id the user/player exited
* from. OPTIONAL: insert 0 if unused.
* @return boolean - added to the log queue successfully?
*/
@Deprecated
public boolean logLogout(final Date theDate, final String theAccountId,
final String theCharacterId, final long theShardId,
final String thePlatform, final long theAreaId) {
return logLogout(theDate, theAccountId, theCharacterId);
}
/**
* Logs a Logout event- The time at which the user logged out of the system where
* the system may be a website, game, software etc
*
* @param theDate Date - what time did the logout occur at?
* @param theAccountId String (MANDATORY Field) - the UUID associated with a particular user/player - email, number
* @param theCharacterId String (MANDATORY Field) - does an account have multiple characters associated with it?
* use this field to track such identifiers.
* Default - AccountId should be used as default if there's no CharacterId
*/
public boolean logLogout(final Date theDate, final String theAccountId,
final String theCharacterId) {
final HashMap<String, String> aDataMap = new HashMap<String, String>();
aDataMap.put(DataMapKeys.TYPE, String.valueOf(EventCodes.LOGOUT));
aDataMap.put(DataMapKeys.ACCOUNT_ID, theAccountId);
aDataMap.put(DataMapKeys.CHARACTER_ID, theCharacterId);
return this.logEvent(aDataMap, theDate);
}
/**
* Logs a Logout event indirectly - This event is meant to get a continuous heartbeat from the user/player to know
* that the user is still active, otherwise calls the Logout event to end the session
*
* @param theDate Date - what time did the logout occur at?
* @param theAccountId String (MANDATORY Field) - the UUID associated with a particular user/player - email, number
* @param theCharacterId String (MANDATORY Field) - does an account have multiple characters associated with it?
* use this field to track such identifiers.
* Default - AccountId should be used as default if there's no CharacterId
*/
/* public boolean logHeartbeat(final Date theDate,
final String theAccountId, final String theCharacterId) {
if(KApi.HEARTBEAT_FLAG == 0) {
KApi.HEARTBEAT_FLAG = 1;
}else {
//no log event has been fired between two heartbeats...no FLAG change between the current heartbeat and the previous heartBeat
this.logLogout(theDate, theAccountId, theCharacterId);
}
}; */
/**
* Logs a Message event- A common feature in many games in the ability of players to message one another.
* Depending upon the game, multiple channels of communication may be used e.g., it may be
* in the form of in-game chat, in-game mail, message broadcast to players in a group etc.
*
* @param theDate Date - when did the message occur?
* @param sendAccId String (MANDATORY Field) - the sender's account id
* @param sendCharId String (MANDATORY Field) - does an account have multiple characters associated with it?
* Use this field to track such identifiers.
* Default - sendAccId should be used as default if there's no sendCharId
* @param recvAccId String (MANDATORY Field) - the reciever's account id
* @param recvCharId String (MANDATORY Field) - does an account have multiple characters associated with it?
* Use this field to track such identifiers.
* Default - recvAccId should be used as default if there's no recvCharId
* @param theShardId long (OPTIONAL Field) - a particular db the Character is associated with
* Default - Use 0 if unused or does not have a value
* @param theChannelLbl String (MANDATORY Field) - examples: Public, Group:Pre-Defined, Group:Ad-Hoc, Private, Other
* Default - "Other"
* @param theMessageDesc String (OPTIONAL Field) - Default - Use "" when not used
* @param theMessageCharCount long (MANDATORY Field) - Default - 1
*/
public boolean logMessage(final Date theDate,
final String sendAccId, final String sendCharId,
final String recvAccId, final String recvCharId,
final long theShardId, final String theChannelLbl,
final String theMessageDesc, final long theMessageCharCount) {
final HashMap<String, String> aDataMap = new HashMap<String, String>();
aDataMap.put(DataMapKeys.TYPE, String.valueOf(EventCodes.MESSAGE));
aDataMap.put(DataMapKeys.SENDER_ACCOUNT_ID, sendAccId);
aDataMap.put(DataMapKeys.SENDER_CHARACTER_ID, sendCharId);
aDataMap.put(DataMapKeys.RECEIVER_ACCOUNT_ID, recvAccId);
aDataMap.put(DataMapKeys.RECEIVER_CHARACTER_ID, recvCharId);
aDataMap.put(DataMapKeys.SHARD_ID, String.valueOf(theShardId));
aDataMap.put(DataMapKeys.MESSAGE_CHANNEL_LABEL, theChannelLbl);
aDataMap.put(DataMapKeys.MESSAGE_DESCRIPTION, theMessageDesc);
aDataMap.put(DataMapKeys.MESSAGE_CHARACTER_COUNT, String.valueOf(theMessageCharCount));
return this.logEvent(aDataMap, theDate);
}
/**
* Logs OGI Receiver Event- This event is the counterpart to event (7) but with the additional information regarding
* how the receiver acted with respect to the invite e.g., did he/she accept the invite or
* did he/she refused it. Logs the end (receiving) of a social transaction outside of the
* application or an Off-Game Interaction
*
* @param theDate Date - what time did the event occur at?
* @param sendAccId String (MANDATORY Field) - the UUID associated with a particular user/player - email, number
* @param sendCharId String (MANDATORY Field) - does an account have multiple characters associated with it?
* Use this field to track such identifiers.
* Default - sendAccId should be used as default if there's no sendCharId
* @param recvAccId String (MANDATORY Field) - the UUID associated with a particular user/player - email, number
* @param recvCharId String (MANDATORY Field) - does an account have multiple characters associated with it?
* Use this field to track such identifiers.
* Default - recvAccId should be used as default if there's no recvCharId.
* @param theShardId long (OPTIONAL Field) - a particular db the Character is associated with
* Default - Use 0 if unused or does not have a value
* @param theOgiLocation String (MANDATORY Field) - a unique identifier for the location, preferably a URI
* Default - "Other"
* @param theOgiCategory String (MANDATORY Field) - examples: "gift", "forum post", "click"
* @param theRecvAction String (MANDATORY Field) - examples: "repost", "RT", "forum reply"
*/
public boolean logOgiRecv(final Date theDate, final String sendAccId,
final String sendCharId, final String recvAccId,
final String recvCharId, final long theShardId,
final String theOgiLocation, final String theOgiCategory,
final String theRecvAction) {
final HashMap<String, String> aDataMap = new HashMap<String, String>();
aDataMap.put(DataMapKeys.TYPE,
String.valueOf(EventCodes.OFF_GAME_INTERACTION_RECEIVE));
aDataMap.put(DataMapKeys.SENDER_ACCOUNT_ID, sendAccId);
aDataMap.put(DataMapKeys.SENDER_CHARACTER_ID, sendCharId);
aDataMap.put(DataMapKeys.RECEIVER_ACCOUNT_ID, recvAccId);
aDataMap.put(DataMapKeys.RECEIVER_CHARACTER_ID, recvCharId);
aDataMap.put(DataMapKeys.SHARD_ID, String.valueOf(theShardId));
aDataMap.put(DataMapKeys.OGI_LOCATION, theOgiLocation);
aDataMap.put(DataMapKeys.OGI_CATEGORY, theOgiCategory);
aDataMap.put(DataMapKeys.OGI_RECEIVER_ACTION, theRecvAction);
return this.logEvent(aDataMap, theDate);
}
/**
* Logs OGI Sender event- Interaction between people outside the environment of the game e.g., when one person who
* is already playing the game sends an invite to another person not player of the game
* Logs the start (sending) of a social transaction outside of the application or an Off-Game Interaction
*
* @param theDate Date - what time did the event occur at?
* @param sendAccId String (MANDATORY Field) - the UUID associated with a particular user/player - email, number
* @param sendCharId String (MANDATORY Field) - does an account have multiple characters associated with it?
* Use this field to track such identifiers.
* Default - sendAccId should be used as default if there's no sendCharId
* @param recvAccId String (MANDATORY Field) - the UUID associated with a particular user/player - email, number
* @param recvCharId String (MANDATORY Field) - does an account have multiple characters associated with it?
* Use this field to track such identifiers.
* Default - recvAccId should be used as default if there's no recvCharId.
* @param theShardId long (OPTIONAL Field) - a particular db the Character is associated with
* Default - Use 0 if unused or does not have a value
* @param theOgiLocation String (MANDATORY Field) - a unique identifier for the location, preferably a URI
* Default - "Other"
* @param theOgiCategory String (MANDATORY Field) - examples: "gift", "forum post", "click"
*/
public boolean logOgiSend(final Date theDate, final String sendAccId,
final String sendCharId, final String recvAccId,
final String recvCharId, final long theShardId,
final String theOgiLocation, final String theOgiCategory) {
final HashMap<String, String> aDataMap = new HashMap<String, String>();
aDataMap.put(DataMapKeys.TYPE,
String.valueOf(EventCodes.OFF_GAME_INTERACTION_SEND));
aDataMap.put(DataMapKeys.SENDER_ACCOUNT_ID, sendAccId);
aDataMap.put(DataMapKeys.SENDER_CHARACTER_ID, sendCharId);
aDataMap.put(DataMapKeys.RECEIVER_ACCOUNT_ID, recvAccId);
aDataMap.put(DataMapKeys.RECEIVER_CHARACTER_ID, recvCharId);
aDataMap.put(DataMapKeys.SHARD_ID, String.valueOf(theShardId));
aDataMap.put(DataMapKeys.OGI_LOCATION, theOgiLocation);
aDataMap.put(DataMapKeys.OGI_CATEGORY, theOgiCategory);
return this.logEvent(aDataMap, theDate);
}
/**
* Logs a Social event- Social events involving two people. This event include all the events which are not covered
* separately under Group events (4,5), Friend (43, 44).
* DO NOT USE for game invites, messages, group enter/exit, store gifts, or clan enter/exit.
* This should be used for social events not already explicitly called out.
*
* @param theDate Date - what time did the event occur at?
* @param sendAccId String (MANDATORY Field) - the UUID associated with a particular user/player - email, number
* @param sendCharId String (MANDATORY Field) - does an account have multiple characters associated with it?
* Use this field to track such identifiers.
* Default - sendAccId should be used as default if there's no sendCharId
* @param sendCharLvl Integer (MANDATORY Field) - the character's level/XP.
* Default - '0'
* @param recvAccId String (MANDATORY Field) - the UUID associated with a particular user/player - email, number
* @param recvCharId String (MANDATORY Field) - does an account have multiple characters associated with it?
* Use this field to track such identifiers.
* Default - recvAccId should be used as default if there's no recvCharId.
* @param recvCharLvl Integer (MANDATORY Field) - the character's level/XP.
* Default - '0'
* @param theShardId long (OPTIONAL Field) - a particular db the Character is associated with
* Default - Use 0 if unused or does not have a value
* @param theEventName String (MANDATORY Field) - the name of the in-game social event.
* consistently names these - MANDATORY Field
* @param theEventType String (MANDATORY Field) - Types example: Send Message, Receive Message, Invite To Temporary Group,
* Invited To Temporary Group, Invite To Permanent Group, Invited To Permanent Group, Remove From Temporary Group,
* Removed From Temporary Group, Remove From Permanent Group, Removed From Permanent Group, Invite To Friend List,
* Invited To Friend List, Remove From Friend List, Removed From Friend List, Send Gift, Receive Gift,
* Invite To Sign Up For The Service/App/Game, Invited To Sign Up For The Service/App/Game, Other
* Default - "Other"
*/
public boolean logSocialEvent(final Date theDate,
final String sendAccId, final String sendCharId,
final int sendCharLvl, final String recvAccId,
final String recvCharId, final int recvCharLvl,
final long theShardId, final String theEventName,
final String theEventType) {
final HashMap<String, String> aDataMap = new HashMap<String, String>();
aDataMap.put(DataMapKeys.TYPE, String.valueOf(EventCodes.SOCIAL));
aDataMap.put(DataMapKeys.SENDER_ACCOUNT_ID, sendAccId);
aDataMap.put(DataMapKeys.SENDER_CHARACTER_ID, sendCharId);
aDataMap.put(DataMapKeys.SENDER_CHARACTER_LEVEL,
String.valueOf(sendCharLvl));
aDataMap.put(DataMapKeys.RECEIVER_ACCOUNT_ID, recvAccId);
aDataMap.put(DataMapKeys.RECEIVER_CHARACTER_ID, recvCharId);
aDataMap.put(DataMapKeys.RECEIVER_CHARACTER_LEVEL,
String.valueOf(recvCharLvl));
aDataMap.put(DataMapKeys.SHARD_ID, String.valueOf(theShardId));
aDataMap.put(DataMapKeys.SOCIAL_EVENT_NAME, theEventName);
aDataMap.put(DataMapKeys.SOCIAL_EVENT_TYPE, theEventType);
return this.logEvent(aDataMap, theDate);
}
/**
* update the NM service with new information about an account subscription
*
* @param theDate Date - what time did the change happen at?
* @param theAccountId String - the UUID associated with a particular
* user/player - email, number
* @param theAccountStatus String - acceptable values: Active, Stopped,
* Expired, Failed, Cancelled
* @param theAccountType String - acceptable values: Free, Paid, Premium
* @param theExpireTs Date - what time does the subscription expire at?
* @return boolean - added to the log queue successfully?
*/
@Deprecated
public boolean putSubChange(final Date theDate, final String theAccountId,
final String theAccountStatus, final String theAccountType,
final Date theExpireTs) {
Long defaultLong = 0L;
return putSubChange(theDate, theAccountId, theAccountStatus, theAccountType, defaultLong, theExpireTs);
}
/**
* Logs a Subscription Change event- Change of subscription type e.g., from free play to paid subscriber or to a premium player.
* This is only applicable to games with subscription and not to free-to-play (F2P) games *
*
* @param theDate Date - when did the subscription start?
* @param theAccountId String (MANDATORY Field) - the UUID associated with a particular user/player - email, number
* @param theSubStatus String (MANDATORY Field) - acceptable values are: Active, Stopped, Expired, Failed, Cancelled
* Default - "Active"
* @param theSubType String (MANDATORY Field) - acceptable values are: Free, Paid, Premium
* Default - "Paid"
* @param theSubValue float (OPTIONAL Field) - amount paid by the user for the subscription for the relevant/current pay period.
* Example: 7.34 (for June)
* @param theExpireTs Date (MANDATORY Field) - when does the subscription expire?
*/
public boolean putSubChange(final Date theDate, final String theAccountId,
final String theSubStatus, final String theSubType,
final long theSubValue, final Date theExpireTs) {
final HashMap<String, String> aDataMap = new HashMap<String, String>();
aDataMap.put(DataMapKeys.TYPE,
String.valueOf(EventCodes.CHANGE_SUBSCRIPTION));
aDataMap.put(DataMapKeys.ACCOUNT_ID, theAccountId);
aDataMap.put(DataMapKeys.ACCOUNT_STATUS, theSubStatus);
aDataMap.put(DataMapKeys.ACCOUNT_SUBSCRIPTION_TYPE, theSubType);
aDataMap.put(DataMapKeys.ACCOUNT_SUBSCRIPTION_VALUE,
String.valueOf(theSubValue));
aDataMap.put(DataMapKeys.ACCOUNT_SUBSCRIPTION_EXPIRES, (new DateObj(
theExpireTs)).getISO8601Str());
return this.logEvent(aDataMap, theDate);
}
/**
* Logs a Begin Combat event- This event refers to the start of combat between a player and a
* non-player character (NPC)kick off the beginning of combat
*
* @param theDate Date - when did combat start?
* @param theAccountId String (MANDATORY Field) - the UUID associated with a particular user/player - email, number
* @param theCharacterId String (MANDATORY Field) - does an account have multiple characters associated with it?
* Use this field to track such identifiers.
* Default - AccountId should be used as default if there's no CharacterId
* @param theShardId Long (OPTIONAL Field) - a particular db the Character is associated with
* Default - Use 0 if unused or does not have a value
* @param theNpcId Long (MANDATORY Field) - the id of the NPC being fought
* @param theAreaId Long (MANDATORY Field) - Default - 0
* @param theX float (MANDATORY Field) - Default - 0
* @param theY float (MANDATORY Field) - Default - 0
* @param theZ float (MANDATORY Field) - Default - 0
* @param theAreaName String (MANDATORY Field) - Default - "NA"
*/
public boolean combatStart(final Date theDate, final String theAccountId,
final String theCharacterId, final long theShardId,
final long theNpcId, final long theAreaId,
final float theX, final float theY,
final float theZ, final String theAreaName) {
final HashMap<String, String> aDataMap = new HashMap<String, String>();
aDataMap.put(DataMapKeys.TYPE,
String.valueOf(EventCodes.COMBAT_BEGIN));
aDataMap.put(DataMapKeys.ACCOUNT_ID, theAccountId);
aDataMap.put(DataMapKeys.CHARACTER_ID, theCharacterId);
aDataMap.put(DataMapKeys.SHARD_ID, String.valueOf(theShardId));
aDataMap.put(DataMapKeys.NPC_ID, String.valueOf(theNpcId));
aDataMap.put(DataMapKeys.AREA_ID, String.valueOf(theAreaId));
aDataMap.put(DataMapKeys.POSITION_X, String.valueOf(theX));
aDataMap.put(DataMapKeys.POSITION_Y, String.valueOf(theY));
aDataMap.put(DataMapKeys.POSITION_Z, String.valueOf(theZ));
aDataMap.put(DataMapKeys.AREA_NAME, theAreaName);
return this.logEvent(aDataMap, theDate);
}
/**
* Logs an End Combat event- This event refers to the end of combat between a player and a non-player character (NPC)
*
* @param theDate Date - when did combat end?
* @param theAccountId String (MANDATORY Field) - the UUID associated with a particular user/player - email, number
* @param theCharacterId String (MANDATORY Field) - does an account have multiple characters associated with it?
* Use this field to track such identifiers.
* Default - AccountId should be used as default if there's no CharacterId
* @param theShardId Long (OPTIONAL Field) - a particular db the Character is associated with
* Default - Use 0 if unused or does not have a value
* @param theNpcId Long (MANDATORY Field) - the id of the NPC fought
* @param theAreaId Long (MANDATORY Field) - Default - 0
* @param theX float (MANDATORY Field) - Default - 0
* @param theY float (MANDATORY Field) - Default - 0
* @param theZ float (MANDATORY Field) - Default - 0
* @param theAreaName String (MANDATORY Field) - Default - "NA"
*/
public boolean combatEnd(final Date theDate, final String theAccountId,
final String theCharacterId, final long theShardId,
final long theNpcId, final long theAreaId,
final float theX, final float theY,
final float theZ, final String theAreaName) {
final HashMap<String, String> aDataMap = new HashMap<String, String>();
aDataMap.put(DataMapKeys.TYPE,
String.valueOf(EventCodes.COMBAT_END));
aDataMap.put(DataMapKeys.ACCOUNT_ID, theAccountId);
aDataMap.put(DataMapKeys.CHARACTER_ID, theCharacterId);
aDataMap.put(DataMapKeys.SHARD_ID, String.valueOf(theShardId));
aDataMap.put(DataMapKeys.NPC_ID, String.valueOf(theNpcId));
aDataMap.put(DataMapKeys.AREA_ID, String.valueOf(theAreaId));
aDataMap.put(DataMapKeys.POSITION_X, String.valueOf(theX));
aDataMap.put(DataMapKeys.POSITION_Y, String.valueOf(theY));
aDataMap.put(DataMapKeys.POSITION_Z, String.valueOf(theZ));
aDataMap.put(DataMapKeys.AREA_NAME, theAreaName);
return this.logEvent(aDataMap, theDate);
}
/**
* Logs a Kill NPC event - Refers to an event when a non-player character (NPC) is killed by a player in the game.
*
* @param theDate Date - when did the kill happen?
* @param theAccountId String (MANDATORY Field) - the UUID associated with a particular user/player - email, number
* @param theCharacterId String (MANDATORY Field) - does an account have multiple characters associated with it?
* Use this field to track such identifiers.
* Default - AccountId should be used as default if there's no CharacterId
* @param theShardId Long (OPTIONAL Field) - a particular db the Character is associated with
* Default - Use 0 if unused or does not have a value
* @param theCharacterLvl Long (MANDATORY Field) - the numeric level identifier the character currently is at.
* Default - 0
* @param theNpcId Long (MANDATORY Field) - the id of the NPC fought
*/
public boolean logKillNpc(final Date theDate, final String theAccountId,
final String theCharacterId, final long theShardId,
final long theCharacterLvl, final long theNpcId) {
final HashMap<String, String> aDataMap = new HashMap<String, String>();
aDataMap.put(DataMapKeys.TYPE,
String.valueOf(EventCodes.KILL));
aDataMap.put(DataMapKeys.ACCOUNT_ID, theAccountId);
aDataMap.put(DataMapKeys.CHARACTER_ID, theCharacterId);
aDataMap.put(DataMapKeys.SHARD_ID, String.valueOf(theShardId));
aDataMap.put(DataMapKeys.CHARACTER_LEVEL, String.valueOf(theCharacterLvl));
aDataMap.put(DataMapKeys.NPC_ID, String.valueOf(theNpcId));
return this.logEvent(aDataMap, theDate);
}
/**
* Logs a Player Points event - Information regarding when a player gains experience points in the game.
* In many games experience points are used as an indicator of how well the player is
* doing in the game and much has she progressed. In many games gaining enough experience
* points leads the player to level up to a higher level.
*
* @param theDate Date - when did the XP get bestowed?
* @param theAccountId String (MANDATORY Field) - the UUID associated with a particular user/player - email, number
* @param theCharacterId String (MANDATORY Field) - does an account have multiple characters associated with it?
* Use this field to track such identifiers.
* Default - AccountId should be used as default if there's no CharacterId
* @param theShardId long (OPTIONAL Field) - a particular db the Character is associated with
* Default - Use 0 if unused or does not have a value
* @param theCharacterLvl Long (MANDATORY Field) - the numeric level identifier the character currently is at.
* Default - 0
*
* @param theXpAmount Long (MANDATORY Field)
* @param isGrouped Boolean (OPTIONAL Field) - did the XP result from a group event?
* Default - "N"
* @param thePointType String (MANDATORY Field) - Example: XP, GENERIC_POINTS, OTHER
* Default - "Other"
*/
public boolean playerPoints(final Date theDate, final String theAccountId,
final String theCharacterId, final long theShardId,
final long theCharacterLvl, final long theXpAmount,
final boolean isGrouped, final String thePointType) {
final HashMap<String, String> aDataMap = new HashMap<String, String>();
aDataMap.put(DataMapKeys.TYPE,
String.valueOf(EventCodes.PLAYER_POINTS));
aDataMap.put(DataMapKeys.ACCOUNT_ID, theAccountId);
aDataMap.put(DataMapKeys.CHARACTER_ID, theCharacterId);
aDataMap.put(DataMapKeys.SHARD_ID, String.valueOf(theShardId));
aDataMap.put(DataMapKeys.CHARACTER_LEVEL, String.valueOf(theCharacterLvl));
aDataMap.put(DataMapKeys.PLAYER_XP_AMOUNT, String.valueOf(theXpAmount));
aDataMap.put(DataMapKeys.POINT_TYPE, thePointType);
if (isGrouped) {
aDataMap.put(DataMapKeys.FLAG_GROUPED, "Y");
} else {
aDataMap.put(DataMapKeys.FLAG_GROUPED, "N");
}
return this.logEvent(aDataMap, theDate);
}
/**
* Logs a PVP Duel event- Information regarding when a player enters a combat against another player.
* This type of event is only applicable to environments or games, where a player is
* allowed to fight against another player since not all environments are competitive in nature.
*
* @param theDate Date - when did the duel occur?
* @param theAccountId String (MANDATORY Field) - the UUID associated with a particular user/player - email, number
* @param theCharacterId String (MANDATORY Field) - does an account have multiple characters associated with it?
* Use this field to track such identifiers.
* Default - AccountId should be used as default if there's no CharacterId
* @param theShardId Long (OPTIONAL Field) - a particular db the Character is associated with
* Default - Use 0 if unused or does not have a value.
* @param isWinner Boolean (MANDATORY Field) - did this player win?
*/
public boolean logPvpDuel(final Date theDate, final String theAccountId,
final String theCharacterId, final long theShardId,
final boolean isWinner) {
final HashMap<String, String> aDataMap = new HashMap<String, String>();
aDataMap.put(DataMapKeys.TYPE,
String.valueOf(EventCodes.PVP_DUEL));
aDataMap.put(DataMapKeys.ACCOUNT_ID, theAccountId);
aDataMap.put(DataMapKeys.CHARACTER_ID, theCharacterId);
aDataMap.put(DataMapKeys.SHARD_ID, String.valueOf(theShardId));
if (isWinner) {
aDataMap.put(DataMapKeys.FLAG_WIN, "Y");
} else {
aDataMap.put(DataMapKeys.FLAG_WIN, "N");
}
return this.logEvent(aDataMap, theDate);
}
/**
* Logs a Player Death event- Information regarding the death of player by a non-player character (NPC)
*
* @param theDate Date - when did the player death occur?
* @param theAccountId String (MANDATORY Field) - the UUID associated with a particular user/player - email, number
* @param theCharacterId String (MANDATORY Field) - does an account have multiple characters associated with it?
* Use this field to track such identifiers.
* Default - AccountId should be used as default if there's no CharacterId
* @param theShardId Long (OPTIONAL Field) - a particular db the Character is associated with
* Default - Use 0 if unused or does not have a value.
* @param theKillerNpcId Long (MANDATORY Field) - the NPC that killed the player
* @param theDeathType String (MANDATORY Field) - Default - use "NA" if unused
* @param theAreaId Long (MANDATORY Field) - Default - 0
* @param theX Float (MANDATORY Field) - Default - 0
* @param theY Float (MANDATORY Field) - Default - 0
* @param theZ Float (MANDATORY Field) - Default - 0
* @param theAreaName String (MANDATORY Field) - Default - "NA"
*/
public boolean logPlayerDeath(final Date theDate, final String theAccountId,
final String theCharacterId, final long theShardId,
final long theKillerNpcId, final String theDeathType,
final long theAreaId, final float theX,
final float theY, final float theZ, final String theAreaName) {
final HashMap<String, String> aDataMap = new HashMap<String, String>();
aDataMap.put(DataMapKeys.TYPE,
String.valueOf(EventCodes.PLAYER_DEATH));
aDataMap.put(DataMapKeys.ACCOUNT_ID, theAccountId);
aDataMap.put(DataMapKeys.CHARACTER_ID, theCharacterId);
aDataMap.put(DataMapKeys.SHARD_ID, String.valueOf(theShardId));
aDataMap.put(DataMapKeys.NPC_ID, String.valueOf(theKillerNpcId));
aDataMap.put(DataMapKeys.PLAYER_DEATH_TYPE, theDeathType);
aDataMap.put(DataMapKeys.AREA_ID, String.valueOf(theAreaId));
aDataMap.put(DataMapKeys.POSITION_X, String.valueOf(theX));
aDataMap.put(DataMapKeys.POSITION_Y, String.valueOf(theY));
aDataMap.put(DataMapKeys.POSITION_Z, String.valueOf(theZ));
aDataMap.put(DataMapKeys.AREA_NAME, theAreaName);
return this.logEvent(aDataMap, theDate);
}
/**
* Logs a level Begin event- A large number of games are organized in terms of levels which reflect the
* difficultly of game play. This event captures the time at which a player begins
* a level
*
* @param theDate Date - when did the player begin?
* @param theAccountId String (MANDATORY Field) - the UUID associated with a particular user/player - email, number
* @param theCharacterId String (MANDATORY Field) - does an account have multiple characters associated with it?
* Use this field to track such identifiers.
* Default - AccountId should be used as default if there's no CharacterId
* @param theCharacterLvl Long (MANDATORY Field) - the numeric level identifier the character currently is at.
* Default - 0
* @param theShardId Long (OPTIONAL Field) - a particular db the Character is associated with
* Default - Use 0 if unused or does not have a value.
* @param theLevelId Long (MANDATORY Field) - the AreaId
* Default - 0
* @param theX Float (MANDATORY Field) - the Position X. Default - 0
* @param theY Float (MANDATORY Field) - the Position Y. Default - 0
* @param theZ Float (MANDATORY Field) - the Position Z. Default - 0
* @param theAreaName String (MANDATORY Field) - Default - "NA"
*/
public boolean levelBegin(final Date theDate, final String theAccountId,
final String theCharacterId, final long theCharacterLvl,
final long theShardId, final long theLevelId,
final float theX, final float theY,
final float theZ, final String theAreaName) {
final HashMap<String, String> aDataMap = new HashMap<String, String>();
aDataMap.put(DataMapKeys.TYPE,
String.valueOf(EventCodes.LEVEL_BEGIN));
aDataMap.put(DataMapKeys.ACCOUNT_ID, theAccountId);
aDataMap.put(DataMapKeys.CHARACTER_ID, theCharacterId);
aDataMap.put(DataMapKeys.CHARACTER_LEVEL, String.valueOf(theCharacterLvl));
aDataMap.put(DataMapKeys.SHARD_ID, String.valueOf(theShardId));
aDataMap.put(DataMapKeys.AREA_ID, String.valueOf(theLevelId));
aDataMap.put(DataMapKeys.POSITION_X, String.valueOf(theX));
aDataMap.put(DataMapKeys.POSITION_Y, String.valueOf(theY));
aDataMap.put(DataMapKeys.POSITION_Z, String.valueOf(theZ));
aDataMap.put(DataMapKeys.AREA_NAME, theAreaName);
return this.logEvent(aDataMap, theDate);
}
/**
* Logs a Level End event- Refers to the level in event (27) but instead of the beginning of levels
* it refers to the end of levels. Log the player completing a level
*
* @param theDate Date - when did the player complete the level?
* @param theAccountId String (MANDATORY Field) - the UUID associated with a particular user/player - email, number
* @param theCharacterId String (MANDATORY Field) - does an account have multiple characters associated with it?
* Use this field to track such identifiers.
* Default - AccountId should be used as default if there's no CharacterId
* @param theCharacterLvl Long (MANDATORY Field) - the numeric level identifier the character currently is at.
* Default - 0
* @param theShardId Long (OPTIONAL Field) - a particular db the Character is associated with
* Default - Use 0 if unused or does not have a value.
* @param theLevelId Long (OPTIONAL Field) - the AreaId. Default - 0
* @param theX Float (MANDATORY Field) - the Position X. Default - 0
* @param theY float (MANDATORY Field) - the Position Y. Default - 0
* @param theZ float (MANDATORY Field) - the Position Z. Default - 0
* @param theAreaName String (MANDATORY Field) - Default - "NA"
*/
public boolean levelEnd(final Date theDate, final String theAccountId,
final String theCharacterId, final long theCharacterLvl,
final long theShardId, final long theLevelId,
final float theX, final float theY,
final float theZ, final String theAreaName) {
final HashMap<String, String> aDataMap = new HashMap<String, String>();
aDataMap.put(DataMapKeys.TYPE,
String.valueOf(EventCodes.LEVEL_END));
aDataMap.put(DataMapKeys.ACCOUNT_ID, theAccountId);
aDataMap.put(DataMapKeys.CHARACTER_ID, theCharacterId);
aDataMap.put(DataMapKeys.CHARACTER_LEVEL, String.valueOf(theCharacterLvl));
aDataMap.put(DataMapKeys.SHARD_ID, String.valueOf(theShardId));
aDataMap.put(DataMapKeys.AREA_ID, String.valueOf(theLevelId));
aDataMap.put(DataMapKeys.POSITION_X, String.valueOf(theX));
aDataMap.put(DataMapKeys.POSITION_Y, String.valueOf(theY));
aDataMap.put(DataMapKeys.POSITION_Z, String.valueOf(theZ));
aDataMap.put(DataMapKeys.AREA_NAME, theAreaName);
return this.logEvent(aDataMap, theDate);
}
/**
* Logs an Area Enter event- Many games are organized in the form of virtual worlds where there are many
* geographical areas. This event refers to the time when a player enters such an area
*
* @param theDate Date - when did the player enter the area?
* @param theAccountId String (MANDATORY Field) - the UUID associated with a particular user/player - email, number
* @param theCharacterId String (MANDATORY Field) - does an account have multiple characters associated with it?
* Use this field to track such identifiers.
* Default - AccountId should be used as default if there's no CharacterId
* @param theCharacterLvl Long (MANDATORY Field) - the numeric level identifier the character currently is at.
* Default - 0
* @param theShardId Long (OPTIONAL Field) - a particular db the Character is associated with
* Default - Use 0 if unused or does not have a value
* @param theAreaId Long (MANDATORY Field) - the Enter Area ID. It is necessary to pass either AreaId or AreaName
* Default - 0 if does not makes sense/already have passed
* AreaName
* @param theX Float (MANDATORY Field) - the Positin X. Default - 0
* @param theY Float (MANDATORY Field) - the Position Y. Default - 0
* @param theZ Float (MANDATORY Field) - the Position Z. Default - 0
* @param theAreaName String (MANDATORY Field) - the Enter Area Name. It is necessary to pass either AreaId or AreaName
* Default - "NA" if does not makes sense/already have passed AreaId
*
*/
public boolean areaEnter(final Date theDate, final String theAccountId,
final String theCharacterId, final long theCharacterLvl,
final long theShardId, final long theAreaId,
final float theX, final float theY,
final float theZ, final String theAreaName) {
final HashMap<String, String> aDataMap = new HashMap<String, String>();
aDataMap.put(DataMapKeys.TYPE,
String.valueOf(EventCodes.AREA_ENTER));
aDataMap.put(DataMapKeys.ACCOUNT_ID, theAccountId);
aDataMap.put(DataMapKeys.CHARACTER_ID, theCharacterId);
aDataMap.put(DataMapKeys.CHARACTER_LEVEL, String.valueOf(theCharacterLvl));
aDataMap.put(DataMapKeys.SHARD_ID, String.valueOf(theShardId));
aDataMap.put(DataMapKeys.AREA_ID, String.valueOf(theAreaId));
aDataMap.put(DataMapKeys.POSITION_X, String.valueOf(theX));
aDataMap.put(DataMapKeys.POSITION_Y, String.valueOf(theY));
aDataMap.put(DataMapKeys.POSITION_Z, String.valueOf(theZ));
aDataMap.put(DataMapKeys.AREA_NAME, theAreaName);
return this.logEvent(aDataMap, theDate);
}
/**
* Logs an Area Exit event- Similar to event (29) but with the difference that it refers to the time when a
* player exits an area. Logs the player exiting an area
*
* @param theDate Date - when did the player leave the area?
* @param theAccountId String (MANDATORY Field) - the UUID associated with a particular user/player - email, number
* @param theCharacterId String (MANDATORY Field) - does an account have multiple characters associated with it?
* Use this field to track such identifiers.
* Default - AccountId should be used as default if there's no CharacterId
* @param theCharacterLvl Long (MANDATORY Field) - the numeric level identifier the character currently is at.
* Default - 0
* @param theShardId Long (OPTIONAL Field)- a particular db the Character is associated with
* Default - Use 0 if unused or does not have a value
* @param theAreaId Long (MANDATORY Field) - the Exited Area ID. It is necessary to pass either AreaId or AreaName
* Default - 0 if does not makes sense/already have passed AreaName
* @param theX Float (MANDATORY Field) - the Position X. Default - 0
* @param theY Float (MANDATORY Field) - the Position Y. Default - 0
* @param theZ Float (MANDATORY Field) - the Position Z. Default - 0
* @param theAreaName String (MANDATORY Field) - the Exited Area Name. It is necessary to pass either AreaId or AreaName
* Default - "NA" if does not makes sense/already have passed AreaId
*/
public boolean areaExit(final Date theDate, final String theAccountId,
final String theCharacterId, final long theCharacterLvl,
final long theShardId, final long theAreaId,
final float theX, final float theY,
final float theZ, final String theAreaName) {
final HashMap<String, String> aDataMap = new HashMap<String, String>();
aDataMap.put(DataMapKeys.TYPE,
String.valueOf(EventCodes.AREA_EXIT));
aDataMap.put(DataMapKeys.ACCOUNT_ID, theAccountId);
aDataMap.put(DataMapKeys.CHARACTER_ID, theCharacterId);
aDataMap.put(DataMapKeys.CHARACTER_LEVEL, String.valueOf(theCharacterLvl));
aDataMap.put(DataMapKeys.SHARD_ID, String.valueOf(theShardId));
aDataMap.put(DataMapKeys.AREA_ID, String.valueOf(theAreaId));
aDataMap.put(DataMapKeys.POSITION_X, String.valueOf(theX));
aDataMap.put(DataMapKeys.POSITION_Y, String.valueOf(theY));
aDataMap.put(DataMapKeys.POSITION_Z, String.valueOf(theZ));
aDataMap.put(DataMapKeys.AREA_NAME, theAreaName);
return this.logEvent(aDataMap, theDate);
}
/**
* Logs a NPC Interaction event- A large class of games have non-player characters (NPCs) which interact with the player
* in the gaming environment. They have different levels of difficulty and may be friendly
* or aggressive. This event is used to populate the dimension tables for NPCs and is referred
* to by all the other events that refer to NPCs.Logs the interaction between an in-game NPC
* and a player
*
* @param theDate Date - when did the interaction take place?
* @param theAccountId String (MANDATORY Field) - the UUID associated with a particular user/player - email, number
* @param theCharacterId String (MANDATORY Field) - does an account have multiple characters associated with it?
* Use this field to track such identifiers.
* Default - AccountId should be used as default if there's no CharacterId
* @param theShardId Long (OPTIONAL Field)- a particular db the Character is associated with
* Default - Use 0 if unused or does not have a value
* @param npcEventName String (MANDATORY Field)
* @param npcEventType String (MANDATORY Field) - examples: "Combat", "Purchase", "quest"
* @param npcId Long (MANDATORY Field) - It is necessary to pass either npcId or npcName
* Default - 0 if does not makes sense/already have passed npcName
* @param npcName String (MANDATORY Field) - It is necessary to pass either npcId or npcName
* Default - "NA" if does not makes sense/already have passed npcId
* @param npcType String (MANDATORY Field) - examples: Vendor, Enemy, Quest Giver, Companion, Pure Scenery, Dialog, Other
* Default - "Other"
* @param theMinLevel Integer (MANDATORY Field) - the lowest level this NPC occurs on
* Default - NULL
* @param theMaxLevel Integer (MANDATORY Field) - the highest level this NPC occurs on
* Default - NULL
* @param theToughness Integer (MANDATORY Field) - a numeric representation of the NPC's ability, example: 0.25
* Default - NULL
* @param theToughnessEnum String (MANDATORY Field) - a textual representation of the NPC's toughness, example: quarter
* Default - NULL
*/
public boolean logNpcInteraction(final Date theDate, final String theAccountId,
final String theCharacterId, final long theShardId,
final String npcEventName, final String npcEventType,
final long npcId, final String npcName,
final String npcType, final int theMinLevel,
final int theMaxLevel, final int theToughness,
final String theToughnessEnum) {
final HashMap<String, String> aDataMap = new HashMap<String, String>();
aDataMap.put(DataMapKeys.TYPE,
String.valueOf(EventCodes.NPC_INTERACTION));
aDataMap.put(DataMapKeys.ACCOUNT_ID, theAccountId);
aDataMap.put(DataMapKeys.CHARACTER_ID, theCharacterId);
aDataMap.put(DataMapKeys.SHARD_ID, String.valueOf(theShardId));
aDataMap.put(DataMapKeys.NPC_EVENT_NAME, npcEventName);
aDataMap.put(DataMapKeys.NPC_EVENT_TYPE, npcEventType);
aDataMap.put(DataMapKeys.NPC_ID, String.valueOf(npcId));
aDataMap.put(DataMapKeys.NPC_NAME, npcName);
aDataMap.put(DataMapKeys.NPC_TYPE, npcType);
aDataMap.put(DataMapKeys.NPC_LEVEL_MIN, String.valueOf(theMinLevel));
aDataMap.put(DataMapKeys.NPC_LEVEL_MAX, String.valueOf(theMaxLevel));
aDataMap.put(DataMapKeys.NPC_TOUGHNESS, String.valueOf(theToughness));
aDataMap.put(DataMapKeys.NPC_TOUGHNESS_ENUM, theToughnessEnum);
return this.logEvent(aDataMap, theDate);
}
/**
* Logs a Challenge event- Challenges are elements of games where a player or even a group of players can perform
* a tasks or a set of tasks to get some reward within the game. Alternatively completing a
* challenge may be necessary to level up in the games. In some genres of games e.g., MMORPGs
* a challenge may be referred to as a quest. Logs a player challenge - starting/working/done
*
* @param theDate Date - timestamp of updates to challenge
* @param theAccountId String (MANDATORY Field) - the UUID associated with a particular user/player - email, number
* @param theCharacterId String (MANDATORY Field) - does an account have multiple characters associated with it?
* Use this field to track such identifiers.
* Default - AccountId should be used as default if there's no CharacterId
* @param theShardId Long (OPTIONAL Field)- a particular db the Character is associated with
* Default - Use 0 if unused or does not have a value
* @param challengeId String (MANDATORY Field)
* @param challengeType String (MANDATORY Field) - examples:Reach A Threshold Number Of Actions, Reach A Threshold Number Of Points,
* Kill An NPC Or Multiple NPCs, Find/Collect An Item Or Items, Timed Event, Other
* Default - "Other"
* @param challengeStatus String (MANDATORY Field) - acceptable values are ONLY: Accepted, Completed, Abandoned
*
*/
public boolean logChallenge(final Date theDate, final String theAccountId,
final String theCharacterId, final long theShardId,
final String challengeId, final String challengeType,
final String challengeStatus) {
final HashMap<String, String> aDataMap = new HashMap<String, String>();
aDataMap.put(DataMapKeys.TYPE,
String.valueOf(EventCodes.CHALLENGE));
aDataMap.put(DataMapKeys.ACCOUNT_ID, theAccountId);
aDataMap.put(DataMapKeys.CHARACTER_ID, theCharacterId);
aDataMap.put(DataMapKeys.SHARD_ID, String.valueOf(theShardId));
aDataMap.put(DataMapKeys.CHALLENGE_ID, challengeId);
aDataMap.put(DataMapKeys.CHALLENGE_TYPE, challengeType);
aDataMap.put(DataMapKeys.CHALLENGE_STATUS, challengeStatus);
return this.logEvent(aDataMap, theDate);
}
/**
* Logs a Recruitment Send event- There are certian types of activities or interactions in games where a player
* may invite other players to join him/her in finishing a certain task. This event captures
* such events where a person may recruit others to join them in those activities.
* Logs that a recruitment message was sent
*
* @param theDate Date - when was the recruitment message sent?
* @param sendAccId String (MANDATORY Field) - the UUID associated with a particular user/player - email, number
* @param sendCharId String (MANDATORY Field) - does an account have multiple characters associated with it?
* Use this field to track such identifiers.
* Default - sendAccId should be used as default if there's no sendCharId
* @param recvAccId String (MANDATORY Field) - the UUID associated with a particular user/player - email, number
* @param recvCharId String (MANDATORY Field) - does an account have multiple characters associated with it?
* Use this field to track such identifiers.
* Default - recvAccId should be used as default if there's no recvCharId
* @param theRecruitmentType String (MANDATORY Field) - open ended String field, Examples: Invited By Another User, Ad-Website,
* Ad-Social Media, Ad-Mobile, Ad-Within Another App, Promotion, Other
* Default - "Other"
*/
public boolean recruitmentSend(final Date theDate, final String sendAccId,
final String sendCharId, final String recvAccId,
final String recvCharId, final String theRecruitmentType) {
final HashMap<String, String> aDataMap = new HashMap<String, String>();
aDataMap.put(DataMapKeys.TYPE,
String.valueOf(EventCodes.RECRUITMENT_SEND));
aDataMap.put(DataMapKeys.SENDER_ACCOUNT_ID, sendAccId);
aDataMap.put(DataMapKeys.SENDER_CHARACTER_ID, sendCharId);
aDataMap.put(DataMapKeys.RECEIVER_ACCOUNT_ID, recvAccId);
aDataMap.put(DataMapKeys.RECEIVER_CHARACTER_ID, recvCharId);
aDataMap.put(DataMapKeys.RECRUITMENT_TYPE, theRecruitmentType);
return this.logEvent(aDataMap, theDate);
}
/**
* Logs a Recruitment Receive event- This event refers to the result of the recuritment action from event (33) i.e.,
* if the person to whom the message was sent accepted the invite or declined it.
* Logs that a recruitment message was responded to.
*
* @param theDate Date - when was the response received?
* @param sendAccId String (MANDATORY Field) - the UUID associated with a particular user/player - email, number
* @param sendCharId String (MANDATORY Field) - does an account have multiple characters associated with it?
* Use this field to track such identifiers.
* Default - sendAccId should be used as default if there's no sendCharId
* @param recvAccId String (MANDATORY Field) - the UUID associated with a particular user/player - email, number
* @param recvCharId String (MANDATORY Field) - does an account have multiple characters associated with it?
* Use this field to track such identifiers.
* Default - recvAccId should be used as default if there's no recvCharId
* @param theRecruitmentType String (MANDATORY Field) - open ended String field, Examples: Invited By Another User, Ad-Website,
* Ad-Social Media, Ad-Mobile, Ad-Within Another App, Promotion, Other
* Default - "Other"
* @param theRecruitmentOutcome String (MANDATORY Field) - open ended String field. Example: Accepted,Rejected
* Default - "Rejected"
*/
public boolean recruitmentReceive(final Date theDate, final String sendAccId,
final String sendCharId, final String recvAccId,
final String recvCharId, final String theRecruitmentType,
final String theRecruitmentOutcome) {
final HashMap<String, String> aDataMap = new HashMap<String, String>();
aDataMap.put(DataMapKeys.TYPE,
String.valueOf(EventCodes.RECRUITMENT_RECEIVE));
aDataMap.put(DataMapKeys.SENDER_ACCOUNT_ID, sendAccId);
aDataMap.put(DataMapKeys.SENDER_CHARACTER_ID, sendCharId);
aDataMap.put(DataMapKeys.RECEIVER_ACCOUNT_ID, recvAccId);
aDataMap.put(DataMapKeys.RECEIVER_CHARACTER_ID, recvCharId);
aDataMap.put(DataMapKeys.RECRUITMENT_TYPE, theRecruitmentType);
aDataMap.put(DataMapKeys.RECRUITMENT_OUTCOME, theRecruitmentOutcome);
return this.logEvent(aDataMap, theDate);
}
/**
* Logs a Store Create event- Some games allow players to set up in-game stores where they can sell items.
* This event refers to the creation of such stores
*
* @param theDate Date
* @param theStoreId long (MANDATORY Field) - Unique ID. It is necessary to pass either StoreId or StoreDesc
* Default - Empty/Blank "" if does not makes sense/already have passed StoreDesc
* @param theStoreDesc String (MANDATORY Field) - It is necessary to pass either StoreId or StoreDesc
* Default - "NA" if does not makes sense/already have passed StoreId
* @param theStreetAddr String (MANDATORY Field) - Default - "NA"
* @param theCity String (MANDATORY Field) - Default - "NA"
* @param theState String (MANDATORY Field) - Default - "NA"
* @param theCountry String (MANDATORY Field) - Default - "NA"
* @param thePostalCode String (MANDATORY Field) - Default - 0
*/
public boolean storeCreate(final Date theDate, final long theStoreId,
final String theStoreDesc, final String theStreetAddr,
final String theCity, final String theState,
final String theCountry, final String thePostalCode) {
final HashMap<String, String> aDataMap = new HashMap<String, String>();
aDataMap.put(DataMapKeys.TYPE,
String.valueOf(EventCodes.STORE_CREATE));
aDataMap.put(DataMapKeys.STORE_ID, String.valueOf(theStoreId));
aDataMap.put(DataMapKeys.STORE_DESCRIPTION, theStoreDesc);
aDataMap.put(DataMapKeys.MAP_REAL_ADDRESS, theStreetAddr);
aDataMap.put(DataMapKeys.MAP_REAL_CITY, theCity);
aDataMap.put(DataMapKeys.MAP_REAL_STATE, theState);
aDataMap.put(DataMapKeys.MAP_REAL_COUNTRY, theCountry);
aDataMap.put(DataMapKeys.MAP_REAL_POSTAL_CODE, thePostalCode);
return this.logEvent(aDataMap, theDate);
}
/**
* Logs a Store Delete event- This event refers to scenarios where the stores from event (35) are deleted
*
* @param theDate Date
* @param theStoreId Long (MANDATORY Field) - Unique ID associated with the store
*/
public boolean storeDelete(final Date theDate, final long theStoreId) {
final HashMap<String, String> aDataMap = new HashMap<String, String>();
aDataMap.put(DataMapKeys.TYPE,
String.valueOf(EventCodes.STORE_DELETE));
aDataMap.put(DataMapKeys.STORE_ID, String.valueOf(theStoreId));
return this.logEvent(aDataMap, theDate);
}
/**
* Logs a Store Buy Item event- This event refers to transactions which involve items which are bought from a store.
* This includes information about the type of currency which is used to buy these items
* i.e., real world currency or virtual currency.
*
* @param theDate Date - when was the item bought?
* @param sendAccId String (MANDATORY Field) - the UUID associated with a particular user/player - email, number
* @param sendCharId String (MANDATORY Field) - does an account have multiple characters associated with it?
* Use this field to track such identifiers.
* Default - sendAccId should be used as default if there's no sendCharId
* @param recvAccId String (MANDATORY Field) - the UUID associated with a particular user/player - email, number
* @param recvCharId String (MANDATORY Field) - does an account have multiple characters associated with it?
* Use this field to track such identifiers.
* Default - recvAccId should be used as default if there's no recvCharId
* @param theShardId Long (OPTIONAL Field)- a particular db the Character is associated with
* Default - Use 0 if unused or does not have a value
* @param theStoreId Long (MANDATORY Field) - previously initialized app unique id
* @param theItemId Long (MANDATORY Field) - previously initialized app unique id. It is necessary to pass either ItemId or ItemName
* Default - 0 if does not makes sense/already have passed ItemName
* @param theItemName String (MANDATORY Field) - Name of the item bought. It is necessary to pass either ItemId or ItemName
* Default - "NA" if does not makes sense/already have passed ItemId
* @param theItemPrice Float (MANDATORY Field) - Price of the item
* @param theCurrencyType Integer (MANDATORY Field) - Accepted values are ONLY: 0 = real world currency, 1 = virtual currency
* @param theVirtualCurrencyLbl String (OPTIONAL Field) - a virtual currency previously initialized from Event# 14.
* If CurrencyType=1, set this Mandatory, else send " ".
* @param theCurrencyValue Float (MANDATORY Field) - how much of a particular currency was used for this transaction
* @param theVirtualCurrencyCount Integer (OPTIONAL Field) - Default - NULL
*/
public boolean storeBuyItem(final Date theDate, final String sendAccId,
final String sendCharId, final String recvAccId,
final String recvCharId, final long theShardId,
final long theStoreId, final long theItemId,
final String theItemName, final float theItemPrice,
final int theCurrencyType, final String theVirtualCurrencyLbl,
final float theCurrencyValue, final int theVirtualCurrencyCount) {
final HashMap<String, String> aDataMap = new HashMap<String, String>();
aDataMap.put(DataMapKeys.TYPE,
String.valueOf(EventCodes.STORE_BUY_ITEM));
aDataMap.put(DataMapKeys.SENDER_ACCOUNT_ID, sendAccId);
aDataMap.put(DataMapKeys.SENDER_CHARACTER_ID, sendCharId);
aDataMap.put(DataMapKeys.RECEIVER_ACCOUNT_ID, recvAccId);
aDataMap.put(DataMapKeys.RECEIVER_CHARACTER_ID, recvAccId);
aDataMap.put(DataMapKeys.SHARD_ID, String.valueOf(theShardId));
aDataMap.put(DataMapKeys.STORE_ID, String.valueOf(theStoreId));
aDataMap.put(DataMapKeys.ITEM_ID, String.valueOf(theItemId));
aDataMap.put(DataMapKeys.ITEM_NAME, theItemName);
aDataMap.put(DataMapKeys.ITEM_PRICE, String.valueOf(theItemPrice));
aDataMap.put(DataMapKeys.CURRENCY_TYPE, String.valueOf(theCurrencyType));
aDataMap.put(DataMapKeys.CURRENCY_VIRTUAL_LABEL, theVirtualCurrencyLbl);
aDataMap.put(DataMapKeys.CURRENCY_VALUE, String.valueOf(theCurrencyValue));
aDataMap.put(DataMapKeys.CURRENCY_VIRTUAL_COUNT, String.valueOf(theVirtualCurrencyCount));
return this.logEvent(aDataMap, theDate);
}
/**
* Logs a Store Login event- The time at which a player logs into a virtual store.
* Logs a store login occurrence
*
* @param theDate Date - when did the user log into the store?
* @param theAccountId String (MANDATORY Field) - the UUID associated with a particular user/player - email, number
* @param theCharacterId String (MANDATORY Field) - does an account have multiple characters associated with it?
* Use this field to track such identifiers.
* Default - AccountId should be used as default if there's no CharacterId
* @param theShardId Long (OPTIONAL Field)- a particular db the Character is associated with
* Default - Use 0 if unused or does not have a value
* @param theStoreId Long (MANDATORY Field) - previously initialized app unique id
*/
public boolean storeLogin(final Date theDate, final String theAccountId,
final String theCharacterId, final long theShardId,
final long theStoreId) {
final HashMap<String, String> aDataMap = new HashMap<String, String>();
aDataMap.put(DataMapKeys.TYPE,
String.valueOf(EventCodes.STORE_LOGIN));
aDataMap.put(DataMapKeys.ACCOUNT_ID, theAccountId);
aDataMap.put(DataMapKeys.CHARACTER_ID, theCharacterId);
aDataMap.put(DataMapKeys.SHARD_ID, String.valueOf(theShardId));
aDataMap.put(DataMapKeys.STORE_ID, String.valueOf(theStoreId));
return this.logEvent(aDataMap, theDate);
}
/**
* Logs a Store Logout event- The time at which a player logs out from a virtual store
* Logs a store logout occurrence
*
* @param theDate Date - when did the logout happen?
* @param theAccountId String (MANDATORY Field) - the UUID associated with a particular user/player - email, number
* @param theCharacterId String (MANDATORY Field) - does an account have multiple characters associated with it?
* Use this field to track such identifiers.
* Default - AccountId should be used as default if there's no CharacterId
* @param theShardId Long (OPTIONAL Field)- a particular db the Character is associated with
* Default - Use 0 if unused or does not have a value
* @param theStoreId Long (MANDATORY Field) - previously initialized app unique id
*/
public boolean storeLogout(final Date theDate, final String theAccountId,
final String theCharacterId, final long theShardId,
final long theStoreId) {
final HashMap<String, String> aDataMap = new HashMap<String, String>();
aDataMap.put(DataMapKeys.TYPE,
String.valueOf(EventCodes.STORE_LOGOUT));
aDataMap.put(DataMapKeys.ACCOUNT_ID, theAccountId);
aDataMap.put(DataMapKeys.CHARACTER_ID, theCharacterId);
aDataMap.put(DataMapKeys.SHARD_ID, String.valueOf(theShardId));
aDataMap.put(DataMapKeys.STORE_ID, String.valueOf(theStoreId));
return this.logEvent(aDataMap, theDate);
}
/**
* Logs a Store Add To Cart event- This event refers to the case when the user adds an item to his/her cart.
* It should be noted that this event is not the same as buying an item but it is only
* about selecting an item. In some games selection may be a prerequisite for buying an
* item. Logs an add to cart event
*
* @param theDate Date - when was the item added to the "cart"?
* @param theAccountId String (MANDATORY Field) - the UUID associated with a particular user/player - email, number
* @param theCharacterId String (MANDATORY Field) - does an account have multiple characters associated with it?
* Use this field to track such identifiers.
* Default - AccountId should be used as default if there's no CharacterId
* @param theStoreId Long (MANDATORY Field) - previously initialized app unique id
* @param theItemId Long (MANDATORY Field) - It is necessary to pass either ItemId or ItemName
* Default - 0 if does not makes sense/already have passed ItemName
* @param theItemName String (MANDATORY Field) - It is necessary to pass either ItemId or ItemName
* Default - "NA" if does not makes sense/already have passed ItemId
* @param theItemType String (MANDATORY Field) - examples: Raw Materials, Mounts And Pets, Weapons, Armor, Upgrades,
* Buffs And Enchantments, Display Items, Aesthetic Items, Housing, Vehicle, Vendor Trash, Containers, Tools, Other
* Default - "Other"
*/
public boolean storeAddToCart(final Date theDate, final String theAccountId,
final String theCharacterId, final long theStoreId,
final long theItemId, final String theItemName,
final String theItemType) {
final HashMap<String, String> aDataMap = new HashMap<String, String>();
aDataMap.put(DataMapKeys.TYPE,
String.valueOf(EventCodes.STORE_CART_ADD));
aDataMap.put(DataMapKeys.ACCOUNT_ID, theAccountId);
aDataMap.put(DataMapKeys.CHARACTER_ID, theCharacterId);
aDataMap.put(DataMapKeys.STORE_ID, String.valueOf(theStoreId));
aDataMap.put(DataMapKeys.ITEM_ID, String.valueOf(theItemId));
aDataMap.put(DataMapKeys.ITEM_NAME, theItemName);
aDataMap.put(DataMapKeys.ITEM_TYPE, theItemType);
return this.logEvent(aDataMap, theDate);
}
/**
* Logs a Guild Enter event- Guilds are analogous to organizations in many online games.
* This event records information regarding when a player becomes part of a guild
* and if he/she is the leader of the guild
*
* @param theDate Date - when did the player enter the guild?
* @param theAccountId String (MANDATORY Field) - the UUID associated with a particular user/player - email, number
* @param theCharacterId String (MANDATORY Field) - does an account have multiple characters associated with it?
* Use this field to track such identifiers.
* Default - AccountId should be used as default if there's no CharacterId
* @param theCharacterLvl Long (MANDATORY Field) - the numeric level identifier the character currently is at
* Default - 0
* @param theShardId Long (OPTIONAL Field)- a particular db the Character is associated with
* Default - Use 0 if unused or does not have a value
* @param theGuildId Long (MANDATORY Field)
*
*/
public boolean logEnterGuild(final Date theDate, final String theAccountId,
final String theCharacterId, final long theCharacterLvl,
final long theShardId, final long theGuildId) {
final HashMap<String, String> aDataMap = new HashMap<String, String>();
aDataMap.put(DataMapKeys.TYPE,
String.valueOf(EventCodes.GUILD_ENTER));
aDataMap.put(DataMapKeys.ACCOUNT_ID, theAccountId);
aDataMap.put(DataMapKeys.CHARACTER_ID, theCharacterId);
aDataMap.put(DataMapKeys.CHARACTER_LEVEL, String.valueOf(theCharacterLvl));
aDataMap.put(DataMapKeys.SHARD_ID, String.valueOf(theShardId));
aDataMap.put(DataMapKeys.GUILD_ID, String.valueOf(theGuildId));
return this.logEvent(aDataMap, theDate);
}
/**
* Logs a Guild Exit event- The event records information regarding exiting a guild (see event 41)
* and the reason for leaving a guild e.g., leaving voluntarily, being evicted etc
*
* @param theDate Date - when did the player exit the guild?
* @param theAccountId String (MANDATORY Field) - the UUID associated with a particular user/player - email, number
* @param theCharacterId String (MANDATORY Field) - does an account have multiple characters associated with it?
* Use this field to track such identifiers.
* Default - AccountId should be used as default if there's no CharacterId
* @param theCharacterLvl Long (MANDATORY Field) - the numeric level identifier the character currently is at
* Default - 0
* @param theShardId Long (OPTIONAL Field)- a particular db the Character is associated with
* Default - Use 0 if unused or does not have a value
* @param theGuildId Long (MANDATORY Field)
* @param theExitReason String (MANDATORY Field) - examples: "hacking", "bad team"
* Default - "NA"
*/
public boolean logExitGuild(final Date theDate, final String theAccountId,
final String theCharacterId, final long theCharacterLvl,
final long theShardId, final long theGuildId,
final String theExitReason) {
final HashMap<String, String> aDataMap = new HashMap<String, String>();
aDataMap.put(DataMapKeys.TYPE,
String.valueOf(EventCodes.GUILD_EXIT));
aDataMap.put(DataMapKeys.ACCOUNT_ID, theAccountId);
aDataMap.put(DataMapKeys.CHARACTER_ID, theCharacterId);
aDataMap.put(DataMapKeys.CHARACTER_LEVEL, String.valueOf(theCharacterLvl));
aDataMap.put(DataMapKeys.SHARD_ID, String.valueOf(theShardId));
aDataMap.put(DataMapKeys.GUILD_ID, String.valueOf(theGuildId));
aDataMap.put(DataMapKeys.GUILD_EXIT_REASON, theExitReason);
return this.logEvent(aDataMap, theDate);
}
/**
* Logs a Friend Addition event- Many online games also allow adding other players as friends.
* This event captures information about friending other players.
* It should be noted that this relationshop may or may not be reciprocated.
*
* @param theDate Date - when did the sender add the receiver?
* @param sendAccId String (MANDATORY Field) - the UUID associated with a particular user/player - email, number
* @param sendCharId String (MANDATORY Field) - does an account have multiple characters associated with it?
* Use this field to track such identifiers.
* Default - sendAccId should be used as default if there's no sendCharId
* @param recvAccId String (MANDATORY Field) - the UUID associated with a particular user/player - email, number
* @param recvCharId String (MANDATORY Field) - does an account have multiple characters associated with it?
* Use this field to track such identifiers.
* Default - recvAccId should be used as default if there's no recvCharId
*/
public boolean logFriendAdd(final Date theDate, final String sendAccId,
final String sendCharId, final String recvAccId,
final String recvCharId) {
final HashMap<String, String> aDataMap = new HashMap<String, String>();
aDataMap.put(DataMapKeys.TYPE,
String.valueOf(EventCodes.FRIEND_ADD));
aDataMap.put(DataMapKeys.SENDER_ACCOUNT_ID, sendAccId);
aDataMap.put(DataMapKeys.SENDER_CHARACTER_ID, sendCharId);
aDataMap.put(DataMapKeys.RECEIVER_ACCOUNT_ID, recvAccId);
aDataMap.put(DataMapKeys.RECEIVER_CHARACTER_ID, recvCharId);
return this.logEvent(aDataMap, theDate);
}
/**
* Logs a Friend Delete event- This event captures information about the end of a friend relationship (see event 43).
*
* @param theDate Date - when did the sender delete the receiver?
* @param sendAccId String (MANDATORY Field) - the UUID associated with a particular user/player - email, number
* @param sendCharId String (MANDATORY Field) - does an account have multiple characters associated with it?
* Use this field to track such identifiers.
* Default - sendAccId should be used as default if there's no sendCharId
* @param recvAccId String (MANDATORY Field) - the UUID associated with a particular user/player - email, number
* @param recvCharId String (MANDATORY Field) - does an account have multiple characters associated with it?
* Use this field to track such identifiers.
* Default - recvAccId should be used as default if there's no recvCharId
*/
public boolean logFriendDelete(final Date theDate, final String sendAccId,
final String sendCharId, final String recvAccId,
final String recvCharId) {
final HashMap<String, String> aDataMap = new HashMap<String, String>();
aDataMap.put(DataMapKeys.TYPE,
String.valueOf(EventCodes.FRIEND_DELETE));
aDataMap.put(DataMapKeys.SENDER_ACCOUNT_ID, sendAccId);
aDataMap.put(DataMapKeys.SENDER_CHARACTER_ID, sendCharId);
aDataMap.put(DataMapKeys.RECEIVER_ACCOUNT_ID, recvAccId);
aDataMap.put(DataMapKeys.RECEIVER_CHARACTER_ID, recvCharId);
return this.logEvent(aDataMap, theDate);
}
/**
* Logs a Guild Leader event- Information regarding whether the player is the leader of the guild with the given guild id
*
* @param theDate Date - when did the player exit the guild?
* @param theAccountId String (MANDATORY Field) - the UUID associated with a particular user/player - email, number
* @param theCharacterId String (MANDATORY Field) - does an account have multiple characters associated with it?
* Use this field to track such identifiers.
* Default - AccountId should be used as default if there's no CharacterId
* @param theGuildId Long (MANDATORY Field)
*/
public boolean putGuildLeader(final Date theDate, final String theAccountId,
final String theCharacterId, final long theGuildId) {
final HashMap<String, String> aDataMap = new HashMap<String, String>();
aDataMap.put(DataMapKeys.TYPE,
String.valueOf(EventCodes.GUILD_LEADER));
aDataMap.put(DataMapKeys.ACCOUNT_ID, theAccountId);
aDataMap.put(DataMapKeys.CHARACTER_ID, theCharacterId);
aDataMap.put(DataMapKeys.GUILD_ID, String.valueOf(theGuildId));
return this.logEvent(aDataMap, theDate);
}
/**
* Logs a UGC Copy event- Information regarding copying of an item that was created by a player. This event is
* not applicable to items that are built in by the gaming company.
* Tracks when User Generated Content is copied to another account
*
* @param theDate Date - when did the copy occur?
* @param theAccountId String (MANDATORY Field) - the UUID associated with a particular user/player - email, number
* @param theCharacterId String (MANDATORY Field) - does an account have multiple characters associated with it?
* Use this field to track such identifiers.
* Default - AccountId should be used as default if there's no CharacterId
* @param theShardId Long (OPTIONAL Field)- a particular db the Character is associated with
* Default - Use 0 if unused or does not have a value
* @param theItemId Long (MANDATORY Field) - the application unique numeric id
* It is necessary to pass either ItemId or ItemName
* Default - 0 if does not makes sense/already have passed ItemName
* @param theItemName String (MANDATORY Field) - example: "crafty button", "GMO grain"
* It is necessary to pass either ItemId or ItemName
* Default - "NA" if does not makes sense/already have passed ItemId
*/
public boolean trackUgcCopy(final Date theDate, final String theAccountId,
final String theCharacterId, final long theShardId,
final long theItemId, final String theItemName) {
final HashMap<String, String> aDataMap = new HashMap<String, String>();
aDataMap.put(DataMapKeys.TYPE,
String.valueOf(EventCodes.UGC_COPY));
aDataMap.put(DataMapKeys.ACCOUNT_ID, theAccountId);
aDataMap.put(DataMapKeys.CHARACTER_ID, theCharacterId);
aDataMap.put(DataMapKeys.SHARD_ID, String.valueOf(theShardId));
aDataMap.put(DataMapKeys.ITEM_ID, String.valueOf(theItemId));
aDataMap.put(DataMapKeys.ITEM_NAME, theItemName);
return this.logEvent(aDataMap, theDate);
}
/**
* Logs FARMER event- Indicates whether the player is a gold farmer and if so what type of gold farmer is he
*
* @param theDate Date - when did the event occurred
* @param theAccountId String (MANDATORY Field) - the UUID associated with a particular user/player - email, number
* @param theCharacterId String (MANDATORY Field) - does an account have multiple characters associated with it?
* Use this field to track such identifiers.
* Default - AccountId should be used as default if there's no CharacterId
* @param theShardId Long (OPTIONAL Field)- a particular db the Character is associated with
* Default - Use 0 if unused or does not have a value
* @param theFarmerType String (MANDATORY Field) - examples: Banker, Gatherer, Mule, Spammer, Other
* Default - "Other"
*/
public boolean logFarmer(final Date theDate, final String theAccountId,
final String theCharacterId, final long theShardId,
final String theFarmerType) {
final HashMap<String, String> aDataMap = new HashMap<String, String>();
aDataMap.put(DataMapKeys.TYPE,
String.valueOf(EventCodes.FARMER));
aDataMap.put(DataMapKeys.ACCOUNT_ID, theAccountId);
aDataMap.put(DataMapKeys.CHARACTER_ID, theCharacterId);
aDataMap.put(DataMapKeys.SHARD_ID, String.valueOf(theShardId));
aDataMap.put(DataMapKeys.FARMER_TYPE, theFarmerType);
return this.logEvent(aDataMap, theDate);
}
/**
* Logs a INTEGRITY event- Indiates whether this account was compromised and if so when was this account
* compromised and the type of integrity violation that resulted in compromising this account
*
* @param theDate Date - when did the event occurred
* @param theAccountId String (MANDATORY Field) - the UUID associated with a particular user/player - email, number
* @param theShardId Long (OPTIONAL Field)- a particular db the Character is associated with
* Default - Use 0 if unused or does not have a value
* @param theIntegrityType String (MANDATORY Field) - examples: Hacked Another'S Account, Had Their Account Hacked,
* Credit Card Fraud, Cheating, Antisocial Behavior, Other
* Default - "Other"
*/
public boolean logIntegrity(final Date theDate, final String theAccountId,
final long theShardId, final String theIntegrityType) {
final HashMap<String, String> aDataMap = new HashMap<String, String>();
aDataMap.put(DataMapKeys.TYPE,
String.valueOf(EventCodes.INTEGRITY));
aDataMap.put(DataMapKeys.ACCOUNT_ID, theAccountId);
aDataMap.put(DataMapKeys.SHARD_ID, String.valueOf(theShardId));
aDataMap.put(DataMapKeys.INTEGRITY_TYPE, theIntegrityType);
return this.logEvent(aDataMap, theDate);
}
/**
* logs a Reward event - relates to where a player may be awarded a certain reward for
* completing a certain task or a reward given based on seniority or some other reason.
*
* @param theDate Date - when did the copy occur?
* @param theAccountId String (MANDATORY Field) - the UUID associated with a particular user/player - email, number
* @param theCharacterId String (MANDATORY Field) - does an account have multiple characters associated with it?
* Use this field to track such identifiers.
* Default - AccountId should be used as default if there's no CharacterId
* @param theShardId Long (OPTIONAL Field)- a particular db the Character is associated with
* Default - Use 0 if unused or does not have a value
* @param theRewardType Long (MANDATORY Field) - acceptable values are: 0 = Real Currency, 1 = Virtual Currency, 2 = Item
* @param theRewardId String (MANDATORY Field) - acceptable values are: "1", when RewardType = 0(Real Currency);
* "virtual item name", when RewardType = 1(virtual currency);
* "item name", when RewardType = 2(item) - MANDATORY Field
* @param theItemType String (OPTIONAL Field) - Examples:Raw Materials, Mounts And Pets, Weapons, Armor, Upgrades,
* Buffs And Enchantments, Display Items, Aesthetic Items, Housing, Vehicle, Vendor Trash,
* Containers, Tools, Other
* Default - "Other"
* @param theRewardCount Float (MANDATORY Field) - Real money value, when Reward Type = 0
* count of the virtual currency, when Reward Type = 1
* Item Count, when Reward Type = 2
*/
public boolean logReward(final Date theDate, final String theAccountId,
final String theCharacterId, final long theShardId,
final long theRewardType, final String theRewardId,
final String theItemType, final float theRewardCount) {
final HashMap<String, String> aDataMap = new HashMap<String, String>();
aDataMap.put(DataMapKeys.TYPE,
String.valueOf(EventCodes.REWARD));
aDataMap.put(DataMapKeys.ACCOUNT_ID, theAccountId);
aDataMap.put(DataMapKeys.CHARACTER_ID, theCharacterId);
aDataMap.put(DataMapKeys.SHARD_ID, String.valueOf(theShardId));
aDataMap.put(DataMapKeys.REWARD_TYPE, String.valueOf(theRewardType));
aDataMap.put(DataMapKeys.REWARD_ID, theRewardId);
aDataMap.put(DataMapKeys.ITEM_TYPE, theItemType);
aDataMap.put(DataMapKeys.REWARD_COUNT, String.valueOf(theRewardCount));
return this.logEvent(aDataMap, theDate);
}
/**
* logs a Area DIM event - Some games have maps associated with them.
* This event saves the dimension information about these maps.
*
* @param theDate Date - when did the event occur?
* @param theAreaName String (MANDATORY Field) - It is necessary to pass either AreaId or AreaName
* Default - "NA" if does not makes sense/already have passed AreaId
* @param theAreaId Long (MANDATORY Field) - It is necessary to pass either AreaId or AreaName
* Default - 0 if does not makes sense/already have passed AreaName
* @param theMapId Long (MANDATORY Field) - It is necessary to pass either MapId or MapLabel
* Default - 0 if does not makes sense/already have passed MapLabel
* @param theMapLabel String (MANDATORY Field) - It is necessary to pass either MapId or MapLabel
* Default - NA if does not makes sense/already have passed MapId
* @param theMinX Float (MANDATORY Field) - Default - 0
* @param theMinY Float (MANDATORY Field) - Default - 0
* @param theMinZ Float (OPTIONAL Field) - Default - 0
* @param theMaxX Float (MANDATORY Field) - Default - 0
* @param theMaxY Float (MANDATORY Field) - Default - 0
* @param theMaxZ Float (OPTIONAL Field) - Default - 0
*/
public boolean logAreaDim(final Date theDate, final String theAreaName,
final long theAreaId, final long theMapId,
final String theMapLabel, final float theMinX,
final float theMinY, final float theMinZ,
final float theMaxX, final float theMaxY,
final float theMaxZ) {
final HashMap<String, String> aDataMap = new HashMap<String, String>();
aDataMap.put(DataMapKeys.TYPE,
String.valueOf(EventCodes.AREA_DIM));
aDataMap.put(DataMapKeys.AREA_NAME, theAreaName);
aDataMap.put(DataMapKeys.AREA_ID, String.valueOf(theAreaId));
aDataMap.put(DataMapKeys.MAP_ID, String.valueOf(theMapId));
aDataMap.put(DataMapKeys.MAP_LABEL, theMapLabel);
aDataMap.put(DataMapKeys.MIN_X, String.valueOf(theMinX));
aDataMap.put(DataMapKeys.MIN_Y, String.valueOf(theMinY));
aDataMap.put(DataMapKeys.MIN_Z, String.valueOf(theMinZ));
aDataMap.put(DataMapKeys.MAX_X, String.valueOf(theMaxX));
aDataMap.put(DataMapKeys.MAX_Y, String.valueOf(theMaxY));
aDataMap.put(DataMapKeys.MAX_Z, String.valueOf(theMaxZ));
return this.logEvent(aDataMap, theDate);
}
/**
* Logs a MOB event - Mobs refers to groupings of non-player characters (NPCs). This event captures the cases
* when the player confronts a mobs and kills that mob. This event captures the cases when the
* player confronts a mob and kills that mob
*
* @param theDate Date - when did the event occur?
* @param theAccountId String(MANDATORY Field) - the UUID associated with a particular user/player - email, number
* @param theCharacterId String (MANDATORY Field) - does an account have multiple characters associated with it?
* Use this field to track such identifiers.
* Default - AccountId should be used as default if there's no CharacterId
* @param theShardId Long (OPTIONAL Field)- a particular db the Character is associated with
* Default - Use 0 if unused or does not have a value
* @param theMobDesc String (OPTIONAL Field) - Default - ""
*/
public boolean logMob(final Date theDate, final String theAccountId,
final String theCharacterId, final long theShardId,
final String theMobDesc) {
final HashMap<String, String> aDataMap = new HashMap<String, String>();
aDataMap.put(DataMapKeys.TYPE,
String.valueOf(EventCodes.MOB));
aDataMap.put(DataMapKeys.ACCOUNT_ID, theAccountId);
aDataMap.put(DataMapKeys.CHARACTER_ID, theCharacterId);
aDataMap.put(DataMapKeys.SHARD_ID, String.valueOf(theShardId));
aDataMap.put(DataMapKeys.MOB_DESC, theMobDesc);
return this.logEvent(aDataMap, theDate);
}
/**
* Logs a CRM Action event- This is generic field for CRM (Customer Relationshop management) action that may be taken
* by a CRM person in the gaming company. Information regarding how the customer responded to
* the action is also saved
*
* @param theDate Date - when did the event occur?
* @param theAccountId String (MANDATORY Field) - the UUID associated with a particular user/player - email, number
* @param theCharacterId String (MANDATORY Field) - does an account have multiple characters associated with it?
* Use this field to track such identifiers.
* Default - AccountId should be used as default if there's no CharacterId
* @param theShardId Long (OPTIONAL Field)- a particular db the Character is associated with
* Default - Use 0 if unused or does not have a value
* @param theCrmAction String (MANDATORY Field) - Default - "Na"
* @param theCrmActionType String (MANDATORY Field) - Example: Free Item, Specific, Free Item, Range, Free Time,
* Discounted Item, Specific, Discounted Item, Range, Discounted Time, Social Promotion - Shared,
* Social Promotion - Pay Forward, Other
* Default - "Other"
* @param theCrmFulfilledStatus String (OPTIONAL Field) - Default - ""
* @param theCrmFulfilledTs Date (OPTIONAL Field) - when does the CRM action fulfilled?
* Default - ""
*/
public boolean logCrmAction(final Date theDate, final String theAccountId,
final String theCharacterId, final long theShardId,
final String theCrmAction, final String theCrmActionType,
final String theCrmFulfilledStatus, final Date theCrmFulfilledTs) {
final HashMap<String, String> aDataMap = new HashMap<String, String>();
aDataMap.put(DataMapKeys.TYPE,
String.valueOf(EventCodes.CRM_ACTION));
aDataMap.put(DataMapKeys.ACCOUNT_ID, theAccountId);
aDataMap.put(DataMapKeys.CHARACTER_ID, theCharacterId);
aDataMap.put(DataMapKeys.SHARD_ID, String.valueOf(theShardId));
aDataMap.put(DataMapKeys.CRM_ACTION, theCrmAction);
aDataMap.put(DataMapKeys.CRM_ACTION_TYPE, theCrmActionType);
aDataMap.put(DataMapKeys.CRM_FULFILLED_STATUS, theCrmFulfilledStatus);
aDataMap.put(DataMapKeys.CRM_FULFILLED_TIMESTAMP,
EventObj.getISO8601Str(theCrmFulfilledTs));
return this.logEvent(aDataMap, theDate);
}
/**
* logs a Customer Service Action event - This event captures all the events which are not described in any of the other
* events but still events which are within the game.
*
* @param theDate Date - when did the event occur?
* @param theAccountId String (MANDATORY Field) - the UUID associated with a particular user/player - email, number
* @param theCharacterId String (MANDATORY Field) - does an account have multiple characters associated with it?
* Use this field to track such identifiers.
* Default - AccountId should be used as default if there's no CharacterId
* @param theShardId Long (OPTIONAL Field)- a particular db the Character is associated with
* Default - Use 0 if unused or does not have a value
* @param theCsAction String (MANDATORY Field)
* @param theCsActionType String (MANDATORY Field) - Example: In-Game Ticket:Other, In-Game Ticket:Item Correction,
* In-Game Ticket:Stat Correction, In-Game Ticket:User Temporarily Banned, In-Game Ticket:User Permanently Banned,
* In-Game Ticket:User Harrassment - Harasser, In-Game Ticket:User Harrassment - Victim,
* In-Game Ticket:Account Compromised, Call Center:Item Correction, Call Center:Stat Correction,
* Call Center:User Temporarily Banned, Call Center:User Permanently Banned, Call Center:User Harrassment - Harasser,
* Call Center:User Harrassment - Victim, Call Center:Account Compromised, Other
* Default - "Other"
*/
public boolean logCustomerServiceAction(final Date theDate, final String theAccountId,
final String theCharacterId, final long theShardId,
final String theCsAction, final String theCsActionType) {
final HashMap<String, String> aDataMap = new HashMap<String, String>();
aDataMap.put(DataMapKeys.TYPE,
String.valueOf(EventCodes.CUSTOMER_SERVICE_ACTION));
aDataMap.put(DataMapKeys.ACCOUNT_ID, theAccountId);
aDataMap.put(DataMapKeys.CHARACTER_ID, theCharacterId);
aDataMap.put(DataMapKeys.SHARD_ID, String.valueOf(theShardId));
aDataMap.put(DataMapKeys.CUSTOMER_SERVICE_ACTION, theCsAction);
aDataMap.put(DataMapKeys.CUSTOMER_SERVICE_ACTION_TYPE, theCsActionType);
return this.logEvent(aDataMap, theDate);
}
/**
* logs a Custom Action event - This event captures all the events which are not described in any of the other events
* and the events are not with respect to actions in the game. Any Ninja Metrics customer
* has the freedom to define this event in any way that they want given the fields described here
*
* @param theDate Date - when did the event occur?
* @param theAccountId String (MANDATORY Field) - the UUID associated with a particular user/player - email, number
* @param theCharacterId String (MANDATORY Field) - does an account have multiple characters associated with it?
* Use this field to track such identifiers.
* Default - AccountId should be used as default if there's no CharacterId
* @param theCustomAction String (MANDATOY Field)
* @param theCustomActionType String (MANDATOY Field)
* @param theCustomActionValue String (MANDATORY Field) - maximum of 200 characters
* Default - "NA"
*/
public boolean logCustomSlot(final Date theDate, final String theAccountId,
final String theCharacterId, final String theCustomAction,
final String theCustomActionType, final String theCustomActionValue) {
final HashMap<String, String> aDataMap = new HashMap<String, String>();
aDataMap.put(DataMapKeys.TYPE,
String.valueOf(EventCodes.CUSTOM_SLOT));
aDataMap.put(DataMapKeys.ACCOUNT_ID, theAccountId);
aDataMap.put(DataMapKeys.CHARACTER_ID, theCharacterId);
aDataMap.put(DataMapKeys.CUSTOM_ACTION, theCustomAction);
aDataMap.put(DataMapKeys.CUSTOM_ACTION_TYPE, theCustomActionType);
aDataMap.put(DataMapKeys.CUSTOM_ACTION_VALUE, theCustomActionValue);
return this.logEvent(aDataMap, theDate);
}
/**
* logs a Productivity event - This event refers to a scenario where any time a player crafts, harvests
* etc an item within the game.
*
* @param theDate Date - when did the event occur?
* @param theAccountId String (MANDATORY Field) - the UUID associated with a particular user/player - email, number
* @param theCharacterId String (MANDATORY Field) - does an account have multiple characters associated with it?
* Use this field to track such identifiers.
* Default - AccountId should be used as default if there's no CharacterId
* @param theShardId Long (OPTIONAL Field)- a particular db the Character is associated with
* Default - Use 0 if unused or does not have a value
* @param theProductivityType String (MANDATORY Field) - Examples: Harvest, Craft, Other
* Default - "Other"
*/
public boolean logProductivity(final Date theDate, final String theAccountId,
final String theCharacterId, final long theShardId,
final String theProductivityType) {
final HashMap<String, String> aDataMap = new HashMap<String, String>();
aDataMap.put(DataMapKeys.TYPE,
String.valueOf(EventCodes.PRODUCTIVITY));
aDataMap.put(DataMapKeys.ACCOUNT_ID, theAccountId);
aDataMap.put(DataMapKeys.CHARACTER_ID, theCharacterId);
aDataMap.put(DataMapKeys.SHARD_ID, String.valueOf(theShardId));
aDataMap.put(DataMapKeys.PRODUCTIVITY_TYPE, theProductivityType);
return this.logEvent(aDataMap, theDate);
}
/**
* logs a Resource event - Refers to events where any time a player acquires a non-item resource,
* e.g. coins, gold, power, etc.
*
* @param theDate Date - when did the event occur?
* @param theAccountId String (MANDATORY Field) - the UUID associated with a particular user/player - email, number
* @param theCharacterId String (MANDATORY Field) - does an account have multiple characters associated with it?
* Use this field to track such identifiers.
* Default - AccountId should be used as default if there's no CharacterId
* @param theShardId Long (OPTIONAL Field)- a particular db the Character is associated with
* Default - Use 0 if unused or does not have a value
* @param theResourceType String (MANDATORY Field) - Examples: Currency, Power, Raw Materials, Vendor Trash, Other
* Default - "Other"
* @param theResourceId String (MANDATORY Field) - acceptable values are: "1", when ResourceType = 0(Real Currency),
* "virtual item name", when ResourceType = 1(Virtual Currency),
* "item name", when ResourceType = 2(item)
* @param theResourceCount Long (MANDATORY Field)
*/
public boolean logResource(final Date theDate, final String theAccountId,
final String theCharacterId, final long theShardId,
final String theResourceType, final String theResourceId,
final long theResourceCount) {
final HashMap<String, String> aDataMap = new HashMap<String, String>();
aDataMap.put(DataMapKeys.TYPE,
String.valueOf(EventCodes.RESOURCE));
aDataMap.put(DataMapKeys.ACCOUNT_ID, theAccountId);
aDataMap.put(DataMapKeys.CHARACTER_ID, theCharacterId);
aDataMap.put(DataMapKeys.SHARD_ID, String.valueOf(theShardId));
aDataMap.put(DataMapKeys.RESOURCE_TYPE, theResourceType);
aDataMap.put(DataMapKeys.RESOURCE_ID, theResourceId);
aDataMap.put(DataMapKeys.RESOURCE_COUNT, String.valueOf(theResourceCount));
return this.logEvent(aDataMap, theDate);
}
/**
* Logs a Ad Click event - This event is a record of the user who either clicks an ad or had already clicked
* the ad and then taking some subsequent action.
*
* @param theDate Date - when did the event occur?
* @param theAccountId String (MANDATORY Field) - the UUID associated with a particular user/player - email, number
* @param theAdTagName String (OPTIONAL Field) Possible values - In-App,Google, Facebook, Ad-Words, Other, or free text, Ad4Game,
Addictive Mobility, Adelphic, Adknowledge, AdTheorent, Altrooz, AppFlood, Appia, AppLift, AppLovin, AppNexus, AppTap,
Aquto (MoVE), Clickky, CrowdMob, Drawbridge, Eclipse-io, Geenapp, Greystripe, HeyZap, Iconpeak, InMobi, Jampp, JumpTap,
Kickbit, LiveIntent, madnet, Manage.com, MdotM, Millennial, mNectar, Mobile Theory, Moblin, Moboqo, mobpartner, Motive Interactive,
motrixi, MyLikes, Nexage, Pandora, RadiumOne, Rocket Fuel, Rovio, SessionM, SponsorPay, StrikeAd, Surikate, TapIt, Taptica, TrialPay,
Velti, Verve, Voltari, YieldMo
Default - "In-App"
* @param theAdActionTs Date (OPTIONAL Field) - Default - NULL
*/
public boolean logAdClick(final Date theDate, final String theAccountId,
final String theAdTagName, final Date theAdActionTs) {
final HashMap<String, String> aDataMap = new HashMap<String, String>();
aDataMap.put(DataMapKeys.TYPE,
String.valueOf(EventCodes.AD_CLICK));
aDataMap.put(DataMapKeys.ACCOUNT_ID, theAccountId);
aDataMap.put(DataMapKeys.AD_TAG_NAME, theAdTagName);
aDataMap.put(DataMapKeys.AD_ACTION_TIMESTAMP,
EventObj.getISO8601Str(theAdActionTs));
return this.logEvent(aDataMap, theDate);
}
/**
* logs a Economic event - This item refers TO Economic Type: Buy item, Sell item, Trade away item
Trade acquire item, Create item
*
* @param theDate Date - when did the event occur?
* @param sendAccId String (MANDATORY Field) - the UUID associated with a particular user/player - email, number
* @param sendCharId String (MANDATORY Field) - does an account have multiple characters associated with it?
* Use this field to track such identifiers.
* Default - sendAccId should be used as default if there's no sendCharId
* @param recvAccId String (MANDATORY Field) - the UUID associated with a particular user/player - email, number
* @param recvCharId String (MANDATORY Field) - does an account have multiple characters associated with it?
* Use this field to track such identifiers.
* Default - recvAccId should be used as default if there's no recvCharId
* @param theShardId Long (OPTIONAL Field)- a particular db the Character is associated with
* Default - Use 0 if unused or does not have a value
* @param theItemId Long (MANDATORY Field) - the item's application unique id
* Default - theItemId or theItemName, any one has to be defined
* Use 0 for default value, if theItemName is already defined
* @param theItemName String (MANDATORY Field) - examples: "the ban hammer", "FISH", "kiTTeh"
* Default - theItemId or theItemName, any one has to be defined
* Use "NA" for default value, if theItemId is already defined
* @param theEconomicType String (MANDATORY Field) - Examples: Buy Item, Sell Item, Trade Away Item, Trade Acquire Item,
* Create Item, Other
* Default - "Other"
* @param theEconomicValue Float (MANDATORY Field)
* @param theCurrencyType Integer (MANDATORY Field) - acceptable values are: 0 = real world, 1 = virtual
* @param theVirtualCurrencyLbl String (OPTIONAL Field) - a virtual currency previously initialized from Event #14.
* If CurrencyType = 1, set this Mandatory, else send " ".
* @param theCurrencyValue Float (MANDATORY Field) - how much of a particular currency was used for this transaction
*
*/
public boolean logEconomic(final Date theDate, final String sendAccId,
final String sendCharId, final String recvAccId,
final String recvCharId, final long theShardId,
final long theItemId, final String theItemName,
final String theEconomicType, final float theEconomicValue,
final int theCurrencyType, final String theVirtualCurrencyLbl,
final long theCurrencyValue) {
final HashMap<String, String> aDataMap = new HashMap<String, String>();
aDataMap.put(DataMapKeys.TYPE,
String.valueOf(EventCodes.ECONOMIC));
aDataMap.put(DataMapKeys.SENDER_ACCOUNT_ID, sendAccId);
aDataMap.put(DataMapKeys.SENDER_CHARACTER_ID, sendCharId);
aDataMap.put(DataMapKeys.RECEIVER_ACCOUNT_ID, recvAccId);
aDataMap.put(DataMapKeys.RECEIVER_ACCOUNT_ID, recvCharId);
aDataMap.put(DataMapKeys.SHARD_ID, String.valueOf(theShardId));
aDataMap.put(DataMapKeys.ITEM_ID, String.valueOf(theItemId));
aDataMap.put(DataMapKeys.ITEM_NAME, theItemName);
aDataMap.put(DataMapKeys.ECONOMIC_TYPE, theEconomicType);
aDataMap.put(DataMapKeys.ECONOMIC_VALUE, String.valueOf(theEconomicValue));
aDataMap.put(DataMapKeys.CURRENCY_TYPE, String.valueOf(theCurrencyType));
aDataMap.put(DataMapKeys.CURRENCY_VIRTUAL_LABEL, theVirtualCurrencyLbl);
aDataMap.put(DataMapKeys.CURRENCY_VALUE, String.valueOf(theCurrencyValue));
return this.logEvent(aDataMap, theDate);
}
/**
* Logs a Traffic Source event - .
*
* @param theDate Date - when did the event occur?
* @param theAccountId String (MANDATORY Field) - the UUID associated with a particular user/player - email, number
* @param theTrafficSource String (MANDATORY Field)
* @param theShardId Long (OPTIONAL Field)- a particular db the Character is associated with
* Default - Use 0 if unused or does not have a value
* @param theTrafficSourceType String (MANDATORY Field) - Examples:In-App,Google, Facebook, Ad-Words, Other, or free text,
* Ad4Game, Addictive Mobility, Adelphic, Adknowledge, AdTheorent, Altrooz, AppFlood, Appia, AppLift, AppLovin,
* AppNexus, AppTap, Aquto (MoVE), Clickky, CrowdMob, Drawbridge, Eclipse-io, Geenapp, Greystripe, HeyZap, Iconpeak,
* InMobi, Jampp, JumpTap, Kickbit, LiveIntent, madnet, Manage.com, MdotM, Millennial, mNectar, Mobile Theory,
* Moblin, Moboqo, mobpartner, Motive Interactive, motrixi, MyLikes, Nexage, Pandora, RadiumOne, Rocket Fuel,
* Rovio, SessionM, SponsorPay, StrikeAd, Surikate, TapIt, Taptica, TrialPay, Velti, Verve, Voltari, YieldMo
* Default - "Unknown"
*/
public boolean logTrafficSource(final Date theDate, final String theAccountId,
final String theTrafficSource, final long theShardId,
final String theTrafficSourceType) {
final HashMap<String, String> aDataMap = new HashMap<String, String>();
aDataMap.put(DataMapKeys.TYPE,
String.valueOf(EventCodes.TRAFFIC_SOURCE));
aDataMap.put(DataMapKeys.ACCOUNT_ID, theAccountId);
aDataMap.put(DataMapKeys.TRAFFIC_SOURCE, theTrafficSource);
aDataMap.put(DataMapKeys.SHARD_ID, String.valueOf(theShardId));
aDataMap.put(DataMapKeys.TRAFFIC_SOURCE_TYPE, theTrafficSourceType);
return this.logEvent(aDataMap, theDate);
}
/**
* log a GENERIC Event (always associated with a time) with certain
* attributes
*
* @param theEventMap Map<String, String>
* @param theDate Date
* @return boolean - was the Event added to the log queue?
*/
private boolean logEvent(final Map<String, String> theEventMap,
final Date theDate) {
if (KApi.myEventThread == null) {
return false;
} else {
if ((theEventMap == null) || (theEventMap.isEmpty())
|| (theDate == null)) {
return false;
}
final EventObj aEventObj = new EventObj();
aEventObj.setDataMap(theEventMap);
aEventObj.setDateObj(theDate);
return KApi.myEventThread.put(aEventObj);
}
}
}