public FFWorker BindHandler <T>(Pbmsg.ClientCmdDef cmd, PbHandler <T> method) where T : pb::IMessage, new() { m_dictCmd2Func[(int)cmd] = (Player player, byte[] data) => { T reqMsg = Util.Byte2Pb <T>(data); method(player, reqMsg); }; return(this); }
public FFWorker BindHandler <T>(Pbmsg.ClientCmdDef cmd, PbHandler <T> method) where T : pb::IMessage, new() { CmdHandler ch = (Player player, string data) => { T reqMsg = Util.String2Pb <T>(data); method(player, reqMsg); }; m_dictCmd2Func[(int)cmd] = ch; return(this); }