A mirai-console plugin that can provide osu!std players some appropriate beatmap. (WIP)
Develop roadmap:#1
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 beatmap for his shortcomings or other kind of beatmap.(not implemented)
Users can also define custom ruleset of beatmap type via these properties using JavaScript expression.
There are other features:
- Analyze player's skills(main function).
- Recommend specific beatmap(main function).
- Show your best performance picture.
- Best performance versus.
- Recalculate the best performance if all full combo.
- Show your skill attributes.
- query your recent score
- ...
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.
It is easy to deploy this bot.
-
A MySQL or MariaDB database, create a database for this plugin.
-
A server with public IP.
-
Mirai console runtime environment.
Learn how to setup mirai console: https://github.com/mamoe/mirai/blob/dev/docs/UserManual.md -
osu! OAuth Application
1. Go to https://osu.ppy.sh/home/account/edit
2. Click New OAuth Application
3. Set Application Callback URL to http://<your server ip or domain name>:port/authCallback
4. Copy Client Id and Client Secret.
-
osu! v1 api key
Request a new v1 api key: https://osu.ppy.sh/p/api/
- Clone this project with submodule (
git clone --recurse-submodules
) and open with IntelliJ IDEA. Sync gradle project and runmirai/buildPlugin
task to build the plugin binary file.
You can also build via command line by running
chmod +x gradlew && ./gradlew buildPlugin
command if your IntelliJ IDEA is not installed. The output binary file is inbuild/mirai
.
- 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.
- 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").
v1ApiKey: '' # your v1 api key
frontend: # frontend is used to process oauth application callback
host: localhost # frontend host
port: 8081 # frontend port
- 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.
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 an issue with bug
to feedback.
Also, if you have any good idea, welcome to contribute to this project or open an issue with feature
label.
- Mirai Framework: mirai, mirai-console, mirai-slf4j-bridge
- Database: Ktorm, HikariCP
- Web Server: ktor
- Graphics: skija
- osu! Related: peace-performance, pp+ algorithm, osuReplayAnalyzer
- Utilities: apache utilities(commons-io, commons-math3, commons-compress), xz
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/>.