This commit is contained in:
azw 2023-11-02 01:00:15 +00:00
parent ef6df292e5
commit b6841bc20f

View File

@ -89,16 +89,26 @@ pub fn get_net_msg_handler(msg_id: u16) -> &'static Option<Handler> {
}
}
pub fn reg_handler_id(msg_id: u16, handler_id: i32){
unsafe {
if (msg_id as usize) < HANDLERS.len() {
match &mut HANDLERS[msg_id as usize] {
Some(v) => {
v.handler_id = handler_id;
}
None => {
}
}
}
}
}
/*
func DispatchMsg(handler *CsNetMsgHandler, hdr *f5.MsgHdr, msgHandler MsgHandler) {
handler.Cb(hdr, msgHandler)
}
func RegHandlerId(msgId int, handlerId int) {
handler := handlers[msgId]
handler.HandlerId = handlerId
}
func ParsePb(msgId uint16, data []byte) interface{} {
handler := handlers[msgId]
if handler == nil {