mirror of
https://github.com/MewoLab/AquaDX.git
synced 2026-02-09 11:07:58 +08:00
[chuni] Add team name customization
This commit is contained in:
@@ -38,7 +38,8 @@ And you can switch to MySQL(MariaDB) database by commenting the Sqlite part.
|
|||||||
#### Game specific setting:
|
#### Game specific setting:
|
||||||
|
|
||||||
##### CHUNITHM:
|
##### CHUNITHM:
|
||||||
Support auto profile downgrade now. You can just run any legacy version, but works better if you set a different keychip serial.
|
- Support auto profile downgrade now. You can just run any legacy version, but works better if you set a different keychip serial.
|
||||||
|
- You can enable team function and customize team name by changing `game.chunithm.team-name` value. Leave this blank to disable team function.
|
||||||
|
|
||||||
### Other Information:
|
### Other Information:
|
||||||
This server provide a simple API for changing some DIVA's setting.
|
This server provide a simple API for changing some DIVA's setting.
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import icu.samnyan.aqua.sega.chunithm.handler.BaseHandler;
|
|||||||
import icu.samnyan.aqua.sega.util.jackson.StringMapper;
|
import icu.samnyan.aqua.sega.util.jackson.StringMapper;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import java.util.LinkedHashMap;
|
import java.util.LinkedHashMap;
|
||||||
@@ -17,9 +18,12 @@ public class GetUserTeamHandler implements BaseHandler {
|
|||||||
|
|
||||||
private final StringMapper mapper;
|
private final StringMapper mapper;
|
||||||
|
|
||||||
|
private final String teamName;
|
||||||
|
|
||||||
public GetUserTeamHandler(StringMapper mapper) {
|
|
||||||
|
public GetUserTeamHandler(StringMapper mapper, @Value("${game.chunithm.team-name:#{null}}") String teamName) {
|
||||||
this.mapper = mapper;
|
this.mapper = mapper;
|
||||||
|
this.teamName = teamName;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -29,18 +33,23 @@ public class GetUserTeamHandler implements BaseHandler {
|
|||||||
|
|
||||||
Map<String, Object> resultMap = new LinkedHashMap<>();
|
Map<String, Object> resultMap = new LinkedHashMap<>();
|
||||||
resultMap.put("userId", userId);
|
resultMap.put("userId", userId);
|
||||||
resultMap.put("teamId", 1);
|
|
||||||
resultMap.put("teamRank", 1);
|
|
||||||
resultMap.put("teamName", "AQUA");
|
|
||||||
|
|
||||||
Map<String, Object> userTeamMap = new LinkedHashMap<>();
|
if (teamName != null && !teamName.isEmpty()) {
|
||||||
userTeamMap.put("userId", userId);
|
resultMap.put("teamId", 1);
|
||||||
userTeamMap.put("teamId", 1);
|
resultMap.put("teamRank", 1);
|
||||||
userTeamMap.put("orderId", 1);
|
resultMap.put("teamName", teamName);
|
||||||
userTeamMap.put("teamPoint", 1);
|
|
||||||
userTeamMap.put("aggrDate", playDate);
|
|
||||||
|
|
||||||
resultMap.put("userTeamPoint", userTeamMap);
|
Map<String, Object> userTeamMap = new LinkedHashMap<>();
|
||||||
|
userTeamMap.put("userId", userId);
|
||||||
|
userTeamMap.put("teamId", 1);
|
||||||
|
userTeamMap.put("orderId", 1);
|
||||||
|
userTeamMap.put("teamPoint", 1);
|
||||||
|
userTeamMap.put("aggrDate", playDate);
|
||||||
|
|
||||||
|
resultMap.put("userTeamPoint", userTeamMap);
|
||||||
|
} else {
|
||||||
|
resultMap.put("teamId", 0);
|
||||||
|
}
|
||||||
|
|
||||||
String json = mapper.write(resultMap);
|
String json = mapper.write(resultMap);
|
||||||
logger.info("Response: " + json);
|
logger.info("Response: " + json);
|
||||||
|
|||||||
@@ -11,6 +11,10 @@ allnet.server.port=80
|
|||||||
## Only change this if you have a reverse proxy running.
|
## Only change this if you have a reverse proxy running.
|
||||||
## The game rely on 80 port for boot up command
|
## The game rely on 80 port for boot up command
|
||||||
server.port=80
|
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
|
## Logging
|
||||||
spring.servlet.multipart.max-file-size=10MB
|
spring.servlet.multipart.max-file-size=10MB
|
||||||
spring.servlet.multipart.max-request-size=20MB
|
spring.servlet.multipart.max-request-size=20MB
|
||||||
|
|||||||
Reference in New Issue
Block a user