Merge remote-tracking branch 'origin/master'

This commit is contained in:
Shaun Bennett 2014-12-23 05:49:08 -06:00
commit ea6214b2ad
23 changed files with 28 additions and 1116 deletions

View File

@ -4,7 +4,9 @@ import org.bukkit.Effect;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.player.PlayerJoinEvent;
import mineplex.core.common.Rank;
import mineplex.core.common.util.C;
import mineplex.core.gadget.types.ParticleGadget;
import mineplex.core.updater.UpdateType;
@ -40,4 +42,13 @@ public class ParticleLegend extends ParticleGadget
player.getWorld().playEffect(player.getLocation().add(0, 1, 0), Effect.ENDER_SIGNAL, 0);
}
}
@EventHandler
public void legendOwner(PlayerJoinEvent event)
{
if (Manager.getClientManager().Get(event.getPlayer()).GetRank().Has(Rank.LEGEND))
{
Manager.getDonationManager().Get(event.getPlayer().getName()).AddUnknownSalesPackagesOwned(GetName());
}
}
}

View File

@ -4,17 +4,21 @@ import org.bukkit.entity.Player;
import mineplex.core.command.CommandBase;
import mineplex.core.common.Rank;
import mineplex.core.recharge.Recharge;
public class HostServerCommand extends CommandBase<PersonalServerManager>
{
public HostServerCommand(PersonalServerManager plugin)
{
super(plugin, Rank.ULTRA, "hostserver");
super(plugin, Rank.LEGEND, "hostserver");
}
@Override
public void Execute(Player caller, String[] args)
{
if (!Recharge.Instance.use(caller, "Host Server", 30000, false, false))
return;
Plugin.hostServer(caller, caller.getName());
}
}

View File

@ -20,6 +20,7 @@ import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.itemstack.ItemStackFactory;
import mineplex.core.recharge.Recharge;
import mineplex.serverdata.Region;
import mineplex.serverdata.ServerGroup;
import mineplex.serverdata.ServerManager;
@ -66,13 +67,16 @@ public class PersonalServerManager extends MiniPlugin
{
if (_interfaceItem.equals(event.getPlayer().getItemInHand()))
{
if (_clientManager.Get(event.getPlayer()).GetRank().Has(Rank.ULTRA))
if (!Recharge.Instance.use(event.getPlayer(), "Host Server Melon", 30000, false, false))
return;
if (_clientManager.Get(event.getPlayer()).GetRank().Has(Rank.LEGEND))
{
showHostMessage(event.getPlayer());
}
else
{
UtilPlayer.message(event.getPlayer(), F.main("Server", "Only players with " + F.rank(Rank.ULTRA) + C.mBody + "+ can host private servers"));
UtilPlayer.message(event.getPlayer(), F.main("Server", "Only players with " + F.rank(Rank.LEGEND) + C.mBody + "+ can host private servers"));
}
}
}
@ -81,11 +85,13 @@ public class PersonalServerManager extends MiniPlugin
{
UtilPlayer.message(player, C.cRed + "------------------------------------------------");
UtilPlayer.message(player, "This will create a Mineplex Player Server for you.");
UtilPlayer.message(player, "Here you can play your favourite games with friends!");
UtilPlayer.message(player, "Here you can play your favorite games with friends!");
new JsonMessage("Please ").click(ClickEvent.RUN_COMMAND, "/hostserver")
.hover(HoverEvent.SHOW_TEXT, C.cGray + "Click to Create Server")
.extra("CLICK HERE").color(Color.GREEN).extra(" to confirm you want to do this.")
.color(Color.WHITE).send(JsonMessage.MessageType.CHAT_BOX, player);
UtilPlayer.message(player, C.cRed + "------------------------------------------------");
}
@ -112,7 +118,7 @@ public class PersonalServerManager extends MiniPlugin
public void hostServer(Player player, String serverName)
{
createGroup(player, serverName, 24, 24, "Smash");
createGroup(player, serverName, 12, 24, "Smash");
}
private void createGroup(final Player host, final String serverName, int minPlayers, int maxPlayers, String games)

View File

