Merge branch 'develop' into sdk
This commit is contained in:
commit
90ee76bbce
@ -300,3 +300,15 @@ func Rand6DigitNumber() string {
|
||||
n := rand.Intn(1000000)
|
||||
return fmt.Sprintf("%06d", n)
|
||||
}
|
||||
|
||||
func UniqueInts(input []int) []int {
|
||||
seen := make(map[int]struct{})
|
||||
result := make([]int, 0, len(input))
|
||||
for _, v := range input {
|
||||
if _, ok := seen[v]; !ok {
|
||||
seen[v] = struct{}{}
|
||||
result = append(result, v)
|
||||
}
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
@ -1462,12 +1462,6 @@ func ReqSearchPlayer(player *Player, buf []byte) error {
|
||||
if player.M_DwUin == v.DwUin {
|
||||
continue
|
||||
}
|
||||
if player.PlayMod.getFriendMod().CheckFriend(int(v.DwUin)) {
|
||||
continue
|
||||
}
|
||||
if player.PlayMod.getFriendMod().CheckSendApply(int(v.DwUin)) {
|
||||
continue
|
||||
}
|
||||
SearchPlayer := G_GameLogicPtr.GetResSimplePlayerByUid(int(v.DwUin))
|
||||
list = append(list, SearchPlayer)
|
||||
|
||||
@ -3143,6 +3137,7 @@ func ReqPlayroomInfo(player *Player, buf []byte) error {
|
||||
RandList = append(RandList, v)
|
||||
}
|
||||
}
|
||||
RandList = GoUtil.UniqueInts(RandList)
|
||||
if len(RandList) == 0 {
|
||||
PlayroomMod.SetGameReward(0, 0, Star)
|
||||
} else if len(RandList) == 1 {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user