mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2025-03-10 13:39:23 +01:00
Make "engine" feature configurable, not much of an engine though, yet.
This commit is contained in:
parent
386a70eda4
commit
fe439d014f
@ -73,6 +73,7 @@ public class ChatConfig implements CheckConfig {
|
|||||||
public final ActionList colorActions;
|
public final ActionList colorActions;
|
||||||
|
|
||||||
public final boolean globalChatCheck;
|
public final boolean globalChatCheck;
|
||||||
|
public final boolean globalChatEngineCheck;
|
||||||
public final Set<String> globalChatCommands;
|
public final Set<String> globalChatCommands;
|
||||||
public final float globalChatFrequencyFactor;
|
public final float globalChatFrequencyFactor;
|
||||||
public final float globalChatFrequencyWeight;
|
public final float globalChatFrequencyWeight;
|
||||||
@ -147,6 +148,7 @@ public class ChatConfig implements CheckConfig {
|
|||||||
colorActions = data.getActionList(ConfPaths.CHAT_COLOR_ACTIONS, Permissions.CHAT_COLOR);
|
colorActions = data.getActionList(ConfPaths.CHAT_COLOR_ACTIONS, Permissions.CHAT_COLOR);
|
||||||
|
|
||||||
globalChatCheck = data.getBoolean(ConfPaths.CHAT_GLOBALCHAT_CHECK);
|
globalChatCheck = data.getBoolean(ConfPaths.CHAT_GLOBALCHAT_CHECK);
|
||||||
|
globalChatEngineCheck = data.getBoolean(ConfPaths.CHAT_GLOBALCHAT_ENGINE_CHECK);
|
||||||
final List<String> commands = data.getStringList(ConfPaths.CHAT_GLOBALCHAT_COMMANDS);
|
final List<String> commands = data.getStringList(ConfPaths.CHAT_GLOBALCHAT_COMMANDS);
|
||||||
globalChatCommands = new HashSet<String>();
|
globalChatCommands = new HashSet<String>();
|
||||||
if (commands != null){
|
if (commands != null){
|
||||||
|
@ -135,8 +135,12 @@ public class GlobalChat extends Check{
|
|||||||
score += wWords;
|
score += wWords;
|
||||||
|
|
||||||
// Engine:
|
// Engine:
|
||||||
|
if (cc.globalChatEngineCheck){
|
||||||
final float wEngine = engine.feed(letterCounts);
|
final float wEngine = engine.feed(letterCounts);
|
||||||
score += wEngine;
|
score += wEngine;
|
||||||
|
}
|
||||||
|
|
||||||
|
// System.out.println(score);
|
||||||
|
|
||||||
// Wrapping it up. --------------------
|
// Wrapping it up. --------------------
|
||||||
// Add weight to frequency counts.
|
// Add weight to frequency counts.
|
||||||
|
@ -141,6 +141,8 @@ public abstract class ConfPaths {
|
|||||||
|
|
||||||
public static final String CHAT_GLOBALCHAT = CHAT + "globalchat.";
|
public static final String CHAT_GLOBALCHAT = CHAT + "globalchat.";
|
||||||
public static final String CHAT_GLOBALCHAT_CHECK = CHAT_GLOBALCHAT + "active";
|
public static final String CHAT_GLOBALCHAT_CHECK = CHAT_GLOBALCHAT + "active";
|
||||||
|
public static final String CHAT_GLOBALCHAT_ENGINE = CHAT_GLOBALCHAT + "engine.";
|
||||||
|
public static final String CHAT_GLOBALCHAT_ENGINE_CHECK = CHAT_GLOBALCHAT_ENGINE + "active";
|
||||||
public static final String CHAT_GLOBALCHAT_COMMANDS = CHAT_GLOBALCHAT + "commands";
|
public static final String CHAT_GLOBALCHAT_COMMANDS = CHAT_GLOBALCHAT + "commands";
|
||||||
public static final String CHAT_GLOBALCHAT_FREQUENCY = CHAT_GLOBALCHAT + "frequency.";
|
public static final String CHAT_GLOBALCHAT_FREQUENCY = CHAT_GLOBALCHAT + "frequency.";
|
||||||
public static final String CHAT_GLOBALCHAT_FREQUENCY_WEIGHT = CHAT_GLOBALCHAT_FREQUENCY + "weight";
|
public static final String CHAT_GLOBALCHAT_FREQUENCY_WEIGHT = CHAT_GLOBALCHAT_FREQUENCY + "weight";
|
||||||
|
@ -130,6 +130,7 @@ public class DefaultConfig extends ConfigFile {
|
|||||||
set(ConfPaths.CHAT_GLOBALCHAT_CHECK, true);
|
set(ConfPaths.CHAT_GLOBALCHAT_CHECK, true);
|
||||||
set(ConfPaths.CHAT_GLOBALCHAT_COMMANDS, new LinkedList<String>(Arrays.asList(
|
set(ConfPaths.CHAT_GLOBALCHAT_COMMANDS, new LinkedList<String>(Arrays.asList(
|
||||||
new String[]{"/me"})));
|
new String[]{"/me"})));
|
||||||
|
set(ConfPaths.CHAT_GLOBALCHAT_ENGINE_CHECK, true);
|
||||||
set(ConfPaths.CHAT_GLOBALCHAT_FREQUENCY_FACTOR, 0.9D);
|
set(ConfPaths.CHAT_GLOBALCHAT_FREQUENCY_FACTOR, 0.9D);
|
||||||
set(ConfPaths.CHAT_GLOBALCHAT_FREQUENCY_WEIGHT, 6.0D);
|
set(ConfPaths.CHAT_GLOBALCHAT_FREQUENCY_WEIGHT, 6.0D);
|
||||||
set(ConfPaths.CHAT_GLOBALCHAT_LEVEL, 45D);
|
set(ConfPaths.CHAT_GLOBALCHAT_LEVEL, 45D);
|
||||||
|
Loading…
Reference in New Issue
Block a user