public static void CrashProcedure(Exception e) { StreamWriter crashLog = new StreamWriter("crash.txt", true); crashLog.WriteLine(e.ToString()); crashLog.Close(); Console.WriteLine("Editor crash: " + e.ToString() + "\n"); MessageBox.Show("ѕроизошел непредвиденный сбой в работе редактора.\n—ейчас произойдет завершение работы клиента (если запущен),\n и будет предложено сохранить изменени¤ (если есть).", "—бой", MessageBoxButtons.OK, MessageBoxIcon.Error); try { if (ClientLoader.m_clientProcess != null) { if (ClientLoader.m_clientProcess.HasExited == false) { ClientLoader.m_clientProcess.Kill(); } } } catch (System.ComponentModel.Win32Exception w) { Console.WriteLine("Can't close client: " + w.Message); } ClientMySQL mySql = new ClientMySQL(); HistoryProcessor.GetHProcessor().ProcessHistory(mySql, true); }
public ArrayList GetResoursesPaths() { if (m_resPaths == null) { // пройтись по истории и найти изначальное им¤ %) HistoryProcessor hproc = HistoryProcessor.GetHProcessor(); byte libFlag; String objectParent = hproc.FindObjectParent(m_objectName, out libFlag); String queryStr = ""; if (libFlag == 0) { queryStr = "SELECT `res` FROM `objects_map` WHERE `name`='" + objectParent + "'"; } else { queryStr = "SELECT `res` FROM `objects_lib` WHERE `id`='" + objectParent + "'"; } ArrayList queryResult = m_mySql.QueryA(queryStr); if (queryResult == null) { m_resPaths = new ArrayList(); m_resPaths.Add(GetGeometryPath() + "common"); } else { if (((Hashtable)(queryResult[0]))["res"] != null) { String objectRes = (String)((Hashtable)(queryResult[0]))["res"]; // пути к ресурсам m_resPaths = new ArrayList(); String[] splittedRes = objectRes.Split(';'); for (int splitItemIndex = 0; splitItemIndex < splittedRes.Length; splitItemIndex++) { if (splitItemIndex % 3 == 0) { if (splittedRes[splitItemIndex] == "") { break; } m_resPaths.Add(GetGeometryPath() + splittedRes[splitItemIndex].Substring(0, splittedRes[splitItemIndex].IndexOf("\\mesh.bmf.zip"))); } } } } } return(m_resPaths); }
public GroupForm() { groupId = -1; InitializeComponent(); m_mySql = new ClientMySQL(); m_mySql.Connect(); m_commander = Commander.GetCommander(); point = new Vector(); m_storage = HistoryProcessor.GetHProcessor(); }