mirror of
https://github.com/asphyxia-core/plugins.git
synced 2026-03-21 17:34:46 -05:00
- Fixed another server error when two players are present, but only one player is using a profile. - Added support for the "ranking" field. Gitadora will now correctly display your server ranking (based on Skill) on the post-game screen. - Added logging for profile loading/saving when Asphyxia is running in dev mode. - Added more logging to mdb (song database) loading. - "Recommended to friends" songs are now saved and loaded correctly. Since you don't have any friends, this won't be terribly useful, but it does at least provide an extra five slots for saving your favourite songs. - Fixed "Recommended to friends" song list being incorrectly initialized to "I think about you". - Removed some unneeded duplicate code. - Latest getPlayer() and savePlayers() API requests and responses are now saved to file when Asphyxia is in dev mode. Useful for debugging. NOTE: The above has only been tested on Gitadora Exchain.
77 lines
2.3 KiB
TypeScript
77 lines
2.3 KiB
TypeScript
import { gameInfoGet, shopInfoRegist } from "./handlers/info";
|
|
import { playableMusic } from "./handlers/MusicList"
|
|
import { getPlayer, check, regist, savePlayers } from "./handlers/profiles";
|
|
import { updatePlayerInfo } from "./handlers/webui";
|
|
import { isAsphyxiaDebugMode, isRequiredCoreVersion } from "./utils";
|
|
import Logger from "./utils/logger";
|
|
|
|
const logger = new Logger("main")
|
|
|
|
export function register() {
|
|
if(!isRequiredCoreVersion(1, 20)) {
|
|
console.error("You need newer version of Core. v1.20 or newer required.")
|
|
}
|
|
|
|
R.GameCode('M32');
|
|
|
|
R.Config("encore_version", {
|
|
name: "Encore Version",
|
|
desc: "Set encore version",
|
|
type: "integer",
|
|
default: 13,
|
|
})
|
|
|
|
R.Config("nextage_dummy_encore", {
|
|
name: "Dummy Encore for SPE (Nextage Only)",
|
|
desc: "Since Nextage's Special Premium Encore system is bit complicated, \n"
|
|
+ "SPE System isn't fully implemented. \n"
|
|
+ "This thing is bandage of these problem as limiting some Encores for SPE.",
|
|
type: "boolean",
|
|
default: false
|
|
})
|
|
|
|
R.Config("enable_custom_mdb", {
|
|
name: "Enable Custom MDB",
|
|
desc: "For who uses own MDB. eg) Omnimix.",
|
|
type: "boolean",
|
|
default: false,
|
|
})
|
|
|
|
R.DataFile("data/mdb/custom.xml", {
|
|
accept: ".xml",
|
|
name: "Custom MDB",
|
|
desc: "You need to enable Custom MDB option first."
|
|
})
|
|
|
|
R.WebUIEvent('updatePlayerInfo', updatePlayerInfo);
|
|
|
|
const MultiRoute = (method: string, handler: EPR | boolean) => {
|
|
// Helper for register multiple versions.
|
|
R.Route(`exchain_${method}`, handler);
|
|
R.Route(`matixx_${method}`, handler);
|
|
R.Route(`nextage_${method}`, handler)
|
|
// TODO: TB, TBRE and more older version?
|
|
};
|
|
|
|
// Info
|
|
MultiRoute('shopinfo.regist', shopInfoRegist)
|
|
MultiRoute('gameinfo.get', gameInfoGet)
|
|
|
|
// MusicList
|
|
MultiRoute('playablemusic.get', playableMusic)
|
|
|
|
// Profile
|
|
MultiRoute('cardutil.regist', regist);
|
|
MultiRoute('cardutil.check', check);
|
|
MultiRoute('gametop.get', getPlayer);
|
|
MultiRoute('gameend.regist', savePlayers);
|
|
|
|
// Misc
|
|
R.Route('bemani_gakuen.get_music_info', true)
|
|
|
|
R.Unhandled(async (info, data, send) => {
|
|
if (["eventlog"].includes(info.module)) return;
|
|
logger.error(`Received Unhandled Request on Method "${info.method}" by ${info.model}/${info.module}`)
|
|
logger.debugError(`Received Request: ${JSON.stringify(data, null, 4)}`)
|
|
})
|
|
} |