Rise 5.99 Insults module 1 files, 185 lines

Rise 5.99 Insults: Full Source Analysis

Insults sends a taunt message when the player kills someone.

dev/rise/module/impl/other/Insults.java · GitHub source ↗

Published 2026-08-13 · Updated 2026-08-13

Packets This Module Uses

Analysis

Overview

Insults sends a taunt message when the player kills someone. AttackEvent records the last attacked player; onPreMotion then checks whether that target has left the world's loaded entity list while staying within 30 blocks (getDistanceSq under 900), which is the kill heuristic: the despawned corpse and the proximity to the player. When the condition holds, a message from one of three pools (Normal insults and Rise ads, Fag slurs, Sigma ads) has its :user: placeholder replaced with the victim's name and goes out through mc.thePlayer.sendChatMessage, one C01 per kill. The server gate suppresses everything on minemenclub and minemanclub. RandomUtils.nextInt(0, pool.length) covers the full pool with no off-by-one, and the TimeUtil timer3 is dead: it is reset twice per send but never queried, so the real gate is only ticksExisted above 20 and there is no cooldown, meaning every matching kill event sends immediately.

Kill detection

The detector is two conditions joined in onPreMotion: the tracked target is no longer in mc.theWorld.playerEntities, and its last known position is within 30 blocks squared distance of the player. A dead player's entity leaves the list when the death animation finishes, so the condition fires shortly after a kill, and the distance bound keeps it from firing when a target merely teleports away. The AttackEvent handler overwrites the target on every attack, so the last victim is always the candidate. The minemenclub and minemanclub server gate returns early, an explicit anti-ban carve-out for servers that actively punish this behavior.

Message pools and cadence

The three pools are field arrays in the module: 55 Normal entries mixing insults with Rise advertisements (several are verbatim ads with no placeholder at all), 7 Fag obfuscations of one slur (fag, f4g, f_a_g, and space variants), and 52 Sigma entries that are pure Rise promotion with a couple of references to the development team. The selection uses RandomUtils.nextInt(0, length), which yields every index in the pool, unlike the off-by-one pattern in sibling clients that leaves the last entry unreachable. timer3 is reset before and after the send but hasReached is never called, so the module has no actual cooldown: the only cadence control is the ticksExisted > 20 guard, and kills faster than the 8-second repeat window are entirely possible.

Wire footprint

The module emits exactly one C01 per detected kill. Messages that carry :user: vary per victim, but the placeholder-free entries are sent byte-identical on every roll, so two kills inside the repeat-similarity window can produce the exact same message. The Fag pool's obfuscations differ only in punctuation, and the Sigma pool is entirely static text, so consecutive kills with these pools produce near-duplicate traffic. The kill cadence itself is a burst pattern: a killstreak concentrates C01s into the same seconds, which is the frequency signature the chat checks key on.

source Insults.java

Insults.java185 lines · JavaOriginal ↗
1
/*
2
 Copyright Alan Wood 2021
3
 None of this code to be reused without my written permission
4
 Intellectual Rights owned by Alan Wood
5
 */
