@@ -80,7 +80,6 @@ namespace PlayEveryWare.EpicOnlineServices
8080 using LogoutOptions = Epic . OnlineServices . Auth . LogoutOptions ;
8181 using OnLogoutCallback = Epic . OnlineServices . Auth . OnLogoutCallback ;
8282#endif
83-
8483 /// <summary>
8584 /// One of the responsibilities of this class is to manage the lifetime of
8685 /// the EOS SDK and to be the interface for getting all the managed EOS interfaces.
@@ -468,7 +467,7 @@ private PlatformInterface CreatePlatformInterface(EOSConfig configData)
468467 IPlatformSpecifics platformSpecifics = EOSManagerPlatformSpecificsSingleton . Instance ;
469468
470469 EOSCreateOptions platformOptions = new EOSCreateOptions ( ) ;
471-
470+
472471 platformOptions . options . CacheDirectory = platformSpecifics . GetTempDir ( ) ;
473472 platformOptions . options . IsServer = configData . isServer ;
474473 platformOptions . options . Flags =
@@ -497,7 +496,8 @@ private PlatformInterface CreatePlatformInterface(EOSConfig configData)
497496
498497 var clientCredentials = new ClientCredentials
499498 {
500- ClientId = configData . clientID , ClientSecret = configData . clientSecret
499+ ClientId = configData . clientID ,
500+ ClientSecret = configData . clientSecret
501501 } ;
502502 platformOptions . options . ClientCredentials = clientCredentials ;
503503
@@ -521,7 +521,7 @@ private PlatformInterface CreatePlatformInterface(EOSConfig configData)
521521 integratedPlatformOptionsContainer . Release ( ) ;
522522#endif
523523 return platformInterface ;
524-
524+
525525 }
526526
527527 //-------------------------------------------------------------------------
@@ -585,24 +585,23 @@ public void Init(IEOSCoroutineOwner coroutineOwner, string configFileName)
585585 LoggingInterface . SetCallback ( SimplePrintCallback ) ;
586586 hasSetLoggingCallback = true ;
587587 }
588- #if UNITY_EDITOR
589- SetLogLevel ( LogCategory . AllCategories , LogLevel . VeryVerbose ) ;
590- #else
591- SetLogLevel ( LogCategory . AllCategories , LogLevel . Warning ) ;
592- #endif
593588
594589 InitializeOverlay ( coroutineOwner ) ;
595590 return ;
596591 }
597592
598- #if ! UNITY_EDITOR && ! UNITY_SWITCH
599- // Set logging to VeryVerbose on EOS SDK bootstrap so we get the most logging information
600- SetLogLevel ( LogCategory . AllCategories , LogLevel . VeryVerbose ) ;
601- #endif
602593 s_state = EOSState . Starting ;
603594
604595 LoadEOSLibraries ( ) ;
605596
597+ // Set log level prior to platform interface initialization
598+ // VeryVerbose for dynamic linking platforms, otherwise set levels from configs
599+ #if UNITY_EDITOR
600+ SetLogLevel ( LogCategory . AllCategories , LogLevel . VeryVerbose ) ;
601+ #else
602+ InitializeLogLevels ( ) ;
603+ #endif
604+
606605 var epicArgs = GetCommandLineArgsFromEpicLauncher ( ) ;
607606
608607 if ( ! string . IsNullOrWhiteSpace ( epicArgs . epicSandboxID ) )
@@ -672,16 +671,8 @@ public void Init(IEOSCoroutineOwner coroutineOwner, string configFileName)
672671 SetEOSPlatformInterface ( eosPlatformInterface ) ;
673672 UpdateEOSApplicationStatus ( ) ;
674673
675-
676674 InitializeOverlay ( coroutineOwner ) ;
677675
678- // Default back to quiet logs
679- #if UNITY_EDITOR
680- SetLogLevel ( LogCategory . AllCategories , LogLevel . VeryVerbose ) ;
681- #else
682- SetLogLevel ( LogCategory . AllCategories , LogLevel . Warning ) ;
683- #endif
684-
685676 print ( "EOS loaded" ) ;
686677 }
687678
@@ -770,6 +761,21 @@ public void SetLogLevel(LogCategory Category, LogLevel Level)
770761 }
771762 }
772763
764+ //-------------------------------------------------------------------------
765+ /// <summary>
766+ /// Initialize log levels loaded from <see cref="LogLevelConfig" />.
767+ /// Should only be called after EOS library loaded, especially for dynamic linking platforms
768+ /// </summary>
769+ private void InitializeLogLevels ( )
770+ {
771+ var logLevelList = LogLevelUtility . LogLevelList ;
772+
773+ for ( int logCategoryIndex = 0 ; logCategoryIndex < logLevelList . Count ; logCategoryIndex ++ )
774+ {
775+ SetLogLevel ( ( LogCategory ) logCategoryIndex , logLevelList [ logCategoryIndex ] ) ;
776+ }
777+ }
778+
773779 //-------------------------------------------------------------------------
774780 /// <summary>
775781 /// Retrieves a log level previously set with <c>SetLogLevel</c>
@@ -826,7 +832,10 @@ static private LoginOptions MakeLoginOptions(LoginCredentialType loginType,
826832 {
827833 var loginCredentials = new Credentials
828834 {
829- Type = loginType , ExternalType = externalCredentialType , Id = id , Token = token
835+ Type = loginType ,
836+ ExternalType = externalCredentialType ,
837+ Id = id ,
838+ Token = token
830839 } ;
831840
832841 var defaultScopeFlags =
@@ -981,7 +990,9 @@ public void AuthLinkExternalAccountWithContinuanceToken(ContinuanceToken token,
981990 var authInterface = GetEOSPlatformInterface ( ) . GetAuthInterface ( ) ;
982991 var linkOptions = new LinkAccountOptions
983992 {
984- ContinuanceToken = token , LinkAccountFlags = linkAccountFlags , LocalUserId = null
993+ ContinuanceToken = token ,
994+ LinkAccountFlags = linkAccountFlags ,
995+ LocalUserId = null
985996 } ;
986997
987998 if ( linkAccountFlags . HasFlag ( LinkAccountFlags . NintendoNsaId ) )
@@ -1064,7 +1075,8 @@ public void StartConnectLoginWithEpicAccount(EpicAccountId epicAccountId,
10641075
10651076 connectLoginOptions . Credentials = new Epic . OnlineServices . Connect . Credentials
10661077 {
1067- Token = userAuthToken . Value . AccessToken , Type = ExternalCredentialType . Epic
1078+ Token = userAuthToken . Value . AccessToken ,
1079+ Type = ExternalCredentialType . Epic
10681080 } ;
10691081
10701082 StartConnectLoginWithOptions ( connectLoginOptions , onConnectLoginCallback ) ;
@@ -1074,7 +1086,8 @@ public void StartConnectLoginWithEpicAccount(EpicAccountId epicAccountId,
10741086 {
10751087 connectLoginOptions . Credentials = new Epic . OnlineServices . Connect . Credentials
10761088 {
1077- Token = authToken . Value . AccessToken , Type = ExternalCredentialType . Epic
1089+ Token = authToken . Value . AccessToken ,
1090+ Type = ExternalCredentialType . Epic
10781091 } ;
10791092
10801093 StartConnectLoginWithOptions ( connectLoginOptions , onConnectLoginCallback ) ;
@@ -1088,7 +1101,8 @@ public void StartConnectLoginWithOptions(ExternalCredentialType externalCredenti
10881101 var loginOptions = new Epic . OnlineServices . Connect . LoginOptions ( ) ;
10891102 loginOptions . Credentials = new Epic . OnlineServices . Connect . Credentials
10901103 {
1091- Token = token , Type = externalCredentialType
1104+ Token = token ,
1105+ Type = externalCredentialType
10921106 } ;
10931107
10941108 switch ( externalCredentialType )
@@ -1100,7 +1114,8 @@ public void StartConnectLoginWithOptions(ExternalCredentialType externalCredenti
11001114 {
11011115 loginOptions . UserLoginInfo = new UserLoginInfo
11021116 {
1103- DisplayName = displayname , NsaIdToken = nsaIdToken ,
1117+ DisplayName = displayname ,
1118+ NsaIdToken = nsaIdToken ,
11041119 } ;
11051120 }
11061121
@@ -1166,7 +1181,8 @@ public void StartConnectLoginWithDeviceToken(string displayName, OnConnectLoginC
11661181
11671182 connectLoginOptions . Credentials = new Epic . OnlineServices . Connect . Credentials
11681183 {
1169- Token = null , Type = ExternalCredentialType . DeviceidAccessToken ,
1184+ Token = null ,
1185+ Type = ExternalCredentialType . DeviceidAccessToken ,
11701186 } ;
11711187
11721188 StartConnectLoginWithOptions ( connectLoginOptions , onLoginCallback ) ;
@@ -1694,13 +1710,13 @@ public void OnApplicationPause(bool isPaused)
16941710 s_isPaused = isPaused ;
16951711 print ( $ "EOSSingleton.OnApplicationPause: IsPaused { wasPaused } -> { s_isPaused } ") ;
16961712
1697- // // Poll for the latest application constrained state as we're about
1698- // // to need it to determine the appropriate EOS application status
1699- //#if UNITY_PS4 || UNITY_GAMECORE_XBOXONE || UNITY_GAMECORE_SCARLETT
1700- // UpdateApplicationConstrainedState(false);
1701- //#else
1702- // UpdateApplicationConstrainedState(true);
1703- //#endif
1713+ // // Poll for the latest application constrained state as we're about
1714+ // // to need it to determine the appropriate EOS application status
1715+ //#if UNITY_PS4 || UNITY_GAMECORE_XBOXONE || UNITY_GAMECORE_SCARLETT
1716+ // UpdateApplicationConstrainedState(false);
1717+ //#else
1718+ // UpdateApplicationConstrainedState(true);
1719+ //#endif
17041720 }
17051721
17061722 //-------------------------------------------------------------------------
@@ -1710,13 +1726,13 @@ public void OnApplicationFocus(bool hasFocus)
17101726 s_hasFocus = hasFocus ;
17111727 print ( $ "EOSSingleton.OnApplicationFocus: HasFocus { hadFocus } -> { s_hasFocus } ") ;
17121728
1713- // // Poll for the latest application constrained state as we're about
1714- // // to need it to determine the appropriate EOS application status
1715- //#if UNITY_PS4 || UNITY_GAMECORE_XBOXONE || UNITY_GAMECORE_SCARLETT
1716- // UpdateApplicationConstrainedState(false);
1717- //#else
1718- // UpdateApplicationConstrainedState(true);
1719- //#endif
1729+ // // Poll for the latest application constrained state as we're about
1730+ // // to need it to determine the appropriate EOS application status
1731+ //#if UNITY_PS4 || UNITY_GAMECORE_XBOXONE || UNITY_GAMECORE_SCARLETT
1732+ // UpdateApplicationConstrainedState(false);
1733+ //#else
1734+ // UpdateApplicationConstrainedState(true);
1735+ //#endif
17201736 }
17211737
17221738 //-------------------------------------------------------------------------
0 commit comments