Dunning

Atlas Config Writer

Jan 8th, 2019
176
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #region --------------------------------------------------Create Config Files----------------------------------------------------------------------------------------------------
  2.  
  3.  
  4. int folderserverinstance = 0;
  5. int foldergridx = 0;
  6. int foldergridy = 0;
  7. string configline;
  8. string configline2;
  9. string configline3;
  10.  
  11. System.IO.StreamReader mastergameini = new System.IO.StreamReader("D:\\AtlasConfig\\Game.ini");
  12. System.IO.StreamReader mastergameusersettingsini = new System.IO.StreamReader("D:\\AtlasConfig\\GameUserSettings.ini");
  13. System.IO.StreamReader masterengineini = new System.IO.StreamReader("D:\\AtlasConfig\\Engine.ini");
  14.  
  15. while (folderserverinstance < 225) //Edit based on size
  16. {
  17. string folder = "D:\\AtlasSaved\\X" + foldergridx + "Y" + foldergridy + "\\Config\\WindowsServer\\";
  18. Directory.CreateDirectory(Path.GetDirectoryName(folder));
  19.  
  20. string tempconfigpath = folder + "Game.ini";
  21. string tempconfigpath2 = folder + "GameUserSettings.ini";
  22. string tempconfigpath3 = folder + "Engine.ini";
  23. System.IO.StreamWriter writegameini = new StreamWriter(tempconfigpath, true);
  24. System.IO.StreamWriter writegameusersettingsini = new StreamWriter(tempconfigpath2, true);
  25. System.IO.StreamWriter writeengineini = new StreamWriter(tempconfigpath3, true);
  26.  
  27. while ((configline = mastergameini.ReadLine()) != null)
  28. {
  29. writegameini.WriteLine(configline);
  30. }
  31. while ((configline2 = mastergameusersettingsini.ReadLine()) != null)
  32. {
  33. writegameusersettingsini.WriteLine(configline2);
  34. }
  35. while ((configline3 = masterengineini.ReadLine()) != null)
  36. {
  37. writeengineini.WriteLine(configline3);
  38. }
  39.  
  40. writegameini.Close();
  41. writegameusersettingsini.Close();
  42. writeengineini.Close();
  43. mastergameini.BaseStream.Seek(0, SeekOrigin.Begin);
  44. mastergameusersettingsini.BaseStream.Seek(0, SeekOrigin.Begin);
  45. masterengineini.BaseStream.Seek(0, SeekOrigin.Begin);
  46.  
  47. foldergridy++;
  48. if (foldergridy > 14) //Edit based on size
  49. {
  50. foldergridy = 0;
  51. foldergridx++;
  52. }
  53. folderserverinstance++;
  54. }
  55.  
  56. #endregion ------------------------------------------------------------------------------------------------------------------------------------------------------
RAW Paste Data