6
package dev.rise.module.impl.other;
7
8
import dev.rise.Rise;
9
import dev.rise.event.impl.motion.PreMotionEvent;
10
import dev.rise.event.impl.other.AttackEvent;
11
import dev.rise.module.Module;
12
import dev.rise.module.api.ModuleInfo;
13
import dev.rise.module.enums.Category;
14
import dev.rise.setting.impl.ModeSetting;
15
import dev.rise.util.math.TimeUtil;
16
import dev.rise.util.player.PlayerUtil;
17
import net.minecraft.entity.Entity;
18
import net.minecraft.entity.player.EntityPlayer;
19
import org.apache.commons.lang3.RandomUtils;
20
21
@ModuleInfo(name = "Insults", description = "Insults people when you kill them", category = Category.OTHER)
22
public final class Insults extends Module {
23
24
    private final ModeSetting mode = new ModeSetting("Mode", this, "Normal", "Normal", "Fag", "Sigma");
25
26
    private EntityPlayer target;
27
    TimeUtil timer3 = new TimeUtil();
28
29
    @Override
30
    public void onAttackEvent(final AttackEvent event) {
31
        final Entity entity = event.getTarget();
32
33
        if (entity instanceof EntityPlayer)
34
            target = (EntityPlayer) entity;
35
    }
36
37
    @Override
38
    public void onPreMotion(final PreMotionEvent event) {
39
        if (target != null && !(PlayerUtil.isOnServer("minemenclub") || PlayerUtil.isOnServer("minemanclub"))) {
40
            if (!mc.theWorld.playerEntities.contains(target) && mc.thePlayer.getDistanceSq(target.posX, mc.thePlayer.posY, target.posZ) < 900) {
41
                timer3.reset();
42
                if (mc.thePlayer.ticksExisted > 20) {
43
                    switch (mode.getMode()) {
44
                        case "Fag":
45
                            mc.thePlayer.sendChatMessage(fags[RandomUtils.nextInt(0, fags.length)].replaceAll(":user:", target.getName()));
46
                            break;
47
48
                        case "Normal":
49
                            mc.thePlayer.sendChatMessage(insults[RandomUtils.nextInt(0, insults.length)].replaceAll(":user:", target.getName()));
50
                            break;
51
52
                        case "Sigma":
53
                            mc.thePlayer.sendChatMessage(sigma[RandomUtils.nextInt(0, sigma.length)].replaceAll(":user:", target.getName()));
54
                            break;
55
                    }
56
                    timer3.reset();
57
                }
58
                target = null;
59
            }
60
        }
61
    }
62
63
    private final String[] insults = {
64
            "Made by The_Bi11iona1re",
65
            "Did :user: pay for that loss?",
66
            "Get Rise from riseclient.com",
67
            "Did :user:'s dad not come back after he wanted to buy some milk?",
68
            "RISE against other cheaters by getting Rise from riseclient.com",
69
            "Are you afraid of me",
70
            "Why not use Rise?",
71
            "#SwitchToRise5",
72
            ":user: I saw you in femboy meetup, hi!",
73
            "Buy Rise, don't be like :user:",
74
            "Did :user: forget to left click?",
75
            ":user: takes up 2 seats on the bus",
76
            "No Rise?",
77
            "It is impossible to miss :user: with their man boobs",
78
            "Come on :user:, report me to the obese staff",
79
            ":user: is the type to overdose on Benadryl for a Tiktok video",
80
            "No wonder :user: dropped out of college",
81
            "Here's your ticket to spectator",
82
            ":user: said they would never give me up and never let me down, I am sad",
83
            "The latest update to Rise fps booster client gave me 1000 fps and regedits for better velocity",
84
            ":user: became Transgender just to join the 50% a day later",
85
            "Drink hand sanitizer so we can get rid of :user:",
86
            "Even the MC Virgins are less virgin than :user:",
87
            ":user:'s free trial of life has expired",
88
            ":user: is socially awkward",
89
            "I bet :user: believes in the flat earth",
90
            ":user: is the reason why society is failing",
91
            "Pay to lose",
92
            "Get good, get Rise @ riseclient.com",
93
            "Why would I be cheating when I am recording?",
94
            ":user: is such a that degenerate :user: believes EQ has more value than IQ",
95
            "The air could've took :user: away because of how weak :user: is",
96
            "Even Kurt Cobain is more alive than :user: with his wounds from a shotgun and heroin in his veins",
97
            ":user: is breaking down more than Nirvana after Kurt Cobain's death",
98
            "Does :user: buy their groceries at the dollar store?",
99
            "Does :user: need some pvp advice?",
100
            "I'd smack :user:, but that would be animal abuse",
101
            "I don't cheat, :user: just needs to click faster",
102
            "Welcome to my rape dungeon! population: :user:!",
103
            ":user: pressed the wrong button when they installed Minecraft?",
104
            "If the body is 70% water than how is :user:'s body 100% salt?",
105
            "Rise " + Rise.CLIENT_VERSION + " is sexier than :user:",
106
            "Oh, :user: is recording? Well I am too",
107
            ":user: is the type of person who would brute force interpolation",
108
            ":user: go drown in your own salt",
109
            ":user: is literally heavier than Overflow",
110
            "Excuse me :user:, I don't speak retard",
111
            "Hmm, the problem :user:'s having looks like a skin color issue",
112
            ":user: I swear I'm on Lunar Client",
113
            "Hey! Wise up :user:! Don't waste your time without Rise",
114
            ":user: didn't even stand a chance",
115
            "If opposites attract I hope :user: finds someone who is intelligent, honest and cultured",
116
            "If laughter is the best medicine, :user:'s face must be curing the world",
117
            ":user: is the type of person to climb over a glass wall to see what's on the other side",
118
            "What does :user:'s IQ and their girlfriend have in common? They're both below 5."
119
    };
120
121
    private final String[] fags = {
122
            "fag",
123
            "f4g",
124
            "f_a_g",
125
            "f a g",
126
            "fa g",
127
            "f ag",
128
            "f 4 g"
129
    };
130
131
    private final String[] sigma = {
132
            "Learn your alphabet with the Rise client: Alan32, Auth, Hazsi, Herkowskyyy, Nicklas, RISE, Strikeless, and Tecnio!",
133
            "Download Rise to kick ass while listening to some badass music!",
134
            "Why Rise? Cause it is the addition of pure skill and incredible intellectual abilities",
135
            "Want some skills? Check out Rise at riseclient.com!",
136
            "You have been oofed by Rise oof oof",
137
            "I am not racist, but I only like Rise users. so git gud noobs",
138
            "Quick Quiz: I am Alan32's son, who am I? RISE",
139
            "Wow! My combo is Rise'n!",
140
            "What should I choose? Rise or Rise?",
141
            "Buy Rise Client, its not free!",
142
            "Bigmama and Risemama",
143
            "I don't hack I just Rise",
144
            "Rise client is your new home",
145
            "Look a divinity! He definitely must use Rise!",
146
            "In need of a cute present for Christmas? Rise is all you need!",
147
            "I have a good Rise config, don't blame me",
148
            "Don't piss me off or you will discover the true power of Rise's inf reach",
149
            "Rise never dies",
150
            "Maybe I will be Rise, I am already Rise",
151
            "Rise will help you! Oops, i killed you instead.",
152
            "#NoHaxJustRise",
153
            "Do like Tenebrous, subscribe to 8Sence!",
154
            "Did I really just forget that melody? Ri ris ris ris Rise",
155
            "Rise. The only client run by speakers of Breton",
156
            "Order free baguettes with Rise client",
157
            "Another Rise user? Awww man",
158
            "Rise utility client no hax 100%",
159
            "Hypixel wants to know Rise owner's location [Accept] [Deny]",
160
            "I am a Rise-magician, thats how I am able to do all those block game tricks",
161
            "Stop it, get some help! Get Rise",
162
            "Rise users belike: Hit or miss I guess I never miss!",
163
            "I dont hack i just have Rise Gaming Chair",
164
            "Stop Hackustation me cuz im just Rise",
165
            "R. I. S. E. Hack with me today!",
166
            "Subscribe to 8Sence and Tecnio on youtube and discover Rise!",
167
            "Beauty is not in the face; beauty is in Rise",
168
            "Imagine using anything but Rise",
169
            "No hax just beta testing the anti-cheat with Rise",
170
            "Don't forget to report me for Rise on the forums!",
171
            "Get Rise hack client at riseclient.com to get the best mineman skills!",
172
            "don't use Rise? ok boomer",
173
            "Rise is better than Optifine",
174
            "It's not BlockFly it's Scaffold in Rise!",
175
            "How come a noob like you not use Rise?",
176
            "A mother becomes a true grandmother the day she gets Rise " + Rise.CLIENT_VERSION,
177
            "Fly faster than light, only available in Rise™",
178
            "Behind every Rise user, is an incredibly cool human being. Trust me, cooler than you.",
179
            "Hello Rise my old friend...",
180
            "#SwitchToRise5",
181
            "What? You've never downloaded Rise? You know it's the best right?",
182
            "Your client sucks, just get Rise",
183
            "Rise made this world a better place, killing you with it even more"
184
    };
185
}

