Commit bafcce8049bfcac3dd4d7b93b0b9bb938217de5d

Authored by 王家文
1 parent b8dfef84
Exists in master and in 1 other branch dev-wjw

feat✨:排行榜功能 排序规则细化

service/roomrank/dto-room.go
@@ -43,7 +43,7 @@ type RoomPlayer struct { @@ -43,7 +43,7 @@ type RoomPlayer struct {
43 Name string // 玩家名字 43 Name string // 玩家名字
44 Icon string // 玩家头像 44 Icon string // 玩家头像
45 Score int64 // 玩家排行分数 45 Score int64 // 玩家排行分数
46 - JoinTime int64 // 加入时间 46 + JoinTime int64 // 加入时间不改命名 改成最后更新分数的时间
47 UserType int // 用户类型 -1=原生配置机器人 47 UserType int // 用户类型 -1=原生配置机器人
48 RobotConfigId int // 0=玩家 48 RobotConfigId int // 0=玩家
49 } 49 }
service/roomrank/logic.go
@@ -3,6 +3,7 @@ package roomrank @@ -3,6 +3,7 @@ package roomrank
3 import ( 3 import (
4 "apigame/configs/confroomrank" 4 "apigame/configs/confroomrank"
5 "apigame/service-common/svconst" 5 "apigame/service-common/svconst"
  6 + "apigame/util/util-lx/lxtime"
6 "apigame/util/utstring" 7 "apigame/util/utstring"
7 "apigame/util/ztime" 8 "apigame/util/ztime"
8 "fmt" 9 "fmt"
@@ -120,6 +121,7 @@ func UpdatePlayerScore(room *Room, player *Player) { @@ -120,6 +121,7 @@ func UpdatePlayerScore(room *Room, player *Player) {
120 p.Name = player.Name 121 p.Name = player.Name
121 p.Icon = player.Icon 122 p.Icon = player.Icon
122 p.Score = player.Score 123 p.Score = player.Score
  124 + p.JoinTime = lxtime.NowUninx()
123 return 125 return
124 } 126 }
125 } 127 }