Commit 25f446c8f757608efca9ff2b9dc27cffb97365fe
1 parent
bc483c81
Exists in
master
and in
1 other branch
fix🐛:id算法优化
Showing
2 changed files
with
9 additions
and
2 deletions
Show diff stats
service/roomrank/player.go
| @@ -8,7 +8,7 @@ import ( | @@ -8,7 +8,7 @@ import ( | ||
| 8 | "apigame/util/util-lx/lxalilog" | 8 | "apigame/util/util-lx/lxalilog" |
| 9 | "apigame/util/util-lx/lxtime" | 9 | "apigame/util/util-lx/lxtime" |
| 10 | "apigame/util/utstring" | 10 | "apigame/util/utstring" |
| 11 | - "github.com/google/uuid" | 11 | + "apigame/util/utuuid" |
| 12 | ) | 12 | ) |
| 13 | 13 | ||
| 14 | func tryInitPlayer(gameId string, player *Player) { | 14 | func tryInitPlayer(gameId string, player *Player) { |
| @@ -49,7 +49,7 @@ func LoadPlayer(gameId string, playerUid int64, topType int) (player *Player) { | @@ -49,7 +49,7 @@ func LoadPlayer(gameId string, playerUid int64, topType int) (player *Player) { | ||
| 49 | func NewRoomRobot(gameId string, robotConfigId int, userType int) *RoomPlayer { | 49 | func NewRoomRobot(gameId string, robotConfigId int, userType int) *RoomPlayer { |
| 50 | d := &RoomPlayer{ | 50 | d := &RoomPlayer{ |
| 51 | //Uid: rand.Int63(), | 51 | //Uid: rand.Int63(), |
| 52 | - Uid: int64(uuid.New().ID()), | 52 | + Uid: int64(utuuid.GetUint32()), |
| 53 | Name: svcommon.GetName(gameId), | 53 | Name: svcommon.GetName(gameId), |
| 54 | Icon: svcommon.GetAvatar(gameId), | 54 | Icon: svcommon.GetAvatar(gameId), |
| 55 | Score: 0, | 55 | Score: 0, |