What this file does

The whole module, including its message pools, lives in this one file, so no supporting file is needed. The kill heuristic (target left the entity list within 30 blocks), the sendChatMessage call with :user: substitution, the server gate, the mode selector for the three pools, and the 114 pool entries are all here. The dead timer3 is visible in the send branch: reset before and after the message, never queried. The pool coverage detail also matters: RandomUtils.nextInt(0, insults.length) yields indices 0 through length minus 1, so unlike the death-insult sibling every entry is reachable.

anticheat Countering Checks

The anticheat code that detects or counters the techniques this module uses. Full source, with the detection mechanism explained below each box.

anticheat Text (repeat similarity and frequency)

Text.java331 lines · Java
1
/*
2
 * This program is free software: you can redistribute it and/or modify
3
 *   it under the terms of the GNU General Public License as published by
4
 *   the Free Software Foundation, either version 3 of the License, or
5
 *   (at your option) any later version.
6
 *
7
 *   This program is distributed in the hope that it will be useful,
8
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
9
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10
 *   GNU General Public License for more details.
11
 *
12
 *   You should have received a copy of the GNU General Public License
13
 *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
14
 */
15
package fr.neatmonster.nocheatplus.checks.chat;
16
17
import java.util.Collections;
18
import java.util.LinkedList;
19
import java.util.List;
20
import java.util.Map;
21
22
import org.bukkit.entity.Player;
23
24
import fr.neatmonster.nocheatplus.NCPAPIProvider;
25
import fr.neatmonster.nocheatplus.checks.Check;
26
import fr.neatmonster.nocheatplus.checks.CheckType;
27
import fr.neatmonster.nocheatplus.checks.chat.analysis.MessageLetterCount;
28
import fr.neatmonster.nocheatplus.checks.chat.analysis.WordLetterCount;
29
import fr.neatmonster.nocheatplus.checks.chat.analysis.engine.LetterEngine;
30
import fr.neatmonster.nocheatplus.checks.combined.CombinedData;
31
import fr.neatmonster.nocheatplus.components.NoCheatPlusAPI;
32
import fr.neatmonster.nocheatplus.components.registry.feature.INotifyReload;
33
import fr.neatmonster.nocheatplus.config.ConfigFile;
34
import fr.neatmonster.nocheatplus.config.ConfigManager;
35
import fr.neatmonster.nocheatplus.players.IPlayerData;
36
import fr.neatmonster.nocheatplus.utilities.ColorUtil;
37
import fr.neatmonster.nocheatplus.utilities.StringUtil;
38
39
/**
40
 * Some alternative more or less advanced analysis methods.
41
 * @author asofold
42
 *
43
 */
