diff --git a/README.md b/README.md index aff1642b..c20b7765 100644 --- a/README.md +++ b/README.md @@ -32,15 +32,15 @@ Multipurpose game server for ALL.Net games. > [!WARNING] > CHUNITHM pre-NEW!! and maimai pre-DX are no longer supported after February 6th, 2026 and all associated data will be removed. -| Game | Latest Ver. | Initial Ver. | Notes | Web UI | Import | AES | -|------------------------|---------------------|---------------------|-------------------------------------------------------------|--------|-------------|---------| -| SDHD: CHUNITHM | 2.45 (X-VERSE-X) | 2.00 (NEW) | | ✅ | ✅ | ✅ | -| SDEZ: maimai DX | 1.65 (CiRCLE PLUS) | 1.00 (DX) | Thanks [@Menci](https://github.com/Menci) | ✅ | ✅ | ✅ | -| SDGA: maimai DX (Intl) | 1.60 (CiRCLE) | 1.00 (DX) | Thanks [@Clansty](https://github.com/clansty) | ✅ | ✅ | ✅ | -| SDED: Card Maker | 1.39 | N/A | Thanks [@Becods](https://github.com/Becods) | ❌ | ❌ | ❌ | -| SDDT: O.N.G.E.K.I. | 1.50 (Re:Fresh) | N/A | Thanks [@PenguinCaptain](https://github.com/PenguinCaptain) | ✅ | ✅ | ✅ | -| SBZV: Project DIVA | 7.10 | N/A | Minimal support | ❌ | ❌ | 🔓 | -| SDFE: Wacca | 3.07 (REVERSE) | N/A | Later versions are EOS patches | ✅ | ❌ | 🔓 | +| Game | Latest Ver. | Initial Ver. | Notes | Web UI | Import | AES | +|------------------------|--------------------|---------------------|-------------------------------------------------------------|--------|-------------|---------| +| SDHD: CHUNITHM | 2.50 (MATE) | 2.00 (NEW) | | ✅ | ✅ | ✅ | +| SDEZ: maimai DX | 1.65 (CiRCLE PLUS) | 1.00 (DX) | Thanks [@Menci](https://github.com/Menci) | ✅ | ✅ | ✅ | +| SDGA: maimai DX (Intl) | 1.60 (CiRCLE) | 1.00 (DX) | Thanks [@Clansty](https://github.com/clansty) | ✅ | ✅ | ✅ | +| SDED: Card Maker | 1.39 | N/A | Thanks [@Becods](https://github.com/Becods) | ❌ | ❌ | ❌ | +| SDDT: O.N.G.E.K.I. | 1.50 (Re:Fresh) | N/A | Thanks [@PenguinCaptain](https://github.com/PenguinCaptain) | ✅ | ✅ | ✅ | +| SBZV: Project DIVA | 7.10 | N/A | Minimal support | ❌ | ❌ | 🔓 | +| SDFE: Wacca | 3.07 (REVERSE) | N/A | Later versions are EOS patches | ✅ | ❌ | 🔓 | diff --git a/src/main/java/icu/samnyan/aqua/sega/chusan/handler/ChusanApis.kt b/src/main/java/icu/samnyan/aqua/sega/chusan/handler/ChusanApis.kt index 311b0045..516d849b 100644 --- a/src/main/java/icu/samnyan/aqua/sega/chusan/handler/ChusanApis.kt +++ b/src/main/java/icu/samnyan/aqua/sega/chusan/handler/ChusanApis.kt @@ -163,6 +163,10 @@ fun ChusanController.chusanInit() { mapOf("userId" to uid, "userGameOption" to userGameOption) } + "GetUserMate" { + db.userMate.findByUser_Card_ExtId(uid).let{ u -> mapOf("userId" to uid, "userMateList" to u) } + } + "RollGacha" { val (gachaId, times) = parsing { data["gachaId"]!!.int to data["times"]!!.int } val lst = db.gameGachaCard.findAllByGachaId(gachaId).shuffled().take(times) @@ -264,6 +268,11 @@ fun ChusanController.chusanInit() { }.map { mapOf("id" to it) } } } + "GetUserFavoriteCollection".pagedWithKind("userFavoriteCollectionList") { + // TODO + val kind = parsing { data["itemKind"]!!.int } + mapOf("itemKind" to kind) grabs { emptyList() } + } val userPreviewKeys = ("userName,reincarnationNum,level,exp,playerRating,lastGameId,lastRomVersion," + "lastDataVersion,trophyId,classEmblemMedal,classEmblemBase,battleRankId").split(',').toSet() diff --git a/src/main/java/icu/samnyan/aqua/sega/chusan/handler/ChusanUpsertApis.kt b/src/main/java/icu/samnyan/aqua/sega/chusan/handler/ChusanUpsertApis.kt index 30bc7091..e3efe5c6 100644 --- a/src/main/java/icu/samnyan/aqua/sega/chusan/handler/ChusanUpsertApis.kt +++ b/src/main/java/icu/samnyan/aqua/sega/chusan/handler/ChusanUpsertApis.kt @@ -164,8 +164,19 @@ fun ChusanController.upsertApiInit() { db.userLinkedVerse.saveAll(list.map{ it.apply{ it.user = u } }.distinctBy { it.linkedVerseId }.mapApply { - id = db.userLinkedVerse.findByUserAndLinkedVerseId(u, linkedVerseId)?.id ?: 0 }) - } + id = db.userLinkedVerse.findByUserAndLinkedVerseId(u, linkedVerseId)?.id ?: 0 }) } + + userMateList?.let { list -> + db.userMate.saveAll(list.map{ + it.apply{ it.user = u } + }.distinctBy { it.mateId }.mapApply { + id = db.userMate.findByUserAndMateId(u, mateId)?.id ?: 0 }) } + + userVoteList?.let { list -> + db.userVote.saveAll(list.map{ + it.apply{ it.user = u } + }.distinctBy { it.voteId }.mapApply { + id = db.userVote.findByUserAndVoteId(u, voteId)?.id ?: 0 }) } // Need testing // userLoginBonusList?.let { list -> diff --git a/src/main/java/icu/samnyan/aqua/sega/chusan/model/Chu3Repos.kt b/src/main/java/icu/samnyan/aqua/sega/chusan/model/Chu3Repos.kt index ed432420..b5944b52 100644 --- a/src/main/java/icu/samnyan/aqua/sega/chusan/model/Chu3Repos.kt +++ b/src/main/java/icu/samnyan/aqua/sega/chusan/model/Chu3Repos.kt @@ -69,11 +69,22 @@ interface Chu3UserCourseRepo : Chu3UserLinked { fun findByUserAndCourseId(user: Chu3UserData, courseId: Int): UserCourse? } +interface Chu3UserMateRepo : Chu3UserLinked { + fun findAllByUser(user: Chu3UserData): List + fun findByUserAndMateId(user: Chu3UserData, mateId: Int): UserMate? +} + +interface Chu3UserVoteRepo : Chu3UserLinked { + fun findAllByUser(user: Chu3UserData): List + fun findByUserAndVoteId(user: Chu3UserData, voteId: Int): UserVote? +} + interface Chu3UserLinkedVerseRepo : Chu3UserLinked { fun findAllByUser(user: Chu3UserData): List fun findByUserAndLinkedVerseId(user: Chu3UserData, linkedVerseId: Int): Chu3UserLinkedVerse? } + interface Chu3UserDataRepo : GenericUserDataRepo { fun findTopByLastClientIdOrderByLastPlayDateDesc(lastClientId: String): Chu3UserData? } @@ -187,6 +198,8 @@ class Chu3Repos( val userMisc: Chu3UserMiscRepo, val userChallenge: Chu3UserChallengeRepo, val userLinkedVerse: Chu3UserLinkedVerseRepo, + val userMate: Chu3UserMateRepo, + val userVote: Chu3UserVoteRepo, val gameData: GameDataService ) { val gameCharge = StaticRepo(gameData.chu3GameCharges) { it.orderId.toLong() } diff --git a/src/main/java/icu/samnyan/aqua/sega/chusan/model/request/Chu3UserAll.kt b/src/main/java/icu/samnyan/aqua/sega/chusan/model/request/Chu3UserAll.kt index 7046c9d3..4c627a9a 100644 --- a/src/main/java/icu/samnyan/aqua/sega/chusan/model/request/Chu3UserAll.kt +++ b/src/main/java/icu/samnyan/aqua/sega/chusan/model/request/Chu3UserAll.kt @@ -64,5 +64,7 @@ class Chu3UserAll( var userCMissionList: List? = null, var userFavoriteMusicList: List? = null, var userUnlockChallengeList: List? = null, - var userLinkedVerseList: List? = null + var userLinkedVerseList: List? = null, + var userMateList: List? = null, + var userVoteList: List? = null ) diff --git a/src/main/java/icu/samnyan/aqua/sega/chusan/model/userdata/Chu3UserData.kt b/src/main/java/icu/samnyan/aqua/sega/chusan/model/userdata/Chu3UserData.kt index 37d0b4da..dfee458a 100644 --- a/src/main/java/icu/samnyan/aqua/sega/chusan/model/userdata/Chu3UserData.kt +++ b/src/main/java/icu/samnyan/aqua/sega/chusan/model/userdata/Chu3UserData.kt @@ -53,6 +53,7 @@ class Chu3UserData : BaseEntity(), IUserData { var nameplateId = 0 var frameId = 0 var characterId = 0 + var mateId = 0 var trophyId = 0 var playedTutorialBit = 0 var firstTutorialCancelNum = 0 diff --git a/src/main/java/icu/samnyan/aqua/sega/chusan/model/userdata/UserMate.kt b/src/main/java/icu/samnyan/aqua/sega/chusan/model/userdata/UserMate.kt new file mode 100644 index 00000000..6808d8fd --- /dev/null +++ b/src/main/java/icu/samnyan/aqua/sega/chusan/model/userdata/UserMate.kt @@ -0,0 +1,21 @@ +package icu.samnyan.aqua.sega.chusan.model.userdata + +import com.fasterxml.jackson.annotation.JsonProperty +import jakarta.persistence.Entity +import jakarta.persistence.Table +import jakarta.persistence.UniqueConstraint + +@Entity(name = "ChusanUserMate") +@Table(name = "chusan_user_mate", uniqueConstraints = [UniqueConstraint(columnNames = ["user_id", "mate_id"])]) +class UserMate : Chu3UserEntity() { + var mateId = 0 + + var playCount = 0 + var enterGardenCount = 0 + var friendshipLevel = 0 + var totalFriendshipExp = 0 + var totalUsePoint = 0 + + @JsonProperty("isValid") + var isValid = true +} \ No newline at end of file diff --git a/src/main/java/icu/samnyan/aqua/sega/chusan/model/userdata/UserVote.kt b/src/main/java/icu/samnyan/aqua/sega/chusan/model/userdata/UserVote.kt new file mode 100644 index 00000000..c170d6ab --- /dev/null +++ b/src/main/java/icu/samnyan/aqua/sega/chusan/model/userdata/UserVote.kt @@ -0,0 +1,18 @@ +package icu.samnyan.aqua.sega.chusan.model.userdata + +import com.fasterxml.jackson.annotation.JsonProperty +import jakarta.persistence.Entity +import jakarta.persistence.Table +import jakarta.persistence.UniqueConstraint + +@Entity(name = "ChusanUserVote") +@Table(name = "chusan_user_vote", uniqueConstraints = [UniqueConstraint(columnNames = ["user_id", "vote_id"])]) +class UserVote : Chu3UserEntity() { + var voteId = 0 + + var point = 0 + var totalPoint = 0 + + @JsonProperty("isValid") + var isValid = true +} diff --git a/src/main/resources/data/game/chusan/game_event.json b/src/main/resources/data/game/chusan/game_event.json index f23162d6..a4f1f5fd 100644 --- a/src/main/resources/data/game/chusan/game_event.json +++ b/src/main/resources/data/game/chusan/game_event.json @@ -8923,5 +8923,495 @@ "id": 18755, "type": 2, "enable": 1 + }, + { + "id": 2607, + "type": 13, + "enable": 1 + }, + { + "id": 2608, + "type": 13, + "enable": 1 + }, + { + "id": 2609, + "type": 13, + "enable": 1 + }, + { + "id": 2610, + "type": 13, + "enable": 1 + }, + { + "id": 2611, + "type": 13, + "enable": 1 + }, + { + "id": 2612, + "type": 13, + "enable": 1 + }, + { + "id": 19000, + "type": 3, + "enable": 1 + }, + { + "id": 19001, + "type": 5, + "enable": 1 + }, + { + "id": 19002, + "type": 12, + "enable": 1 + }, + { + "id": 19003, + "type": 4, + "enable": 1 + }, + { + "id": 19004, + "type": 2, + "enable": 1 + }, + { + "id": 19005, + "type": 2, + "enable": 1 + }, + { + "id": 19006, + "type": 2, + "enable": 1 + }, + { + "id": 19007, + "type": 2, + "enable": 1 + }, + { + "id": 19008, + "type": 2, + "enable": 1 + }, + { + "id": 19009, + "type": 2, + "enable": 1 + }, + { + "id": 19010, + "type": 2, + "enable": 1 + }, + { + "id": 19011, + "type": 2, + "enable": 1 + }, + { + "id": 19012, + "type": 2, + "enable": 1 + }, + { + "id": 19013, + "type": 2, + "enable": 1 + }, + { + "id": 19014, + "type": 2, + "enable": 1 + }, + { + "id": 19015, + "type": 2, + "enable": 1 + }, + { + "id": 19016, + "type": 2, + "enable": 1 + }, + { + "id": 19017, + "type": 2, + "enable": 1 + }, + { + "id": 19018, + "type": 2, + "enable": 1 + }, + { + "id": 19019, + "type": 2, + "enable": 1 + }, + { + "id": 19020, + "type": 2, + "enable": 1 + }, + { + "id": 19021, + "type": 2, + "enable": 1 + }, + { + "id": 19022, + "type": 2, + "enable": 1 + }, + { + "id": 19023, + "type": 2, + "enable": 1 + }, + { + "id": 19024, + "type": 2, + "enable": 1 + }, + { + "id": 19025, + "type": 2, + "enable": 1 + }, + { + "id": 19026, + "type": 2, + "enable": 1 + }, + { + "id": 19027, + "type": 2, + "enable": 1 + }, + { + "id": 19028, + "type": 8, + "enable": 1 + }, + { + "id": 19029, + "type": 8, + "enable": 1 + }, + { + "id": 19030, + "type": 8, + "enable": 1 + }, + { + "id": 19031, + "type": 8, + "enable": 1 + }, + { + "id": 19032, + "type": 8, + "enable": 1 + }, + { + "id": 19033, + "type": 8, + "enable": 1 + }, + { + "id": 19034, + "type": 8, + "enable": 1 + }, + { + "id": 19035, + "type": 8, + "enable": 1 + }, + { + "id": 19036, + "type": 8, + "enable": 1 + }, + { + "id": 19037, + "type": 8, + "enable": 1 + }, + { + "id": 19038, + "type": 8, + "enable": 1 + }, + { + "id": 19039, + "type": 8, + "enable": 1 + }, + { + "id": 19040, + "type": 8, + "enable": 1 + }, + { + "id": 19041, + "type": 8, + "enable": 1 + }, + { + "id": 19042, + "type": 8, + "enable": 1 + }, + { + "id": 19043, + "type": 8, + "enable": 1 + }, + { + "id": 19044, + "type": 8, + "enable": 1 + }, + { + "id": 19045, + "type": 8, + "enable": 1 + }, + { + "id": 19046, + "type": 8, + "enable": 1 + }, + { + "id": 19047, + "type": 8, + "enable": 1 + }, + { + "id": 19048, + "type": 8, + "enable": 1 + }, + { + "id": 19049, + "type": 8, + "enable": 1 + }, + { + "id": 19050, + "type": 8, + "enable": 1 + }, + { + "id": 19051, + "type": 8, + "enable": 1 + }, + { + "id": 19052, + "type": 8, + "enable": 1 + }, + { + "id": 19053, + "type": 8, + "enable": 1 + }, + { + "id": 19054, + "type": 8, + "enable": 1 + }, + { + "id": 19055, + "type": 8, + "enable": 1 + }, + { + "id": 19056, + "type": 8, + "enable": 1 + }, + { + "id": 19057, + "type": 3, + "enable": 1 + }, + { + "id": 19058, + "type": 10, + "enable": 1 + }, + { + "id": 19059, + "type": 7, + "enable": 1 + }, + { + "id": 19060, + "type": 7, + "enable": 1 + }, + { + "id": 19061, + "type": 3, + "enable": 1 + }, + { + "id": 19062, + "type": 3, + "enable": 1 + }, + { + "id": 19063, + "type": 1, + "enable": 1 + }, + { + "id": 19064, + "type": 1, + "enable": 1 + }, + { + "id": 19065, + "type": 1, + "enable": 1 + }, + { + "id": 19066, + "type": 3, + "enable": 1 + }, + { + "id": 19067, + "type": 1, + "enable": 1 + }, + { + "id": 19068, + "type": 2, + "enable": 1 + }, + { + "id": 19069, + "type": 8, + "enable": 1 + }, + { + "id": 19070, + "type": 1, + "enable": 1 + }, + { + "id": 19071, + "type": 2, + "enable": 1 + }, + { + "id": 19072, + "type": 8, + "enable": 1 + }, + { + "id": 19073, + "type": 1, + "enable": 1 + }, + { + "id": 19074, + "type": 2, + "enable": 1 + }, + { + "id": 19075, + "type": 1, + "enable": 1 + }, + { + "id": 19076, + "type": 2, + "enable": 1 + }, + { + "id": 19077, + "type": 2, + "enable": 1 + }, + { + "id": 19078, + "type": 2, + "enable": 1 + }, + { + "id": 19079, + "type": 1, + "enable": 1 + }, + { + "id": 19080, + "type": 16, + "enable": 1 + }, + { + "id": 19081, + "type": 1, + "enable": 1 + }, + { + "id": 19082, + "type": 16, + "enable": 1 + }, + { + "id": 19083, + "type": 1, + "enable": 1 + }, + { + "id": 19084, + "type": 14, + "enable": 1 + }, + { + "id": 19085, + "type": 1, + "enable": 1 + }, + { + "id": 19086, + "type": 2, + "enable": 1 + }, + { + "id": 19087, + "type": 8, + "enable": 1 + }, + { + "id": 19088, + "type": 1, + "enable": 1 + }, + { + "id": 19089, + "type": 2, + "enable": 1 + }, + { + "id": 19090, + "type": 8, + "enable": 1 + }, + { + "id": 19091, + "type": 11, + "enable": 1 } ] \ No newline at end of file diff --git a/src/main/resources/db/120/V1000_82__chusan_mate.sql b/src/main/resources/db/120/V1000_82__chusan_mate.sql new file mode 100644 index 00000000..0b45319c --- /dev/null +++ b/src/main/resources/db/120/V1000_82__chusan_mate.sql @@ -0,0 +1,33 @@ +ALTER TABLE chusan_user_data + ADD mate_id INT NOT NULL DEFAULT 0; + +CREATE TABLE chusan_user_mate +( + id BIGINT AUTO_INCREMENT NOT NULL PRIMARY KEY, + user_id BIGINT NOT NULL, + mate_id INTEGER NOT NULL, + play_count INTEGER NOT NULL, + enter_garden_count INTEGER NOT NULL, + friendship_level INTEGER NOT NULL, + total_friendship_exp INTEGER NOT NULL, + total_use_point INTEGER NOT NULL, + + is_valid BOOLEAN NOT NULL, + + CONSTRAINT fku_chusan_user_mate FOREIGN KEY (user_id) REFERENCES chusan_user_data (id) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT unique_user_mate UNIQUE (user_id, mate_id) +); + +CREATE TABLE chusan_user_vote +( + id BIGINT AUTO_INCREMENT NOT NULL PRIMARY KEY, + user_id BIGINT NOT NULL, + vote_id INTEGER NOT NULL, + point INTEGER NOT NULL, + total_point INTEGER NOT NULL, + + is_valid BOOLEAN NOT NULL, + + CONSTRAINT fku_chusan_user_vote FOREIGN KEY (user_id) REFERENCES chusan_user_data (id) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT unique_user_vote UNIQUE (user_id, vote_id) +); \ No newline at end of file