This commit is contained in:
azw 2023-11-02 01:21:54 +00:00
parent 06d7487868
commit 9d85f1b22c

View File

@ -159,12 +159,16 @@ pub fn registe_handlers() {
(item) => {
if (item.name[0] == 'C' &&
item.name[1] == 'M') {
const finalyName = this.converLowCaseName(item.name);
data += `
HANDLERS[cs_msgid::CMMessageId_e::_${item.name} as usize] = Some(
Handler {
msg_id: cs_msgid::CMMessageId_e::_${item.name} as i32,
handler_id: 0,
cb: Box::new(|_: &f9::MsgHdr, _: &dyn MsgHandler| {
cb: Box::new(|hdr: &f9::MsgHdr, handler: &dyn MsgHandler| {
if let Some(msg) = hdr.msg.downcast_ref::<Rc::<RefCell::<cs::${item.name}>>>() {
handler.${finalyName}(hdr, msg.clone());
}
}),
});
`;