44
public class Text extends Check implements INotifyReload {
45
46
    private LetterEngine engine = null;
47
48
    /** Not really cancelled but above threshold for actions. */
49
    private String lastCancelledMessage = "";
50
    private long lastCancelledTime = 0;
51
52
    private String lastGlobalMessage = "";
53
    private long lastGlobalTime = 0;
54
55
    public Text() {
56
        super(CheckType.CHAT_TEXT);
57
        init();
58
    }
59
60
    /**
61
     * Start analysis.
62
     * @param player
63
     *          The player who issued the message.
64
     * @param message
65
     *          The message to check.
66
     * @param captcha 
67
     *          Used for starting captcha on failure, if configured so.
68
     * @param alreadyCancelled 
69
     * @return
70
     */
71
    public boolean check(final Player player, final String message, 
72
                         final ChatConfig cc, final IPlayerData pData,
73
                         final ICaptcha captcha, boolean isMainThread, final boolean alreadyCancelled) {
74
        final ChatData data = pData.getGenericInstance(ChatData.class);
75
        synchronized (data) {
76
            return unsafeCheck(player, message, captcha, cc, data, pData, isMainThread, alreadyCancelled);
77
        }
78
    }
79
80
    private void init() {
81
        // Set some things from the global config.
82
        final ConfigFile config = ConfigManager.getConfigFile();
83
        final NoCheatPlusAPI api = NCPAPIProvider.getNoCheatPlusAPI();
84
        if (engine != null) {
85
            engine.clear();
86
            api.removeComponent(engine);
87
        }
88
        engine = new LetterEngine(config);
89
        api.addComponent(engine);
90
    }
91
92
    @Override
93
    public void onReload() {
94
        synchronized(engine) {
95
            engine.clear();
96
        }
97
        init();
98
    }
99
100
    /**
101
     * Check without further synchronization.
102
     * @param player
103
     * @param message
104
     * @param captcha
105
     * @param cc
106
     * @param data
107
     * @param isMainThread 
108
     * @param alreadyCancelled 
109
     * @return
110
     */
111
    private boolean unsafeCheck(final Player player, final String message, final ICaptcha captcha,
112
                                final ChatConfig cc, final ChatData data, final IPlayerData pData,
113
                                boolean isMainThread, final boolean alreadyCancelled) {
114
115
        // Test captcha.
116
        if (captcha.shouldCheckCaptcha(player, cc, data, pData)) {
117
            captcha.checkCaptcha(player, message, cc, data, isMainThread);
118
            return true;
119
        } 
120
        else if (alreadyCancelled) {
121
            // Skip checking.
122
            return true;
123
        }
124
125
        final long time = System.currentTimeMillis();
126
        final String lcMessage = message.trim().toLowerCase();
127
        boolean cancel = false;
128
        final boolean debug = pData.isDebugActive(type);
129
        final List<String> debugParts;
130
        if (debug) {
131
            debugParts = new LinkedList<String>();
132
            debugParts.add("Message (length=" + message.length()+"): ");
133
        }
134
        else debugParts = null;
135
136
        // Update the frequency interval weights.
137
        data.chatFrequency.update(time);
138
139
        // Score for this message (violation score).
140
        float score = 0;
141
        final MessageLetterCount letterCounts = new MessageLetterCount(message);
142
        final int msgLen = message.length();
143
144
145
146
        // (Following: random/made up criteria.)
147
        // TODO: Create tests for all methods with wordlists, fake chat (refactor for that).
148
        // Full message processing. ------------
149
        // Upper case.
150
        if (letterCounts.fullCount.upperCase > msgLen / 3) {
151
            // TODO: Regard chunks of 48 or so letters of the message for this?
152
            final float wUpperCase = 0.6f * letterCounts.fullCount.getUpperCaseRatio();
153
            score += wUpperCase  * cc.textMessageUpperCase;
154
        }
155
156
        // Letters vs. word length.
157
        if (msgLen > 4) {
158
            final float fullRep = letterCounts.fullCount.getLetterCountRatio();
159
            // Long messages: very small and very big are bad !
160
            // 128 is a quick attempt to make one long message possible on 1.11.
161
            final float wRepetition = (float) Math.min(msgLen, 128) / 15.0f * Math.abs(0.5f - fullRep);
162
            score += wRepetition * cc.textMessageLetterCount;
163
164
            // Number of words vs. length of message
165
            final float fnWords = (float) letterCounts.words.length / (float) msgLen;
166
            if (fnWords > 0.75f) { // TODO: balance or configure or remove ?
167
                score += fnWords  * cc.textMessagePartition;
168
            }
169
        }
170
171
        final CombinedData cData = pData.getGenericInstance(CombinedData.class);
172
        final long timeout = 8000; // TODO: maybe set dynamically in data.
173
        // Repetition of last message.
174
        if (cc.textMsgRepeatSelf != 0f && time - data.chatLastTime < timeout) {
175
            if (StringUtil.isSimilar(lcMessage, data.chatLastMessage, 0.8f)) {
176
                final float timeWeight = (float) (timeout - (time - data.chatLastTime)) / (float) timeout; 
177
                score += cc.textMsgRepeatSelf * timeWeight;
178
            }
179
        }
180
        // Repetition of last global message.
181
        if (cc.textMsgRepeatGlobal != 0f && time - lastGlobalTime < timeout) {
182
            if (StringUtil.isSimilar(lcMessage, lastGlobalMessage, 0.8f)) {
183
                final float timeWeight = (float) (timeout - (time - lastGlobalTime)) / (float) timeout; 
184
                score += cc.textMsgRepeatGlobal * timeWeight;
185
            }
186
        }
187
        // Repetition of last cancelled message.
188
        if (cc.textMsgRepeatCancel != 0f && time - lastCancelledTime < timeout) {
189
            if (StringUtil.isSimilar(lcMessage, lastCancelledMessage, 0.8f)) {
190
                final float timeWeight = (float) (timeout - (time - lastCancelledTime)) / (float) timeout; 
191
                score += cc.textMsgRepeatCancel * timeWeight;
192
            }
193
        }
194
        // Chat quickly after join.
195
        if (cc.textMsgAfterJoin != 0f && time - cData.lastJoinTime < timeout) {
196
            final float timeWeight = (float) (timeout - (time - cData.lastJoinTime)) / (float) timeout;
197
            score += cc.textMsgAfterJoin * timeWeight; 
198
        }
199
        // Chat without moving.
200
        if (cc.textMsgNoMoving != 0f && time - cData.lastMoveTime > timeout) {
201
            score += cc.textMsgNoMoving;
202
        }
203
204
205
206
        // Per word checks. -------------------
207
        float wWords = 0.0f;
208
        final float avwLen = (float) msgLen / (float) letterCounts.words.length; 
209
        for (final WordLetterCount word : letterCounts.words) {
210
            float wWord = 0.0f;
211
            final int wLen = word.word.length();
212
            // TODO: ? used letters vs. word length.
213
214
            // Length of word vs. av. word length.
215
            final float fLenAv = Math.abs(avwLen - (float) wLen) / avwLen;
216
            wWord += fLenAv * cc.textMessageLengthAv;
217
218
            // Length of word vs. message length;
219
            final float fLenMsg = (float) wLen / (float) msgLen;
220
            wWord += fLenMsg * cc.textMessageLengthMsg;
221
222
            // Not letter:
223
            float notLetter = word.getNotLetterRatio();
224
            notLetter *= notLetter;
225
            wWord += notLetter * cc.textMessageNoLetter;
226
227
            wWord *= wWord; // TODO: quadratic ? (configurable)
228
            wWords += wWord;
229
        }
230
        wWords /= (float) letterCounts.words.length;
231
        score += wWords;
232
233
        if (debug && score > 0f) {
234
            debugParts.add("Simple score: " + StringUtil.fdec3.format(score));
235
        }
236
237
        // Engine:
238
        // TODO: more fine grained sync !
239
        float wEngine = 0f;
240
        final Map<String, Float> engMap;
241
        synchronized (engine) {
242
            engMap = engine.process(letterCounts, player.getName(), cc, data);
243
            // TODO: more fine grained sync !s
244
            // TODO: different methods (add or max or add+max or something else).
245
            for (final Float res : engMap.values()) {
246
                if (cc.textEngineMaximum) {
247
                    wEngine = Math.max(wEngine, res.floatValue());
248
                }
249
                else wEngine += res.floatValue();
250
            }
251
        }
252
        score += wEngine;
253
254
255
        // Wrapping it up. --------------------
256
        // Add weight to frequency counts.
257
        final float normalScore = Math.max(cc.textFreqNormMin, score);
258
        data.chatFrequency.add(time, normalScore);
259
        final float accumulated = cc.textFreqNormWeight * data.chatFrequency.score(cc.textFreqNormFactor);
260
        final boolean normalViolation = accumulated > cc.textFreqNormLevel;
261
        final float shortTermScore = Math.max(cc.textFreqShortTermMin, score);
262
        data.chatShortTermFrequency.add(time, shortTermScore);
263
        // TODO: very short term (1st bucket) or do it indirectly.
264
        final float shortTermAccumulated = cc.textFreqShortTermWeight * data.chatShortTermFrequency.score(cc.textFreqShortTermFactor);
265
        final boolean shortTermViolation = shortTermAccumulated > cc.textFreqShortTermLevel;
266
267
        if (normalViolation || shortTermViolation) {
268
            lastCancelledMessage = lcMessage;
269
            lastCancelledTime = time;
270
271
            final double added;
272
            if (shortTermViolation) {
273
                added = (shortTermAccumulated - cc.textFreqShortTermLevel)/ 3.0;
274
            } 
275
            else added = (accumulated - cc.textFreqNormLevel) / 10.0; 
276
            data.textVL += added;
277
278
            if (captcha.shouldStartCaptcha(player, cc, data, pData)) {
279
                captcha.sendNewCaptcha(player, cc, data);
280
                cancel = true;
281
            }
282
            else {
283
                if (shortTermViolation) {
284
                    if (executeActions(player, data.textVL, added, cc.textFreqShortTermActions).willCancel()) {
285
                        cancel = true;
286
                    }
287
                }
288
                else if (normalViolation) {
289
                    if (executeActions(player, data.textVL, added, cc.textFreqNormActions).willCancel()) {
290
                        cancel = true;
291
                    }
292
                }
293
            }
294
        }
295
        else if (cc.chatWarningCheck && time - data.chatWarningTime > cc.chatWarningTimeout && (100f * accumulated / cc.textFreqNormLevel > cc.chatWarningLevel || 100f * shortTermAccumulated / cc.textFreqShortTermLevel > cc.chatWarningLevel)) {
296
            NCPAPIProvider.getNoCheatPlusAPI().sendMessageOnTick(player.getName(), ColorUtil.replaceColors(cc.chatWarningMessage));
297
            data.chatWarningTime = time;
298
        }
299
        else {
300
            data.textVL *= 0.95;
301
            if (cc.textAllowVLReset && normalScore < 2.0f * cc.textFreqNormWeight && shortTermScore < 2.0f * cc.textFreqShortTermWeight) {
302
                // Reset the VL.
303
                // Maybe elaborate on resetting conditions (after some timeout just divide by two or so?).
304
                data.textVL = 0.0;
305
            }
306
        }
307
308
        if (debug) {
309
            final List<String> keys = new LinkedList<String>(engMap.keySet());
310
            Collections.sort(keys);
311
            for (String key : keys) {
312
                Float s = engMap.get(key);
313
                if (s.floatValue() > 0.0f)
314
                    debugParts.add(key + ":" + StringUtil.fdec3.format(s));
315
            }
316
            if (wEngine > 0.0f)
317
                debugParts.add("Engine score (" + (cc.textEngineMaximum?"max":"sum") + "): " + StringUtil.fdec3.format(wEngine));
318
319
            debugParts.add("Final score: " +  StringUtil.fdec3.format(score));
320
            debugParts.add("Normal: min=" +  StringUtil.fdec3.format(cc.textFreqNormMin) +", weight=" +  StringUtil.fdec3.format(cc.textFreqNormWeight) + " => accumulated=" + StringUtil.fdec3.format(accumulated));
321
            debugParts.add("Short-term: min=" +  StringUtil.fdec3.format(cc.textFreqShortTermMin) +", weight=" +  StringUtil.fdec3.format(cc.textFreqShortTermWeight) + " => accumulated=" + StringUtil.fdec3.format(shortTermAccumulated));
322
            debugParts.add("vl: " + StringUtil.fdec3.format(data.textVL));
323
            debug(player, StringUtil.join(debugParts, " | "));
324
            debugParts.clear();
325
        }
326
327
        lastGlobalMessage = data.chatLastMessage = lcMessage;
328
        lastGlobalTime = data.chatLastTime = time;
329
        return cancel;
330
    }
331
}

