|
@@ -150,6 +150,9 @@ public class DataEyeGA
|
|
|
|
|
|
public static void SetAccount(string accountId, AccountType accountType, bool sendOnline = false)
|
|
|
{
|
|
|
+ if(!CheckIsInited())
|
|
|
+ return;
|
|
|
+
|
|
|
DataEyeGA.accountId = accountId;
|
|
|
DataEyeGA.accountType = accountType.GetHashCode();
|
|
|
if(sendOnline)
|
|
@@ -160,6 +163,9 @@ public class DataEyeGA
|
|
|
|
|
|
public static void ActOrReg()
|
|
|
{
|
|
|
+ if(!CheckIsInited())
|
|
|
+ return;
|
|
|
+
|
|
|
List<KeyValuePair<string, string>> paramList = new List<KeyValuePair<string, string>>();
|
|
|
paramList.Add(new KeyValuePair<string, string>("actTime", DateUtil.GetCurrentTimeByStandardTime().ToString()));
|
|
|
paramList.Add(new KeyValuePair<string, string>("regTime", DateUtil.GetCurrentTimeByStandardTime().ToString()));
|
|
@@ -168,6 +174,9 @@ public class DataEyeGA
|
|
|
|
|
|
public static void Online(int level = 0)
|
|
|
{
|
|
|
+ if(!CheckIsInited())
|
|
|
+ return;
|
|
|
+
|
|
|
if (DateUtil.GetRealTimeSinceStart() <= 60)
|
|
|
return;
|
|
|
List<KeyValuePair<string, string>> paramList = new List<KeyValuePair<string, string>>();
|
|
@@ -184,6 +193,9 @@ public class DataEyeGA
|
|
|
/// <param name="orderId">订单ID</param>
|
|
|
public static void Pay(int currencyAmount, string currencyType, string iapid, string orderId)
|
|
|
{
|
|
|
+ if(!CheckIsInited())
|
|
|
+ return;
|
|
|
+
|
|
|
List<KeyValuePair<string, string>> paramList = new List<KeyValuePair<string, string>>();
|
|
|
paramList.Add(new KeyValuePair<string, string>("currencyAmount", currencyAmount.ToString()));
|
|
|
paramList.Add(new KeyValuePair<string, string>("currencyType", currencyType));
|
|
@@ -200,6 +212,9 @@ public class DataEyeGA
|
|
|
/// <param name="totalCoin">该玩家手里最终持有的货币数量</param>
|
|
|
public static void VirtualCurrency(int coinNum, string coinType, string type, bool isGain, int totalCoin)
|
|
|
{
|
|
|
+ if(!CheckIsInited())
|
|
|
+ return;
|
|
|
+
|
|
|
List<KeyValuePair<string, string>> paramList = new List<KeyValuePair<string, string>>();
|
|
|
paramList.Add(new KeyValuePair<string, string>("coinNum", coinNum.ToString()));
|
|
|
paramList.Add(new KeyValuePair<string, string>("coinType", coinType));
|
|
@@ -217,6 +232,9 @@ public class DataEyeGA
|
|
|
/// <param name="coinType">虚拟币种类</param>
|
|
|
public static void BuyItem(string itemId, string itemType, string itemCnt, int coinNum, string coinType)
|
|
|
{
|
|
|
+ if(!CheckIsInited())
|
|
|
+ return;
|
|
|
+
|
|
|
List<KeyValuePair<string, string>> paramList = new List<KeyValuePair<string, string>>();
|
|
|
paramList.Add(new KeyValuePair<string, string>("itemId", itemId));
|
|
|
paramList.Add(new KeyValuePair<string, string>("itemType", itemType));
|
|
@@ -233,6 +251,9 @@ public class DataEyeGA
|
|
|
/// <param name="reason">道具消耗的途径</param>
|
|
|
public static void UseItem(string itemId, string itemType, string itemCnt, string reason)
|
|
|
{
|
|
|
+ if(!CheckIsInited())
|
|
|
+ return;
|
|
|
+
|
|
|
List<KeyValuePair<string, string>> paramList = new List<KeyValuePair<string, string>>();
|
|
|
paramList.Add(new KeyValuePair<string, string>("itemId", itemId));
|
|
|
paramList.Add(new KeyValuePair<string, string>("itemType", itemType));
|
|
@@ -248,6 +269,9 @@ public class DataEyeGA
|
|
|
/// <param name="reason">道具获得的途径</param>
|
|
|
public static void GetItem(string itemId, string itemType, int itemCnt, string reason)
|
|
|
{
|
|
|
+ if(!CheckIsInited())
|
|
|
+ return;
|
|
|
+
|
|
|
List<KeyValuePair<string, string>> paramList = new List<KeyValuePair<string, string>>();
|
|
|
paramList.Add(new KeyValuePair<string, string>("itemId", itemId));
|
|
|
paramList.Add(new KeyValuePair<string, string>("itemType", itemType));
|
|
@@ -264,6 +288,9 @@ public class DataEyeGA
|
|
|
/// <param name="reason">任务失败原因</param>
|
|
|
public static void Task(string taskId, TaskType taskType, int duration, bool isSucc, string reason)
|
|
|
{
|
|
|
+ if(!CheckIsInited())
|
|
|
+ return;
|
|
|
+
|
|
|
List<KeyValuePair<string, string>> paramList = new List<KeyValuePair<string, string>>();
|
|
|
paramList.Add(new KeyValuePair<string, string>("taskId", taskId));
|
|
|
paramList.Add(new KeyValuePair<string, string>("taskType", taskType.GetHashCode().ToString()));
|
|
@@ -279,6 +306,9 @@ public class DataEyeGA
|
|
|
/// <param name="interval">升级时长(秒)</param>
|
|
|
public static void LevelUp(int startLevel, int endLevel, int interval)
|
|
|
{
|
|
|
+ if(!CheckIsInited())
|
|
|
+ return;
|
|
|
+
|
|
|
List<KeyValuePair<string, string>> paramList = new List<KeyValuePair<string, string>>();
|
|
|
paramList.Add(new KeyValuePair<string, string>("startLevel", startLevel.ToString()));
|
|
|
paramList.Add(new KeyValuePair<string, string>("endLevel", endLevel.ToString()));
|
|
@@ -295,6 +325,9 @@ public class DataEyeGA
|
|
|
/// <param name="keyValueList">参数列表</param>
|
|
|
public static void CustomEvent(string eventId, int duration, List<KeyValuePair<string, string>> labelMapList)
|
|
|
{
|
|
|
+ if(!CheckIsInited())
|
|
|
+ return;
|
|
|
+
|
|
|
List<KeyValuePair<string, string>> paramList = new List<KeyValuePair<string, string>>();
|
|
|
paramList.Add(new KeyValuePair<string, string>("eventId", eventId));
|
|
|
paramList.Add(new KeyValuePair<string, string>("duration", duration.ToString()));
|
|
@@ -306,6 +339,15 @@ public class DataEyeGA
|
|
|
SendUrl(RequestType.CustomEvent, paramList);
|
|
|
}
|
|
|
|
|
|
+ private static bool CheckIsInited(){
|
|
|
+ if(isInited)
|
|
|
+ return true;
|
|
|
+ else{
|
|
|
+ Debug.Log("<color=#ff6600>DataEyeGA is not Inited!</color>");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
private static string SendUrl(RequestType requestType, List<KeyValuePair<string, string>> specialParamList = null)
|
|
|
{
|
|
|
string url = urlPrefix + requestDict[requestType];
|