Skip to content

Latest commit

 

History

History
155 lines (111 loc) · 7.17 KB

README-en.md

File metadata and controls

155 lines (111 loc) · 7.17 KB

OsuMapSuggester

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

CI CodeFactor

Develop roadmap:#1

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

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.

Deploy

It is easy to deploy this bot.

Preparation:

Run:

  1. Clone this project with submodule (git clone --recurse-submodules) 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 running chmod +x gradlew && ./gradlew buildPlugin command if your IntelliJ IDEA is not installed. The output binary file is in build/mirai.

  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").
  v1ApiKey: '' # your v1 api key
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 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.

Library

LICENSE of this project and mirai

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