How it counteracts this module

Text scores every non-command chat message on content and rate. The repeat path is the direct hit: isSimilar against the previous message with an 0.8 threshold over 8000 ms catches the module's byte-identical placeholder-free ads ("Made by The_Bi11iona1re", "Get Rise from riseclient.com", "#SwitchToRise5") and the Fag pool's punctuation-only obfuscations ("fag" vs "f4g" vs "f a g"), which consecutive kills within the window will produce. The frequency accumulators bound killstreaks: several C01s in one second push the short-term bucket, and the no-moving penalty adds weight when the player stands still between kills. The per-message letter and non-letter scores also weigh the obfuscated forms, where underscore and digit characters square the per-word penalty, and the Sigma pool's uppercase and symbol-heavy lines ("R. I. S. E. Hack with me today!", "Rise™") exceed the upper-case ratio the check allows.

anticheat Captcha (chat gate, auto-armed)

Captcha.java115 lines · Java
1
/*
2
 * This program is free software: you can redistribute it and/or modify
3
 *   it under the terms of the GNU General Public License as published by
4
 *   the Free Software Foundation, either version 3 of the License, or
5
 *   (at your option) any later version.
6
 *
7
 *   This program is distributed in the hope that it will be useful,
8
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
9
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10
 *   GNU General Public License for more details.
11
 *
12
 *   You should have received a copy of the GNU General Public License
13
 *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
14
 */
