/// <summary> /// 好友上线或下线的处理 /// </summary> /// <param name="response"></param> public void OnFriendStateChange(OperationResponse response) { DtoFriend friend = JsonMapper.ToObject <DtoFriend>(response.Parameters[(byte)ParameterCode.DtoFriend] as string); FriendListPanel panel = (FriendListPanel)UIManager.Instance.GetPanel(UIPanelType.FriendList); panel.UpdateFriendItem(friend); }
/// <summary> /// 获取添加好友的结果 /// </summary> /// <param name="response"></param> public void OnAddResult(OperationResponse response) { if (response.ReturnCode == (short)ReturnCode.Falied) { // 对方拒绝了 但我什么也不敢做 } else if (response.ReturnCode == (short)ReturnCode.Suceess) { // 添加新的好友 DtoFriend friend = JsonMapper.ToObject <DtoFriend>(response.Parameters[(byte)ParameterCode.DtoFriend] as string); FriendListPanel panel = (FriendListPanel)UIManager.Instance.GetPanel(UIPanelType.FriendList); panel.AddFriend(friend); } }