195 lines
4.9 KiB
Go
195 lines
4.9 KiB
Go
package rdbkey
|
|
|
|
import (
|
|
"fmt"
|
|
"samba/util/config"
|
|
"strings"
|
|
)
|
|
|
|
// RedisBaseInfo
|
|
func BaseUserKey(uid int64) string {
|
|
return fmt.Sprintf("userinfo|base|%v", uid)
|
|
}
|
|
|
|
// 玩家所在的所有俱乐部id set集 RedisBaseInfo
|
|
func UserInClubKey(uid int64) string {
|
|
return fmt.Sprintf("clublist|%v", uid)
|
|
}
|
|
|
|
// 俱乐部在线玩家 RedisBaseInfo
|
|
func ClubMemberOnlineKey(clubId int) string {
|
|
return fmt.Sprintf("club|%v|online", clubId)
|
|
}
|
|
|
|
// 俱乐部在玩玩家 RedisBaseInfo
|
|
func ClubMemberPlayingKey(clubId int) string {
|
|
return fmt.Sprintf("club|%v|playing", clubId)
|
|
}
|
|
|
|
// 玩家俱乐部信息(俱乐部币等) RedisMoney
|
|
func UserClubKey(uid int64, clubId int) string {
|
|
return fmt.Sprintf("club|user|%v|%v", uid, clubId)
|
|
}
|
|
|
|
// 俱乐部信息(名称等) RedisBaseInfo
|
|
func ClubKey(clubId int) string {
|
|
return fmt.Sprintf("clubinfo|%v", clubId)
|
|
}
|
|
|
|
// 俱乐部等级表 RedisConfig
|
|
func ClubLevelKey() string {
|
|
return "club|config|level"
|
|
}
|
|
|
|
// 俱乐部管理员权限 RedisBaseInfo
|
|
func ClubPermissionsKey(clubId int) string {
|
|
return fmt.Sprintf("clubu|perm|%v", clubId)
|
|
}
|
|
|
|
// 俱乐部创建的玩法 RedisConfig
|
|
func ClubPlayInfoKey(clubId int) string {
|
|
return fmt.Sprintf("club|playinfo|%v", clubId)
|
|
}
|
|
|
|
// 俱乐部当前正在玩的房间信息 RedisBaseInfo
|
|
func ClubPlayingRoomKey(clubId int) string {
|
|
if strings.Contains(config.Cmd.ConfigPath, "_dev") {
|
|
return fmt.Sprintf("club|playing|room|dev|%v", clubId)
|
|
}
|
|
return fmt.Sprintf("club|playing|room|%v", clubId)
|
|
}
|
|
|
|
// 俱乐部玩家获取和保存最近游玩的房间 RedisBaseInfo
|
|
func UserQuickMatchKey(uid int64) string {
|
|
return fmt.Sprintf("user-quick-match|%v", uid)
|
|
}
|
|
|
|
// 机器人id集 RedisBaseInfo
|
|
func RobotIdSetKey() string {
|
|
return fmt.Sprintf("robot|ids")
|
|
}
|
|
|
|
// 俱乐部机器人id集 RedisBaseInfo
|
|
func ClubRobotIdSetKey() string {
|
|
return "robot|club|ids"
|
|
}
|
|
|
|
// 机器人信息 RedisBaseInfo
|
|
func RobotInfoKey(uid int64) string {
|
|
return fmt.Sprintf("robot|%d", uid)
|
|
}
|
|
|
|
// 用户资源表 RedisMoney
|
|
func UserResourceKey(uid int64) string {
|
|
return fmt.Sprintf("user|resource|%v", uid)
|
|
}
|
|
|
|
// 记录玩家当前所有游戏房间 RedisBaseInfo
|
|
func UserPlayingRoomKey(uid int64) string {
|
|
return fmt.Sprintf("user-playing-room|%v", uid)
|
|
}
|
|
|
|
// 每个房间的玩家集合 RedisBaseInfo
|
|
func RoomTypePlayerNumKey(roomType int) string {
|
|
return fmt.Sprintf("room-type|%v", roomType)
|
|
}
|
|
|
|
// 俱乐部在玩的玩家集合 RedisBaseInfo
|
|
func ClubRoomPlayerNumKey() string {
|
|
return "club-player"
|
|
}
|
|
|
|
// ClubWaitingRoomKey 俱乐部等待房间列表 RedisBaseInfo
|
|
func ClubWaitingRoomKey(clubId int) string {
|
|
return fmt.Sprintf("club-waiting-room|%d", clubId)
|
|
}
|
|
|
|
// 机器人金币池 RedisMoney
|
|
func RobotCoinPoolKey(roomType int) string {
|
|
return fmt.Sprintf("robot-coin-pool|%v", roomType)
|
|
}
|
|
|
|
// 机器人俱乐部积分池 RedisMoney
|
|
func RobotClubScorePoolKey() string {
|
|
return "robot-club-score-pool"
|
|
}
|
|
|
|
// 房间游戏数据汇总 php日志分析 RedisGameLog
|
|
func TrucoRoomGameKey(roomType int) string {
|
|
return fmt.Sprintf("game-log|%v", roomType)
|
|
}
|
|
|
|
// 在线人数-分渠道 RedisGameLog
|
|
func OnlineUserKey(ch int) string {
|
|
return fmt.Sprintf("online_user|total|%v", ch)
|
|
}
|
|
|
|
// 最新服务记录
|
|
func ServiceKey() string {
|
|
return fmt.Sprintf("service|%v", config.Config.Rabbitmq.VHost)
|
|
}
|
|
|
|
// RedeemCodeKey 兑换码Key RedisBaseInfo
|
|
func RedeemCodeKey() string {
|
|
return "redeem-code"
|
|
}
|
|
|
|
// RedeemCodeUsedKey 兑换码使用次数记录Key RedisBaseInfo
|
|
func RedeemCodeUsedKey() string {
|
|
return "redeem-code-use"
|
|
}
|
|
|
|
// RedeemCodeUseKey 兑换码使用记录key RedisBaseInfo
|
|
//
|
|
// 存放兑换码中所有用户的使用记录
|
|
func RedeemCodeUseKey(code string) string {
|
|
return fmt.Sprintf("redeem-code-use|%s", code)
|
|
}
|
|
|
|
// RedeemCodeUserUseKey 用户兑换码使用记录key RedisBaseInfo
|
|
//
|
|
// 存放用户使用过的所有兑换码记录
|
|
func RedeemCodeUserUseKey(uid int64) string {
|
|
return fmt.Sprintf("redeem-code-user-use|%d", uid)
|
|
}
|
|
|
|
// RealPlayerGameKey 记录最新的真人对局时间戳 RedisGameLog
|
|
func RealPlayerGameKey() string {
|
|
return "real-player-game"
|
|
}
|
|
|
|
// PlayGameKey 记录最新的对局时间戳 RedisGameLog
|
|
func PlayGameKey() string {
|
|
return "play-game"
|
|
}
|
|
|
|
// CurrentOnlineUserKey 记录当前在线人数 RedisGameLog
|
|
func CurrentOnlineUserKey() string {
|
|
return "current-online-user"
|
|
}
|
|
|
|
// RoomPlayingNumKey 房间在玩人数 RedisBaseInfo (hash key:roomType-(fake or real) value:人数)
|
|
func RoomPlayingNumKey() string {
|
|
return "room-playing-num"
|
|
}
|
|
|
|
// UserLuckyPointKey 用户幸运值 RedisBaseInfo
|
|
func UserLuckyPointKey(uid int64) string {
|
|
return fmt.Sprintf("user-lucky-point|%d", uid)
|
|
}
|
|
|
|
// UserMStatKey 用户mstat RedisBaseInfo
|
|
func UserMStatKey(uid int64) string {
|
|
return fmt.Sprintf("mstat_%d", uid)
|
|
}
|
|
|
|
// UserLossStreakKey 用户连败计数 RedisGameLog
|
|
func UserLossStreakKey() string {
|
|
return fmt.Sprintf("loss-streak")
|
|
}
|
|
|
|
// UserBankruptStreakKey 用户连续破产计数 RedisGameLog
|
|
func UserBankruptStreakKey() string {
|
|
return fmt.Sprintf("bankrupt-streak")
|
|
}
|