This commit is contained in:
azw 2023-11-02 00:42:58 +00:00
parent 1b61eecd09
commit 6df64c08ad

View File

@ -74,6 +74,7 @@ use crate::cs::cs_msgid as cs_msgid;
struct Handler {
msg_id: i32,
handler_id: i32,
cb: Box::<dyn FnMut (&f9::MsgHdr, &dyn MsgHandler)>,
}
static mut HANDLERS: Vec<Option<Handler>> = Vec::new();
@ -139,17 +140,15 @@ pub fn registe_handlers() {
Handler {
msg_id: cs_msgid::CMMessageId_e::_${item.name} as i32,
handler_id: 0,
/*
Cb: func (hdr *f5.MsgHdr, handler MsgHandler) {
handler.${item.name}(hdr, hdr.Msg.(*${item.name}))
},
*/
cb: Box::new(|_: &f9::MsgHdr, _: &dyn MsgHandler| {
}),
});
`;
}
});
data += `
}}`;
}
}`;
fs.writeFileSync('./src/cs/cs_auto_gen.rs', data);
}