Ejemplo n.º 1
0
 public string GetValueFromLog(BILog log, string key)
 {
     if (this.paramDict.ContainsKey(key))
     {
         return(WWW.UnEscapeURL(this.paramDict[key]));
     }
     return("u");
 }
Ejemplo n.º 2
0
        public BILogData CreateWWWDataFromBILog(BILog log)
        {
            string url = this.ToURL(log);

            return(new BILogData
            {
                url = url
            });
        }
Ejemplo n.º 3
0
        private void AddElapsedTime(string stepName, BILog log)
        {
            float realTimeSinceStartUpInMilliseconds = DateUtils.GetRealTimeSinceStartUpInMilliseconds();

            if (!this.timeStamps.ContainsKey(stepName))
            {
                this.timeStamps.Add(stepName, realTimeSinceStartUpInMilliseconds);
            }
            float num = this.timeStamps[stepName];

            log.AddParam("elapsed_time_ms", ((int)(realTimeSinceStartUpInMilliseconds - num)).ToString());
        }
Ejemplo n.º 4
0
        public string ToURL(BILog log)
        {
            StringBuilder stringBuilder           = new StringBuilder(log.UseSecondaryUrl ? this.secondaryNoProxyURL : this.primaryURL);
            Dictionary <string, string> paramDict = log.GetParamDict();

            foreach (string current in paramDict.Keys)
            {
                stringBuilder.Append("&");
                stringBuilder.Append(current);
                stringBuilder.Append("=");
                stringBuilder.Append(paramDict[current]);
            }
            return(stringBuilder.ToString());
        }
