playroom优化
This commit is contained in:
parent
099d7793f0
commit
55f44293a2
@ -641,9 +641,8 @@ func BackChampship(p *Player) {
|
||||
|
||||
func GetVisitorPlayer(p *Player) int {
|
||||
PlayroomMod := p.PlayMod.getPlayroomMod()
|
||||
VisitorList := PlayroomMod.GetVisitor()
|
||||
HasVisit := PlayroomMod.GetHasVisit()
|
||||
TodayVisitedUsers := PlayroomMod.GetTodayVisitedUsers()
|
||||
VisitorList := PlayroomMod.GetVisitor() // 到访用户
|
||||
TodayVisitedUsers := PlayroomMod.GetTodayVisitedUsers() // 今日已互动用户
|
||||
FriendMod := p.PlayMod.getFriendMod()
|
||||
type sortData struct {
|
||||
Uid int
|
||||
@ -652,10 +651,16 @@ func GetVisitorPlayer(p *Player) int {
|
||||
PlayerList := make([]sortData, 0)
|
||||
PlayerList2 := make([]sortData, 0)
|
||||
Now := GoUtil.Now()
|
||||
/**
|
||||
排除当日玩家已对其发起过交互的用户
|
||||
优先选择24小时内曾经与玩家进行过宠物交互的好友
|
||||
若存在复数对象的情况下,优先选择交互发生时间与当前时间最近的好友
|
||||
若不存在符合条件的用户,则选择24小时内曾经与玩家进行过宠物交互的陌生用户
|
||||
若存在复数对象的情况下,优先选择交互发生时间与当前时间最近的用户
|
||||
若不存在符合条件的用户,则选择24小时内登入过游戏且上次登入时间与当前时间最近的好友
|
||||
若不存在符合条件的用户,则依据以上用户推荐算法,选择一位随机推荐用户,并且在下次触发式订单完成时,不再排除已发起过交互的用户
|
||||
*/
|
||||
for k, v := range VisitorList {
|
||||
if _, ok := HasVisit[k]; ok {
|
||||
continue
|
||||
}
|
||||
if GoUtil.InArray(k, TodayVisitedUsers) {
|
||||
continue
|
||||
}
|
||||
@ -694,11 +699,12 @@ func GetVisitorPlayer(p *Player) int {
|
||||
if ps == nil {
|
||||
continue
|
||||
}
|
||||
if GoUtil.Now()-ps.Loginout <= 86400 { // 24小时内登录过
|
||||
if ps.Loginout > recentLoginTime {
|
||||
recentLoginTime = ps.Loginout
|
||||
recentFriendUid = uid
|
||||
}
|
||||
if GoUtil.Now()-ps.Loginout > 86400 { // 24小时内登录过
|
||||
continue
|
||||
}
|
||||
if ps.Loginout > recentLoginTime {
|
||||
recentLoginTime = ps.Loginout
|
||||
recentFriendUid = uid
|
||||
}
|
||||
}
|
||||
if recentFriendUid != 0 {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user