Skip to content

Commit

Permalink
Add support the jp name in anti Namespoof
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonlaubb committed Sep 18, 2024
1 parent 0c6a645 commit 3f7b60c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ac_BP/src/Modules/Player/NameSpoof.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ async function AntiNameSpoof(config: configi, player: Player, playerName: string
}

//get the non-ASCII characters in player name
const nonASCII = playerName?.match(/[^\x00-\x7F]/g);
const nonASCII = playerName?.match(/[^\x00-\x7F]/gu);

//if the player name contains non-ASCII characters, check if the non-ASCII characters are illegal
if (nonASCII && nonASCII.length > 0) {
Expand All @@ -35,7 +35,7 @@ async function AntiNameSpoof(config: configi, player: Player, playerName: string
const regax = nonASCII[i];

//if the word isn't a valid character for player name
if (!/[\u4E00-\u9FFF\uAC00-\uD7AF\u3040-\u30FF]|[^\d_]|[().&*]/.test(regax)) {
if (!(/[\u4E00-\u9FFF\uAC00-\uD7AF\u3040-\u30FF]|[^\d_]|[().&*]/).test(regax) && !(/[一-龠]|[ぁ-ゔ]|[ァ-ヴー]|[々〆〤ヶ]/u).test(regax)) {
illegalName = true;
break;
}
Expand Down

0 comments on commit 3f7b60c

Please sign in to comment.