예제 #1
0
        public static InstancedMap LoadInstancedMap(DatabaseConnection dbConnection, string mapID)
        {
            DataManager.Maps.InstancedMap loadedMap = MapDataManager.LoadInstancedMap(dbConnection.Database, mapID);
            InstancedMap map = new InstancedMap(loadedMap);

            return(map);
        }
예제 #2
0
        public static InstancedMap LoadInstancedMap(MySql database, string mapID)
        {
            InstancedMap map = new InstancedMap(mapID);

            LoadMapDump(database, mapID, map);

            string query             = "SELECT map_instanced_data.MapBase FROM map_instanced_data WHERE map_instanced_data.MapID = \'" + database.VerifyValueString(mapID) + "\'";
            DataColumnCollection row = database.RetrieveRow(query);

            if (row != null)
            {
                int counter = 0;
                map.MapBase = Convert.ToInt32(row[counter++].Value);
            }
            else
            {
                throw new Exception("Instanced map data not found");
            }

            return(map);
        }
예제 #3
0
        public static void SaveInstancedMap(MySql database, string mapID, InstancedMap map)
        {
            bool localTransaction = false;

            if (database.IsTransactionActive == false)
            {
                database.BeginTransaction();
                localTransaction = true;
            }

            SaveMapDump(database, mapID, map);

            // Save extra data associated with instanced maps
            database.UpdateOrInsert("map_instanced_data", new IDataColumn[] {
                database.CreateColumn(false, "MapID", mapID),
                database.CreateColumn(false, "MapBase", map.MapBase.ToString())
            });

            if (localTransaction)
            {
                database.EndTransaction();
            }
        }
예제 #4
0
        public static InstancedMap LoadInstancedMap(MySql database, string mapID)
        {
            InstancedMap map = new InstancedMap(mapID);
            LoadMapDump(database, mapID, map);

            string query = "SELECT map_instanced_data.MapBase FROM map_instanced_data WHERE map_instanced_data.MapID = \'" + database.VerifyValueString(mapID) + "\'";
            DataColumnCollection row = database.RetrieveRow(query);
            if (row != null) {
                int counter = 0;
                map.MapBase = Convert.ToInt32(row[counter++].Value);
            } else {
                throw new Exception("Instanced map data not found");
            }

            return map;
        }
예제 #5
0
        public static void SaveInstancedMap(MySql database, string mapID, InstancedMap map)
        {
            bool localTransaction = false;
            if (database.IsTransactionActive == false) {
                database.BeginTransaction();
                localTransaction = true;
            }

            SaveMapDump(database, mapID, map);

            // Save extra data associated with instanced maps
            database.UpdateOrInsert("map_instanced_data", new IDataColumn[] {
                database.CreateColumn(false, "MapID", mapID),
                database.CreateColumn(false, "MapBase", map.MapBase.ToString())
            });

            if (localTransaction) {
                database.EndTransaction();
            }
        }