15
package fr.neatmonster.nocheatplus.checks.chat;
16
17
import java.util.concurrent.ThreadLocalRandom;
18
19
import org.bukkit.entity.Player;
20
21
import fr.neatmonster.nocheatplus.checks.Check;
22
import fr.neatmonster.nocheatplus.checks.CheckType;
23
import fr.neatmonster.nocheatplus.players.DataManager;
24
import fr.neatmonster.nocheatplus.players.IPlayerData;
25
import fr.neatmonster.nocheatplus.utilities.ColorUtil;
26
27
/**
28
 * NOTE: EARLY REFACTORING STATE, MOST METHODS NEED SYNC OVER DATA !
29
 * @author mc_dev
30
 *
31
 */
32
public class Captcha extends Check implements ICaptcha{
33
34
    public Captcha() {
35
        super(CheckType.CHAT_CAPTCHA);
36
    }
37
38
    @Override
39
    public void checkCaptcha(Player player, String message, ChatConfig cc, ChatData data, boolean isMainThread) {
40
        // Correct answer to the captcha?
41
        if (message.equals(data.captchaGenerated)) {
42
            // Yes, clear their data and do not worry anymore about them.
43
            data.reset();
44
            data.captchaStarted = false;
45
            player.sendMessage(ColorUtil.replaceColors(cc.captchaSuccess));
46
        } 
47
        else {
48
            // Increment their tries number counter.
49
            data.captchTries++;
50
            data.captchaVL ++;
51
            // Have they failed too man times?
52
            if (data.captchTries > cc.captchaTries) {
53
                // Find out if we need to kick the player or not.
54
                executeActions(player, data.captchaVL, 1, cc.captchaActions);
55
                // (Resetting captcha tries is done on quit/kick).
56
            }
57
            // Display the question again (if not kicked).
58
            if (player.isOnline()) {
59
                sendCaptcha(player, cc, data);
60
            }
61
        }
62
    }
63
64
    @Override
65
    public void sendNewCaptcha(Player player, ChatConfig cc, ChatData data) {
66
        // Display a captcha to the player.
67
        generateCaptcha(cc, data, true);
68
        sendCaptcha(player, cc, data);
69
        data.captchaStarted = true;
70
    }
71
72
    @Override
73
    public void generateCaptcha(ChatConfig cc, ChatData data, boolean reset) {
74
        if (reset) data.captchTries = 0;
75
        final char[] chars = new char[cc.captchaLength];
76
        for (int i = 0; i < cc.captchaLength; i++) {
77
            chars[i] = cc.captchaCharacters.charAt(ThreadLocalRandom.current().nextInt(cc.captchaCharacters.length()));
78
        }
79
        data.captchaGenerated = new String(chars);
80
    }
81
82
    @Override
83
    public void resetCaptcha(Player player){
84
        final IPlayerData pData = DataManager.getPlayerData(player);
85
        ChatData data = pData.getGenericInstance(ChatData.class);
86
        synchronized (data) {
87
            resetCaptcha(player, pData.getGenericInstance(ChatConfig.class), data, pData);
88
        }
89
    }
90
91
    @Override
92
    public void resetCaptcha(Player player, ChatConfig cc, ChatData data, IPlayerData pData) {
93
        data.captchTries = 0;
94
        if (shouldCheckCaptcha(player, cc, data, pData) || shouldStartCaptcha(player, cc, data, pData)){
95
            generateCaptcha(cc, data, true);
96
        }
97
    }
98
99
    @Override
100
    public void sendCaptcha(Player player, ChatConfig cc, ChatData data) {
101
        player.sendMessage(ColorUtil.replaceColors(cc.captchaQuestion.replace("[captcha]", data.captchaGenerated)));
102
    }
103
104
    @Override
105
    public boolean shouldStartCaptcha(Player player, ChatConfig cc, ChatData data, IPlayerData pData) {
106
        // TODO: Only call if IWorldData.isCheckActive(CHAT_CAPTCHA) has returned true?
107
        return !data.captchaStarted && pData.isCheckActive(CheckType.CHAT_CAPTCHA, player);
108
    }
109
110
    @Override
111
    public boolean shouldCheckCaptcha(Player player, ChatConfig cc, ChatData data, IPlayerData pData) {
112
        // TODO: Only call if IWorldData.isCheckActive(CHAT_CAPTCHA) has returned true?
113
        return data.captchaStarted  && pData.isCheckActive(CheckType.CHAT_CAPTCHA, player);
114
    }
115
}