Ejemplo n.º 5
0
        public BILogData CreateWWWDataFromBILog(BILog log)
        {
            uint serverTime = Service.ServerAPI.ServerTime;

            this.paramDict = log.GetParamDict();
            string     text       = (!this.paramDict.ContainsKey("tag")) ? "u" : WWW.UnEscapeURL(this.paramDict["tag"]);
            string     empty      = string.Empty;
            string     tier       = string.Empty;
            string     tier2      = string.Empty;
            string     tier3      = string.Empty;
            string     tier4      = string.Empty;
            string     tier5      = string.Empty;
            Serializer serializer = Serializer.Start();

            if (text != null)
            {
                if (Event2LogCreator.< > f__switch$map3 == null)
                {
                    Event2LogCreator.< > f__switch$map3 = new Dictionary <string, int>(11)
                    {
                        {
                            "authorization",
                            0
                        },
                        {
                            "clicked_link",
                            1
                        },
                        {
                            "user_info",
                            2
                        },
                        {
                            "player_info",
                            3
                        },
                        {
                            "device_info",
                            4
                        },
                        {
                            "game_action",
                            5
                        },
                        {
                            "step_timing",
                            6
                        },
                        {
                            "geo",
                            7
                        },
                        {
                            "performance",
                            8
                        },
                        {
                            "error",
                            9
                        },
                        {
                            "send_message",
                            10
                        }
                    };
                }
                int num;
                if (Event2LogCreator.< > f__switch$map3.TryGetValue(text, out num))
                {
                    string val;
                    switch (num)
                    {
                    case 0:
                        val = "action";
                        this.SetStandardDataForAction(out empty, out tier, out tier5);
                        tier2 = "authorization";
                        tier3 = this.GetValueFromLog(log, "type");
                        tier4 = this.GetValueFromLog(log, "step");
                        this.SerializeActionEventProperties(serializer, empty, tier, tier2, tier3, tier4, tier5);
                        break;

                    case 1:
                        val = "action";
                        this.SetStandardDataForAction(out empty, out tier, out tier5);
                        tier  = this.GetValueFromLog(log, "app");
                        tier2 = "clicked_link";
                        tier3 = this.GetValueFromLog(log, "is_new_user");
                        tier4 = this.GetValueFromLog(log, "log_app");
                        tier5 = this.GetValueFromLog(log, "tracking_code");
                        this.SerializeActionEventProperties(serializer, empty, tier, tier2, tier3, tier4, tier5);
                        break;

                    case 2:
                        this.LogIgnoredEvent("user_info");
                        return(null);

                    case 3:
                        this.LogIgnoredEvent("player_info");
                        return(null);

                    case 4:
                        this.LogIgnoredEvent("device_info");
                        return(null);

                    case 5:
                        val = "action";
                        this.SetStandardDataForAction(out empty, out tier, out tier5);
                        tier2 = this.GetValueFromLog(log, "context");
                        tier3 = this.GetValueFromLog(log, "action");
                        tier4 = this.GetValueFromLog(log, "message");
                        this.SerializeActionEventProperties(serializer, empty, tier, tier2, tier3, tier4, tier5);
                        break;

                    case 6:
                    {
                        val = "timing";
                        string valueFromLog = this.GetValueFromLog(log, "context");
                        serializer.AddString("c", valueFromLog);
                        string valueFromLog2 = this.GetValueFromLog(log, "location");
                        serializer.AddString("l", valueFromLog2);
                        string text2 = this.GetValueFromLog(log, "path_name");
                        if (string.IsNullOrEmpty(text2))
                        {
                            text2 = "u";
                        }
                        serializer.AddString("pn", text2);
                        string valueFromLog3 = this.GetValueFromLog(log, "elapsed_time_ms");
                        int    num2          = 0;
                        int.TryParse(valueFromLog3, out num2);
                        if (num2 < 1)
                        {
                            this.LogIgnoredEvent("step_timing Ignoring Step timing event with no elapsed time.");
                            return(null);
                        }
                        serializer.Add <int>("etms", num2);
                        serializer.Add <int>("r", 1);
                        break;
                    }

                    case 7:
                        this.LogIgnoredEvent("geo");
                        return(null);

                    case 8:
                        val = "action";
                        this.SetStandardDataForAction(out empty, out tier, out tier5);
                        tier  = this.GetValueFromLog(log, "time_since_start");
                        tier2 = "performance";
                        tier3 = this.GetValueFromLog(log, "fps");
                        tier4 = this.GetValueFromLog(log, "memory_used");
                        tier5 = this.GetValueFromLog(log, "display_state");
                        this.SerializeActionEventProperties(serializer, empty, tier, tier2, tier3, tier4, tier5);
                        break;

                    case 9:
                        val = "action";
                        this.SetStandardDataForAction(out empty, out tier, out tier5);
                        tier2 = "error";
                        tier3 = this.GetValueFromLog(log, "context");
                        tier4 = this.GetValueFromLog(log, "reason");
                        tier5 = this.GetValueFromLog(log, "message");
                        this.SerializeActionEventProperties(serializer, empty, tier, tier2, tier3, tier4, tier5);
                        break;

                    case 10:
                        val = "action";
                        this.SetStandardDataForAction(out empty, out tier, out tier5);
                        tier  = this.GetValueFromLog(log, "tracking_code");
                        tier2 = "send_message";
                        tier3 = this.GetValueFromLog(log, "send_timestamp");
                        tier4 = this.GetValueFromLog(log, "target_user_id");
                        tier5 = this.GetValueFromLog(log, "num_sent");
                        this.SerializeActionEventProperties(serializer, empty, tier, tier2, tier3, tier4, tier5);
                        break;

                    case 11:
                        goto IL_4AC;

                    default:
                        goto IL_4AC;
                    }
                    if (this.app == null)
                    {
                        this.SetupSantardizedData();
                    }
                    Serializer serializer2 = Serializer.Start();
                    serializer2.AddDictionary <string>("app", this.app);
                    serializer2.AddDictionary <string>("session", this.session);
                    serializer2.Add <string>("guest", this.guest.ToString());
                    serializer2.AddDictionary <string>("device", this.device);
                    Serializer serializer3 = Serializer.Start();
                    Serializer serializer4 = Serializer.Start();
                    serializer4.Add <string>("event_prop", serializer.End().ToString());
                    serializer4.AddString("s", "mc");
                    serializer4.AddString("of", "1");
                    serializer4.Add <uint>("lts", serverTime);
                    serializer4.Add <uint>("ts", serverTime);
                    serializer4.AddString("id", Guid.NewGuid().ToString());
                    serializer4.Add <int>("sn", this.logSequenceNumber);
                    this.logSequenceNumber++;
                    serializer4.AddString("n", val);
                    serializer3.Add <string>("event", serializer4.End().ToString());
                    string val2 = "[" + serializer3.End().ToString() + "]";
                    serializer2.Add <string>("events", val2);
                    serializer2.End();
                    byte[] bytes = Encoding.UTF8.GetBytes(serializer2.ToString());
                    string url   = (!log.UseSecondaryUrl) ? this.primaryURL : this.secondaryNoProxyURL;
                    return(new BILogData
                    {
                        url = url,
                        postData = bytes,
                        headers = this.headers
                    });
                }
            }
IL_4AC:
            this.LogIgnoredEvent(text);
            return(null);
        }
