@@ -6,21 +6,17 @@ import { Logger } from '../utils/Logger';
66import { PLUGIN_PATH , APIFindOne , APIFind } from '../utils/EamuseIO' ;
77import path from 'path' ;
88import { readdirSync , readFileSync } from 'fs' ;
9- import {
10- FindCard ,
11- CreateProfile ,
12- CreateCard ,
13- BindProfile ,
14- GetProfileCount ,
15- } from '../utils/EamuseIO' ;
9+ import { FindCard , CreateProfile , CreateCard , BindProfile } from '../utils/EamuseIO' ;
1610
1711import { compile } from 'pug' ;
1812import { CONFIG } from '../utils/ArgConfig' ;
1913import { nfc2card } from '../utils/CardCipher' ;
2014
2115async function cardSanitizer ( gameCode : string , str : string , refMap : any ) : Promise < string > {
22- const regex = / ( ^ | [ ^ A - Z a - z 0 - 9 ] ) ( (?: 0 1 [ A - F a - f 0 - 9 ] { 14 } ) | (?: E 0 0 4 [ A - F a - f 0 - 9 ] { 12 } ) ) ( $ | [ ^ A - Z a - z 0 - 9 = \- _ , + \/ ] ) / g;
23- const regexI = / ( ^ | [ ^ A - Z a - z 0 - 9 ] ) ( (?: 0 1 [ A - F a - f 0 - 9 ] { 14 } ) | (?: E 0 0 4 [ A - F a - f 0 - 9 ] { 12 } ) ) ( $ | [ ^ A - Z a - z 0 - 9 = \- _ , + \/ ] ) / ;
16+ const regex =
17+ / ( ^ | [ ^ A - Z a - z 0 - 9 ] ) ( (?: 0 1 [ A - F a - f 0 - 9 ] { 14 } ) | (?: E 0 0 4 [ A - F a - f 0 - 9 ] { 12 } ) ) ( $ | [ ^ A - Z a - z 0 - 9 = \- _ , + \/ ] ) / g;
18+ const regexI =
19+ / ( ^ | [ ^ A - Z a - z 0 - 9 ] ) ( (?: 0 1 [ A - F a - f 0 - 9 ] { 14 } ) | (?: E 0 0 4 [ A - F a - f 0 - 9 ] { 12 } ) ) ( $ | [ ^ A - Z a - z 0 - 9 = \- _ , + \/ ] ) / ;
2420 if ( typeof str !== 'string' ) {
2521 return str ;
2622 }
@@ -37,8 +33,6 @@ async function cardSanitizer(gameCode: string, str: string, refMap: any): Promis
3733 const did = nfc2card ( cid ) ;
3834 const card = await FindCard ( cid ) ;
3935 if ( ! card ) {
40- const profileCount = await GetProfileCount ( ) ;
41- if ( profileCount < 0 || profileCount >= 16 ) return null ;
4236 const newProfile = await CreateProfile ( 'unset' , gameCode ) ;
4337 if ( ! newProfile ) return null ;
4438 const newCard = await CreateCard ( cid , newProfile . __refid ) ;
0 commit comments