How it counteracts this module

Once Text or the frequency path crosses its violation threshold, NCP arms the captcha gate and the next message must equal the generated string exactly; every wrong answer increments captchaVL toward the configured actions. The module has no captcha-reply logic at all, so a flagged session becomes a guaranteed-wrong-answer machine at the module's own kill cadence. The auto-arm is the mechanism that turns the module's burst behavior into a self-terminating sequence: the first violation arms the gate, and the module cannot clear it.

anticheat LetterEngine (config-gated word processors)

LetterEngine.java153 lines · Java
1
/*
2
 * This program is free software: you can redistribute it and/or modify
3
 *   it under the terms of the GNU General Public License as published by
4
 *   the Free Software Foundation, either version 3 of the License, or
5
 *   (at your option) any later version.
6
 *
7
 *   This program is distributed in the hope that it will be useful,
8
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
9
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10
 *   GNU General Public License for more details.
11
 *
12
 *   You should have received a copy of the GNU General Public License
13
 *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
14
 */
15
package fr.neatmonster.nocheatplus.checks.chat.analysis.engine;
16
17
import java.util.ArrayList;
18
import java.util.HashMap;
19
import java.util.List;
20
import java.util.Map;
21
22
import org.bukkit.entity.Player;
23
24
import fr.neatmonster.nocheatplus.checks.CheckType;
25
import fr.neatmonster.nocheatplus.checks.chat.ChatConfig;
26
import fr.neatmonster.nocheatplus.checks.chat.ChatData;
27
import fr.neatmonster.nocheatplus.checks.chat.analysis.MessageLetterCount;
28
import fr.neatmonster.nocheatplus.checks.chat.analysis.engine.processors.FlatWords;
29
import fr.neatmonster.nocheatplus.checks.chat.analysis.engine.processors.FlatWords.FlatWordsSettings;
30
import fr.neatmonster.nocheatplus.checks.chat.analysis.engine.processors.SimilarWordsBKL;
31
import fr.neatmonster.nocheatplus.checks.chat.analysis.engine.processors.SimilarWordsBKL.SimilarWordsBKLSettings;
32
import fr.neatmonster.nocheatplus.checks.chat.analysis.engine.processors.WordPrefixes;
33
import fr.neatmonster.nocheatplus.checks.chat.analysis.engine.processors.WordPrefixes.WordPrefixesSettings;
34
import fr.neatmonster.nocheatplus.checks.chat.analysis.engine.processors.WordProcessor;
35
import fr.neatmonster.nocheatplus.components.data.IData;
36
import fr.neatmonster.nocheatplus.components.registry.feature.ConsistencyChecker;
37
import fr.neatmonster.nocheatplus.components.registry.feature.IHaveCheckType;
38
import fr.neatmonster.nocheatplus.components.registry.feature.IRemoveData;
39
import fr.neatmonster.nocheatplus.config.ConfPaths;
40
import fr.neatmonster.nocheatplus.config.ConfigFile;
41
import fr.neatmonster.nocheatplus.logging.StaticLog;
42
43
44
/**
45
 * Process words.
46
 * @author asofold
47
 *
48
 */
