Example #1
0
        private void ReloadTable(IEvent ievent)
        {
            var v = ievent as ReloadTableEvent;

            if (v == null)
            {
                return;
            }
            if (v.tableName == "ServerName")
            {
                Table.ForeachServerName(record =>
                {
                    if (record.LogicID == record.Id && ServerMysteryStoreManager.Servers.ContainsKey(record.LogicID) == false && (record.IsClientDisplay == 1 || record.IsClientDisplay == 2))
                    {
                        MysteryStoreManager temp = new MysteryStoreManager();
                        temp.Init(record.LogicID);
                        ServerMysteryStoreManager.Servers.Add(record.LogicID, temp);
                    }
                    return(true);
                });
            }
            if (v.tableName == "Store")
            {
                ResetStore();
            }
        }
Example #2
0
        public void Init()
        {
            Table.ForeachServerName(record =>
            {
                if (record.LogicID == record.Id && ServerMysteryStoreManager.Servers.ContainsKey(record.LogicID) == false && (record.IsClientDisplay == 1 || record.IsClientDisplay == 2))
                {
                    MysteryStoreManager temp = new MysteryStoreManager();
                    temp.Init(record.LogicID);
                    ServerMysteryStoreManager.Servers.Add(record.LogicID, temp);
                }
                return(true);
            });

            SetTrigger();
            EventDispatcher.Instance.AddEventListener(ReloadTableEvent.EVENT_TYPE, ReloadTable);
        }