File tree Expand file tree Collapse file tree 4 files changed +13
-12
lines changed
Expand file tree Collapse file tree 4 files changed +13
-12
lines changed Original file line number Diff line number Diff line change @@ -302,7 +302,6 @@ function createWindow() {
302302 WebAssembly.instantiate = async function(buffer, imports = {}) {
303303 const wasmFunctionNames = ${ JSON . stringify ( funcNames ) } ;
304304 window.ayuHooks.functions = wasmFunctionNames;
305- window.ayuHooks.parsedFunctions = ${ JSON . stringify ( parsedFunctions ) } ;
306305
307306 if (!imports.hooks) imports.hooks = {};
308307
Original file line number Diff line number Diff line change 1- import { dispatcher } from "@/commands/dispatcher.ts" ;
1+ import { commandManager , dispatcher } from "@/commands/dispatcher.ts" ;
22import { literal } from "@jsprismarine/brigadier" ;
33import { addChatMessage } from "@/gameChat/gameChatUtility.ts" ;
44
55dispatcher . register (
6- literal ( 'aaccept ' ) . executes (
6+ literal ( 'ban ' ) . executes (
77 async ( ) => {
88 addChatMessage ( [
99 {
10- text : 'Joining squad 3v7f7v ' ,
10+ text : 'Banned ' ,
1111 r : 163 ,
1212 g : 196 ,
1313 b : 243
1414 }
1515 ] ) ;
16- return '/squad-join 3v7f7v' ;
1716 }
1817 )
19- )
18+ ) ;
19+
20+ commandManager . registerCommand ( 'ban' , 'Ban someone in chat' ) ;
Original file line number Diff line number Diff line change 11import './ahelp.ts' ;
2- import './asquad .ts' ;
2+ import './ban .ts' ;
Original file line number Diff line number Diff line change @@ -67,16 +67,17 @@ if (window.electron) {
6767 }
6868
6969 let firstPtr = 0 ;
70- window . Module . asm . registerHookPre ( 440 ) ;
70+ window . Module . asm . registerHookPre ( 439 ) ;
7171
72- window . ayuHooks . pre_79 = ( arg0 : number , arg1 : number ) => {
72+ window . ayuHooks . pre_78 = ( arg0 : number , arg1 : number ) => {
73+ console . log ( arg0 , arg1 ) ;
7374 if ( ! firstPtr ) {
7475 firstPtr = arg1 ;
7576 }
7677 if ( arg1 == firstPtr ) {
77- for ( const [ , { ptr } ] of commandManager . getAllCommands ( ) ) {
78- window . Module . asm [ 79 ] ?.( arg0 , ptr ) ;
79- }
78+ [ ... commandManager . getAllCommands ( ) . keys ( ) ] . reverse ( ) . forEach ( key => {
79+ window . Module . asm [ 78 ] ?.( arg0 , commandManager . getAllCommands ( ) . get ( key ) ! . ptr ) ;
80+ } ) ;
8081 }
8182 } ;
8283 } ) ( ) ;
You can’t perform that action at this time.
0 commit comments