Comments (3)
已实现动态加载dll, 重载很麻烦
from miraicp.
麻烦的地方主要在卸载,目前的卸载只是从通知列表移除插件,但仍然会占用原有的dll
目前大概发现了几个办法
- 使用自定义classLoader反射加载,然后使用完后gc https://web.archive.org/web/20140704120535/http://www.codethesis.com/blog/unload-java-jni-dll
- 和mirai-native一样在native部分加载和管理插件
from miraicp.
目前打算选取一种独特的方式,因为上面的方法
- System.gc()并不可靠,只是推荐system进行gc但不能确保
- mirai-native那种方法要增加额外的CPP组件
大概在运行的时候先创建/清空一个独特的缓存文件夹,然后把要运行的插件复制进去然后改名运行
如果需要重载的话,就再复制一次然后改名载入,虽然原本的插件无法解除占用,但是可以支持重载了,并且在下一次启动的时候清空就好了
from miraicp.
Related Issues (20)
- [Bug]MiraiCP-loader无法登录
- 群临时会话发信时出错
- Serializer for class 'Command' is not found. HOT 1
- 群头衔 HOT 2
- LibLoader 严重报错 HOT 1
- 将GroupMessageEvent中的PlainText对象传递给MessageChain::add后,在发送消息时报错 HOT 2
- BotLeaveEvent事件类型枚举定义错位
- 重构CPP到下一个大版本3.*, 同时这个2.*版本也会继续维护(修复一些提交的问题), 但是不会更新其他功能(会尽量不写太多API change, 但是为了优化使用, API change是必要的), 大概包含以下几点
- miraicode解析对at出错 HOT 2
- 重载插件后,先前的计时器会被保留 HOT 3
- 获取所有在线的bot
- MemberLeaveEvent 构造函数异常 HOT 2
- version `GLIBC_2.33' not found HOT 2
- 想问应该如何恰当实现定时任务 HOT 2
- 通过MessageSource获取发送人、消息内容等信息 HOT 1
- schedule 占用 cpu 过多 HOT 2
- 无法获取文件列表 HOT 1
- Compiler Warning (level 1) C4251
- BotOnline事件不触发 HOT 4
- 点歌点不了 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from miraicp.