1- using LabApi . Loader ;
1+ using LabApi . Features . Console ;
2+ using LabApi . Loader ;
23using MEC ;
34using SER . Code . Extensions ;
45using SER . Code . MethodSystem ;
@@ -27,7 +28,7 @@ public void Load()
2728 _handles . Add ( Timing . RunCoroutine ( Await ( framework ) ) ) ;
2829 }
2930 }
30-
31+
3132 public string StopAndGetLoadedFrameworksMessage ( )
3233 {
3334 Timing . KillCoroutines ( _handles . ToArray ( ) ) ;
@@ -39,12 +40,39 @@ public string StopAndGetLoadedFrameworksMessage()
3940
4041 private IEnumerator < float > Await ( Framework framework )
4142 {
42- while ( PluginLoader . EnabledPlugins . All ( plg => plg . Name != framework . Name ) )
43+ for ( int timer = 0 ; timer <= 3 ; timer ++ )
4344 {
44- yield return Timing . WaitForSeconds ( 0.1f ) ;
45+ yield return Timing . WaitForSeconds ( 1f ) ;
46+
47+ if ( _found . Contains ( framework ) )
48+ {
49+ continue ;
50+ }
51+
52+ if ( PluginLoader . EnabledPlugins . All ( plg => plg . Name != framework . Name ) && ! IsExiledCompatFrameworkLoaded ( framework ) )
53+ {
54+ continue ;
55+ }
56+
57+ _found . Add ( framework ) ;
58+ MethodIndex . LoadMethodsOfFramework ( framework . Type ) ;
4559 }
46-
47- _found . Add ( framework ) ;
48- MethodIndex . LoadMethodsOfFramework ( framework . Type ) ;
60+
61+ Logger . Raw ( StopAndGetLoadedFrameworksMessage ( ) , ConsoleColor . DarkYellow ) ;
62+ }
63+
64+ private bool IsExiledCompatFrameworkLoaded ( Framework framework )
65+ {
66+ if ( framework . Type == IDependOnFramework . Type . Callvote ) // As of right now, Callvote-Exiled is not compatible with SER.
67+ {
68+ return false ;
69+ }
70+
71+ if ( PluginLoader . Plugins . Any ( plg => plg . Key . Name == "Exiled Loader" ) )
72+ {
73+ return Exiled . Loader . Loader . Plugins . Any ( plg => plg . Name == framework . Name ) ;
74+ }
75+
76+ return false ;
4977 }
5078}
0 commit comments