Skip to content

Commit

Permalink
Change task initialization priority
Browse files Browse the repository at this point in the history
  • Loading branch information
leonardosnt committed Feb 4, 2016
1 parent e521bde commit 9f166fc
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/Core/EssCore.cs
Expand Up @@ -90,8 +90,6 @@ protected override void Load()
Logger = new EssLogger( "[uEssentials] " );
ConnectedPlayers = new HashSet<UPlayer>();

TryAddComponent<Tasks>();

U.Events.OnPlayerConnected += player =>
{
ConnectedPlayers.Add( new UPlayer( player ) );
Expand Down Expand Up @@ -132,15 +130,6 @@ protected override void Load()
EventManager = new EventManager();
EventManager.RegisterAll( GetType().Assembly );

Tasks.New( t => {
WarpManager.Save();
}).Delay( 60 * 1000 ).Interval( 60 * 1000 ).Go();

Tasks.New( t => {
File.Delete( $"{Folder}uEssentials.en.translation.xml" );
File.Delete( $"{Folder}uEssentials.configuration.xml" );
} ).Delay( 100 ).Go();

Logger.Log( "Loaded uEssentials", ConsoleColor.Green );

Logger.Log( "Plugin version: ", ConsoleColor.Green, suffix: "" );
Expand Down Expand Up @@ -182,6 +171,17 @@ protected override void Load()
#if !DEV
Essentials.Analytics.Metrics.Init();
#endif

TryAddComponent<Tasks>();

Tasks.New( t => {
WarpManager.Save();
}).Delay( 60 * 1000 ).Interval( 60 * 1000 ).Go();

Tasks.New( t => {
File.Delete( $"{Folder}uEssentials.en.translation.xml" );
File.Delete( $"{Folder}uEssentials.configuration.xml" );
} ).Delay( 100 ).Go();
}


Expand Down

0 comments on commit 9f166fc

Please sign in to comment.