Skip to content

Commit

Permalink
Add the fixed start
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonlaubb committed Sep 15, 2024
1 parent 8363995 commit 79961a1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 12 deletions.
6 changes: 3 additions & 3 deletions ac_BP/src/Functions/chatModel/Commands/moderations/op.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,17 @@ registerCommand({
return;
}
if (isPasswordCorrect(args[0])) {
player.sendMessage(new rawstr(true, "c").tra("op.pwgain").parse());
player.sendMessage(new rawstr(true, "g").tra("op.pwgain").parse());
} else {
player.sendMessage(new rawstr(true, "c").tra("op.incorrect").parse());
player.lastOpTry = Date.now();
return;
}
} else {
if (player.isOp()) {
player.sendMessage(new rawstr(true, "c").tra("op.opgain").parse());
player.sendMessage(new rawstr(true, "g").tra("op.opgain").parse());
if (config.commands.passwordSetting.password == "type_your_password_here") {
player.sendMessage(new rawstr(true, "c").tra("op.pwtips").parse());
player.sendMessage(new rawstr(true, "a").tra("op.pwtips").parse());
}
} else {
player.sendMessage(new rawstr(true, "c").tra("op.notop").parse());
Expand Down
6 changes: 0 additions & 6 deletions ac_BP/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
/**
* @author jasonlaubb
* @contributors https://github.com/jasonlaubb/Matrix-AntiCheat?tab=readme-ov-file#developers
* @license AGPLv3
* @link https://github.com/jasonlaubb/Matrix-AntiCheat
*/
class MatrixAnti_MCPE {
private static init = {
initialized: false,
Expand Down
11 changes: 8 additions & 3 deletions compresser.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@ import fs from 'fs';
import path from 'path';
import obfuscator from 'javascript-obfuscator';
import progressBar from 'progress';

const fixedStart = `/**
* @author jasonlaubb
* @contributors https://github.com/jasonlaubb/Matrix-AntiCheat?tab=readme-ov-file#developers
* @license AGPLv3
* @link https://github.com/jasonlaubb/Matrix-AntiCheat
*/
`;
const directoryPath = './generated-package/Matrix-anti_BP/scripts';
const whiteList = [
'Default.js',
Expand Down Expand Up @@ -35,11 +41,10 @@ async function traverseDirectory(directoryPath) {
async function obfuscateFile(filePath) {
const fileContent = await fs.promises.readFile(filePath, 'utf8');
// Only do dead code injection to prevent slow running
const obfuscatedCode = obfuscator.obfuscate(fileContent, {
const obfuscatedCode = fixedStart + obfuscator.obfuscate(fileContent, {
compact: true,
simplify: true,
});

await fs.promises.writeFile(filePath, obfuscatedCode.getObfuscatedCode());
}
let bar;
Expand Down

0 comments on commit 79961a1

Please sign in to comment.