public void UpdateRoyalData(royal_box_info _data) { if (serverdata != null) { serverdata.id = _data.id; serverdata.rest_time = _data.rest_time; serverdata.type = _data.type; serverdata.active = _data.active; } else { serverdata = _data; } }
protected void S2C_ReplyBoxData(Pt _msg) { //Debug.Log("S2C_ReplyBoxData"); pt_reply_royal_box_list_d941 msg = _msg as pt_reply_royal_box_list_d941; if (msg != null) { royalTreasureDic.Clear(); restActiveTimes = (int)msg.rest_acc_times; isOpeningBox = false; for (int i = 0; i < msg.box_list.Count; i++) { royal_box_info data = msg.box_list[i]; //Debug.Log(ConfigMng.Instance.GetRoyalBoxRef((int)data.type).boxItemID); if (data.active == 1)//当前有一个宝箱正在开启 { //Debug.Log("已经开启剩余时间=" + data.rest_time); timeGap = Time.realtimeSinceStartup; if (data.rest_time > 0.00) { isOpeningBox = true; } RoyalBoxRef royalBoxRef = ConfigMng.Instance.GetRoyalBoxRef((int)data.type); //发送消息推送(只发送一次,就在刚开启的时候发送) if (royalBoxRef != null && data.rest_time == royalBoxRef.time) { DateTime newServerTime = GameCenter.instance.CurServerTime; DateTime endTime = newServerTime.AddSeconds((int)data.rest_time); string time = string.Format("{0:D2}:{1:D2}:{2:D2}", endTime.Hour, endTime.Minute, endTime.Second); GameCenter.messageMng.SendPushInfo(2, 1, time); } } if (!royalTreasureDic.ContainsKey(data.id)) { RoyalTreaureData royalData = new RoyalTreaureData(data); royalTreasureDic[data.id] = royalData; } //if(royalTreasureDic.Count>=4)//宝箱位只有4个超过4个提示宝箱格已满 //{ // GameCenter.messageMng.AddClientMsg(486); //} } } if (OnRoyalBoxUpdate != null) { OnRoyalBoxUpdate(); } }
public RoyalTreaureData(royal_box_info _data) { serverdata = _data; }