Zmiany w PropertiesEditorForm.cs
No to tak... Nie, tak nie powinno być. To co się stało to kurde... To będzie potrzebowało egzorcysty... A jeszcze będzie potem musiał zapisywać do pliku servmanager.srv. [screams internally]
This commit is contained in:
Binary file not shown.
+468
-467
File diff suppressed because it is too large
Load Diff
@@ -1,20 +1,16 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel;
|
|
||||||
using System.Data;
|
|
||||||
using System.Drawing;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace ServCreator
|
namespace ServCreator
|
||||||
{
|
{
|
||||||
public partial class PropertiesEditorForm : Form
|
public partial class PropertiesEditorForm : Form
|
||||||
{
|
{
|
||||||
string pathToEdit;
|
public string pathToEdit;
|
||||||
|
StreamWriter writer;
|
||||||
public PropertiesEditorForm(string path, string name)
|
public PropertiesEditorForm(string path, string name)
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
@@ -27,16 +23,59 @@ namespace ServCreator
|
|||||||
StreamReader streamReader = new StreamReader(pathToEdit);
|
StreamReader streamReader = new StreamReader(pathToEdit);
|
||||||
richTextBox1.Text = streamReader.ReadToEnd();
|
richTextBox1.Text = streamReader.ReadToEnd();
|
||||||
streamReader.Close();
|
streamReader.Close();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void saveIt()
|
void saveIt()
|
||||||
{
|
{
|
||||||
StreamWriter streamWriter = new StreamWriter(pathToEdit);
|
writer = new StreamWriter(pathToEdit);
|
||||||
streamWriter.Write(richTextBox1.Text);
|
writer.Write(richTextBox1.Text);
|
||||||
streamWriter.Close();
|
writer.Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void button1_Click(object sender, EventArgs e) { saveIt(); }
|
void simpleSave()
|
||||||
|
{
|
||||||
|
var nowalinia = Environment.NewLine;
|
||||||
|
|
||||||
|
writer = new StreamWriter(pathToEdit);
|
||||||
|
writer.Write("#Minecraft server properties" + nowalinia +
|
||||||
|
"#" + DateTime.Now + nowalinia +
|
||||||
|
"spawn-protection=" + spawnProtection.Value + nowalinia +
|
||||||
|
"generator-settings=" + generatorSettings.Text + nowalinia +
|
||||||
|
"force-gamemode=" + forceGamemode.Checked.ToString().ToLower() + nowalinia +
|
||||||
|
"allow-nether=" + allowNether.Checked.ToString().ToLower() + nowalinia +
|
||||||
|
"gamemode=" + gamemode.Text + nowalinia +
|
||||||
|
"difficulty=" + difficulty.Text + nowalinia +
|
||||||
|
"spawn-monstars=" + spawnMonsters.Checked.ToString().ToLower() + nowalinia +
|
||||||
|
"pvp=" + enablePvp.Checked.ToString().ToLower() + nowalinia +
|
||||||
|
"level-type=default" + nowalinia +
|
||||||
|
"hardcore=" + hardcore.Checked.ToString().ToLower() + nowalinia +
|
||||||
|
"enable-status=" + enableStatus.Checked.ToString().ToLower() + nowalinia +
|
||||||
|
"enable-command-block=" + enableCommandBlocks.Checked.ToString().ToLower() + nowalinia +
|
||||||
|
"max-players=" + maxPlayers.Value + nowalinia +
|
||||||
|
"max-world-size=" + maxWorldSize.Value + nowalinia +
|
||||||
|
"server-port=" + serverPort.Value + nowalinia +
|
||||||
|
"server-ip=" + serverIp.Text + nowalinia +
|
||||||
|
"spawn-npcs=" + spawnNpcs.Checked.ToString().ToLower() + nowalinia +
|
||||||
|
"allow-flight=" + allowFlight.Checked.ToString().ToLower() + nowalinia +
|
||||||
|
"level-name=" + levelName.Text + nowalinia +
|
||||||
|
"view-distance=" + viewDistance.Value + nowalinia +
|
||||||
|
"spawn-animals=" + spawnAnimals.Checked.ToString().ToLower() + nowalinia +
|
||||||
|
"white-list=" + whiteList.Checked.ToString().ToLower() + nowalinia +
|
||||||
|
"generate-structures=" + generateStructures.Checked.ToString().ToLower() + nowalinia +
|
||||||
|
"online-mode=" + onlineMode.Checked.ToString().ToLower() + nowalinia +
|
||||||
|
"motd=" + motd.Text + nowalinia
|
||||||
|
);
|
||||||
|
writer.Close();
|
||||||
|
MessageBox.Show("ja pier...")
|
||||||
|
}
|
||||||
|
|
||||||
|
private void button1_Click(object sender, EventArgs e) {
|
||||||
|
if (tabControl1.SelectedIndex == 1)
|
||||||
|
saveIt();
|
||||||
|
else
|
||||||
|
MessageBox.Show("Idź do manualnego, lol");
|
||||||
|
}
|
||||||
private void button2_Click(object sender, EventArgs e) { saveIt(); this.Close(); }
|
private void button2_Click(object sender, EventArgs e) { saveIt(); this.Close(); }
|
||||||
|
|
||||||
private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
|
private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user