public static InstancedMap LoadInstancedMap(DatabaseConnection dbConnection, string mapID) { DataManager.Maps.InstancedMap loadedMap = MapDataManager.LoadInstancedMap(dbConnection.Database, mapID); InstancedMap map = new InstancedMap(loadedMap); return(map); }
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); }
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(); } }
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; }