public void OnClickApprove() { C2G.FriendsApprove packet = new C2G.FriendsApprove(); packet.account_idx = m_Info.account_idx; packet.is_all = false; Network.GameServer.JsonAsync <C2G.FriendsApprove, C2G.FriendsAckBase>(packet, OnFriendsApproveHandler); }
public void OnClickApproveAll() { if (m_Friends.Count == 0) { return; } C2G.FriendsApprove packet = new C2G.FriendsApprove(); packet.account_idx = 0; packet.is_all = true; Network.GameServer.JsonAsync <C2G.FriendsApprove, C2G.FriendsAckBase>(packet, OnFriendsApproveHandler); }
void OnFriendsApproveHandler(C2G.FriendsApprove packet, C2G.FriendsAckBase ack) { switch (ack.result) { case pe_FriendsResult.Success: StateInfo.state = eFriendsState.Friends; gameObject.SetActive(false); if (OnCallback != null) { OnCallback(m_Info); } break; default: Friends.ShowFriendsErrorTooltip(ack.result); break; } }
void OnFriendsApproveHandler(C2G.FriendsApprove packet, C2G.FriendsAckBase ack) { switch (ack.result) { case pe_FriendsResult.Success: m_Friends.ForEach(e => e.state_info.state = eFriendsState.Friends); m_FriendsList.AddRange(m_Friends); m_Friends.Clear(); InitItem(); Network.Instance.NotifyMenu.is_friends_requested = false; UpdateNotify(); break; default: ShowFriendsErrorTooltip(ack.result); break; } }