OsuMapSuggester

A mirai-console plugin that can provide osu!std players some appropriate beatmap. (WIP)

CI CodeFactor

Features

It can analyze player’s aim, speed and accuracy skills of his best performances and PerformancePlus and other factors to infer what type of the player he is.

Then it can recommend specific beatmaps for his shortcomings or other kind of beatmaps.

But currently none of the feature above is implemented, because it is still working in progress. XD

There are also other features:

  • Analyze player’s skills(main function).
  • Recommend specific beatmaps(main function).
  • Show your best performance picture.
  • Best performance versus.
  • Recalculate best performance if all full combo.

How plugin process OAuth request and bind account

When users click OAuth link and confirm authorization. It will redirect to your callback URL with query parameters state and code.

The OsuMapSuggester plugin will open a frontend http server to process the parameters.

Pictures generated by plugin

Help page
Command: .help 1-100
Show best performance
Command: .bpa 1-100
Recalculate best performance if all fc
Command: .bpa fc 1-100
Best performance versus
me and OsmiumD
Command: .bpvs @Target 1-100

Deploy

It is easy to deploy this bot.

Preparation:

Run:

  1. Clone this project and open with IntelliJ IDEA. Sync gradle project and run mirai/buildPlugin task to build the plugin binary file.

You can also build via command line by runing ./gradle buildPlugin command if your IntelliJ IDEA is not installed.

  1. Copy the output in build/mirai/OsuMapSuggester-xxx.mirai.jar to <console runtime>/plugins/ folder, and start mirai console once, you may get this error log:

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 'root'@'localhost' (using password: YES).
2021-07-26 20:22:37 E/OsuMapSuggester: Retry to connect database in 10 seconds.
  1. Close mirai console, edit config/OsuMapSuggester/OsuMapSuggester.Config.yml

qq: 1234567890 # Enable the plugin for this bot
database: 
  address: localhost # Your database address
  port: 3306 # Database port
  user: root # Database user
  password: testpwd # Database password
  table: osu!beatmap suggester # Database name
  maximumPoolSize: 10
osuAuth: 
  clientId: 0 # The OAuth application client id you just created.
  secret: '' # OAuth application client secret
  authCallbackBaseUrl: 'http://localhost:8081' # callback base url, it is for generating OAuth link when users bind qq account, must be same with OAuth application callback base url(no "/authCallback").
frontend: # frontend is used to process oauth application callback
  host: localhost # frontend host
  port: 8081 # frontend port
  1. Save config, rerun mirai console. If you see this log, it means everything works ok.

2021-07-26 20:34:27 I/OsuMapSuggester: Subscribed group and friend messages.

Issues

This project is still working in progress, it is unstable and there are still many bugs.

If you suffer from fatal bug when running bot, please open a issue with bug to feedback.

Also, if you have any good idea, welcome to contribute to this project or open a issue with feature label.

Library

  • mirai – High-performance bot framework for Tencent QQ.
  • mirai-console – headless frontend for mirai.
  • Exposed – A Kotlin SQL Framework.
  • HikariCP – 光 HikariCP ・ A solid, high-performance, JDBC connection pool at last.
  • peace-performance – osu! pp & stars calculation algorithm.
  • ktor – Framework for quickly creating connected applications in Kotlin with minimal effort
  • skija – Skia bindings for Java

LICENSE of this project and mirai

<div class="snippet-clipboard-content position-relative" data-snippet-clipboard-copy-content="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 .
“>

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/>.