-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
6 changed files
with
125 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Diagnostics; | ||
using System.IO; | ||
using System.Linq; | ||
using System.Security.Cryptography.X509Certificates; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using PaperDownloader.Servers.Versions; | ||
|
||
namespace PaperDownload.Launch | ||
{ | ||
class Batch | ||
{ | ||
public string Arguments { get; } | ||
public string FileName { get; set; } | ||
public string WorkingDir { get; set; } | ||
|
||
public Batch(Project project, string version, string build, string workingDir, string fileName) | ||
{ | ||
WorkingDir = workingDir; | ||
FileName = fileName; | ||
|
||
Arguments = | ||
$":start\r\necho off\r\ncls\r\njava -Xms3G -Xmx3G -XX:+UseG1GC -XX:+UnlockExperimentalVMOptions -XX:MaxGCPauseMillis=100 -XX:+DisableExplicitGC -XX:TargetSurvivorRatio=90 -XX:G1NewSizePercent=50 -XX:G1MaxNewSizePercent=80 -XX:G1MixedGCLiveThresholdPercent=35 -XX:+AlwaysPreTouch -XX:+ParallelRefProcEnabled -jar {project}-{version}_{build}.jar\r\npause\r\ngoto start"; | ||
} | ||
|
||
public void Create() | ||
{ | ||
var path = Path.Combine(WorkingDir, FileName); | ||
try | ||
{ | ||
if (File.Exists(path)) | ||
{ | ||
File.Delete(path); | ||
} | ||
|
||
// Create a new file | ||
using (var fs = File.CreateText(path)) | ||
{ | ||
// Add some text to file | ||
fs.WriteLine(Arguments); | ||
} | ||
} | ||
catch (Exception e) | ||
{ | ||
Console.WriteLine(e); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Diagnostics; | ||
using System.Globalization; | ||
using System.IO; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace PaperDownload.Launch | ||
{ | ||
class Eula | ||
{ | ||
public string WorkingDir { get; set; } | ||
public string Message { get; } | ||
|
||
public Eula(string workingDir, bool accept) | ||
{ | ||
WorkingDir = workingDir; | ||
|
||
Message = | ||
"#By changing the setting below to TRUE you are indicating your agreement to our EULA (https://account.mojang.com/documents/minecraft_eula)." | ||
+ "\r\n#You also agree that tacos are tasty, and the best food in the world." | ||
+ $"\r\n#{string.Format(CultureInfo.InvariantCulture, "{0:ddd MMM dd HH:mm:ss z yyyy}", DateTime.Now)}" | ||
+ $"\r\neula={accept.ToString().ToLower()}"; | ||
} | ||
|
||
//EEE MMM dd HH:mm:ss Z yyyy | ||
public void Create() | ||
{ | ||
var path = Path.Combine(WorkingDir, "eula.txt"); | ||
try | ||
{ | ||
if (File.Exists(path)) | ||
{ | ||
File.Delete(path); | ||
} | ||
|
||
// Create a new file | ||
using (var fs = File.CreateText(path)) | ||
{ | ||
// Add some text to file | ||
fs.WriteLine(Message); | ||
} | ||
} | ||
catch (Exception e) | ||
{ | ||
Console.WriteLine(e); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters