diff --git a/src/pages/training/components/ScoreResult.vue b/src/pages/training/components/ScoreResult.vue index dd7f2b6..a30bfac 100644 --- a/src/pages/training/components/ScoreResult.vue +++ b/src/pages/training/components/ScoreResult.vue @@ -247,6 +247,13 @@ const metricConfigs = { deltaKeys: ["deltaTotalRings", "delta_total_rings"], deltaUnit: "环", }, + { + label: "十环次数", + valueKeys: ["tenRingCount", "ten_ring_count"], + unit: "次", + deltaKeys: ["deltaTenRingCount", "delta_ten_ring_count"], + deltaUnit: "次", + }, ], endurance: [ { @@ -364,7 +371,7 @@ const calories = computed( -- - + 消耗卡路里 @@ -447,7 +454,7 @@ const calories = computed( - diff --git a/src/pages/training/index.vue b/src/pages/training/index.vue index fee365a..e765997 100644 --- a/src/pages/training/index.vue +++ b/src/pages/training/index.vue @@ -15,9 +15,9 @@ const trainingModeRouteMap = { endurance: "endurance", precision: "precision", rhythm: "rhythm", - strength: "power", + stability: "power", }; -const unavailableTrainingIds = new Set(["strength"]); +const unavailableTrainingIds = new Set(["stability"]); // 训练项目卡片右侧主图标。 const trainingModeIconMap = { base_bow: @@ -39,21 +39,22 @@ const trainingModeTitleImageMap = { "https://static.shelingxingqiu.com/shootmini/static/training-home/jingzhunxunlian.png", rhythm: "https://static.shelingxingqiu.com/shootmini/static/training-home/jiezouxunlian.png", - strength: + stability: "https://static.shelingxingqiu.com/shootmini/static/training-home/wendingxunlian.png", }; const defaultWeekDays = ["周一", "周二", "周三", "周四", "周五", "周六", "周日"]; const defaultRadarDimensions = [ { name: "基础", score: 0 }, { name: "精准", score: 0 }, - { name: "力量", score: 0 }, + { name: "稳定", score: 0 }, { name: "节奏", score: 0 }, { name: "耐力", score: 0 }, ]; const radarDimensionTrainingIdMap = Object.freeze({ 基础: "base", 精准: "precision", - 力量: "strength", + 稳定: "stability", + 力量: "stability", 节奏: "rhythm", 耐力: "endurance", }); @@ -66,7 +67,7 @@ const createDefaultTrainingData = () => ({ total_arrows: 0, target_rate: 0, ten_ring_count: 0, - total_calories: 0, + average_ring: 0, }, beat_percent: 0, radar_max: 0, @@ -137,7 +138,6 @@ const getLevelText = (item) => { return `当前进度 LV${level} >`; }; -// 接口字段暂时沿用 total_calories,页面按平均环数展示。 const getAverageRingValue = (value) => formatValue(value); const getTrainingIcon = (item = {}) => @@ -289,7 +289,7 @@ const loadPersonalTrainingData = async () => { total_arrows: result?.stats?.total_arrows ?? 0, target_rate: result?.stats?.target_rate ?? 0, ten_ring_count: result?.stats?.ten_ring_count ?? 0, - total_calories: result?.stats?.total_calories ?? 0, + average_ring: result?.stats?.average_ring ?? 0, }, beat_percent: result?.beat_percent ?? 0, radar_max: result?.radar_max ?? 0, @@ -458,7 +458,7 @@ onShow(async () => { - {{ getAverageRingValue(trainingData.stats.total_calories) }} + {{ getAverageRingValue(trainingData.stats.average_ring) }} @@ -531,19 +531,26 @@ onShow(async () => { - - - - - 12箭练习 - - - + + + + 无级别限制 + + + + { width: 92rpx; } -.featured-card { - position: relative; - width: 100%; - height: 130rpx; - margin-top: 38rpx; - border-radius: 16rpx; - overflow: hidden; -} - -.featured-card-bg { - width: 100%; -} - -.featured-card-mask { - position: absolute; - left: 0; - top: 0; - width: 278rpx; - height: 130rpx; -} - -.featured-card-copy { - position: absolute; - left: 174rpx; - top: 60rpx; - display: flex; - flex-direction: column; -} - -.featured-card-title { - display: block; - color: #895409; - font-size: 34rpx; - font-family: "AlimamaShuHeiTi-Bold", "PingFang SC", sans-serif; - font-weight: 700; - line-height: 42rpx; -} - -.featured-card-subtitle { - display: block; - color: #895409; - font-size: 20rpx; - line-height: 28rpx; -} - .mode-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); @@ -919,7 +881,7 @@ onShow(async () => { box-shadow: inset 2rpx 2rpx 6rpx 0rpx rgba(255, 255, 255, 0.27); border-radius: 16rpx; border: 2rpx solid rgba(235, 184, 123, 0.5); - background: rgba(0, 0, 0, 0.5); + /* background: rgba(0, 0, 0, 0.5); */ overflow: hidden; } diff --git a/src/pages/training/practise-one.vue b/src/pages/training/practise-one.vue index 034bb67..5e0dfc9 100644 --- a/src/pages/training/practise-one.vue +++ b/src/pages/training/practise-one.vue @@ -92,6 +92,8 @@ const rhythmServerTimestamp = ref(0); const rhythmFallbackWindowStart = ref(0); const rhythmFallbackTimestamp = ref(0); const rhythmHasActiveServerAnchor = ref(false); +// 节奏训练目标箭数以服务端 total_arrows 为准;首帧缺失时用 arrows_left 初始化并保持稳定。 +const rhythmTargetArrows = ref(0); // 服务端状态立即落到 practiceInfo,精准训练的目标区域单独延迟展示。 const visiblePrecisionTarget = ref({ randomBlock: 0, @@ -416,7 +418,7 @@ const trainingCopy = computed(() => { } if (trainingType.value === "rhythm") { - const targetArrows = getPositiveInteger(total.value); + const targetArrows = getPositiveInteger(rhythmTargetArrows.value); const arrowsLeft = Math.min( targetArrows, Math.max( @@ -494,6 +496,8 @@ const practiceInfoFields = [ "deltaTotalArrows", "deltaAverageRing", "deltaStability", + "tenRingCount", + "deltaTenRingCount", "beforeExp", "beforeLevel", "currentExp", @@ -522,6 +526,8 @@ const practiceResultFields = [ "deltaTotalArrows", "deltaAverageRing", "deltaStability", + "tenRingCount", + "deltaTenRingCount", "beforeExp", "beforeLevel", "currentExp", @@ -569,8 +575,31 @@ const cacheRhythmTrainingConfig = (message = {}) => { } }; +const cacheRhythmTargetArrows = (message = {}) => { + const messageTrainingType = String( + message.trainingType ?? message.training_type ?? trainingType.value + ).trim(); + if (messageTrainingType !== "rhythm") return; + + const totalArrows = getPositiveInteger( + message.totalArrows ?? message.total_arrows + ); + if (totalArrows > 0) { + rhythmTargetArrows.value = totalArrows; + return; + } + + // 兼容服务端首帧 total_arrows 暂为 0:只初始化一次,避免剩余数递减时分母跟着变化。 + if (rhythmTargetArrows.value === 0) { + rhythmTargetArrows.value = getPositiveInteger( + message.arrowsLeft ?? message.arrows_left + ); + } +}; + const syncPracticeInfo = (message = {}) => { cacheRhythmTrainingConfig(message); + cacheRhythmTargetArrows(message); const nextInfo = practiceInfoFields.reduce((result, field) => { if (Object.prototype.hasOwnProperty.call(message, field)) { result[field] = message[field]; @@ -1427,6 +1456,7 @@ async function onRetry() { rhythmFallbackWindowStart.value = 0; rhythmFallbackTimestamp.value = 0; rhythmHasActiveServerAnchor.value = false; + rhythmTargetArrows.value = 0; invalidateShotPresentations({ resetVisible: true }); start.value = false; scores.value = []; diff --git a/src/static/training-home/img_2.png b/src/static/training-home/img_2.png new file mode 100644 index 0000000..9f7fa59 Binary files /dev/null and b/src/static/training-home/img_2.png differ diff --git a/src/static/training-home/ziyouxunlian.png b/src/static/training-home/ziyouxunlian.png new file mode 100644 index 0000000..94a5205 Binary files /dev/null and b/src/static/training-home/ziyouxunlian.png differ diff --git a/src/utils/match.min.js b/src/utils/match.min.js index b0a391e..96f5137 100644 --- a/src/utils/match.min.js +++ b/src/utils/match.min.js @@ -1,4 +1,4 @@ /* eslint-disable */ import * as $protobuf from "protobufjs"; -const $root=$protobuf.Root.create({"nested":{"rpc":{"ServerMessageType":{"SERVER_MSG_UNKNOWN":0,"SERVER_MSG_MATCH_READY":1,"SERVER_MSG_MATCH_START":2,"SERVER_MSG_NOW_YOU":3,"SERVER_MSG_SHOT":4,"SERVER_MSG_NEW_ROUND":5,"SERVER_MSG_MATCH_END":6,"SERVER_MSG_TIMEOUT":7,"SERVER_MSG_CHECK":8,"SERVER_MSG_RAND":9,"SERVER_MSG_NOT_ENOUGH_DISTANCE":10,"SERVER_MSG_PLAYER_LEFT":11,"SERVER_MSG_HEARTBEAT":12,"SERVER_MSG_PRACTICE_END":13,"SERVER_MSG_SYNC_PRACTICE_INFO":14,"SERVER_MSG_SYNC_MATCH_INFO":15},"ClientMessageType":{"CLIENT_MSG_UNKNOWN":0,"CLIENT_MSG_HEARTBEAT_ACK":1,"CLIENT_MSG_SHOOT_DATA":2,"CLIENT_MSG_ACK":3,"CLIENT_MSG_LEAVE":4,"CLIENT_MSG_SYNC_PRACTICE_INFO":5,"CLIENT_MSG_SYNC_MATCH_INFO":6},"MatchStatus":{"MATCH_STATUS_READY":0,"MATCH_STATUS_STARTED":1,"MATCH_STATUS_END":2,"MATCH_STATUS_TIMEOUT":3,"MATCH_STATUS_UNEXPECTEDLY":4},"MatchPlayerStatus":{"MATCH_PLAYER_STATUS_READY":0,"MATCH_PLAYER_STATUS_STARTED":1,"MATCH_PLAYER_STATUS_END":2},"MatchShoot":{"fields":{"player_id":{"type":"int64","id":1},"status":{"type":"int32","id":2},"x":{"type":"float","id":3},"y":{"type":"float","id":4},"ring":{"type":"int32","id":5},"ring_x":{"type":"bool","id":6},"angle":{"type":"float","id":7},"distance":{"type":"float","id":8},"three_consecutive_10_rings":{"type":"bool","id":9},"ok":{"type":"bool","id":10},"target_ok":{"type":"bool","id":11}}},"MatchShootList":{"fields":{"items":{"type":"MatchShoot","id":1,"rule":"repeated"}}},"RoundScore":{"fields":{"total_ring":{"type":"int32","id":1},"score":{"type":"int32","id":2},"if_win":{"type":"bool","id":3}}},"MatchRound":{"fields":{"shoots":{"type":"MatchShootList","id":1,"keytype":"int64"},"scores":{"type":"RoundScore","id":2,"keytype":"int32"},"round":{"type":"int32","id":3},"if_gold":{"type":"bool","id":4},"status":{"type":"int32","id":5},"gold_round":{"type":"int32","id":6}}},"PlayerMatchResult":{"fields":{"total_ring":{"type":"int32","id":1},"user_id":{"type":"int64","id":2},"ten_ring_count":{"type":"int32","id":3},"average_ring":{"type":"float","id":4}}},"PlayerFull":{"fields":{"id":{"type":"int64","id":1},"name":{"type":"string","id":2},"avatar":{"type":"string","id":3},"exp":{"type":"int32","id":4},"score":{"type":"int32","id":5},"level":{"type":"int32","id":6},"before_level":{"type":"int32","id":7},"before_exp":{"type":"int32","id":8},"current_exp":{"type":"int32","id":9},"upgrade_exp":{"type":"int32","id":10},"active":{"type":"int32","id":11},"device_id":{"type":"string","id":12},"s_vip":{"type":"bool","id":13},"vip":{"type":"bool","id":14},"player_match_result":{"type":"PlayerMatchResult","id":15},"rank_lvl":{"type":"int32","id":16},"rank_name":{"type":"string","id":17},"rank_icon":{"type":"string","id":18}}},"TeamInfo":{"fields":{"players":{"type":"PlayerFull","id":1,"rule":"repeated"},"id":{"type":"int32","id":2},"name":{"type":"string","id":3},"score":{"type":"int32","id":4}}},"CurrentShoot":{"fields":{"round":{"type":"int32","id":1},"round_id":{"type":"int64","id":2},"index":{"type":"int32","id":3},"start_time":{"type":"int64","id":4},"player_id":{"type":"int64","id":5},"gold_round":{"type":"bool","id":6},"start_time_text":{"type":"string","id":7},"my_index":{"type":"int32","id":8},"index_map":{"type":"int32","id":9,"keytype":"int64"},"ack_time":{"type":"int64","id":10}}},"ShootData":{"fields":{"x":{"type":"float","id":1},"y":{"type":"float","id":2},"r":{"type":"float","id":3},"dst":{"type":"float","id":4},"m":{"type":"string","id":5},"adc":{"type":"float","id":6},"device_id":{"type":"string","id":7},"shoot_id":{"type":"string","id":8},"three_consecutive_10_rings":{"type":"bool","id":9},"target_ok":{"type":"bool","id":10}}},"PracticeInfo":{"fields":{"id":{"type":"int64","id":1},"user_id":{"type":"int64","id":2},"status":{"type":"int32","id":3},"status_text":{"type":"string","id":4},"start_time":{"type":"int64","id":5},"target_type":{"type":"int32","id":6},"vip":{"type":"bool","id":7},"s_vip":{"type":"bool","id":8},"device_id":{"type":"string","id":9},"shoot_data":{"type":"MatchShoot","id":10},"details":{"type":"MatchShoot","id":11,"rule":"repeated"},"training_type":{"type":"string","id":12},"difficulty_level":{"type":"int32","id":13},"hit_req":{"type":"int32","id":14},"arrows_left":{"type":"int32","id":15},"target_arrows":{"type":"int32","id":16},"target_rings":{"type":"int32","id":17},"current_arrows":{"type":"int32","id":18},"current_rings":{"type":"int32","id":19},"blocks":{"type":"int32","id":20},"random_block":{"type":"int32","id":21},"random_ring_area":{"type":"int32","id":22},"score_slot":{"type":"int32","id":44},"current_energy":{"type":"int32","id":45},"energy_cost_per_sec":{"type":"int32","id":46},"energy_per_hit":{"type":"int32","id":47},"energy_req_percent":{"type":"int32","id":48},"round_time":{"type":"int32","id":50},"shoot_time":{"type":"int32","id":53},"shoot_window_start":{"type":"int64","id":51},"in_shoot_window":{"type":"bool","id":52},"time_limit":{"type":"int32","id":23},"completed":{"type":"bool","id":24},"total_arrows":{"type":"int32","id":25},"duration":{"type":"int32","id":26},"average_ring":{"type":"float","id":27},"stability":{"type":"float","id":28},"max_combo":{"type":"int32","id":29},"total_hits":{"type":"int32","id":30},"delta_total_hits":{"type":"int32","id":31},"delta_duration":{"type":"int32","id":32},"delta_max_combo":{"type":"int32","id":33},"delta_total_rings":{"type":"int32","id":34},"delta_total_arrows":{"type":"int32","id":35},"delta_average_ring":{"type":"float","id":36},"delta_stability":{"type":"float","id":37},"delta_current_energy":{"type":"int32","id":49},"before_exp":{"type":"int32","id":38},"before_level":{"type":"int32","id":39},"current_exp":{"type":"int32","id":40},"level":{"type":"int32","id":41},"upgrade_exp":{"type":"int32","id":42},"calories":{"type":"double","id":43}}},"MatchInfo":{"fields":{"match_id":{"type":"string","id":1},"create_time":{"type":"int64","id":2},"start_time":{"type":"int64","id":3},"server_time":{"type":"int64","id":4},"shoot_time":{"type":"int32","id":5},"shoot_number":{"type":"int32","id":6},"ready_time":{"type":"int32","id":7},"way":{"type":"int32","id":8},"mode":{"type":"int32","id":9},"status":{"type":"MatchStatus","id":10},"status_text":{"type":"string","id":11},"rounds":{"type":"MatchRound","id":12,"rule":"repeated"},"teams":{"type":"TeamInfo","id":13,"keytype":"int32"},"current":{"type":"CurrentShoot","id":14},"next":{"type":"CurrentShoot","id":15},"shoot_data":{"type":"MatchShoot","id":16},"win_team":{"type":"int32","id":17},"mvp":{"type":"PlayerFull","id":18},"room_id":{"type":"string","id":19},"result_list":{"type":"PlayerMatchResult","id":20,"rule":"repeated"},"timeout_time":{"type":"int64","id":21},"target_type":{"type":"int32","id":22},"event_type":{"type":"int32","id":23},"timeout":{"type":"int32","id":24},"server_addr":{"type":"string","id":25},"countdown_start_time":{"type":"int64","id":26}}},"ServerMessage":{"fields":{"type":{"type":"ServerMessageType","id":1},"match_id":{"type":"string","id":2},"timestamp":{"type":"int64","id":3},"match_info":{"type":"MatchInfo","id":4},"shoot_data":{"type":"ShootData","id":5},"practice_info":{"type":"PracticeInfo","id":6},"sequence":{"type":"int64","id":7}}},"ClientMessage":{"fields":{"type":{"type":"ClientMessageType","id":1},"match_id":{"type":"string","id":2},"user_id":{"type":"int64","id":3},"sequence":{"type":"int64","id":4},"data":{"type":"bytes","id":5}}}}}}); +const $root=$protobuf.Root.create({"nested":{"rpc":{"ServerMessageType":{"SERVER_MSG_UNKNOWN":0,"SERVER_MSG_MATCH_READY":1,"SERVER_MSG_MATCH_START":2,"SERVER_MSG_NOW_YOU":3,"SERVER_MSG_SHOT":4,"SERVER_MSG_NEW_ROUND":5,"SERVER_MSG_MATCH_END":6,"SERVER_MSG_TIMEOUT":7,"SERVER_MSG_CHECK":8,"SERVER_MSG_RAND":9,"SERVER_MSG_NOT_ENOUGH_DISTANCE":10,"SERVER_MSG_PLAYER_LEFT":11,"SERVER_MSG_HEARTBEAT":12,"SERVER_MSG_PRACTICE_END":13,"SERVER_MSG_SYNC_PRACTICE_INFO":14,"SERVER_MSG_SYNC_MATCH_INFO":15},"ClientMessageType":{"CLIENT_MSG_UNKNOWN":0,"CLIENT_MSG_HEARTBEAT_ACK":1,"CLIENT_MSG_SHOOT_DATA":2,"CLIENT_MSG_ACK":3,"CLIENT_MSG_LEAVE":4,"CLIENT_MSG_SYNC_PRACTICE_INFO":5,"CLIENT_MSG_SYNC_MATCH_INFO":6},"MatchStatus":{"MATCH_STATUS_READY":0,"MATCH_STATUS_STARTED":1,"MATCH_STATUS_END":2,"MATCH_STATUS_TIMEOUT":3,"MATCH_STATUS_UNEXPECTEDLY":4},"MatchPlayerStatus":{"MATCH_PLAYER_STATUS_READY":0,"MATCH_PLAYER_STATUS_STARTED":1,"MATCH_PLAYER_STATUS_END":2},"MatchShoot":{"fields":{"player_id":{"type":"int64","id":1},"status":{"type":"int32","id":2},"x":{"type":"float","id":3},"y":{"type":"float","id":4},"ring":{"type":"int32","id":5},"ring_x":{"type":"bool","id":6},"angle":{"type":"float","id":7},"distance":{"type":"float","id":8},"three_consecutive_10_rings":{"type":"bool","id":9},"ok":{"type":"bool","id":10},"target_ok":{"type":"bool","id":11}}},"MatchShootList":{"fields":{"items":{"type":"MatchShoot","id":1,"rule":"repeated"}}},"RoundScore":{"fields":{"total_ring":{"type":"int32","id":1},"score":{"type":"int32","id":2},"if_win":{"type":"bool","id":3}}},"MatchRound":{"fields":{"shoots":{"type":"MatchShootList","id":1,"keytype":"int64"},"scores":{"type":"RoundScore","id":2,"keytype":"int32"},"round":{"type":"int32","id":3},"if_gold":{"type":"bool","id":4},"status":{"type":"int32","id":5},"gold_round":{"type":"int32","id":6}}},"PlayerMatchResult":{"fields":{"total_ring":{"type":"int32","id":1},"user_id":{"type":"int64","id":2},"ten_ring_count":{"type":"int32","id":3},"average_ring":{"type":"float","id":4}}},"PlayerFull":{"fields":{"id":{"type":"int64","id":1},"name":{"type":"string","id":2},"avatar":{"type":"string","id":3},"exp":{"type":"int32","id":4},"score":{"type":"int32","id":5},"level":{"type":"int32","id":6},"before_level":{"type":"int32","id":7},"before_exp":{"type":"int32","id":8},"current_exp":{"type":"int32","id":9},"upgrade_exp":{"type":"int32","id":10},"active":{"type":"int32","id":11},"device_id":{"type":"string","id":12},"s_vip":{"type":"bool","id":13},"vip":{"type":"bool","id":14},"player_match_result":{"type":"PlayerMatchResult","id":15},"rank_lvl":{"type":"int32","id":16},"rank_name":{"type":"string","id":17},"rank_icon":{"type":"string","id":18}}},"TeamInfo":{"fields":{"players":{"type":"PlayerFull","id":1,"rule":"repeated"},"id":{"type":"int32","id":2},"name":{"type":"string","id":3},"score":{"type":"int32","id":4}}},"CurrentShoot":{"fields":{"round":{"type":"int32","id":1},"round_id":{"type":"int64","id":2},"index":{"type":"int32","id":3},"start_time":{"type":"int64","id":4},"player_id":{"type":"int64","id":5},"gold_round":{"type":"bool","id":6},"start_time_text":{"type":"string","id":7},"my_index":{"type":"int32","id":8},"index_map":{"type":"int32","id":9,"keytype":"int64"},"ack_time":{"type":"int64","id":10}}},"ShootData":{"fields":{"x":{"type":"float","id":1},"y":{"type":"float","id":2},"r":{"type":"float","id":3},"dst":{"type":"float","id":4},"m":{"type":"string","id":5},"adc":{"type":"float","id":6},"device_id":{"type":"string","id":7},"shoot_id":{"type":"string","id":8},"three_consecutive_10_rings":{"type":"bool","id":9},"target_ok":{"type":"bool","id":10}}},"PracticeInfo":{"fields":{"id":{"type":"int64","id":1},"user_id":{"type":"int64","id":2},"status":{"type":"int32","id":3},"status_text":{"type":"string","id":4},"start_time":{"type":"int64","id":5},"target_type":{"type":"int32","id":6},"vip":{"type":"bool","id":7},"s_vip":{"type":"bool","id":8},"device_id":{"type":"string","id":9},"shoot_data":{"type":"MatchShoot","id":10},"details":{"type":"MatchShoot","id":11,"rule":"repeated"},"training_type":{"type":"string","id":12},"difficulty_level":{"type":"int32","id":13},"hit_req":{"type":"int32","id":14},"arrows_left":{"type":"int32","id":15},"target_arrows":{"type":"int32","id":16},"target_rings":{"type":"int32","id":17},"current_arrows":{"type":"int32","id":18},"current_rings":{"type":"int32","id":19},"blocks":{"type":"int32","id":20},"random_block":{"type":"int32","id":21},"random_ring_area":{"type":"int32","id":22},"score_slot":{"type":"int32","id":44},"current_energy":{"type":"int32","id":45},"energy_cost_per_sec":{"type":"int32","id":46},"energy_per_hit":{"type":"int32","id":47},"energy_req_percent":{"type":"int32","id":48},"round_time":{"type":"int32","id":50},"shoot_time":{"type":"int32","id":53},"shoot_window_start":{"type":"int64","id":51},"in_shoot_window":{"type":"bool","id":52},"time_limit":{"type":"int32","id":23},"completed":{"type":"bool","id":24},"total_arrows":{"type":"int32","id":25},"duration":{"type":"int32","id":26},"average_ring":{"type":"float","id":27},"stability":{"type":"float","id":28},"max_combo":{"type":"int32","id":29},"total_hits":{"type":"int32","id":30},"delta_total_hits":{"type":"int32","id":31},"delta_duration":{"type":"int32","id":32},"delta_max_combo":{"type":"int32","id":33},"delta_total_rings":{"type":"int32","id":34},"delta_total_arrows":{"type":"int32","id":35},"delta_average_ring":{"type":"float","id":36},"delta_stability":{"type":"float","id":37},"delta_current_energy":{"type":"int32","id":49},"ten_ring_count":{"type":"int32","id":54},"delta_ten_ring_count":{"type":"int32","id":55},"before_exp":{"type":"int32","id":38},"before_level":{"type":"int32","id":39},"current_exp":{"type":"int32","id":40},"level":{"type":"int32","id":41},"upgrade_exp":{"type":"int32","id":42},"calories":{"type":"double","id":43}}},"MatchInfo":{"fields":{"match_id":{"type":"string","id":1},"create_time":{"type":"int64","id":2},"start_time":{"type":"int64","id":3},"server_time":{"type":"int64","id":4},"shoot_time":{"type":"int32","id":5},"shoot_number":{"type":"int32","id":6},"ready_time":{"type":"int32","id":7},"way":{"type":"int32","id":8},"mode":{"type":"int32","id":9},"status":{"type":"MatchStatus","id":10},"status_text":{"type":"string","id":11},"rounds":{"type":"MatchRound","id":12,"rule":"repeated"},"teams":{"type":"TeamInfo","id":13,"keytype":"int32"},"current":{"type":"CurrentShoot","id":14},"next":{"type":"CurrentShoot","id":15},"shoot_data":{"type":"MatchShoot","id":16},"win_team":{"type":"int32","id":17},"mvp":{"type":"PlayerFull","id":18},"room_id":{"type":"string","id":19},"result_list":{"type":"PlayerMatchResult","id":20,"rule":"repeated"},"timeout_time":{"type":"int64","id":21},"target_type":{"type":"int32","id":22},"event_type":{"type":"int32","id":23},"timeout":{"type":"int32","id":24},"server_addr":{"type":"string","id":25},"countdown_start_time":{"type":"int64","id":26}}},"ServerMessage":{"fields":{"type":{"type":"ServerMessageType","id":1},"match_id":{"type":"string","id":2},"timestamp":{"type":"int64","id":3},"match_info":{"type":"MatchInfo","id":4},"shoot_data":{"type":"ShootData","id":5},"practice_info":{"type":"PracticeInfo","id":6},"sequence":{"type":"int64","id":7}}},"ClientMessage":{"fields":{"type":{"type":"ClientMessageType","id":1},"match_id":{"type":"string","id":2},"user_id":{"type":"int64","id":3},"sequence":{"type":"int64","id":4},"data":{"type":"bytes","id":5}}}}}}); export default $root; diff --git a/src/utils/matchProtocol.js b/src/utils/matchProtocol.js index 1b36c67..7f57cb8 100644 --- a/src/utils/matchProtocol.js +++ b/src/utils/matchProtocol.js @@ -7,8 +7,8 @@ const { Reader, Writer } = protobuf; // 所以这里使用 minimal Reader/Writer 做静态字段解码和客户端消息编码。 // // 此区块由 scripts/generate-match-schema.mjs 自动生成,请勿手动修改。 -// 来源:src/utils/match.min.js(sha256: a7ab92ae43e405e7) -// 协议命名空间:rpc;消息数:12;字段数:153 +// 来源:src/utils/match.min.js(sha256: fbf97fd3d08ae314) +// 协议命名空间:rpc;消息数:12;字段数:155 export const ServerMessageType = { SERVER_MSG_UNKNOWN: 0, @@ -196,6 +196,8 @@ const SCHEMAS = { 51: { name: "shoot_window_start", kind: "int64" }, 52: { name: "in_shoot_window", kind: "bool" }, 53: { name: "shoot_time", kind: "int32" }, + 54: { name: "ten_ring_count", kind: "int32" }, + 55: { name: "delta_ten_ring_count", kind: "int32" }, }, MatchInfo: { 1: { name: "match_id", kind: "string" },