コード例 #1
0
        public void Initialize(bool isDebugIndicatorReport, string appKeyIndicator, string appKeyLog)
        {
            if (isInitialized == false)
            {
                isInitialized = true;

                this.isDebugIndicatorReport = isDebugIndicatorReport;

                if (string.IsNullOrEmpty(appKeyIndicator) == false)
                {
                    this.appKeyIndicator = appKeyIndicator;
                }

                if (string.IsNullOrEmpty(appKeyLog) == false)
                {
                    this.appKeyLog = appKeyLog;
                }

                GamebaseCoroutineManager.StartCoroutine(
                    GamebaseGameObjectManager.GameObjectType.INDICATOR_REPORT_TYPE,
                    SendIndicatorPolling());

                if (this.isDebugIndicatorReport == true)
                {
                    GamebaseCoroutineManager.StartCoroutine(
                        GamebaseGameObjectManager.GameObjectType.INDICATOR_REPORT_TYPE,
                        SendLogPolling());
                    return;
                }
                else
                {
                    sendLogDataQueue.Clear();
                }
            }
        }
コード例 #2
0
        private IEnumerator SendIndicatorPolling()
        {
            while (true)
            {
                if (sendIndicatorDataQueue.Count > 0)
                {
                    SendData sendData = null;
                    lock (sendIndicatorDataQueue)
                    {
                        sendData = sendIndicatorDataQueue.Dequeue();
                    }

                    if (sendData != null)
                    {
                        MergeDictionary(
                            ref sendData.sendDataDic,
                            new Dictionary <string, string>
                        {
                            { SEND_DATA_KEY_PROJECT_NAME, appKeyIndicator }
                        });

                        yield return(GamebaseCoroutineManager.StartCoroutine(
                                         GamebaseGameObjectManager.GameObjectType.INDICATOR_REPORT_TYPE,
                                         SendHTTPPost(
                                             sendData.levelType,
                                             sendData.bodyType,
                                             sendData.sendDataDic)));
                    }
                }
                else
                {
                    yield return(new WaitForSecondsRealtime(LONG_INTERVAL));
                }
            }
        }