@ -322,7 +322,7 @@ public class Enjin extends MiniPlugin implements CommandExecutor
{
public void run()
{
if (_clientManager.Get(name).GetRank() == Rank.ALL || _clientManager.Get(name).GetRank() == Rank.ULTRA || _clientManager.Get(name).GetRank() == Rank.HERO)
if (_clientManager.Get(name).GetRank() == Rank.ALL || _clientManager.Get(name).GetRank() == Rank.ULTRA || _clientManager.Get(name).GetRank() == Rank.HERO || _clientManager.Get(name).GetRank() == Rank.LEGEND)
{
_clientManager.SaveRank(name, mineplex.core.common.Rank.valueOf(rank), perm);
System.out.println("[" + _dateFormat.format(new Date()) + "] " + name + " received " + rank + " " + (perm ? "permanently." : "for 1 month."));

View File

@ -253,7 +253,7 @@ public class GameHostManager implements Listener
public boolean isPrivateServer()
{
return Manager.GetHost() != null || Manager.GetHost().length() > 0;
return Manager.GetHost() != null && Manager.GetHost().length() > 0;
}
@EventHandler

View File

@ -1,11 +0,0 @@
<Configuration>
<SnapshotDialog>
<InitialDirectory>C:\Work\LOC\Webserver\ServerHandler</InitialDirectory>
</SnapshotDialog>
<CoverageFilters>
<IncludeFilters>
<Filter ModuleMask="*" ClassMask="*" FunctionMask="*" />
</IncludeFilters>
<ExcludeFilters />
</CoverageFilters>
</Configuration>

View File

@ -1,169 +0,0 @@
<Configuration>
<SettingsComponent>
<string />
<integer />
<boolean>
<setting name="SolutionAnalysisEnabled">False</setting>
</boolean>
</SettingsComponent>
<RecentFiles>
<RecentFiles>
<File id="7674049F-5C67-4CD0-AD1F-8F23C718E37B/f:app.manifest" caret="917" fromTop="14" />
<File id="7674049F-5C67-4CD0-AD1F-8F23C718E37B/f:Program.cs" caret="311" fromTop="13" />
<File id="7674049F-5C67-4CD0-AD1F-8F23C718E37B/f:Form1.Designer.cs" caret="6226" fromTop="14" />
<File id="7674049F-5C67-4CD0-AD1F-8F23C718E37B/f:Form1.cs" caret="832" fromTop="29" />
<File id="7674049F-5C67-4CD0-AD1F-8F23C718E37B/f:Server.cs" caret="775" fromTop="7" />
</RecentFiles>
<RecentEdits>
<File id="7674049F-5C67-4CD0-AD1F-8F23C718E37B/f:Program.cs" caret="502" fromTop="13" />
<File id="7674049F-5C67-4CD0-AD1F-8F23C718E37B/f:Form1.cs" caret="1874" fromTop="15" />
<File id="7674049F-5C67-4CD0-AD1F-8F23C718E37B/f:Form1.cs" caret="1874" fromTop="15" />
<File id="7674049F-5C67-4CD0-AD1F-8F23C718E37B/f:Form1.cs" caret="1075" fromTop="23" />
<File id="7674049F-5C67-4CD0-AD1F-8F23C718E37B/f:Form1.cs" caret="1221" fromTop="25" />
<File id="7674049F-5C67-4CD0-AD1F-8F23C718E37B/f:Form1.cs" caret="1367" fromTop="17" />
<File id="7674049F-5C67-4CD0-AD1F-8F23C718E37B/f:Form1.cs" caret="1367" fromTop="21" />
<File id="7674049F-5C67-4CD0-AD1F-8F23C718E37B/f:Form1.cs" caret="45" fromTop="2" />
<File id="7674049F-5C67-4CD0-AD1F-8F23C718E37B/f:Server.cs" caret="520" fromTop="10" />
<File id="7674049F-5C67-4CD0-AD1F-8F23C718E37B/f:Form1.cs" caret="1733" fromTop="24" />
<File id="7674049F-5C67-4CD0-AD1F-8F23C718E37B/f:Form1.cs" caret="1820" fromTop="28" />
<File id="7674049F-5C67-4CD0-AD1F-8F23C718E37B/f:Form1.cs" caret="1514" fromTop="18" />
<File id="7674049F-5C67-4CD0-AD1F-8F23C718E37B/f:Form1.cs" caret="1367" fromTop="4" />
<File id="7674049F-5C67-4CD0-AD1F-8F23C718E37B/f:Form1.cs" caret="1163" fromTop="14" />
<File id="7674049F-5C67-4CD0-AD1F-8F23C718E37B/f:Form1.cs" caret="614" fromTop="9" />
<File id="7674049F-5C67-4CD0-AD1F-8F23C718E37B/f:Form1.cs" caret="796" fromTop="16" />
<File id="7674049F-5C67-4CD0-AD1F-8F23C718E37B/f:Form1.cs" caret="871" fromTop="18" />
<File id="7674049F-5C67-4CD0-AD1F-8F23C718E37B/f:Form1.cs" caret="942" fromTop="21" />
<File id="7674049F-5C67-4CD0-AD1F-8F23C718E37B/f:Form1.cs" caret="1017" fromTop="23" />
<File id="7674049F-5C67-4CD0-AD1F-8F23C718E37B/f:Form1.cs" caret="1163" fromTop="19" />
<File id="7674049F-5C67-4CD0-AD1F-8F23C718E37B/f:Form1.cs" caret="1309" fromTop="24" />
<File id="7674049F-5C67-4CD0-AD1F-8F23C718E37B/f:Form1.cs" caret="588" fromTop="19" />
<File id="7674049F-5C67-4CD0-AD1F-8F23C718E37B/f:Form1.cs" caret="161" fromTop="5" />
<File id="7674049F-5C67-4CD0-AD1F-8F23C718E37B/f:Form1.Designer.cs" caret="6522" fromTop="21" />
<File id="7674049F-5C67-4CD0-AD1F-8F23C718E37B/f:Server.cs" caret="2265" fromTop="17" />
<File id="7674049F-5C67-4CD0-AD1F-8F23C718E37B/f:Server.cs" caret="902" fromTop="9" />
<File id="7674049F-5C67-4CD0-AD1F-8F23C718E37B/f:Server.cs" caret="1671" fromTop="18" />
<File id="7674049F-5C67-4CD0-AD1F-8F23C718E37B/f:Server.cs" caret="1671" fromTop="23" />
<File id="7674049F-5C67-4CD0-AD1F-8F23C718E37B/f:Server.cs" caret="2859" fromTop="27" />
<File id="7674049F-5C67-4CD0-AD1F-8F23C718E37B/f:Server.cs" caret="1252" fromTop="17" />
</RecentEdits>
</RecentFiles>
<NAntValidationSettings>
<NAntPath value="" />
</NAntValidationSettings>
<UnitTestRunner>
<Providers />
</UnitTestRunner>
<UnitTestRunnerNUnit>
<NUnitInstallDir IsNull="False">
</NUnitInstallDir>
<UseAddins>Never</UseAddins>
</UnitTestRunnerNUnit>
<CompletionStatisticsManager>
<ItemStatistics item="Default">
<Item value="private" priority="9" />
<Item value="bool" priority="2" />
<Item value="if" priority="6" />
<Item value="else" priority="0" />
<Item value="button1" priority="3" />
<Item value="false" priority="0" />
<Item value="true" priority="1" />
<Item value="void" priority="7" />
<Item value="_serverProcess" priority="9" />
<Item value="new" priority="9" />
<Item value="Process" priority="0" />
<Item value="ProcessStartInfo" priority="0" />
<Item value="_shouldBeRunning" priority="4" />
<Item value="ThreadStart" priority="0" />
<Item value="Thread`0" priority="1" />
<Item value="_watcherThread" priority="3" />
<Item value="Thread" priority="0" />
<Item value="while" priority="1" />
<Item value="SecureString" priority="0" />
<Item value="OnClosing`0" priority="0" />
<Item value="string" priority="0" />
<Item value="FileDialog`0" priority="0" />
<Item value="var" priority="2" />
<Item value="foreach" priority="0" />
<Item value="in" priority="0" />
<Item value="File`0" priority="1" />
<Item value="worldDirectory" priority="1" />
<Item value="try" priority="1" />
<Item value="MessageBox`0" priority="1" />
<Item value="ex" priority="2" />
<Item value="Directory`0" priority="1" />
<Item value="commonDirectory" priority="0" />
<Item value="file" priority="1" />
<Item value="public" priority="7" />
<Item value="String`0" priority="1" />
<Item value="Server`0" priority="3" />
<Item value="_path" priority="1" />
<Item value="path" priority="0" />
<Item value="return" priority="0" />
<Item value="Server" priority="1" />
<Item value="ParamArrayAttribute`0" priority="0" />
<Item value="_hg1" priority="0" />
<Item value="PrepFiles`0" priority="0" />
<Item value="Start`0" priority="0" />
<Item value="this" priority="2" />
<Item value="Button`0" priority="1" />
<Item value="processInfo" priority="0" />
</ItemStatistics>
<ItemStatistics item="Qualified:System.Windows.Forms.Button">
<Item value="Text" priority="1" />
<Item value="Enabled" priority="1" />
</ItemStatistics>
<ItemStatistics item="Qualified:System.Diagnostics.Process">
<Item value="StartInfo" priority="3" />
<Item value="Start`0" priority="1" />
<Item value="WaitForExit`0" priority="0" />
<Item value="HasExited" priority="0" />
<Item value="Kill`0" priority="0" />
<Item value="StartTime" priority="0" />
</ItemStatistics>
<ItemStatistics item="Qualified:System.Threading.Thread">
<Item value="Start`0" priority="0" />
<Item value="Abort`0" priority="1" />
</ItemStatistics>
<ItemStatistics item="Qualified:@System.Threading.Thread">
<Item value="Sleep`0" priority="1" />
</ItemStatistics>
<ItemStatistics item="Qualified:System.Diagnostics.ProcessStartInfo">
<Item value="UserName" priority="0" />
<Item value="Password" priority="0" />
<Item value="Arguments" priority="1" />
<Item value="WorkingDirectory" priority="0" />
</ItemStatistics>
<ItemStatistics item="Qualified:System.String">
<Item value="Length" priority="0" />
</ItemStatistics>
<ItemStatistics item="Qualified:ServerHandler.Form1">
<Item value="OnClosing`0" priority="0" />
<Item value="Form1_Exit`0" priority="0" />
<Item value="Closing" priority="3" />
</ItemStatistics>
<ItemStatistics item="Qualified:@System.IO.Directory">
<Item value="GetDirectories`0" priority="0" />
<Item value="GetDirectoryRoot`0" priority="0" />
<Item value="GetParent`0" priority="0" />
</ItemStatistics>
<ItemStatistics item="Qualified:System.IO.DirectoryInfo">
<Item value="Delete`0" priority="0" />
<Item value="GetFiles`0" priority="0" />
<Item value="Exists" priority="0" />
</ItemStatistics>
<ItemStatistics item="Qualified:@System.Windows.Forms.MessageBox">
<Item value="Show`0" priority="1" />
</ItemStatistics>
<ItemStatistics item="Qualified:System.Exception">
<Item value="Message" priority="1" />
<Item value="StackTrace" priority="1" />
</ItemStatistics>
<ItemStatistics item="Qualified:@System.IO.File">
<Item value="Copy`0" priority="0" />
</ItemStatistics>
<ItemStatistics item="Qualified:System.IO.FileInfo">
<Item value="CopyTo`0" priority="0" />
<Item value="Name" priority="0" />
</ItemStatistics>
</CompletionStatisticsManager>
</Configuration>

View File

@ -1,20 +0,0 @@

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ServerHandler", "ServerHandler\ServerHandler.csproj", "{7674049F-5C67-4CD0-AD1F-8F23C718E37B}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x86 = Debug|x86
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{7674049F-5C67-4CD0-AD1F-8F23C718E37B}.Debug|x86.ActiveCfg = Debug|x86
{7674049F-5C67-4CD0-AD1F-8F23C718E37B}.Debug|x86.Build.0 = Debug|x86
{7674049F-5C67-4CD0-AD1F-8F23C718E37B}.Release|x86.ActiveCfg = Release|x86
{7674049F-5C67-4CD0-AD1F-8F23C718E37B}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

View File

@ -1,2 +0,0 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:Boolean x:Key="/Default/Housekeeping/SolutionSettingsUpgraded/IsUpgraded/@EntryValue">True</s:Boolean></wpf:ResourceDictionary>

View File

@ -1,175 +0,0 @@
namespace ServerHandler
{
partial class Form1
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.button1 = new System.Windows.Forms.Button();
this.button2 = new System.Windows.Forms.Button();
this.button3 = new System.Windows.Forms.Button();
this.button4 = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.label5 = new System.Windows.Forms.Label();
this.button5 = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// button1
//
this.button1.Location = new System.Drawing.Point(100, 12);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(135, 26);
this.button1.TabIndex = 0;
this.button1.Text = "Start";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// button2
//
this.button2.Location = new System.Drawing.Point(100, 55);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(135, 26);
this.button2.TabIndex = 1;
this.button2.Text = "Start";
this.button2.UseVisualStyleBackColor = true;
this.button2.Click += new System.EventHandler(this.button2_Click);
//
// button3
//
this.button3.Location = new System.Drawing.Point(100, 97);
this.button3.Name = "button3";
this.button3.Size = new System.Drawing.Size(135, 26);
this.button3.TabIndex = 2;
this.button3.Text = "Start";
this.button3.UseVisualStyleBackColor = true;
this.button3.Click += new System.EventHandler(this.button3_Click);
//
// button4
//
this.button4.Location = new System.Drawing.Point(100, 138);
this.button4.Name = "button4";
this.button4.Size = new System.Drawing.Size(135, 26);
this.button4.TabIndex = 3;
this.button4.Text = "Start";
this.button4.UseVisualStyleBackColor = true;
this.button4.Click += new System.EventHandler(this.button4_Click);
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(37, 19);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(29, 13);
this.label1.TabIndex = 4;
this.label1.Text = "HG1";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(37, 62);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(29, 13);
this.label2.TabIndex = 5;
this.label2.Text = "HG2";
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(37, 104);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(29, 13);
this.label3.TabIndex = 6;
this.label3.Text = "HG3";
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(37, 145);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(29, 13);
this.label4.TabIndex = 7;
this.label4.Text = "HG4";
//
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(37, 184);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(29, 13);
this.label5.TabIndex = 9;
this.label5.Text = "HG5";
//
// button5
//
this.button5.Location = new System.Drawing.Point(100, 177);
this.button5.Name = "button5";
this.button5.Size = new System.Drawing.Size(135, 26);
this.button5.TabIndex = 8;
this.button5.Text = "Start";
this.button5.UseVisualStyleBackColor = true;
this.button5.Click += new System.EventHandler(this.button5_Click);
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(244, 216);
this.Controls.Add(this.label5);
this.Controls.Add(this.button5);
this.Controls.Add(this.label4);
this.Controls.Add(this.label3);
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
this.Controls.Add(this.button4);
this.Controls.Add(this.button3);
this.Controls.Add(this.button2);
this.Controls.Add(this.button1);
this.Name = "Form1";
this.Text = "Form1";
this.Closing += OnFormClosing;
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.Button button3;
private System.Windows.Forms.Button button4;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.Button button5;
}
}

View File

@ -1,72 +0,0 @@
namespace ServerHandler
{
using System;
using System.Windows.Forms;
public partial class Form1 : Form
{
private readonly Server _hg1;
private readonly Server _hg2;
private readonly Server _hg3;
private readonly Server _hg4;
private readonly Server _hg5;
public Form1()
{
InitializeComponent();
_hg1 = new Server("hg1");
_hg2 = new Server("hg2");
_hg3 = new Server("hg3");
_hg4 = new Server("hg4");
_hg5 = new Server("hg5");
}
private void OnFormClosing(object sender, EventArgs e)
{
_hg1.Stop();
_hg2.Stop();
_hg3.Stop();
_hg4.Stop();
}
private void button1_Click(object sender, EventArgs e)
{
ToggleServerAndButton(_hg1, (Button)sender);
}
private void button2_Click(object sender, EventArgs e)
{
ToggleServerAndButton(_hg2, (Button)sender);
}
private void button3_Click(object sender, EventArgs e)
{
ToggleServerAndButton(_hg3, (Button)sender);
}
private void button4_Click(object sender, EventArgs e)
{
ToggleServerAndButton(_hg4, (Button)sender);
}
private void button5_Click(object sender, EventArgs e)
{
ToggleServerAndButton(_hg5, (Button) sender);
}
private void ToggleServerAndButton(Server server, Button button)
{
server.ToggleRunning();
if (server.ShouldBeRunning())
{
button.Text = "Stop";
}
else
{
button.Text = "Start";
}
}
}
}

View File

@ -1,120 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@ -1,21 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
namespace ServerHandler
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
}
}