Ejemplo n.º 6
0
 public void AddDeviceSpecificInfo(BILog log)
 {
 }
Ejemplo n.º 7
0
 public void EndStep(string stepName, BILog log)
 {
     this.AddElapsedTime(stepName, log);
     this.timeStamps.Remove(stepName);
 }
Ejemplo n.º 8
0
 public void IntermediaryStep(string stepName, BILog log)
 {
     this.AddElapsedTime(stepName, log);
 }
Ejemplo n.º 9
0
        public BILogData CreateWWWDataFromBILog(BILog log)
        {
            uint serverTime = Service.Get <ServerAPI>().ServerTime;

            this.paramDict = log.GetParamDict();
            string     text       = this.paramDict.ContainsKey("tag") ? WWW.UnEscapeURL(this.paramDict["tag"]) : "u";
            string     empty      = string.Empty;
            string     tier       = string.Empty;
            string     tier2      = string.Empty;
            string     tier3      = string.Empty;
            string     tier4      = string.Empty;
            string     tier5      = string.Empty;
            Serializer serializer = Serializer.Start();
            uint       num        = < PrivateImplementationDetails >.ComputeStringHash(text);
            string     val;

            if (num <= 2139057587u)
            {
                if (num <= 1264827581u)
                {
                    if (num != 168538109u)
                    {
                        if (num != 563185489u)
                        {
                            if (num == 1264827581u)
                            {
                                if (text == "network_mapping_info")
                                {
                                    val = "action";
                                    this.SetStandardDataForAction(out empty, out tier, out tier5);
                                    tier2 = "network_mapping_info";
                                    tier3 = this.GetValueFromLog(log, "secondary_user_id");
                                    tier4 = this.GetValueFromLog(log, "action");
                                    tier5 = this.GetValueFromLog(log, "secondary_network");
                                    this.SerializeActionEventProperties(serializer, empty, tier, tier2, tier3, tier4, tier5);
                                    goto IL_5BC;
                                }
                            }
                        }
                        else if (text == "error")
                        {
                            val = "action";
                            this.SetStandardDataForAction(out empty, out tier, out tier5);
                            tier2 = "error";
                            tier3 = this.GetValueFromLog(log, "context");
                            tier4 = this.GetValueFromLog(log, "reason");
                            tier5 = this.GetValueFromLog(log, "message");
                            this.SerializeActionEventProperties(serializer, empty, tier, tier2, tier3, tier4, tier5);
                            goto IL_5BC;
                        }
                    }
                    else if (text == "player_info")
                    {
                        this.LogIgnoredEvent("player_info");
                        return(null);
                    }
                }
                else if (num != 1561113986u)
                {
                    if (num != 1807269074u)
                    {
                        if (num == 2139057587u)
                        {
                            if (text == "user_info")
                            {
                                this.LogIgnoredEvent("user_info");
                                return(null);
                            }
                        }
                    }
                    else if (text == "game_action")
                    {
                        val = "action";
                        this.SetStandardDataForAction(out empty, out tier, out tier5);
                        tier2 = this.GetValueFromLog(log, "context");
                        tier3 = this.GetValueFromLog(log, "action");
                        tier4 = this.GetValueFromLog(log, "message");
                        this.SerializeActionEventProperties(serializer, empty, tier, tier2, tier3, tier4, tier5);
                        goto IL_5BC;
                    }
                }
                else if (text == "geo")
                {
                    this.LogIgnoredEvent("geo");
                    return(null);
                }
            }
            else if (num <= 2630488359u)
            {
                if (num != 2199459864u)
                {
                    if (num != 2436257726u)
                    {
                        if (num == 2630488359u)
                        {
                            if (text == "clicked_link")
                            {
                                val = "action";
                                this.SetStandardDataForAction(out empty, out tier, out tier5);
                                tier  = this.GetValueFromLog(log, "app");
                                tier2 = "clicked_link";
                                tier3 = this.GetValueFromLog(log, "is_new_user");
                                tier4 = this.GetValueFromLog(log, "log_app");
                                tier5 = this.GetValueFromLog(log, "tracking_code");
                                this.SerializeActionEventProperties(serializer, empty, tier, tier2, tier3, tier4, tier5);
                                goto IL_5BC;
                            }
                        }
                    }
                    else if (text == "authorization")
                    {
                        val = "action";
                        this.SetStandardDataForAction(out empty, out tier, out tier5);
                        tier2 = "authorization";
                        tier3 = this.GetValueFromLog(log, "type");
                        tier4 = this.GetValueFromLog(log, "step");
                        this.SerializeActionEventProperties(serializer, empty, tier, tier2, tier3, tier4, tier5);
                        goto IL_5BC;
                    }
                }
                else if (text == "device_info")
                {
                    this.LogIgnoredEvent("device_info");
                    return(null);
                }
            }
            else if (num != 2932772005u)
            {
                if (num != 3320562554u)
                {
                    if (num == 3968383111u)
                    {
                        if (text == "send_message")
                        {
                            val = "action";
                            this.SetStandardDataForAction(out empty, out tier, out tier5);
                            tier  = this.GetValueFromLog(log, "tracking_code");
                            tier2 = "send_message";
                            tier3 = this.GetValueFromLog(log, "send_timestamp");
                            tier4 = this.GetValueFromLog(log, "target_user_id");
                            tier5 = this.GetValueFromLog(log, "num_sent");
                            this.SerializeActionEventProperties(serializer, empty, tier, tier2, tier3, tier4, tier5);
                            goto IL_5BC;
                        }
                    }
                }
                else if (text == "step_timing")
                {
                    val = "timing";
                    string valueFromLog = this.GetValueFromLog(log, "context");
                    serializer.AddString("c", valueFromLog);
                    string valueFromLog2 = this.GetValueFromLog(log, "location");
                    serializer.AddString("l", valueFromLog2);
                    string text2 = this.GetValueFromLog(log, "path_name");
                    if (string.IsNullOrEmpty(text2))
                    {
                        text2 = "u";
                    }
                    serializer.AddString("pn", text2);
                    string valueFromLog3 = this.GetValueFromLog(log, "elapsed_time_ms");
                    int    num2          = 0;
                    int.TryParse(valueFromLog3, ref num2);
                    if (num2 < 1)
                    {
                        this.LogIgnoredEvent("step_timing Ignoring Step timing event with no elapsed time.");
                        return(null);
                    }
                    serializer.Add <int>("etms", num2);
                    serializer.Add <int>("r", 1);
                    goto IL_5BC;
                }
            }
            else if (text == "performance")
            {
                val = "action";
                this.SetStandardDataForAction(out empty, out tier, out tier5);
                tier  = this.GetValueFromLog(log, "time_since_start");
                tier2 = "performance";
                tier3 = this.GetValueFromLog(log, "fps");
                tier4 = this.GetValueFromLog(log, "memory_used");
                tier5 = this.GetValueFromLog(log, "display_state");
                this.SerializeActionEventProperties(serializer, empty, tier, tier2, tier3, tier4, tier5);
                goto IL_5BC;
            }
            this.LogIgnoredEvent(text);
            return(null);

IL_5BC:
            if (this.app == null)
            {
                this.SetupSantardizedData();
            }
            Serializer serializer2 = Serializer.Start();

            serializer2.AddDictionary <string>("app", this.app);
            serializer2.AddDictionary <string>("session", this.session);
            serializer2.Add <string>("guest", this.guest.ToString());
            serializer2.AddDictionary <string>("device", this.device);
            Serializer serializer3 = Serializer.Start();
            Serializer serializer4 = Serializer.Start();

            serializer4.Add <string>("event_prop", serializer.End().ToString());
            serializer4.AddString("s", "mc");
            serializer4.AddString("of", "1");
            serializer4.Add <uint>("lts", serverTime);
            serializer4.Add <uint>("ts", serverTime);
            serializer4.AddString("id", Guid.NewGuid().ToString());
            serializer4.Add <int>("sn", this.logSequenceNumber);
            this.logSequenceNumber++;
            serializer4.AddString("n", val);
            serializer3.Add <string>("event", serializer4.End().ToString());
            string val2 = "[" + serializer3.End().ToString() + "]";

            serializer2.Add <string>("events", val2);
            serializer2.End();
            byte[] bytes = Encoding.UTF8.GetBytes(serializer2.ToString());
            string url   = log.UseSecondaryUrl ? this.secondaryNoProxyURL : this.primaryURL;

            return(new BILogData
            {
                url = url,
                postData = bytes,
                headers = this.headers
            });
        }
Ejemplo n.º 10
0
        public void AddDeviceSpecificInfo(BILog log)
        {
            string deviceAdvertisingId = this.GetDeviceAdvertisingId();

            log.AddParam("google_advertising_id", EncryptionUtil.EncryptString(deviceAdvertisingId));
        }