| | |
| | | {
|
| | | serverInited = false;
|
| | | m_RedEnvelopeDict.Clear();
|
| | | redpacks.Clear();
|
| | | }
|
| | |
|
| | | bool serverInited = false;
|
| | |
|
| | | private Dictionary<int, RedEnvelope> m_RedEnvelopeDict = new Dictionary<int, RedEnvelope>();
|
| | | Dictionary<int, RedEnvelope> m_RedEnvelopeDict = new Dictionary<int, RedEnvelope>();
|
| | | Dictionary<int, List<int>> redpacks = new Dictionary<int, List<int>>();
|
| | |
|
| | | public event Action EnvelopeUpdateEvent;
|
| | | public event Action<int> EnvelopeGetEvent;
|
| | |
| | | state = info.State,
|
| | | Wish = UIHelper.ServerStringTrim(info.Wish)
|
| | | };
|
| | |
|
| | | List<int> list;
|
| | | if (!redpacks.TryGetValue(info.GetWay, out list))
|
| | | {
|
| | | list = new List<int>();
|
| | | redpacks.Add(info.GetWay, list);
|
| | | }
|
| | | if (!list.Contains((int)info.RedPacketID))
|
| | | {
|
| | | list.Add((int)info.RedPacketID);
|
| | | }
|
| | |
|
| | | m_RedEnvelopeDict[(int)info.RedPacketID] = _envelope;
|
| | | if (EnvelopeGetEvent != null)
|
| | | {
|
| | |
| | | var _id = (int)_pak.DelRedPacketID[i];
|
| | | if (m_RedEnvelopeDict.ContainsKey(_id))
|
| | | {
|
| | | var type = m_RedEnvelopeDict[_id].type;
|
| | | if (redpacks.ContainsKey(type))
|
| | | {
|
| | | var list = redpacks[type];
|
| | | if (list.Contains(_id))
|
| | | {
|
| | | list.Remove(_id);
|
| | | }
|
| | | }
|
| | |
|
| | | m_RedEnvelopeDict.Remove(_id);
|
| | | }
|
| | | }
|
| | |
| | | }
|
| | | }
|
| | | return _has;
|
| | | }
|
| | |
|
| | | public bool TryGetEnvelopes(int type, out List<int> list)
|
| | | {
|
| | | return redpacks.TryGetValue(type, out list);
|
| | | }
|
| | |
|
| | | public void GetEnvelopes(int _type, ref List<int> _list)
|
| | |
| | |
|
| | | public int cacheEnvelopeId = 0;
|
| | | public int envelopeSfx { get; set; }
|
| | | public void RequestDetail(int _id)
|
| | | public void SendOpenRedpackPackage(int _id)
|
| | | {
|
| | | cacheEnvelopeId = _id;
|
| | | CAB12_tagCMGrabFamilyRedPacket _pak = new CAB12_tagCMGrabFamilyRedPacket();
|