@jetthai/cuora 1.1.359 → 1.1.360
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/package.json +1 -1
- package/src/machine/game_v2_1.js +4 -4
- package/src/machine/ranking.js +10 -8
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [1.1.360](https://github.com/jetthai/cuora-module/compare/v1.1.359...v1.1.360) (2025-06-03)
|
|
6
|
+
|
|
5
7
|
### [1.1.359](https://github.com/jetthai/cuora-module/compare/v1.1.358...v1.1.359) (2025-05-23)
|
|
6
8
|
|
|
7
9
|
### [1.1.358](https://github.com/jetthai/cuora-module/compare/v1.1.357...v1.1.358) (2025-05-09)
|
package/package.json
CHANGED
package/src/machine/game_v2_1.js
CHANGED
|
@@ -83,7 +83,7 @@ export default function (request) {
|
|
|
83
83
|
},
|
|
84
84
|
ENTER_GAME: {
|
|
85
85
|
target: 'connecting',
|
|
86
|
-
actions: ['setGameInfo', 'setLang', '
|
|
86
|
+
actions: ['setGameInfo', 'setLang', 'setWalletType'],
|
|
87
87
|
},
|
|
88
88
|
DEMO_GAME: {
|
|
89
89
|
target: 'demoGame',
|
|
@@ -91,7 +91,7 @@ export default function (request) {
|
|
|
91
91
|
},
|
|
92
92
|
MENU_ENTER_GAME: {
|
|
93
93
|
target: 'connecting',
|
|
94
|
-
actions: ['setGameInfo', 'setLang', '
|
|
94
|
+
actions: ['setGameInfo', 'setLang', 'setWalletType'],
|
|
95
95
|
},
|
|
96
96
|
UPDATE: {
|
|
97
97
|
target: 'updating',
|
|
@@ -241,7 +241,7 @@ export default function (request) {
|
|
|
241
241
|
},
|
|
242
242
|
ENTER_GAME: {
|
|
243
243
|
target: 'connecting',
|
|
244
|
-
actions: ['setGameInfo', 'setLang', '
|
|
244
|
+
actions: ['setGameInfo', 'setLang', 'setWalletType'],
|
|
245
245
|
},
|
|
246
246
|
},
|
|
247
247
|
},
|
|
@@ -455,7 +455,7 @@ export default function (request) {
|
|
|
455
455
|
const { providerId, gameId, gameTypeId, mappingId, portrait, gameCode, name } = context.switchGame
|
|
456
456
|
return { game: { providerId, gameId, gameTypeId, mappingId, portrait: portrait ? 1 : 0, gameCode, name } }
|
|
457
457
|
}),
|
|
458
|
-
|
|
458
|
+
setWalletType: assign((context, event) => {
|
|
459
459
|
return { walletType: event.data.walletType }
|
|
460
460
|
}),
|
|
461
461
|
setLang: assign((context, event) => {
|
package/src/machine/ranking.js
CHANGED
|
@@ -3,11 +3,13 @@ import ranking from '../api/ranking.js'
|
|
|
3
3
|
|
|
4
4
|
export default function (request) {
|
|
5
5
|
const cycleMapping = ['DAILY', 'WEEKLY', 'MONTHLY']
|
|
6
|
+
const limit = { DAILY: 56, WEEKLY: 8, MONTHLY: 2, ALL: 2 }
|
|
6
7
|
|
|
7
|
-
function roundProcess(rounds) {
|
|
8
|
+
function roundProcess(rounds, cycles) {
|
|
8
9
|
const roundArrays = rounds.map((round) => Array.from({ length: round }, (_, i) => i + 1))
|
|
9
10
|
return roundArrays.reduce((acc, roundArray, index) => {
|
|
10
|
-
|
|
11
|
+
const max = limit[cycles[index]] || rounds[index] // 若沒限制則取全部
|
|
12
|
+
acc[cycles[index]] = roundArray.reverse().slice(0, max)
|
|
11
13
|
return acc
|
|
12
14
|
}, {})
|
|
13
15
|
}
|
|
@@ -151,14 +153,14 @@ export default function (request) {
|
|
|
151
153
|
}
|
|
152
154
|
}),
|
|
153
155
|
setRankingOptions: assign((context, event) => {
|
|
156
|
+
const isChampion = event.data?.rule === 'CHAMPION'
|
|
154
157
|
const cycle = event.data?.cycle
|
|
155
158
|
const currentRound = event.data?.currentRound || []
|
|
156
159
|
// 取得結算週期選單列表
|
|
157
|
-
const cycleOptions = cycleMapping.slice(0, currentRound.length)
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
if (cycle === 'MONTHLY') {
|
|
160
|
+
const cycleOptions = isChampion ? cycleMapping.slice(0, currentRound.length) : [cycle]
|
|
161
|
+
const roundOptions = roundProcess(currentRound, cycleOptions)
|
|
162
|
+
// 如果是冠軍龍虎月結算,則加入全部選項
|
|
163
|
+
if (cycle === 'MONTHLY' && isChampion) {
|
|
162
164
|
cycleOptions.push('ALL')
|
|
163
165
|
roundOptions.ALL = roundOptions.MONTHLY
|
|
164
166
|
}
|
|
@@ -166,7 +168,7 @@ export default function (request) {
|
|
|
166
168
|
...event.data,
|
|
167
169
|
options: { cycle: cycleOptions, round: roundOptions },
|
|
168
170
|
// 初始固定顯示 DAILY
|
|
169
|
-
cycle:
|
|
171
|
+
cycle: isChampion ? 'DAILY' : cycle,
|
|
170
172
|
round: currentRound[0],
|
|
171
173
|
}
|
|
172
174
|
}),
|