internal static void Init(
     GameServiceClientConfiguration configuration
     , Action <GameService> onSuccess
     , Action <string> onError)
 {
     if (configuration.LoginType == LoginType.Normal)
     {
         FiroozehGameServiceAppLoginCheck.CheckUserLoginStatus(
             configuration.CheckAppStatus
             , configuration.CheckOptionalUpdate
             , configuration.EnableLog
             , isLogin =>
         {
             if (isLogin)
             {
                 AppPluginHandler.InitGameService(
                     configuration.ClientId, configuration.ClientSecret, configuration.EnableLog, false,
                     s =>
                 {
                     onSuccess.Invoke(new GameService(s, GameServiceType.App,
                                                      configuration.HaveNotification));
                 }
                     , onError.Invoke, configuration.NotificationListener);
             }
             else
             {
                 FiroozehGameServiceAppLoginCheck.ShowLoginUI(
                     configuration.CheckAppStatus
                     , configuration.CheckOptionalUpdate
                     , configuration.EnableLog
                     , r =>
                 {
                     if (r)
                     {
                         AppPluginHandler.InitGameService(
                             configuration.ClientId, configuration.ClientSecret, configuration.EnableLog, false,
                             s =>
                         {
                             onSuccess.Invoke(new GameService(s, GameServiceType.App,
                                                              configuration.HaveNotification));
                         }
                             , onError.Invoke, configuration.NotificationListener);
                     }
                 }, onError.Invoke);
             }
         }, onError.Invoke);
     }
     else
     {
         AppPluginHandler.InitGameService(
             configuration.ClientId, configuration.ClientSecret, configuration.EnableLog, true,
             s =>
         {
             onSuccess.Invoke(new GameService(s, GameServiceType.App,
                                              configuration.HaveNotification));
         }
             , onError.Invoke, configuration.NotificationListener);
     }
 }
示例#2
0
 public static void ShowLoginUI(
     bool checkAppStatus
     , bool checkOptionalUpdate
     , bool isLogEnable
     , DelegateCore.IsUserLogin isUserLogin
     , DelegateCore.OnError error)
 {
     AppPluginHandler.InitGameLoginService(checkAppStatus, checkOptionalUpdate, isLogEnable
                                           , s =>
     {
         s.Call("ShowLoginUI",
                new IGameServiceLoginCheck(
                    isUserLogin.Invoke, error.Invoke));
     }
                                           , error.Invoke);
 }
示例#3
0
 internal static void CheckUserLoginStatus(
     bool checkAppStatus
     , bool checkOptionalUpdate
     , bool isLogEnable
     , DelegateCore.IsUserLogin userLogin
     , DelegateCore.OnError error)
 {
     AppPluginHandler.InitGameLoginService(
         checkAppStatus
         , checkOptionalUpdate
         , isLogEnable
         , s =>
     {
         s.Call("IsUserLoggedIn",
                new IGameServiceLoginCheck(
                    userLogin.Invoke
                    , error.Invoke));
     }, error.Invoke);
 }