Exemple #1
0
        /// <summary>
        /// Run Game Service.
        /// </summary>
        /// <param name="connected">(Not NULL)this Listener Called When Game Service Connected Successfully</param>
        /// <param name="onError">(Not NULL)this Listener Called When Game Service Initialize With Problem</param>
        public static void Run(Action connected, Action <string> onError)
        {
            if (Configuration == null)
            {
                LogUtil.LogError(Tag, "Configuration Not Set, Do Nothing..");
                return;
            }

            _actions = new Pair <Action, Action <string> >(connected, onError);

            if (Instance != null)
            {
                if (Configuration.EnableLog)
                {
                    LogUtil.LogWarning(Tag, "GameService Initialized Before , Do Nothing..");
                }
                return;
            }

            if (Configuration.DownloadTag != null)
            {
                GameServiceDownloadInitializer.DownloadData(Configuration, DownloadListener, DownloadErrorListener);
            }
            else
            {
                GameServiceAppInitializer.Init(Configuration, OnSuccessInit, OnErrorInit);
            }
        }
Exemple #2
0
        /// <summary>
        /// Login To Game Service With LoginType
        /// </summary>
        /// <param name="loginType">(Not NULL)Specifies the type of login.<see cref="Enums.LoginType"/></param>
        public static void Login(LoginType loginType)
        {
            if (Instance == null)
            {
                LogUtil.LogError(Tag, "GameService Not Initialized Before , You Must Call \"Run\" Function...");
                return;
            }
            if (Instance.IsAvailable())
            {
                if (Configuration.EnableLog)
                {
                    LogUtil.LogWarning(Tag, "GameService Initialized Before , You Must Logout First...");
                }
                return;
            }

            Configuration.LoginType = loginType;
            GameServiceAppInitializer.Init(Configuration, OnSuccessInit, OnErrorInit);
        }
Exemple #3
0
 private static void DownloadListener(string callback)
 {
     GameServiceAppInitializer.Init(Configuration, OnSuccessInit, OnErrorInit);
 }