xmdhs / gomclauncher

A Minecraft Launcher
https://gml.xmdhs.com
MIT License
81 stars 11 forks source link

提供 programmatic API #10

Closed g-plane closed 2 years ago

g-plane commented 2 years ago

有没有计划提供经过一定程度封装的「可用于编程调用」的 API?

虽然目前有 c-shared 库用于 FFI,但如果下游用户就是用 Go 来写,就没必要走 FFI 吧?

xmdhs commented 2 years ago

有的,https://pkg.go.dev/github.com/xmdhs/gomclauncher

不过目前注释是一个都没有写,而且其中的 gomclauncher/flag 应该放到 gomclauncher/internal/flag 但是现在也不好改了。

示例的话,可以看下 https://github.com/xmdhs/gml-c-shared 或者 https://github.com/xmdhs/gomclauncher/tree/master/flag 内的源码 ,不过也没有写注释就是了。

封装程度的话,游戏文件下载那比较复杂,其他的登录和启动我觉得还是比较简单的。