1
This commit is contained in:
parent
e16035737d
commit
37574f5bd8
@ -322,6 +322,10 @@ func (this *friendMgr) AsyncAddBlack(senderId string, targetId string, cb func(i
|
||||
cb(0, "")
|
||||
return
|
||||
}
|
||||
if senderId == targetId {
|
||||
cb(1, "")
|
||||
return
|
||||
}
|
||||
nowTime := f5.GetApp().GetNowSeconds()
|
||||
f5.GetJsStyleDb().Upsert(
|
||||
constant.FRIEND_DB,
|
||||
|
@ -305,9 +305,38 @@ func (this *player) CMDeleteFriendShip(hdr *f5.MsgHdr, msg *cs.CMDeleteFriendShi
|
||||
}
|
||||
|
||||
func (this *player) CMAddBlacklist(hdr *f5.MsgHdr, msg *cs.CMAddBlacklist) {
|
||||
rspMsg := new(cs.SMAddBlacklist)
|
||||
GetFriendMgr().AsyncAddBlack(
|
||||
this.GetAccountId(),
|
||||
msg.GetTargetAccountId(),
|
||||
func (errCode int32, errMsg string) {
|
||||
if errCode != 0 {
|
||||
this.SendMsg(rspMsg.Err(500, "server internal error"))
|
||||
return
|
||||
}
|
||||
this.SendMsg(rspMsg.Err(errCode, errMsg))
|
||||
})
|
||||
}
|
||||
|
||||
func (this *player) CMRemoveBlacklist(hdr *f5.MsgHdr, msg *cs.CMRemoveBlacklist) {
|
||||
rspMsg := new(cs.SMRemoveBlacklist)
|
||||
f5.NewLockAsyncTask(
|
||||
[][]string{
|
||||
{constant.MEMBER_LOCK_KEY, this.GetAccountId()},
|
||||
{constant.MEMBER_LOCK_KEY, msg.GetTargetAccountId()},
|
||||
},
|
||||
func (cb *f5.LockAsyncTask) {
|
||||
GetFriendMgr().AsyncRemoveBlack(
|
||||
this.GetAccountId(),
|
||||
msg.GetTargetAccountId(),
|
||||
func (errCode int32, errMsg string) {
|
||||
if errCode != 0 {
|
||||
this.SendMsg(rspMsg.Err(500, "server internal error"))
|
||||
return
|
||||
}
|
||||
this.SendMsg(rspMsg)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
func (this *player) CMInviteFriendMsg(hdr *f5.MsgHdr, msg *cs.CMInviteFriendMsg) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user