当前位置: 首页>>代码示例>>Java>>正文


Java Timings.reset方法代码示例

本文整理汇总了Java中co.aikar.timings.Timings.reset方法的典型用法代码示例。如果您正苦于以下问题:Java Timings.reset方法的具体用法?Java Timings.reset怎么用?Java Timings.reset使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在co.aikar.timings.Timings的用法示例。


在下文中一共展示了Timings.reset方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: reload

import co.aikar.timings.Timings; //导入方法依赖的package包/类
public void reload() {
    this.logger.info("Reloading...");

    this.logger.info("Saving levels...");

    for (Level level : this.levels.values()) {
        level.save();
    }

    this.pluginManager.disablePlugins();
    this.pluginManager.clearPlugins();
    this.commandMap.clearCommands();

    this.logger.info("Reloading properties...");
    this.properties.reload();
    this.maxPlayers = this.getPropertyInt("max-players", 20);

    if (this.getPropertyBoolean("hardcore", false) && this.getDifficulty() < 3) {
        this.setPropertyInt("difficulty", 3);
    }

    this.banByIP.load();
    this.banByName.load();
    this.reloadWhitelist();
    this.operators.reload();

    for (BanEntry entry : this.getIPBans().getEntires().values()) {
        this.getNetwork().blockAddress(entry.getName(), -1);
    }

    this.pluginManager.registerInterface(JavaPluginLoader.class);
    this.pluginManager.loadPlugins(this.pluginPath);
    this.enablePlugins(PluginLoadOrder.STARTUP);
    this.enablePlugins(PluginLoadOrder.POSTWORLD);
    Timings.reset();
}
 
开发者ID:Rsplwe,项目名称:Nukkit-Java9,代码行数:37,代码来源:Server.java

示例2: reload

import co.aikar.timings.Timings; //导入方法依赖的package包/类
/**
 * サーバーを再読み込みさせます。
 * @return void
 */
public void reload() {
    this.logger.info("再読み込み中...");

    this.logger.info("ワールドを保存しています...");

    for (Level level : this.levels.values()) {
        level.save();
    }

    this.pluginManager.disablePlugins();
    this.pluginManager.clearPlugins();
    this.commandMap.clearCommands();

    this.logger.info("server.propertiesを再読み込みしています...");
    this.properties.reload();
    this.maxPlayers = this.getPropertyInt("max-players", 20);

    if (this.getPropertyBoolean("hardcore", false) && this.getDifficulty() < 3) {
        this.setPropertyInt("difficulty", 3);
    }

    this.banByIP.load();
    this.banByName.load();
    this.reloadWhitelist();
    this.operators.reload();

    for (BanEntry entry : this.getIPBans().getEntires().values()) {
        this.getNetwork().blockAddress(entry.getName(), -1);
    }

    this.pluginManager.registerInterface(JavaPluginLoader.class);
    this.pluginManager.loadPlugins(this.pluginPath);
    this.enablePlugins(PluginLoadOrder.STARTUP);
    this.enablePlugins(PluginLoadOrder.POSTWORLD);



    Timings.reset();
}
 
开发者ID:JupiterDevelopmentTeam,项目名称:Jupiter,代码行数:44,代码来源:Server.java

示例3: execute

import co.aikar.timings.Timings; //导入方法依赖的package包/类
public void execute(DragonProxy proxy, String[] args) {
    if (args.length == 0)
    {
        proxy.getLogger().info("Timings command (start / stop / paste / history)");
    }
    else
    {
        switch(args[0])
        {
            case "start":
                Timings.setTimingsEnabled(true);
                proxy.getLogger().info("Timings started !");
                break;
            case "stop":
                Timings.setTimingsEnabled(false);
                proxy.getLogger().info("Timings stopped !");
                break;
            case "reset":
                Timings.reset();
                proxy.getLogger().info("Timings reseted !");
                break;
            case "paste":
                TimingsExport.reportTimings(null);
                break;
            case "history":
                break;
        }
    }
}
 
开发者ID:DragonetMC,项目名称:DragonProxy,代码行数:30,代码来源:TimingsCommand.java

示例4: execute

import co.aikar.timings.Timings; //导入方法依赖的package包/类
@Override
public boolean execute(CommandSender sender, String commandLabel, String[] args) {
    if (!this.testPermission(sender)) {
        return true;
    }

    if (args.length != 1) {
        sender.sendMessage(new TranslationContainer("commands.generic.usage", usageMessage));
        return true;
    }

    String mode = args[0].toLowerCase();

    if (mode.equals("on")) {
        Timings.setTimingsEnabled(true);
        Timings.reset();
        sender.sendMessage(new TranslationContainer("nukkit.command.timings.enable"));
        return true;
    } else if (mode.equals("off")) {
        Timings.setTimingsEnabled(false);
        sender.sendMessage(new TranslationContainer("nukkit.command.timings.disable"));
        return true;
    }

    if (!Timings.isTimingsEnabled()) {
        sender.sendMessage(new TranslationContainer("nukkit.command.timings.timingsDisabled"));
        return true;
    }

    switch (mode) {
        case "verbon":
            sender.sendMessage(new TranslationContainer("nukkit.command.timings.verboseEnable"));
            Timings.setVerboseEnabled(true);
            break;
        case "verboff":
            sender.sendMessage(new TranslationContainer("nukkit.command.timings.verboseDisable"));
            Timings.setVerboseEnabled(true);
            break;
        case "reset":
            Timings.reset();
            sender.sendMessage(new TranslationContainer("nukkit.command.timings.reset"));
            break;
        case "report":
        case "paste":
            TimingsExport.reportTimings(sender);
            break;
    }
    return true;
}
 
开发者ID:Rsplwe,项目名称:Nukkit-Java9,代码行数:50,代码来源:TimingsCommand.java


注:本文中的co.aikar.timings.Timings.reset方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。