ace/Source/ACE.DatLoader/DatManager.cs
Charles 6f272fd9cd Fix CIRand admin function. (#397)
* Support multiple getlist.

* Commented too much oopisies.

* WIP

* wip

* Working on exercising inventory creation.   Have a bug that is causing client to crash.

* Fixed alignment bug at hooktype.   Added priority to aceObject and set it in debugObject.

* Fixed file location error.

* God help me - I can't type or read it seems.   I think I have this right now.

* Update 02-06-19-2017-vw_weenie_class.sql

* Made requested changes.

* Found style cop error

* Ugh - that was hard to find.   I think this got it.   When I killed cell in postion, it was still used in the view.

* Update 03-06-20-2017-vw_ace_object.sql
2017-06-20 13:17:22 -04:00

56 lines
1.9 KiB
C#

using System;
using System.Linq;
using System.IO;
using ACE.Common;
using log4net;
namespace ACE.DatLoader
{
public class DatManager
{
private static readonly ILog log = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
private static CellDatDatabase cellDat;
private static PortalDatDatabase portalDat;
private static string datFile;
private static int count;
public static CellDatDatabase CellDat { get { return cellDat; } }
public static PortalDatDatabase PortalDat { get { return portalDat; } }
public static void Initialize()
{
var datDir = Path.GetFullPath(Path.Combine(ConfigManager.Config.Server.DatFilesDirectory));
try
{
datFile = Path.Combine(datDir, "client_cell_1.dat");
cellDat = new CellDatDatabase(datFile);
count = cellDat.AllFiles.Count();
log.Info($"Successfully opened {datFile} file, containing {count} records");
}
catch (FileNotFoundException ex)
{
log.Info($"An exception occured while attempting to open {datFile} file! This needs to be corrected in order for Landblocks to load!");
log.Info($"Exception: {ex.Message}");
}
try
{
datFile = Path.Combine(datDir, "client_portal.dat");
portalDat = new PortalDatDatabase(datFile);
count = portalDat.AllFiles.Count();
log.Info($"Successfully opened {datFile} file, containing {count} records");
}
catch (FileNotFoundException ex)
{
log.Info($"An exception occured while attempting to open {datFile} file! This needs to be corrected in order for Landblocks to load!");
log.Info($"Exception: {ex.Message}");
}
}
}
}