Skip to content

Commit

Permalink
Correction Scheduler name
Browse files Browse the repository at this point in the history
  • Loading branch information
NeutronStars committed Oct 15, 2017
1 parent 66c35fc commit 0d1314a
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 20 deletions.
6 changes: 3 additions & 3 deletions src/main/java/fr/neutronstars/nbot/NBot.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import fr.neutronstars.nbot.exception.NBotUnsupportedOperationException;
import fr.neutronstars.nbot.logger.NBotLogger;
import fr.neutronstars.nbot.plugin.PluginManager;
import fr.neutronstars.nbot.sheduler.Sheduler;
import fr.neutronstars.nbot.scheduler.Scheduler;
import fr.neutronstars.nbot.util.Configuration;
import net.dv8tion.jda.core.JDA;
import net.dv8tion.jda.core.hooks.EventListener;
Expand Down Expand Up @@ -80,9 +80,9 @@ public static Configuration getConfiguration()
return server.getNBotConfiguration();
}

public static Sheduler getSheduler()
public static Scheduler getScheduler()
{
return server.getSheduler();
return server.getScheduler();
}

public static void addJDAListener(EventListener listener)
Expand Down
11 changes: 4 additions & 7 deletions src/main/java/fr/neutronstars/nbot/NBotServer.java
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
package fr.neutronstars.nbot;

import fr.neutronstars.nbot.command.CommandManager;
import fr.neutronstars.nbot.command.defaut.DefaultCommand;
import fr.neutronstars.nbot.entity.Console;
import fr.neutronstars.nbot.entity.Guild;
import fr.neutronstars.nbot.listener.NBotListener;
import fr.neutronstars.nbot.logger.NBotLogger;
import fr.neutronstars.nbot.plugin.PluginManager;
import fr.neutronstars.nbot.sheduler.Sheduler;
import fr.neutronstars.nbot.scheduler.Scheduler;
import fr.neutronstars.nbot.util.Configuration;
import net.dv8tion.jda.core.AccountType;
import net.dv8tion.jda.core.JDA;
Expand All @@ -16,7 +14,6 @@

import javax.security.auth.login.LoginException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
Expand All @@ -26,7 +23,7 @@ final class NBotServer
{
private final NBotLogger logger = NBotLogger.getLogger("NBot");
private final Map<Long, Guild> guilds = new HashMap<>();
private final Sheduler sheduler = new Sheduler();
private final Scheduler scheduler = new Scheduler();
private final Configuration configuration;
private final PluginManager pluginManager;
private final JDA jda;
Expand Down Expand Up @@ -74,9 +71,9 @@ public Guild getGuild(net.dv8tion.jda.core.entities.Guild guild)
return guilds.get(guild.getIdLong());
}

public Sheduler getSheduler()
public Scheduler getScheduler()
{
return sheduler;
return scheduler;
}

public int getTps()
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/fr/neutronstars/nbot/NBotStart.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ private static void loop(NBotServer server)

private static void update()
{
NBot.getSheduler().updateTasks();
NBot.getScheduler().updateTasks();
}

private static Configuration loadConfiguration()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ public class JDALogListener implements LogListener

public void onLog(SimpleLog log, org.slf4j.event.Level logLevel, Object message)
{

logger.log(Level.valueOf(logLevel.toString()), message.toString(), false);
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/fr/neutronstars/nbot/logger/Level.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@

public enum Level
{
ALL, TRACE, DEBUG, INFO, WARNING, FATAL, OFF;
ALL, TRACE, DEBUG, INFO, WARNING, FATAL, OFF, ERROR, WARN;
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package fr.neutronstars.nbot.sheduler;
package fr.neutronstars.nbot.scheduler;

import fr.neutronstars.nbot.NBot;
import fr.neutronstars.nbot.exception.NBotTaskException;
Expand All @@ -12,23 +12,23 @@ public abstract class NBotRunnable implements Runnable

public final void runTask()
{
NBot.getSheduler().runTask(this);
NBot.getScheduler().runTask(this);
}

public final void runTaskLater(long delay)
{
NBot.getSheduler().runTaskLater(this, delay);
NBot.getScheduler().runTaskLater(this, delay);
}

public final void runTaskTimer(long delay, long period)
{
id = NBot.getSheduler().runTaskTimer(this, delay, period);
id = NBot.getScheduler().runTaskTimer(this, delay, period);
}

public void cancel()
{
if(id == -1) throw new NBotTaskException("This task is not started.");
NBot.getSheduler().cancelTask(id);
NBot.getScheduler().cancelTask(id);
id = -1;
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package fr.neutronstars.nbot.sheduler;
package fr.neutronstars.nbot.scheduler;

/**
* Created by NeutronStars on 12/10/2017
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package fr.neutronstars.nbot.sheduler;
package fr.neutronstars.nbot.scheduler;

import fr.neutronstars.nbot.exception.NBotTaskException;

Expand All @@ -10,7 +10,7 @@
/**
* Created by NeutronStars on 12/10/2017
*/
public class Sheduler
public class Scheduler
{
private final Map<Integer, NBotTask> taskMap = new HashMap<>();

Expand Down

0 comments on commit 0d1314a

Please sign in to comment.