添加好友机制调整
This commit is contained in:
parent
b0e2c5672c
commit
fd4ab739bf
@ -409,13 +409,13 @@ func ReqGmCommand_(player *Player, Command string) error {
|
||||
case "resetFriend":
|
||||
FriendMod := player.PlayMod.getFriendMod()
|
||||
FriendMod.FriendList = make(map[int]struct{})
|
||||
FriendMod.ApplyList = make(map[int]int64)
|
||||
FriendMod.NewApplyList = make(map[int]*friend.ApplyInfo)
|
||||
FriendMod.Card = make(map[string]*card.CardInfo)
|
||||
FriendMod.SendApply = make(map[int]int64)
|
||||
FriendMod.NewFriendList = make(map[int]*friend.FriendInfo)
|
||||
FriendMod.Npc = []int{}
|
||||
FriendMod.Npc = nil
|
||||
FriendMod.Id = 0
|
||||
FriendMod.Log = make([]*friend.LogInfo, 0)
|
||||
FriendMod.Log = nil
|
||||
FriendMod.InitData()
|
||||
player.FriendListBackData()
|
||||
player.FriendLogBackData()
|
||||
|
||||
@ -346,13 +346,13 @@ func (p *Player) FriendListBackData() {
|
||||
|
||||
func (p *Player) FriendApplyBackData() {
|
||||
FriendMod := p.PlayMod.getFriendMod()
|
||||
al := make([]*proto.ResFriendApplyInfo, 0, len(FriendMod.ApplyList))
|
||||
for k, v := range FriendMod.ApplyList {
|
||||
al := make([]*proto.ResFriendApplyInfo, 0, len(FriendMod.NewApplyList))
|
||||
for k, v := range FriendMod.NewApplyList {
|
||||
ps := G_GameLogicPtr.GetResSimplePlayerByUid(k)
|
||||
if ps != nil {
|
||||
al = append(al, &proto.ResFriendApplyInfo{
|
||||
Player: ps,
|
||||
Time: int32(v),
|
||||
Time: int32(v.Time),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@ -13,3 +13,13 @@ func TestFriendInit(t *testing.T) {
|
||||
t.Error("FriendMod init failed")
|
||||
}
|
||||
}
|
||||
|
||||
func TestFriendApply(t *testing.T) {
|
||||
p1 := new(game.Player)
|
||||
p1.InitPlayer("3625212")
|
||||
FriendMod := p1.GetFriendMod()
|
||||
FriendMod.AddFriendApply(100002, 0)
|
||||
if !FriendMod.CheckApply(100002) {
|
||||
t.Error("FriendMod AddFriendApply failed")
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user