playroom过滤今天已拜访过的好友

This commit is contained in:
hahwu 2025-07-08 17:57:32 +08:00
parent 1714e9d27e
commit 054cbdf1e8
3 changed files with 59 additions and 44 deletions

View File

@ -656,6 +656,7 @@ func GetVisitorPlayer(p *Player) int {
PlayroomMod := p.PlayMod.getPlayroomMod() PlayroomMod := p.PlayMod.getPlayroomMod()
VisitorList := PlayroomMod.GetVisitor() VisitorList := PlayroomMod.GetVisitor()
HasVisit := PlayroomMod.GetHasVisit() HasVisit := PlayroomMod.GetHasVisit()
TodayVisitedUsers := PlayroomMod.GetTodayVisitedUsers()
FriendMod := p.PlayMod.getFriendMod() FriendMod := p.PlayMod.getFriendMod()
type sortData struct { type sortData struct {
Uid int Uid int
@ -668,6 +669,9 @@ func GetVisitorPlayer(p *Player) int {
if _, ok := HasVisit[k]; ok { if _, ok := HasVisit[k]; ok {
continue continue
} }
if GoUtil.InArray(k, TodayVisitedUsers) {
continue
}
if v.Time < Now-86400 { if v.Time < Now-86400 {
continue continue
} }
@ -696,6 +700,9 @@ func GetVisitorPlayer(p *Player) int {
if uid == int(p.M_DwUin) { if uid == int(p.M_DwUin) {
continue continue
} }
if GoUtil.InArray(uid, TodayVisitedUsers) {
continue
}
ps := G_GameLogicPtr.GetSimplePlayerByUid(uid) ps := G_GameLogicPtr.GetSimplePlayerByUid(uid)
if ps == nil { if ps == nil {
continue continue

View File

@ -3219,7 +3219,7 @@ func ReqPlayroomSetRoom(player *Player, buf []byte) error {
return nil return nil
} }
// 玩游戏 Desprecated // 玩游戏
func ReqPlayroomGame(player *Player, buf []byte) error { func ReqPlayroomGame(player *Player, buf []byte) error {
req := &msg.ReqPlayroomGame{} req := &msg.ReqPlayroomGame{}
proto.Unmarshal(buf, req) proto.Unmarshal(buf, req)
@ -3261,6 +3261,7 @@ func ReqPlayroomGame(player *Player, buf []byte) error {
Type: MsqMod.HANDLE_TYPE_PLAYROOM_GAME, Type: MsqMod.HANDLE_TYPE_PLAYROOM_GAME,
SendT: GoUtil.Now(), SendT: GoUtil.Now(),
}) })
PlayroomMod.ResetGame()
player.PlayMod.save() player.PlayMod.save()
ItemsMsg := make(map[int32]*msg.ItemInfo, 0) ItemsMsg := make(map[int32]*msg.ItemInfo, 0)
for k, v := range PlayroomMod.GameReward { for k, v := range PlayroomMod.GameReward {

View File

@ -12,49 +12,50 @@ import (
) )
type PlayroomMod struct { type PlayroomMod struct {
Collect map[int]int // 装饰 Collect map[int]int // 装饰
Room map[int]int // 房间 Room map[int]int // 房间
Dress map[int][]int // 服装仓库 Dress map[int][]int // 服装仓库
DressSet map[int]int // 服装穿戴 DressSet map[int]int // 服装穿戴
PetAir []int // 宠物空气背包 PetAir []int // 宠物空气背包
PetAirSet int // 宠物空气背包穿戴 PetAirSet int // 宠物空气背包穿戴
Status int // 0: 未拜访 1: 拜访 Status int // 0: 未拜访 1: 拜访
Endtime int64 // 结束时间 Endtime int64 // 结束时间
Starttime int64 // 开始时间 Starttime int64 // 开始时间
WorkStatus int // 0: 未开始 1: 进行中 2: 结束 WorkStatus int // 0: 未开始 1: 进行中 2: 结束
Visitor map[int]*Info // 访客 Visitor map[int]*Info // 访客
MoodInfo map[int]*Mood // 心情 MoodInfo map[int]*Mood // 心情
AllMood int // 总心情 AllMood int // 总心情
Reward []*item.Item // 奖励 Reward []*item.Item // 奖励
DayFirstT int // 每日未首次触发次数 DayFirstT int // 每日未首次触发次数
Trigger int // 未触发次数 Trigger int // 未触发次数
TriggerTime int64 // 触发时间 TriggerTime int64 // 触发时间
HasVisit map[int]int64 // 今日已拜访的玩家 HasVisit map[int]int64 // 今日已拜访的玩家
Target int // 拜访的目标 Target int // 拜访的目标
GameId int // 游戏ID GameId int // 游戏ID
GameReward map[int]*item.Item // 游戏奖励 GameReward map[int]*item.Item // 游戏奖励
GameStatus int // 游戏状态 GameStatus int // 游戏状态
GameInfo map[int]interface{} // 游戏信息 GameInfo map[int]interface{} // 游戏信息
Exclude bool // 是否排除 Exclude bool // 是否排除
LoseItem []*item.Item // 失去的物品 LoseItem []*item.Item // 失去的物品
ChipList []*ChipInfo // 碎片列表 ChipList []*ChipInfo // 碎片列表
Flip map[int]int // 翻牌 Flip map[int]int // 翻牌
FlipReward []*item.Item // 翻牌奖励 FlipReward []*item.Item // 翻牌奖励
WorkOutline int // 是否离线 WorkOutline int // 是否离线
LastFlip int // 上次翻牌奖励档次 LastFlip int // 上次翻牌奖励档次
NoFlip int // 连续未获取最高翻牌奖励次数 NoFlip int // 连续未获取最高翻牌奖励次数
TodayFlip bool // 今日是否已获得最高档奖励 TodayFlip bool // 今日是否已获得最高档奖励
JackpotNum int // 每日转盘数量 JackpotNum int // 每日转盘数量
Upvote int // 收到点赞次数 Upvote int // 收到点赞次数
UpvoteList []int // 点赞列表 UpvoteList []int // 点赞列表
RoomPoint int // 房间点数 RoomPoint int // 房间点数
UnlockList map[int]int64 // 解锁 UnlockList map[int]int64 // 解锁
DailyTask map[int]*DailyTask // 每日任务 DailyTask map[int]*DailyTask // 每日任务
DailyTaskReward []int // 每日任务奖励 DailyTaskReward []int // 每日任务奖励
Physiology map[int]*Physiology Physiology map[int]*Physiology
InteractNum int // 互动次数 InteractNum int // 互动次数
RevengeUid int64 // 复仇Uid RevengeUid int64 // 复仇Uid
FilterVisitor bool // 是否过滤访客 FilterVisitor bool // 是否过滤访客
TodayVisitedUsers []int // 今日已拜访过的用户
} }
type DailyTask struct { type DailyTask struct {
@ -190,6 +191,7 @@ func (p *PlayroomMod) ZeroUpdate() {
p.JackpotNum = playroomCfg.GetJackpotNum() p.JackpotNum = playroomCfg.GetJackpotNum()
p.UpvoteList = make([]int, 0) p.UpvoteList = make([]int, 0)
p.DailyTaskReward = make([]int, 0) p.DailyTaskReward = make([]int, 0)
p.TodayVisitedUsers = make([]int, 0)
p.InitDailyTask() p.InitDailyTask()
} }
@ -281,6 +283,10 @@ func (p *PlayroomMod) GetHasVisit() map[int]int64 {
return p.HasVisit return p.HasVisit
} }
func (p *PlayroomMod) GetTodayVisitedUsers() []int {
return p.TodayVisitedUsers
}
func (p *PlayroomMod) GetMood() map[int]int { func (p *PlayroomMod) GetMood() map[int]int {
Mood := make(map[int]int) Mood := make(map[int]int)
for k, v := range p.MoodInfo { for k, v := range p.MoodInfo {
@ -460,6 +466,7 @@ func (p *PlayroomMod) AddDress(Id int) {
} }
func (p *PlayroomMod) ResetGame() { func (p *PlayroomMod) ResetGame() {
p.TodayVisitedUsers = append(p.TodayVisitedUsers, p.Target)
p.Target = 0 p.Target = 0
p.Status = STATUS_IDLE p.Status = STATUS_IDLE
p.GameId = 0 p.GameId = 0