public MainRunning() { m_CurrentBotIndex = 0; I18NFileAccessor i18NFileAccessor = new I18NFileAccessor(); string path = ""; if (File.Exists(@"C:\Program Files (x86)\Dofus2\app\data\i18n\i18n_fr.d2i")) { path = @"C:\Program Files (x86)\Dofus2\app\data\i18n\i18n_fr.d2i"; i18NFileAccessor.Init(path); I18N i18N = new I18N(i18NFileAccessor); m_GameDataFileAccessor = new GameDataFileAccessor(); m_GameDataFileAccessor.Init(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86) + @"\Dofus2\app\data\common\Effects.d2o"); m_GameDataFileAccessor.Init(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86) + @"\Dofus2\app\data\common\Items.d2o"); m_GameDataFileAccessor.Init(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86) + @"\Dofus2\app\data\common\ItemTypes.d2o"); } else { path = @"D:\Dofus2\app\data\i18n\i18n_fr.d2i"; i18NFileAccessor.Init(path); I18N i18N = new I18N(i18NFileAccessor); m_GameDataFileAccessor = new GameDataFileAccessor(); m_GameDataFileAccessor.Init(@"D:\Dofus2\app\data\common\Effects.d2o"); m_GameDataFileAccessor.Init(@"D:\Dofus2\app\data\common\Items.d2o"); m_GameDataFileAccessor.Init(@"D:\Dofus2\app\data\common\ItemTypes.d2o"); m_GameDataFileAccessor.Init(@"D:\Dofus2\app\data\common\Spells.d2o"); } }
private static void CheckBlueSheepDatas() { // Create the BlueSheep needed folders string applicationDataPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData); string blueSheepPath = Path.Combine(applicationDataPath, "BlueSheep"); if (!Directory.Exists(blueSheepPath)) { Directory.CreateDirectory(blueSheepPath); } if (!Directory.Exists(Path.Combine(blueSheepPath, "Accounts"))) { Directory.CreateDirectory(Path.Combine(blueSheepPath, "Accounts")).Attributes = FileAttributes.Normal; } if (!Directory.Exists(Path.Combine(blueSheepPath, "Groups"))) { Directory.CreateDirectory(Path.Combine(blueSheepPath, "Groups")).Attributes = FileAttributes.Normal; } if (!Directory.Exists(Path.Combine(blueSheepPath, "Temp"))) { Directory.CreateDirectory(Path.Combine(blueSheepPath, "Temp")).Attributes = FileAttributes.Normal; } if (!Directory.Exists(Path.Combine(blueSheepPath, "Paths"))) { Directory.CreateDirectory(Path.Combine(blueSheepPath, "Paths")).Attributes = FileAttributes.Normal; } if (!Directory.Exists(Path.Combine(blueSheepPath, "IAs"))) { Directory.CreateDirectory(Path.Combine(blueSheepPath, "IAs")).Attributes = FileAttributes.Normal; } if (!Directory.Exists(Path.Combine(blueSheepPath, "Logs"))) { Directory.CreateDirectory(Path.Combine(blueSheepPath, "Logs")).Attributes = FileAttributes.Normal; } string bsConfPath = Path.Combine(blueSheepPath, "bs.conf"); if (File.Exists(bsConfPath)) { StreamReader sr = new StreamReader(bsConfPath); string path = sr.ReadLine(); if (Directory.Exists(Path.Combine(path, "app", "content", "maps"))) { ActualMainForm.DofusPath = path; } else { sr.Close(); DofusPathForm frm = new DofusPathForm(ActualMainForm); frm.ShowDialog(); } } else { DofusPathForm frm = new DofusPathForm(ActualMainForm); frm.ShowDialog(); } FileInfo fileInfo = new FileInfo(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + @"\BlueSheep\Logs.txt"); fileInfo.Delete(); using (fileInfo.Create()) { } //fileInfo = new FileInfo(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + @"\BlueSheep\Packets.txt"); //fileInfo.Delete(); //using (fileInfo.Create()) //{ //} I18NFileAccessor i18NFileAccessor = new I18NFileAccessor(); if (File.Exists(@"C:\Program Files (x86)\Dofus2\app\data\i18n\i18n_fr.d2i")) { string path = @"C:\Program Files (x86)\Dofus2\app\data\i18n\i18n_fr.d2i"; i18NFileAccessor.Init(path); I18N i18N = new I18N(i18NFileAccessor); GameData.Init(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86) + @"\Dofus2\app\data\common"); MapsManager.Init(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86) + @"\Dofus2\app\content\maps"); } else if (File.Exists(bsConfPath)) { List <string> PaysList = new List <string>(); PaysList.AddRange(new List <string>() { "fr", "en", "ja", "es", "de", "pt" }); foreach (string pays in PaysList) { string combinedPath = Path.Combine(ActualMainForm.DofusPath, "app", "data", "i18n", "i18n_" + pays + ".d2i"); if (File.Exists(combinedPath)) { i18NFileAccessor.Init(combinedPath); break; } } I18N i18N = new I18N(i18NFileAccessor); GameData.Init(Path.Combine(ActualMainForm.DofusPath, "app", "data", "common")); MapsManager.Init(Path.Combine(ActualMainForm.DofusPath, "app", "content", "maps")); } //else //{ // i18NFileAccessor.Init(Path.Combine(ActualMainForm.DofusPath, "app", "data", "i18n", "i18n_fr.d2i")); // I18N i18N = new I18N(i18NFileAccessor); // GameData.Init(@"D:\Dofus2\app\data\common"); // MapsManager.Init(@"D:\Dofus2\app\content\maps"); //} IntelliSense.InitMonsters(); IntelliSense.InitItems(); IntelliSense.InitServers(); }
public I18N(I18NFileAccessor i18NFileAccessor) { m_I18NFileAccessor = i18NFileAccessor; }