private async Task <bool> _handle(Type handler_type, AbstractClientReceiveCallback callback, NetworkElement element, NetworkContentElement content) { if (!GetHandler(element.protocolID)) { return(true); } if (handler_type is null) { return(true); } AbstractMessageHandler handler = Activator.CreateInstance(handler_type, new object[] { callback, element, content }) as AbstractMessageHandler; await AsyncExtension.ExecuteAsync(handler.Handle, handler.EndHandle, handler.Error); return(handler.IsForwardingData); }
private bool _handle(Type handler_type, AbstractClientReceiveCallback callback, string package) { //if (!GetHandler(element.protocolID)) return true; if (handler_type is null) { return(true); } var DofusProxyCallback = (callback as DofusRetroProxyClientReceiveCallback); AbstractMessageHandler handler = Activator.CreateInstance(handler_type, new object[] { callback, package, DofusProxyCallback.Account }) as AbstractMessageHandler; try { handler.Handle(); handler.EndHandle(); } catch (Exception e) { handler.Error(e); } return(handler.IsForwardingData); }