public override bool TakeAction() { UserBasisCache dest = UserHelper.FindUserBasis(destuid); UserFriendsCache destFriends = UserHelper.FindUserFriends(destuid); FriendApplyData apply = GetFriends.FindFriendApply(destuid); if (apply == null) { receipt = RequestFriendResult.NoApply; return(true); } if (result == EventStatus.Good) { if (GetFriends.IsFriendNumFull()) { receipt = RequestFriendResult.FriendNumFull; } else if (GetFriends.IsHaveFriend(destuid)) { receipt = RequestFriendResult.HadFriend; } else if (destFriends.IsFriendNumFull()) { receipt = RequestFriendResult.DestFriendNumFull; } else { receipt = RequestFriendResult.OK; GetFriends.AddFriend(destuid); destFriends.AddFriend(Current.UserId); PushMessageHelper.NewFriendNotification(GameSession.Get(destuid), Current.UserId); PushMessageHelper.NewFriendNotification(Current, destuid); } } GetFriends.ApplyList.Remove(apply); return(true); }
public override bool TakeAction() { UserBasisCache dest = UserHelper.FindUserBasis(destuid); UserFriendsCache destFriends = UserHelper.FindUserFriends(destuid); if (GetFriends.IsFriendNumFull()) { receipt = RequestFriendResult.FriendNumFull; } else if (destFriends.IsFriendNumFull()) { receipt = RequestFriendResult.DestFriendNumFull; } else if (GetFriends.IsHaveFriend(destuid)) { receipt = RequestFriendResult.HadFriend; } else if (destFriends.IsHaveFriendApply(Current.UserId)) { receipt = RequestFriendResult.HadApply; } else { receipt = RequestFriendResult.OK; destFriends.AddFriendApply(Current.UserId); var session = GameSession.Get(destuid); PushMessageHelper.NewFriendRequestNotification(GameSession.Get(destuid), Current.UserId); //GetFriends.AddFriend(destuid); //destFriends.AddFriend(Current.UserId); //PushMessageHelper.NewFriendNotification(GameSession.Get(destuid), Current.UserId); //PushMessageHelper.NewFriendNotification(Current, destuid); } return(true); }