private void OnRequest(InviteData invite) //请求加好友 { if (invite.Catalog == InvitesMessage.FRIEND_OPERATE) { var sender = MyFriends.Find(invite.SenderUid); if (sender != null) { EB.Debug.LogError("already is my friend uid={0}", invite.SenderUid); return; //Applys.Add(sender); } if (invite.SenderUid != AllianceUtil.GetLocalUid() && Applys.Find(invite.SenderUid) == null) { Info.ApplyCount++; Messenger.Raise(Hotfix_LT.EventName.FriendApplyEvent, true); //MarkDirty(ApplyListId); GetApplyList(); } } }
public void Add(long uid, string verifyInfo, System.Action <bool> callback) { if (Instance.CheckBeblack(uid)) { return; } if (MyFriends.Find(uid) != null) { MessageTemplateManager.ShowMessage(CodeHasFriend); return; } Api.ExceptionFun = (string error) => { if (error.Equals("send Invite too much")) { MessageTemplateManager.ShowMessage(eMessageUIType.MessageDialogue_1, EB.Localizer.GetString("ID_codefont_in_FriendManager_17152")); return(true); } return(false); }; Api.Add(uid, verifyInfo, delegate(EB.Sparx.Response response) { if (response != null) { FetchDataHandler(response); callback(response.sucessful); } else { callback(false); } }); }