public void Shutdown() { Logger.ConsoleWriteLine("Shutdown for RPPDatabaseHandler is triggered!", ConsoleColor.White); m_MainThread = null; if (m_Communicator != null) { m_Communicator.Shutdown(); try { ProcessData(); } catch (Exception ex) { Logger.LogException(ex); } m_Communicator.WaitForClosed(); try { ProcessData(); } catch (Exception ex) { Logger.LogException(ex); } m_Communicator = null; } }
public RPPDatabaseHandler(string _RPPDBFolder) { List <WowRealm> realmsInUse = new List <WowRealm>(); foreach (var realm in Database.ALL_REALMS) { if (Database.SKIP_REALM_TAGS.Contains(realm)) { continue; } if (StaticValues.DeadRealms.Contains(realm) == false) { realmsInUse.Add(realm); } } m_RealmsInUse = realmsInUse.ToArray(); m_RPPDBFolder = _RPPDBFolder; if (ItemDropDatabase.DatabaseExists(m_RPPDBFolder + "Database\\") == false) { ItemDropDatabase itemDropDatabase = new ItemDropDatabase(m_RPPDBFolder + "Database\\"); } m_Communicator = new UploaderCommunication.RPPCommunicator(18374); m_Database = new Database(m_RPPDBFolder + "Database\\", null, m_RealmsInUse); m_MainThread = new System.Threading.Thread(MainThread); m_MainThread.Start(); }
static void CurrentDomain_ProcessExit(object sender, EventArgs e) { m_Communicator.Shutdown(); ProcessData(); m_Communicator.WaitForClosed(); ProcessData(); m_Communicator = null; }
public RPPDatabaseHandler(string _RPPDBFolder) { m_RPPDBFolder = _RPPDBFolder; if (ItemDropDatabase.DatabaseExists(m_RPPDBFolder + "Database\\") == false) { ItemDropDatabase itemDropDatabase = new ItemDropDatabase(m_RPPDBFolder + "Database\\"); } m_Communicator = new UploaderCommunication.RPPCommunicator(18374); m_Database = new Database(m_RPPDBFolder + "Database\\"); m_MainThread = new System.Threading.Thread(MainThread); m_MainThread.Start(); }
public void Shutdown() { m_MainThread = null; if (m_Communicator != null) { m_Communicator.Shutdown(); ProcessData(); m_Communicator.WaitForClosed(); ProcessData(); m_Communicator = null; } }
static void Main(string[] args) { try { if (ItemDropDatabase.DatabaseExists("Database\\") == false) { ItemDropDatabase itemDropDatabase = new ItemDropDatabase("Database\\"); } AppDomain.CurrentDomain.ProcessExit += CurrentDomain_ProcessExit; m_Communicator = new UploaderCommunication.RPPCommunicator(18374); m_Database = new Database("Database\\"); while (m_Communicator != null) { ProcessData(); m_Database.Cleanup(); System.Threading.Thread.Sleep(30000); } } catch (Exception ex) { Logger.LogException(ex); } }