49
public class LetterEngine implements IRemoveData, IHaveCheckType, ConsistencyChecker{
50
51
    /** Global processors */
52
    protected final List<WordProcessor> processors = new ArrayList<WordProcessor>();
53
54
    /**
55
     * Mapping players to data.
56
     */
57
    protected final EnginePlayerDataMap dataMap;
58
59
    public LetterEngine(ConfigFile config){
60
        // Add word processors.
61
        // NOTE: These settings should be compared to the per player settings done in the EnginePlayerConfig constructor.
62
        if (config.getBoolean(ConfPaths.CHAT_TEXT_GL_WORDS_CHECK, false)) {
63
            FlatWordsSettings settings = new FlatWordsSettings();
64
            settings.maxSize = 1000;
65
            settings.applyConfig(config, ConfPaths.CHAT_TEXT_GL_WORDS);
66
            processors.add(new FlatWords("glWords",settings));
67
        }
68
        if (config.getBoolean(ConfPaths.CHAT_TEXT_GL_PREFIXES_CHECK , false)) {
69
            WordPrefixesSettings settings = new WordPrefixesSettings();
70
            settings.maxAdd = 2000;
71
            settings.applyConfig(config, ConfPaths.CHAT_TEXT_GL_PREFIXES);
72
            processors.add(new WordPrefixes("glPrefixes", settings));
73
        }
74
        if (config.getBoolean(ConfPaths.CHAT_TEXT_GL_SIMILARITY_CHECK , false)) {
75
            SimilarWordsBKLSettings settings = new SimilarWordsBKLSettings();
76
            settings.maxSize = 1000;
77
            settings.applyConfig(config, ConfPaths.CHAT_TEXT_GL_SIMILARITY);
78
            processors.add(new SimilarWordsBKL("glSimilarity", settings));
79
        }
80
        // TODO: At least expiration duration configurable? (Entries expire after 10 minutes.)
81
        dataMap = new EnginePlayerDataMap(600000L, 100, 0.75f);
82
    }
83
84
    public Map<String, Float> process(final MessageLetterCount letterCount, final String playerName, final ChatConfig cc, final ChatData data) {
85
        final Map<String, Float> result = new HashMap<String, Float>();
86
        // Global processors.
87
        if (cc.textGlobalCheck) {
88
            for (final WordProcessor processor : processors) {
89
                try {
90
                    result.put(processor.getProcessorName(), processor.process(letterCount) * cc.textGlobalWeight);
91
                }
92
                catch( final Exception e) {
93
                    StaticLog.logSevere("chat.text: processor("+processor.getProcessorName()+") generated an exception: " + e.getClass().getSimpleName() + ": " + e.getMessage());
94
                    StaticLog.logSevere(e);
95
                    continue;
96
                }
97
            }
98
        }
99
100
        // Per player processors.
101
        if (cc.textPlayerCheck) {
102
            final EnginePlayerData engineData = dataMap.get(playerName, cc); 
103
            for (final WordProcessor processor : engineData.processors){
104
                try {
105
                    result.put(processor.getProcessorName(), processor.process(letterCount) * cc.textPlayerWeight);
106
                }
107
                catch( final Exception e) {
108
                    StaticLog.logSevere("chat.text: processor("+processor.getProcessorName()+") generated an exception: " + e.getClass().getSimpleName() + ": " + e.getMessage());
109
                    StaticLog.logSevere(e);
110
                    continue;
111
                }
112
            }
113
        }
114
115
        return result;
116
    }
117
118
    public void clear() {
119
        for (WordProcessor processor : processors) {
120
            processor.clear();
121
        }
122
        processors.clear();
123
        dataMap.clear();
124
    }
125
126
    @Override
127
    public IData removeData(final String playerName) {
128
        return dataMap.remove(playerName);
129
    }
130
131
    @Override
132
    public void removeAllData() {
133
        dataMap.clear();
134
    }
135
136
    @Override
137
    public final CheckType getCheckType() {
138
        return CheckType.CHAT_TEXT;
139
    }
140
141
    @Override
142
    public void checkConsistency(final Player[] onlinePlayers) {
143
        // Use consistency checking to release some memory.
144
        final long now = System.currentTimeMillis();
145
        if (now < dataMap.lastExpired) {
146
            dataMap.clear();
147
            return;
148
        }
149
        if (now - dataMap.lastExpired > dataMap.durExpire) {
150
            dataMap.expire(now - dataMap.durExpire);
151
        }
152
    }
153
}

How it counteracts this module

The config-gated word-profile engine: FlatWords and WordPrefixes processors over a BK-Levenshtein similarity tree with range 2, plus per-player processors with a 10-minute expiry, all weighted by global and per-player factors. The Fag pool's slurs and the Normal pool's hostile vocabulary (retard, rape dungeon, and the like) are exactly the flat-word profile this engine exists to score, so a server that enables the text-global or per-player word checks converts the module's pool content into a steady violation source. The caveat is structural: the engine only runs when the corresponding config flags are on, and stock NCP ships them off, so the counter is configuration-dependent rather than automatic.

anticheat ChatEvent (Spartan dispatch shim)

ChatEvent.java19 lines · Java
1
package ai.idealistic.spartan.listeners.bukkit.standalone;
2
3
import ai.idealistic.spartan.abstraction.protocol.PlayerProtocol;
4
import ai.idealistic.spartan.functionality.concurrent.CheckThread;
5
import ai.idealistic.spartan.functionality.server.PluginBase;
6
import org.bukkit.event.EventHandler;
7
import org.bukkit.event.EventPriority;
8
import org.bukkit.event.Listener;
9
import org.bukkit.event.player.AsyncPlayerChatEvent;
10
11
public class ChatEvent implements Listener {
12
13
    @EventHandler(priority = EventPriority.HIGHEST)
14
    private void Event(AsyncPlayerChatEvent e) {
15
        PlayerProtocol p = PluginBase.getProtocol(e.getPlayer());
16
        CheckThread.run(null, () -> p.executeRunners(e.isCancelled(), e));
17
    }
18
19
}

How it counteracts this module

Spartan's only chat hook in the corpus is the HIGHEST-priority AsyncPlayerChatEvent dispatch shim that feeds the check runner; there is no chat-content or spam analysis in the clone. The real exposure the shim points at is the Bukkit event chain itself, where moderation plugins see each insult as a normal player message: on servers with chat filtering the slur pools are blocked or logged at the plugin layer, which is the practical counter to this module even though no anticheat check in the corpus scores its content.

← Back to Analysis Hub