Beispiel #1
0
        private static void post(string postData)
        {
            if (EditorConfig.TELEMETRY)
            {
                byte[] data = new System.Text.ASCIIEncoding().GetBytes(postData);

                try
                {
                    System.Net.ServicePointManager.ServerCertificateValidationCallback = Util.Helper.RemoteCertificateValidationCallback;

                    using (System.Net.WebClient client = new Util.CTWebClient())
                    {
                        client.Headers[System.Net.HttpRequestHeader.ContentType] = "application/x-www-form-urlencoded";
                        client.Headers[System.Net.HttpRequestHeader.UserAgent]   = "Mozilla/5.0 (" + userAgent() + ")";

                        client.UploadData("https://www.google-analytics.com/collect", data);

                        if (Util.Constants.DEV_DEBUG)
                        {
                            Debug.Log("Data uploaded: " + postData);
                        }
                    }
                }
                catch (System.Exception ex)
                {
                    if (Util.Constants.DEV_DEBUG)
                    {
                        Debug.LogError("Could not upload GA-data: " + System.Environment.NewLine + ex);
                    }
                }
            }
        }
        private static void post(string postData)
        {
            byte[] data = new System.Text.ASCIIEncoding().GetBytes(postData);

            try
            {
                System.Net.ServicePointManager.ServerCertificateValidationCallback = Util.BaseHelper.RemoteCertificateValidationCallback;

                using (System.Net.WebClient client = new Util.CTWebClient())
                {
                    client.Headers[System.Net.HttpRequestHeader.ContentType] = "application/x-www-form-urlencoded";
                    client.Headers[System.Net.HttpRequestHeader.UserAgent]   = "Mozilla/5.0 (" + userAgent() + ")";

                    client.UploadData("tcelloc/moc.scitylana-elgoog.www//:sptth".CTReverse(), data);

                    if (Util.BaseConstants.DEV_DEBUG)
                    {
                        Debug.Log("Data uploaded: " + postData);
                    }
                }
            }
            catch (System.Exception ex)
            {
                if (Util.BaseConstants.DEV_DEBUG)
                {
                    Debug.LogError("Could not upload GA-data: " + System.Environment.NewLine + ex);
                }
            }
        }