예제 #1
0
        public override void Handle(Session Session)
        {
            string            ResponseJson = Session.GetResponseBodyAsString();
            EventListDungeons result       = JsonConvert.DeserializeObject <EventListDungeons>(ResponseJson);

            lock (FFRKProxy.Instance.Cache.SyncRoot)
            {
                foreach (DataDungeon dungeon in result.Dungeons)
                {
                    DataCache.Dungeons.Key key = new DataCache.Dungeons.Key {
                        DungeonId = dungeon.Id
                    };
                    DataCache.Dungeons.Data data = null;
                    if (!FFRKProxy.Instance.Cache.Dungeons.TryGetValue(key, out data))
                    {
                        data = new DataCache.Dungeons.Data
                        {
                            Difficulty = dungeon.Difficulty,
                            Name       = dungeon.Name,
                            Series     = dungeon.SeriesId,
                            Type       = dungeon.Type,
                            WorldId    = dungeon.WorldId
                        };
                        FFRKProxy.Instance.Cache.Dungeons.Update(key, data);
                    }
                }
            }

            FFRKProxy.Instance.Database.BeginExecuteRequest(new DbOpRecordDungeonList(result));
            FFRKProxy.Instance.RaiseListDungeons(result);
        }
예제 #2
0
        public override void Handle(Session Session)
        {
            string ResponseJson = Session.GetResponseBodyAsString();
            EventListDungeons result = JsonConvert.DeserializeObject<EventListDungeons>(ResponseJson);

            lock (FFRKProxy.Instance.Cache.SyncRoot)
            {
                foreach (DataDungeon dungeon in result.Dungeons)
                {
                    DataCache.Dungeons.Key key = new DataCache.Dungeons.Key { DungeonId = dungeon.Id };
                    DataCache.Dungeons.Data data = null;
                    if (!FFRKProxy.Instance.Cache.Dungeons.TryGetValue(key, out data))
                    {
                        data = new DataCache.Dungeons.Data
                        {
                            Difficulty = dungeon.Difficulty,
                            Name = dungeon.Name,
                            Series = dungeon.SeriesId,
                            Type = dungeon.Type,
                            WorldId = dungeon.WorldId
                        };
                        FFRKProxy.Instance.Cache.Dungeons.Update(key, data);
                    }
                }
            }

            FFRKProxy.Instance.Database.BeginExecuteRequest(new DbOpRecordDungeonList(result));
            FFRKProxy.Instance.RaiseListDungeons(result);
        }
예제 #3
0
 public void Execute(MySqlConnection connection, MySqlTransaction transaction)
 {
     string stmt = "SELECT * FROM dungeons";
     using (MySqlCommand command = new MySqlCommand(stmt, connection, transaction))
     {
         using (MySqlDataReader reader = command.ExecuteReader())
         {
             while (reader.Read())
             {
                 DataCache.Dungeons.Key key = new DataCache.Dungeons.Key();
                 DataCache.Dungeons.Data data = new DataCache.Dungeons.Data();
                 key.DungeonId = (uint)reader["id"];
                 data.WorldId = (uint)reader["world"];
                 data.Series = (uint)reader["series"];
                 data.Name = (string)reader["name"];
                 data.Type = (SchemaConstants.DungeonType)reader["type"];
                 data.Difficulty = (ushort)reader["difficulty"];
                 mDungeons.Update(key, data);
             }
         }
     }
 }
예제 #4
0
        public void Execute(MySqlConnection connection, MySqlTransaction transaction)
        {
            string stmt = "SELECT * FROM dungeons";

            using (MySqlCommand command = new MySqlCommand(stmt, connection, transaction))
            {
                using (MySqlDataReader reader = command.ExecuteReader())
                {
                    while (reader.Read())
                    {
                        DataCache.Dungeons.Key  key  = new DataCache.Dungeons.Key();
                        DataCache.Dungeons.Data data = new DataCache.Dungeons.Data();
                        key.DungeonId   = (uint)reader["id"];
                        data.WorldId    = (uint)reader["world"];
                        data.Series     = (uint)reader["series"];
                        data.Name       = (string)reader["name"];
                        data.Type       = (SchemaConstants.DungeonType)reader["type"];
                        data.Difficulty = (ushort)reader["difficulty"];
                        mDungeons.Update(key, data);
                    }
                }
            }
        }
예제 #5
0
 public DungeonListItem(DataCache.Dungeons.Key key, DataCache.Dungeons.Data data)
 {
     mKey  = key;
     mData = data;
 }
예제 #6
0
 public DungeonListItem(DataCache.Dungeons.Key key, DataCache.Dungeons.Data data)
 {
     mKey = key;
     mData = data;
 }