MiraiForum

    • 注册
    • 登录
    • 搜索
    • 热门
    • 最新
    • 未解决
    • 标签
    • 群组
    • 友情链接

    OsuMapSuggester - 一个可以为 osu!standard 玩家推图的 mirai-console 插件

    插件发布
    8
    19
    3225
    正在加载更多帖子
    • 从旧到新
    • 从新到旧
    • 最多赞同
    回复
    • 在新帖中回复
    登录后回复
    此主题已被删除。只有拥有主题管理权限的用户可以查看。
    • StageGuard
      StageGuard 最后由 Hoshino Tented 编辑

      OsuMapSuggester

      一个可以为 osu!standard 玩家推图的 mirai-console 插件。

      CI CodeFactor

      查看开发进度:#1

      特性

      插件可以从 osu!standard 玩家的 Best Performance 分析 aim, speed and accuracy 能力和 PerformancePlus 以及其他因素来推断玩家的类型(跳跳人或串串人之类的)。

      然后插件可以针对这个玩家的弱点或强项给这个玩家推荐特定类型的谱面。(未实现)

      用户也可以通过以下方式来自定义谱面类型规则。

      除此之外,还有其他以下特性:

      • 查询玩家的
        Best Performance 并以图片显示。
      • 和其他玩家对比
        Best Performance。
      • 以 Full Combo 重新计算
        Best Performance 和排名。
      • 显示玩家技能雷达图。
      • 查询玩家最近一次成绩,包括类似 osu!lazer 的 Accuracy Heatmap 和 PP 曲线图等属性,并以图片显示。
      • ...

      开始

      使用

      如果你已经加了拥有此功能的 BOT 所在的群,想查看使用方法,请前往 Wiki 界面。

      部署

      准备工作

      • MySQL 或 MariaDB 数据库, 并需要为插件创建一个数据库。

      • 有公网 IP 的服务器。

      • mirai-console 运行环境

      • osu! OAuth 应用

      • osu! v1 api 密钥

      运行

      1. 克隆并用 IntelliJ IDEA 打开工程. 同步 gradle 项目后运行 mirai/buildPlugin gradle 任务来构建项目。

      如果你不想用 IntelliJ IDEA,也可以克隆后在命令行运行 chmod +x gradlew && ./gradlew buildPlugin 指令来构建. 构建完成后的 jar 输出在 build/mirai.

      1. 把构建好的 jar 包放入 <mirai-console目录>/plugins/ 中,启动 mirai console,不出意外的话你会看到以下输出:
      2021-07-26 20:22:37 E/OsuMapSuggester: Failed to connect database: com.zaxxer.hikari.pool.HikariPool$PoolInitializationException: Failed to initialize pool: Access denied for user 'user'@'host' (using password: YES/NO).
      2021-07-26 20:22:37 E/OsuMapSuggester: Retry to connect database in 10 seconds.
      
      1. 停止 mirai console, 编辑配置文件 config/OsuMapSuggester/OsuMapSuggester.Config.yml
      qq: 1234567890 # 为这个 BOT 启用插件
      database: 
        address: localhost # 数据库地址
        port: 3306 # 端口
        user: root # 账号
        password: testpwd # 密码
        table: osu!beatmap suggester # 数据库名称(在准备工作第一步创建的数据库)
        maximumPoolSize: 10
      osuAuth: 
        clientId: 0 # OAuth clientId
        secret: '' # OAuth client secret
        # 回调地址,必须和 OAuth 设置的相同(不包含 /authCallback)
        # 注意这个地址是为了生成绑定账号的 OAuth 链接。
        authCallbackBaseUrl: 'http://localhost:8081' 
        v1ApiKey: '' # vi api 密钥
      frontend:
        host: localhost # 前端主机地址,注意这个地址是实际主机地址
        port: 8081 # 前端端口
      
      1. 保存,重新运行 mirai console,登录设定的账号后,看到以下输出则意味着工作正常:
      2021-07-26 20:34:27 I/OsuMapSuggester: Subscribed group and friend messages.
      

      问题反馈

      这个项目仍在活跃开发中,并不稳定并且有许多 BUG。

      如果你在使用过程中遇到了致命 BUG,请新建一个 Issue 并加上 bug 标签。

      同时欢迎 pr;或者如果有好的想法,也可以新建一个 Issue 加上feature 标签。

      效果

      • 最近成绩
        Recent Play

      • 与其他玩家最好成绩对比
        Best Performance VS

      • 自定义谱面规则
        Ruleset List

      • 触发推图
        Suggest

      • 在插件开启的前端创建 / 编辑自己的谱面集规则
        Edit Ruleset

      许可证

      OsuMapSuggester
      Copyright (C) 2021 StageGuard
      
      This program is free software: you can redistribute it and/or modify
      it under the terms of the GNU Affero General Public License as published
      by the Free Software Foundation, either version 3 of the License, or
      (at your option) any later version.
      
      This program is distributed in the hope that it will be useful,
      but WITHOUT ANY WARRANTY; without even the implied warranty of
      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      GNU Affero General Public License for more details.
      
      You should have received a copy of the GNU Affero General Public License
      along with this program.  If not, see <https://www.gnu.org/licenses/>.
      
      mirai
      Copyright (C) 2019-2021 Mamoe Technologies and contributors.
      
      This program is free software: you can redistribute it and/or modify
      it under the terms of the GNU Affero General Public License as
      published by the Free Software Foundation, either version 3 of the
      License, or (at your option) any later version.
      
      This program is distributed in the hope that it will be useful,
      but WITHOUT ANY WARRANTY; without even the implied warranty of
      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      GNU Affero General Public License for more details.
      
      You should have received a copy of the GNU Affero General Public License
      along with this program.  If not, see <http://www.gnu.org/licenses/>.
      
      1 条回复 最后回复 回复 引用 1
      • FuYon
        FuYon 摸鱼 最后由 编辑

        此回复已被删除!
        1 条回复 最后回复 回复 引用 0
        • Hoshino Tented
          Hoshino Tented ⭐2021⭐ 最后由 编辑

          牛逼

          1 条回复 最后回复 回复 引用 0
          • JOYACEpoor
            JOYACEpoor 最后由 编辑

            我去,是保安

            1 条回复 最后回复 回复 引用 0
            • FuYon
              FuYon 摸鱼 最后由 FuYon 编辑

              Hello!我在准备使用时遇到了一个对我而言很棘手的问题。作为萌新,抱歉占用大大这几分钟的时间,希望能帮忙指正哪里出错了,十分感谢!

              为了方便阅读我把我的相关配置合并成了一张图片:
              展示了4样要素:
              【密钥设置】
              【插件配置文件】
              【我幼稚的认为需要:创建服务器防火墙规则】
              【访问.bind授权网页失败】)
              我创建了密钥,并根据我对README幼稚的理解对其做出了如下配置,在.bind时访问网页出错(数据库应该没有任何问题,所以我肯定是在网络配置上出错了):

              6bf4efce-0d70-4f75-a85c-f2f0594a87e6-33FC9BA2676C2CC76AF75C281AF73AE7.jpg

              StageGuard 1 条回复 最后回复 回复 引用 0
              • StageGuard
                StageGuard @FuYon 最后由 StageGuard 编辑

                @fuyon 你这个应该是浏览器的问题吧。。把链接解析成了 www.localhost.com
                而且你在服务器上运行插件,不应该把callback url设置为服务器的域名或ip吗

                FuYon 1 条回复 最后回复 回复 引用 0
                • FuYon
                  FuYon 摸鱼 @StageGuard 最后由 FuYon 编辑

                  @stageguard
                  我把两个api地址都改成 http://81.68.74.247:59988/authCallback 了,然后机器人发送过来的是
                  http://81.68.74.247:59988/authorize?state=5M%2F3mho3pIVFyXLroIlksRP7wcWkVDegVvIIa6YpVEFOVV%2Fo9AB8ACHEt01yzqi6j%2BwYr85dcWs%2BtItMR2nLaw%3D%3D
                  b37fd771-c0b6-4297-a303-94681f85b2d8-image.png
                  还是会出错,不太知道问题出在哪里,前端地址?还是服务器地址(内网地址?添加防火墙规则?)?
                  5746da80-7f3f-4754-93f2-00e262aa86ca-image.png

                  以上,thank you and kind regards

                  StageGuard 1 条回复 最后回复 回复 引用 0
                  • StageGuard
                    StageGuard @FuYon 最后由 编辑

                    @fuyon 报错信息呢

                    FuYon 1 条回复 最后回复 回复 引用 0
                    • FuYon
                      FuYon 摸鱼 @StageGuard 最后由 编辑

                      @stageguard mirai console并没有报错信息,和上次相似,打开网页后看到的是

                      net::ERR_NAME_NOT _REFUSED

                      FuYon 1 条回复 最后回复 回复 引用 0
                      • FuYon
                        FuYon 摸鱼 @FuYon 最后由 FuYon 编辑

                        @fuyon 稍等,我再去测试一下

                        请问这样配置是有误的吗?
                        7d849566-6b19-4563-a514-9437fc944e9d-image.png

                        d3ddc8d4-e232-4de1-a717-d8343b1456f8-image.png

                        3c446666-80d2-4fd2-a0b3-90fabd2a5e41-image.png

                        StageGuard 1 条回复 最后回复 回复 引用 0
                        • StageGuard
                          StageGuard @FuYon 最后由 StageGuard 编辑

                          @fuyon 检查一下端口是否开放,可以访问http://ip:port/ruleset/edit/new 看看

                          1 条回复 最后回复 回复 引用 0
                          • X
                            xiaole233 最后由 编辑

                            此回复已被删除!
                            1 条回复 最后回复 回复 引用 0
                            • yuudachi
                              yuudachi 最后由 编辑

                              大佬求助,运行后报错:
                              2022-03-31 22:15:34 I/OsuMapSuggester: Responding at http://1.12.xxx.xxx:8081
                              2022-03-31 22:15:34 E/OsuMapSuggester: Http server occurred an error
                              java.net.BindException: Cannot assign requested address: bind
                              at java.base/sun.nio.ch.Net.bind0(Native Method)
                              at java.base/sun.nio.ch.Net.bind(Unknown Source)
                              at java.base/sun.nio.ch.Net.bind(Unknown Source)
                              at java.base/sun.nio.ch.ServerSocketChannelImpl.bind(Unknown Source)
                              at io.netty.channel.socket.nio.NioServerSocketChannel.doBind(NioServerSocketChannel.java:134)
                              at io.netty.channel.AbstractChannel$AbstractUnsafe.bind(AbstractChannel.java:562)
                              at io.netty.channel.DefaultChannelPipeline$HeadContext.bind(DefaultChannelPipeline.java:1334)
                              at io.netty.channel.AbstractChannelHandlerContext.invokeBind(AbstractChannelHandlerContext.java:506)
                              at io.netty.channel.AbstractChannelHandlerContext.bind(AbstractChannelHandlerContext.java:491)
                              at io.netty.channel.DefaultChannelPipeline.bind(DefaultChannelPipeline.java:973)
                              at io.netty.channel.AbstractChannel.bind(AbstractChannel.java:260)
                              at io.netty.bootstrap.AbstractBootstrap$2.run(AbstractBootstrap.java:356)
                              at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:164)
                              at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:472)
                              at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:500)
                              at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)
                              at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
                              at io.ktor.server.netty.EventLoopGroupProxy$Companion$create$factory$1$1.run(NettyApplicationEngine.kt:241)
                              at io.netty.util.concurrent.FastThreadLocalRunnab
                              端口已经放开了

                              StageGuard 1 条回复 最后回复 回复 引用 0
                              • StageGuard
                                StageGuard @yuudachi 最后由 编辑

                                @yuudachi 我觉得是你 server ip 配置有问题,是0.0.0.0吗

                                yuudachi 1 条回复 最后回复 回复 引用 0
                                • yuudachi
                                  yuudachi @StageGuard 最后由 编辑

                                  @StageGuard 啊,感谢大佬,是我配置的问题,改成0.0.0.0就没问题了

                                  1 条回复 最后回复 回复 引用 0
                                  • 子君9297
                                    子君9297 最后由 编辑

                                    image.png卡在构建了,请问这是哪里出了问题

                                    T StageGuard 2 条回复 最后回复 回复 引用 0
                                    • Hoshino Tented
                                      Hoshino Tented ⭐2021⭐ 最后由 编辑

                                      牛逼

                                      1 条回复 最后回复 回复 引用 0
                                      • T
                                        TNTobsidian @子君9297 最后由 TNTobsidian 编辑

                                        @子君9297 同样的报错,使用Google Cloud Shell也无法构建QAQ

                                        1 条回复 最后回复 回复 引用 0
                                        • StageGuard
                                          StageGuard @子君9297 最后由 编辑

                                          @子君9297 @TNTobsidian 抱歉很长时间没登录论坛,8月某次更新更改了 pp 算法实现,需要预先安装 rust 工具链构建 pp 算法库

                                          1 条回复 最后回复 回复 引用 0
                                          • 1 / 1
                                          • First post
                                            Last post
                                          Powered by Mamoe Technologies & NodeBB | 友情链接 | 服务监控 | Contact