public void OnRecvMailReward() { if (mail_info.rewards.Count > 0 == true && mail_info.used_reward == false) { C2G.MailReward packet = new C2G.MailReward(); packet.mail_idx = mail_info.mail_idx; packet.rewards = mail_info.rewards; Network.GameServer.JsonAsync <C2G.MailReward, C2G.MailRewardAck>(packet, MailRewardHandler); } else { OnClose(); } }
void MailRewardHandler(C2G.MailReward send, C2G.MailRewardAck recv) { Network.Instance.ProcessReward3Ack(recv.reward_ack); MailManager.Instance.SetRewarded(send.mail_idx); GameMain.Instance.UpdateNotify(false); OnClose(); List <RewardBase> rewards = send.rewards.Select(r => new RewardBase(r.reward_idn, r.reward_value)).ToList(); Popup.Instance.Show(ePopupMode.Reward, rewards, mail_info.title, Localization.Get("GetThisRewards"), recv.reward_ack, m_parms[1]); Network.Instance.SetUnreadMail(MailManager.Instance.GetUnreadState()); }