View File

@ -1,36 +0,0 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("ServerHandler")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Windows User")]
[assembly: AssemblyProduct("ServerHandler")]
[assembly: AssemblyCopyright("Copyright © Windows User 2012")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("6c5498e0-d3d9-4c0a-8a68-0c1de5bda313")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@ -1,71 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.269
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace ServerHandler.Properties
{
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources
{
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources()
{
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager
{
get
{
if ((resourceMan == null))
{
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ServerHandler.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture
{
get
{
return resourceCulture;
}
set
{
resourceCulture = value;
}
}
}
}

View File

@ -1,117 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@ -1,30 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.269
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace ServerHandler.Properties
{
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
{
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default
{
get
{
return defaultInstance;
}
}
}
}

View File

@ -1,7 +0,0 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>

View File

@ -1,117 +0,0 @@
namespace ServerHandler
{
using System;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Threading;
using System.Windows.Forms;
public class Server
{
private bool _shouldBeRunning;
private Thread _watcherThread;
private Process _serverProcess;
private String _path;
public Server(String path)
{
_path = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + @"\" + path;
_watcherThread = new Thread(Watch);
_watcherThread.Start();
}
public bool ShouldBeRunning()
{
return _shouldBeRunning;
}
public void ToggleRunning()
{
_shouldBeRunning = !_shouldBeRunning;
if (_serverProcess == null)
{
try
{
String memParams = "-Djava.ext.dirs=lib -Xincgc -Xmx2048M ";
String args = memParams + "-jar " + "\"" + _path + @"\craftbukkit-0.0.1-snapshot.jar";
var processInfo = new ProcessStartInfo("java.exe", args);
processInfo.WorkingDirectory = _path;
processInfo.Verb = "runas";
processInfo.UseShellExecute = false;
_serverProcess = new Process();
_serverProcess.StartInfo = processInfo;
}
catch (Exception ex)
{
MessageBox.Show("Error creating process " + ex.Message + "\n" + ex.StackTrace);
}
}
if (!_shouldBeRunning)
{
if (!_serverProcess.HasExited)
{
_serverProcess.Kill();
}
}
}
public void PrepFiles()
{
var worldDirectory = new DirectoryInfo(_path + @"\world");
var worldEndDirectory = new DirectoryInfo(_path + @"\world_the_end");
try
{
if (worldDirectory.Exists)
worldDirectory.Delete(true);
if (worldEndDirectory.Exists)
worldEndDirectory.Delete(true);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message + "\n" + ex.StackTrace);
}
var commonDirectory = new DirectoryInfo(Directory.GetParent(Assembly.GetExecutingAssembly().Location) + @"\Common");
var files = commonDirectory.GetFiles();
// Copy the files and overwrite destination files if they already exist.
foreach (var file in files)
{
file.CopyTo(_path + @"\" + file.Name, true);
}
}
public void Start()
{
_serverProcess.Start();
_serverProcess.WaitForExit();
}
public void Stop()
{
_watcherThread.Abort();
}
public void Watch()
{
while (true)
{
if (_shouldBeRunning)
{
PrepFiles();
Start();
}
Thread.Sleep(2000);
}
}
}
}

View File

@ -1,92 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{7674049F-5C67-4CD0-AD1F-8F23C718E37B}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>ServerHandler</RootNamespace>
<AssemblyName>ServerHandler</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<PlatformTarget>x86</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<ApplicationManifest>app.manifest</ApplicationManifest>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Form1.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Form1.Designer.cs">
<DependentUpon>Form1.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Server.cs" />
<EmbeddedResource Include="Form1.resx">
<DependentUpon>Form1.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<None Include="app.manifest" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View File

@ -1,49 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<asmv1:assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<assemblyIdentity version="1.0.0.0" name="MyApplication.app"/>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
<!-- UAC Manifest Options
If you want to change the Windows User Account Control level replace the
requestedExecutionLevel node with one of the following.
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
<requestedExecutionLevel level="highestAvailable" uiAccess="false" />
Specifying requestedExecutionLevel node will disable file and registry virtualization.
If you want to utilize File and Registry Virtualization for backward
compatibility then delete the requestedExecutionLevel node.
-->
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
</requestedPrivileges>
</security>
</trustInfo>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!-- A list of all Windows versions that this application is designed to work with. Windows will automatically select the most compatible environment.-->
<!-- If your application is designed to work with Windows 7, uncomment the following supportedOS node-->
<!--<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>-->
</application>
</compatibility>
<!-- Enable themes for Windows common controls and dialogs (Windows XP and later) -->
<!-- <dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="*"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>-->
</asmv1:assembly>

Binary file not shown.