@@ -16,6 +16,7 @@ import { i18n, noI18n } from 'lib/i18n/text'
1616import { onPlayerMove } from 'lib/player-move'
1717import { is } from 'lib/roles'
1818import { isNotPlaying } from 'lib/utils/game'
19+ import { createLogger } from 'lib/utils/logger'
1920import { AbstractPoint } from 'lib/utils/point'
2021import { Vec } from 'lib/vector'
2122import { EventSignal } from '../event-signal'
@@ -113,13 +114,19 @@ actionGuard((player, region, context) => {
113114 }
114115} , ActionGuardOrder . ProjectileUsePrevent )
115116
117+ const permdebugLogger = createLogger ( 'region-perm' )
118+
116119const allowed : InteractionAllowed = ( player , region , context , regions ) => {
117120 //
118121 for ( const [ fn ] of EventSignal . sortSubscribers ( ACTION_GUARD ) ) {
119122 const result = fn ( player , region , context , regions )
120123 if ( Region . permissionDebug ) {
121- if ( is ( player . id , 'techAdmin' ) ) console . log ( 'regionDebug' , fn . toString ( ) . slice ( 0 , 50 ) , ' ' , result )
122- player . info ( noI18n `regionDebug ${ fn . toString ( ) . slice ( 0 , 50 ) . replaceAll ( '\n' , ' ' ) } ${ result } ` )
124+ if ( is ( player . id , 'techAdmin' ) ) {
125+ let msg = noI18n `§5${ fn . toString ( ) . slice ( 0 , 100 ) . replaceAll ( '\n' , ' ' ) } -> ${ typeof result === 'undefined' ? '§bSKIP' : result } `
126+ if ( typeof result === 'boolean' ) msg += noI18n `\n§fResult: ${ result } `
127+ permdebugLogger . info ( msg )
128+ player . tell ( msg )
129+ }
123130 }
124131 if ( typeof result === 'boolean' ) {
125132 return result
0 commit comments