[maimai2] Fix incompatibility with old versions

pull/1/head
Dom Eori 2022-04-10 22:19:51 +09:00
parent 75e38f48b4
commit 37b550aa16
4 changed files with 24 additions and 30 deletions

View File

@ -39,6 +39,11 @@ game.chusan.team-name=
## For example, if DataConfig.xml says "<major>1</major>, <minor>35</minor>, <release>1</release>" then this need to be 1.35.01
game.ongeki.version=1.05.00
## Maimai DX
## Set this true if you are using old version of Splash network patch and have no other choice.
## This is a dirty workaround. If enabled, you probably won't able to play other versions.
game.maimai2.splash-old-patch=false
## Logging
spring.servlet.multipart.max-file-size=10MB
spring.servlet.multipart.max-request-size=20MB

View File

@ -34,11 +34,14 @@ public class AllNetController {
private final ObjectMapper mapper = new ObjectMapper();
private final String HOST_OVERRIDE;
private final String PORT_OVERRIDE;
private final boolean MAIMAI2_NO_HTTP;
public AllNetController(@Value("${allnet.server.host:}") String HOST,
@Value("${allnet.server.port:}") String PORT) {
@Value("${allnet.server.port:}") String PORT,
@Value("${game.maimai2.splash-old-patch:false}") boolean MAIMAI2_NO_HTTP) {
this.HOST_OVERRIDE = HOST;
this.PORT_OVERRIDE = PORT;
this.MAIMAI2_NO_HTTP = MAIMAI2_NO_HTTP;
}
@GetMapping("/")
@ -142,7 +145,12 @@ public class AllNetController {
case "SDEY":
return "http://" + addr + ":" + port + "/MaimaiServlet/";
case "SDEZ":
return "http://" + addr + ":" + port + "/Maimai2Servlet/";
// Workaround for old splash patch
if (MAIMAI2_NO_HTTP) {
return addr + ":" + port + "/Maimai2Servlet/";
} else {
return "http://" + addr + ":" + port + "/Maimai2Servlet/";
}
case "SDHD":
return "http://" + addr + ":" + port + "/ChusanServlet/";
default:

View File

@ -14,7 +14,7 @@ import java.util.Map;
* @author samnyan (privateamusement@protonmail.com)
*/
@RestController
@RequestMapping({"/Maimai2Servlet", "/Maimai2Servlet/Maimai2Servlet"}) // Workaround for endpoint mismatch, let's just accept both
@RequestMapping({"/Maimai2Servlet/Maimai2Servlet", "/Maimai2Servlet"}) // Workaround for endpoint mismatch, let's just accept both
public class Maimai2ServletController {
private final GetGameSettingHandler getGameSettingHandler;

View File

@ -1,41 +1,22 @@
## AimeDb server setting
# This configuration file is for define default values
# User should use application.properties in the /config folder instead, not this
aimedb.server.enable=true
aimedb.server.address=0.0.0.0
aimedb.server.port=22345
## Billing server setting
billing.server.enable=true
billing.server.port=8443
## Server host & port return to client when boot up.
## By default the same address and port from the client connection is returned.
## Please notice DIVA won't work with localhost or 127.0.0.1
#allnet.server.host=localhost
#allnet.server.port=80
## Http Server Port
## Only change this if you have a reverse proxy running.
## The game rely on 80 port for boot up command
server.port=80
########## Game specific setting ##########
## Chunithm
## This enables team function if you set team name here. Leave this blank to disable it.
game.chunithm.team-name=
## Logging
spring.servlet.multipart.max-file-size=10MB
spring.servlet.multipart.max-request-size=20MB
## Database Setting
spring.flyway.baseline-on-migrate=true
spring.flyway.locations=classpath:db/migration/{vendor}
########## For Sqlite ##########
spring.datasource.driver-class-name=org.sqlite.JDBC
spring.datasource.url=jdbc:sqlite:data/db.sqlite
spring.datasource.hikari.maximum-pool-size=1
#auto schema update will case sqlite error
spring.jpa.hibernate.ddl-auto=none
spring.jpa.properties.hibernate.dialect=org.sqlite.hibernate.dialect.SQLiteDialect
########## For Mysql ##########
#spring.datasource.driver-class-name=org.mariadb.jdbc.Driver
#spring.datasource.username=
#spring.datasource.password=
#spring.datasource.url=jdbc:mariadb://localhost:3306/?useSSL=false
#spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MariaDB10Dialect
## You can add any Spring Boot properties below
spring.jpa.properties.hibernate.dialect=org.sqlite.hibernate.dialect.SQLiteDialect