Mud Designer:

- Added new Project. Mud Designer project will include the GUI elements needed for graphically building a MUD. Due to Environment creation being finalized, work on a GUI based Environment creation can start.

Mud Engine:
 - Objects no longer require a path to be supplied when calling Object.Save()
 - EditRealm command now edits senses.
 - EditRoom now fully supports creating doorways, however editing existing doorways and linking to existing rooms is not implemented. This command only supports creating new doorways for non-existing Rooms (Rooms are generated as needed)
 - EditZone Now fully supports senses and implemented.
 - Game now supports loading of .ini files when calling Game.Load()
 - All objects now include a SavePath properties. Override this to supply a path for where the object needs to be saved. All Environment and BaseCharacter objects override the BaseObject.SavePath to save into ActiveGame.DataPaths.Environemnts and Players respectively.
 - ObjectCollection now instanced during ScriptEngine initialization to prevent exceptions during runtime.
 - Create command no longer converts all names to lower case.
 - Updated the Walk command to execute the Look command in a safe manor without injecting a command into the player Telnet console.
This commit is contained in:
Scionwest_cp 2010-09-26 08:00:34 -07:00
parent 304b2d07eb
commit a347607337
35 changed files with 2013 additions and 60 deletions

View file

@ -1,6 +1,6 @@

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
# Visual C# Express 2010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MudEngine", "MudEngine\MudEngine.csproj", "{498943A8-DF5A-4DB0-B506-0BFF44788657}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MUDCompiler", "MUDCompiler\MUDCompiler.csproj", "{98E974DA-C650-4B88-B2F8-57AC7AE6C34F}"
@ -9,6 +9,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MudGame", "MudGame\MudGame.
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MudClient", "MudClient\MudClient.csproj", "{970B3390-7485-41A5-8465-CFF2580501B6}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MudDesigner", "MudDesigner\MudDesigner.csproj", "{5B18E552-26D0-4491-8BAC-FF80046F0B0F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -59,6 +61,16 @@ Global
{970B3390-7485-41A5-8465-CFF2580501B6}.Release|Mixed Platforms.Build.0 = Release|x86
{970B3390-7485-41A5-8465-CFF2580501B6}.Release|x86.ActiveCfg = Release|x86
{970B3390-7485-41A5-8465-CFF2580501B6}.Release|x86.Build.0 = Release|x86
{5B18E552-26D0-4491-8BAC-FF80046F0B0F}.Debug|Any CPU.ActiveCfg = Debug|x86
{5B18E552-26D0-4491-8BAC-FF80046F0B0F}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
{5B18E552-26D0-4491-8BAC-FF80046F0B0F}.Debug|Mixed Platforms.Build.0 = Debug|x86
{5B18E552-26D0-4491-8BAC-FF80046F0B0F}.Debug|x86.ActiveCfg = Debug|x86
{5B18E552-26D0-4491-8BAC-FF80046F0B0F}.Debug|x86.Build.0 = Debug|x86
{5B18E552-26D0-4491-8BAC-FF80046F0B0F}.Release|Any CPU.ActiveCfg = Release|x86
{5B18E552-26D0-4491-8BAC-FF80046F0B0F}.Release|Mixed Platforms.ActiveCfg = Release|x86
{5B18E552-26D0-4491-8BAC-FF80046F0B0F}.Release|Mixed Platforms.Build.0 = Release|x86
{5B18E552-26D0-4491-8BAC-FF80046F0B0F}.Release|x86.ActiveCfg = Release|x86
{5B18E552-26D0-4491-8BAC-FF80046F0B0F}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

View file

@ -0,0 +1,111 @@
<?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>{5B18E552-26D0-4491-8BAC-FF80046F0B0F}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>MudDesigner</RootNamespace>
<AssemblyName>MudDesigner</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<PlatformTarget>x86</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>
<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="frmDesigner.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="frmDesigner.Designer.cs">
<DependentUpon>frmDesigner.cs</DependentUpon>
</Compile>
<Compile Include="frmInputBox.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="frmInputBox.Designer.cs">
<DependentUpon>frmInputBox.cs</DependentUpon>
</Compile>
<Compile Include="frmProjectManager.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="frmProjectManager.Designer.cs">
<DependentUpon>frmProjectManager.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="frmDesigner.resx">
<DependentUpon>frmDesigner.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="frmInputBox.resx">
<DependentUpon>frmInputBox.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="frmProjectManager.resx">
<DependentUpon>frmProjectManager.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="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>
<ItemGroup>
<ProjectReference Include="..\MudEngine\MudEngine.csproj">
<Project>{498943A8-DF5A-4DB0-B506-0BFF44788657}</Project>
<Name>MudEngine</Name>
</ProjectReference>
</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>

21
MudDesigner/Program.cs Normal file
View file

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

View file

@ -0,0 +1,36 @@
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("MudDesigner")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("MudDesigner")]
[assembly: AssemblyCopyright("Copyright © 2010")]
[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("a13fbcd8-b06c-46d0-8120-c5636503f121")]
// 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

@ -0,0 +1,71 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.1
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace MudDesigner.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("MudDesigner.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

@ -0,0 +1,117 @@
<?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

@ -0,0 +1,30 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.1
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace MudDesigner.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

@ -0,0 +1,7 @@
<?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>

65
MudDesigner/frmDesigner.Designer.cs generated Normal file
View file

@ -0,0 +1,65 @@
namespace MudDesigner
{
partial class frmDesigner
{
/// <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.propertyGrid1 = new System.Windows.Forms.PropertyGrid();
this.SuspendLayout();
//
// propertyGrid1
//
this.propertyGrid1.Dock = System.Windows.Forms.DockStyle.Right;
this.propertyGrid1.Location = new System.Drawing.Point(525, 0);
this.propertyGrid1.Name = "propertyGrid1";
this.propertyGrid1.Size = new System.Drawing.Size(259, 564);
this.propertyGrid1.TabIndex = 0;
this.propertyGrid1.PropertyValueChanged += new System.Windows.Forms.PropertyValueChangedEventHandler(this.propertyGrid1_PropertyValueChanged);
//
// frmDesigner
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.ClientSize = new System.Drawing.Size(784, 564);
this.Controls.Add(this.propertyGrid1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "frmDesigner";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Mud Designer";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.frmDesigner_FormClosing);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.PropertyGrid propertyGrid1;
}
}

View file

@ -0,0 +1,77 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
using MudEngine.GameManagement;
using MudEngine.FileSystem;
namespace MudDesigner
{
public partial class frmDesigner : Form
{
private Game _Game;
private Boolean _IsRenaming;
private String _OldName;
public frmDesigner(Game game)
{
InitializeComponent();
_Game = game;
MudEngine.GameObjects.Environment.Room r = new MudEngine.GameObjects.Environment.Room(_Game);
this.propertyGrid1.SelectedObject = _Game;
}
/// <summary>
/// Saves the project.
/// </summary>
public void Save()
{
if ((String.IsNullOrEmpty(_Game.GameTitle)) || (_Game.GameTitle == new Game().GameTitle))
return;
if ((_IsRenaming) && (Directory.Exists(Path.Combine("Projects", _OldName))))
{
Directory.Delete(Path.Combine("Projects", _OldName), true);
File.Delete(Path.Combine(Environment.CurrentDirectory, _OldName + ".ini"));
}
_Game.Save();
}
private void frmDesigner_FormClosing(object sender, FormClosingEventArgs e)
{
DialogResult result = MessageBox.Show("Save Changes?", this.Text, MessageBoxButtons.YesNoCancel);
if (result == System.Windows.Forms.DialogResult.Cancel)
{
e.Cancel = true;
return;
}
else if (result == System.Windows.Forms.DialogResult.Yes)
this.Save();
}
private void propertyGrid1_PropertyValueChanged(object s, PropertyValueChangedEventArgs e)
{
if (e.ChangedItem.Label == "GameTitle")
{
String Env = _Game.DataPaths.Environment.Replace(e.OldValue.ToString(), e.ChangedItem.Value.ToString());
String plyr = _Game.DataPaths.Players.Replace(e.OldValue.ToString(), e.ChangedItem.Value.ToString());
_Game.DataPaths = new SaveDataPaths(Env, plyr);
_IsRenaming = true;
_OldName = e.OldValue.ToString();
}
}
}
}

View file

@ -0,0 +1,120 @@
<?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>

100
MudDesigner/frmInputBox.Designer.cs generated Normal file
View file

@ -0,0 +1,100 @@
namespace MudDesigner
{
partial class frmInputBox
{
/// <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.lblDescription = new System.Windows.Forms.Label();
this.txtInput = new System.Windows.Forms.TextBox();
this.btnCancel = new System.Windows.Forms.Button();
this.btnOK = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// lblDescription
//
this.lblDescription.Location = new System.Drawing.Point(0, 0);
this.lblDescription.Name = "lblDescription";
this.lblDescription.Size = new System.Drawing.Size(353, 87);
this.lblDescription.TabIndex = 0;
this.lblDescription.Text = "Place input directions here via frmInputBox.Description";
//
// txtInput
//
this.txtInput.Location = new System.Drawing.Point(3, 90);
this.txtInput.Name = "txtInput";
this.txtInput.Size = new System.Drawing.Size(350, 20);
this.txtInput.TabIndex = 1;
this.txtInput.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtInput_KeyDown);
//
// btnCancel
//
this.btnCancel.Location = new System.Drawing.Point(278, 116);
this.btnCancel.Name = "btnCancel";
this.btnCancel.Size = new System.Drawing.Size(75, 24);
this.btnCancel.TabIndex = 2;
this.btnCancel.Text = "Cancel";
this.btnCancel.UseVisualStyleBackColor = true;
this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
//
// btnOK
//
this.btnOK.Location = new System.Drawing.Point(197, 116);
this.btnOK.Name = "btnOK";
this.btnOK.Size = new System.Drawing.Size(75, 24);
this.btnOK.TabIndex = 3;
this.btnOK.Text = "OK";
this.btnOK.UseVisualStyleBackColor = true;
this.btnOK.Click += new System.EventHandler(this.btnOK_Click);
//
// frmInputBox
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(356, 145);
this.Controls.Add(this.btnOK);
this.Controls.Add(this.btnCancel);
this.Controls.Add(this.txtInput);
this.Controls.Add(this.lblDescription);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "frmInputBox";
this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label lblDescription;
private System.Windows.Forms.TextBox txtInput;
private System.Windows.Forms.Button btnCancel;
private System.Windows.Forms.Button btnOK;
}
}

View file

@ -0,0 +1,46 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace MudDesigner
{
public partial class frmInputBox : Form
{
public bool IsCancel { get; set; }
public String Description { get { return this.lblDescription.Text; } set { this.lblDescription.Text = value; } }
public String Input { get { return this.txtInput.Text; } private set { this.txtInput.Text = value; } }
public frmInputBox(String desc)
{
InitializeComponent();
this.Description = desc;
}
private void btnOK_Click(object sender, EventArgs e)
{
this.Hide();
}
private void btnCancel_Click(object sender, EventArgs e)
{
IsCancel = true;
Input = String.Empty;
}
private void txtInput_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
btnOK_Click(sender, null);
else if (e.KeyCode == Keys.Escape)
btnCancel_Click(sender, null);
}
}
}

View file

@ -0,0 +1,120 @@
<?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>

265
MudDesigner/frmProjectManager.Designer.cs generated Normal file
View file

@ -0,0 +1,265 @@
namespace MudDesigner
{
partial class frmProjectManager
{
/// <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.components = new System.ComponentModel.Container();
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.button1 = new System.Windows.Forms.Button();
this.splitContainer2 = new System.Windows.Forms.SplitContainer();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.lstProjects = new System.Windows.Forms.ListBox();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.btnClose = new System.Windows.Forms.Button();
this.btnNewProject = new System.Windows.Forms.Button();
this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components);
this.launchServerToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripSeparator();
this.editProjectToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.renameProjectToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripMenuItem2 = new System.Windows.Forms.ToolStripSeparator();
this.deleteProjectToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
this.splitContainer1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).BeginInit();
this.splitContainer2.Panel1.SuspendLayout();
this.splitContainer2.Panel2.SuspendLayout();
this.splitContainer2.SuspendLayout();
this.groupBox1.SuspendLayout();
this.groupBox2.SuspendLayout();
this.contextMenuStrip1.SuspendLayout();
this.SuspendLayout();
//
// splitContainer1
//
this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer1.Location = new System.Drawing.Point(0, 0);
this.splitContainer1.Name = "splitContainer1";
this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal;
//
// splitContainer1.Panel1
//
this.splitContainer1.Panel1.Controls.Add(this.button1);
//
// splitContainer1.Panel2
//
this.splitContainer1.Panel2.Controls.Add(this.splitContainer2);
this.splitContainer1.Size = new System.Drawing.Size(624, 444);
this.splitContainer1.SplitterDistance = 169;
this.splitContainer1.TabIndex = 0;
//
// button1
//
this.button1.BackColor = System.Drawing.Color.Black;
this.button1.Dock = System.Windows.Forms.DockStyle.Fill;
this.button1.FlatAppearance.BorderColor = System.Drawing.Color.Silver;
this.button1.FlatAppearance.BorderSize = 2;
this.button1.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Black;
this.button1.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Black;
this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.button1.Font = new System.Drawing.Font("Microsoft Sans Serif", 15.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.button1.ForeColor = System.Drawing.Color.White;
this.button1.Location = new System.Drawing.Point(0, 0);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(624, 169);
this.button1.TabIndex = 0;
this.button1.Text = "Mud Designer\r\nAlpha 1";
this.button1.UseVisualStyleBackColor = false;
//
// splitContainer2
//
this.splitContainer2.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer2.Location = new System.Drawing.Point(0, 0);
this.splitContainer2.Name = "splitContainer2";
this.splitContainer2.Orientation = System.Windows.Forms.Orientation.Horizontal;
//
// splitContainer2.Panel1
//
this.splitContainer2.Panel1.Controls.Add(this.groupBox1);
//
// splitContainer2.Panel2
//
this.splitContainer2.Panel2.Controls.Add(this.groupBox2);
this.splitContainer2.Size = new System.Drawing.Size(624, 271);
this.splitContainer2.SplitterDistance = 216;
this.splitContainer2.TabIndex = 0;
//
// groupBox1
//
this.groupBox1.Controls.Add(this.lstProjects);
this.groupBox1.Dock = System.Windows.Forms.DockStyle.Fill;
this.groupBox1.Location = new System.Drawing.Point(0, 0);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(624, 216);
this.groupBox1.TabIndex = 1;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "Available Projects";
//
// lstProjects
//
this.lstProjects.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
this.lstProjects.ContextMenuStrip = this.contextMenuStrip1;
this.lstProjects.Dock = System.Windows.Forms.DockStyle.Fill;
this.lstProjects.FormattingEnabled = true;
this.lstProjects.Location = new System.Drawing.Point(3, 16);
this.lstProjects.Name = "lstProjects";
this.lstProjects.Size = new System.Drawing.Size(618, 197);
this.lstProjects.TabIndex = 0;
//
// groupBox2
//
this.groupBox2.Controls.Add(this.btnClose);
this.groupBox2.Controls.Add(this.btnNewProject);
this.groupBox2.Dock = System.Windows.Forms.DockStyle.Fill;
this.groupBox2.Location = new System.Drawing.Point(0, 0);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(624, 51);
this.groupBox2.TabIndex = 0;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "Options";
//
// btnClose
//
this.btnClose.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnClose.Location = new System.Drawing.Point(509, 16);
this.btnClose.Name = "btnClose";
this.btnClose.Size = new System.Drawing.Size(109, 32);
this.btnClose.TabIndex = 2;
this.btnClose.Text = "Close";
this.btnClose.UseVisualStyleBackColor = true;
this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
//
// btnNewProject
//
this.btnNewProject.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnNewProject.Location = new System.Drawing.Point(6, 16);
this.btnNewProject.Name = "btnNewProject";
this.btnNewProject.Size = new System.Drawing.Size(109, 32);
this.btnNewProject.TabIndex = 0;
this.btnNewProject.Text = "New Project";
this.btnNewProject.UseVisualStyleBackColor = true;
this.btnNewProject.Click += new System.EventHandler(this.btnNewProject_Click);
//
// contextMenuStrip1
//
this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.launchServerToolStripMenuItem,
this.toolStripMenuItem1,
this.editProjectToolStripMenuItem,
this.renameProjectToolStripMenuItem,
this.toolStripMenuItem2,
this.deleteProjectToolStripMenuItem});
this.contextMenuStrip1.Name = "contextMenuStrip1";
this.contextMenuStrip1.Size = new System.Drawing.Size(158, 104);
//
// launchServerToolStripMenuItem
//
this.launchServerToolStripMenuItem.Name = "launchServerToolStripMenuItem";
this.launchServerToolStripMenuItem.Size = new System.Drawing.Size(157, 22);
this.launchServerToolStripMenuItem.Text = "Launch Server";
//
// toolStripMenuItem1
//
this.toolStripMenuItem1.Name = "toolStripMenuItem1";
this.toolStripMenuItem1.Size = new System.Drawing.Size(154, 6);
//
// editProjectToolStripMenuItem
//
this.editProjectToolStripMenuItem.Name = "editProjectToolStripMenuItem";
this.editProjectToolStripMenuItem.Size = new System.Drawing.Size(157, 22);
this.editProjectToolStripMenuItem.Text = "Edit Project";
this.editProjectToolStripMenuItem.Click += new System.EventHandler(this.editProjectToolStripMenuItem_Click);
//
// renameProjectToolStripMenuItem
//
this.renameProjectToolStripMenuItem.Name = "renameProjectToolStripMenuItem";
this.renameProjectToolStripMenuItem.Size = new System.Drawing.Size(157, 22);
this.renameProjectToolStripMenuItem.Text = "Rename Project";
//
// toolStripMenuItem2
//
this.toolStripMenuItem2.Name = "toolStripMenuItem2";
this.toolStripMenuItem2.Size = new System.Drawing.Size(154, 6);
//
// deleteProjectToolStripMenuItem
//
this.deleteProjectToolStripMenuItem.Name = "deleteProjectToolStripMenuItem";
this.deleteProjectToolStripMenuItem.Size = new System.Drawing.Size(157, 22);
this.deleteProjectToolStripMenuItem.Text = "Delete Project";
//
// frmProjectManager
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.ClientSize = new System.Drawing.Size(624, 444);
this.Controls.Add(this.splitContainer1);
this.ForeColor = System.Drawing.Color.Silver;
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "frmProjectManager";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Mud Designer Project Manager";
this.splitContainer1.Panel1.ResumeLayout(false);
this.splitContainer1.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
this.splitContainer1.ResumeLayout(false);
this.splitContainer2.Panel1.ResumeLayout(false);
this.splitContainer2.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).EndInit();
this.splitContainer2.ResumeLayout(false);
this.groupBox1.ResumeLayout(false);
this.groupBox2.ResumeLayout(false);
this.contextMenuStrip1.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.SplitContainer splitContainer1;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.SplitContainer splitContainer2;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.ListBox lstProjects;
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.Button btnClose;
private System.Windows.Forms.Button btnNewProject;
private System.Windows.Forms.ContextMenuStrip contextMenuStrip1;
private System.Windows.Forms.ToolStripMenuItem launchServerToolStripMenuItem;
private System.Windows.Forms.ToolStripSeparator toolStripMenuItem1;
private System.Windows.Forms.ToolStripMenuItem editProjectToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem renameProjectToolStripMenuItem;
private System.Windows.Forms.ToolStripSeparator toolStripMenuItem2;
private System.Windows.Forms.ToolStripMenuItem deleteProjectToolStripMenuItem;
}
}

View file

@ -0,0 +1,131 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
using MudEngine.FileSystem;
using MudEngine.GameManagement;
using MudEngine.Scripting;
namespace MudDesigner
{
public partial class frmProjectManager : Form
{
String[] _ProjectFiles;
String _ProjectPath;
String _ScriptPath;
const String SettingsFile = "Settings.ini";
dynamic _Game;
ScriptEngine _ScriptEngine;
public frmProjectManager()
{
InitializeComponent();
_ProjectPath = Path.Combine(Environment.CurrentDirectory, "Projects");
_ScriptPath = Path.Combine(Environment.CurrentDirectory, "Scripts");
if (!Directory.Exists(_ProjectPath))
Directory.CreateDirectory(_ProjectPath);
if (!Directory.Exists(_ScriptPath))
Directory.CreateDirectory(_ScriptPath);
if (!File.Exists(SettingsFile))
{
Log.Write("Settings.ini missing!", false);
FileManager.WriteLine(SettingsFile, "Scripts", "ScriptPath");
FileManager.WriteLine(SettingsFile, ".cs", "ScriptExtension");
FileManager.WriteLine(SettingsFile, "True", "ServerEnabled");
}
_ScriptEngine = new ScriptEngine(new Game(), ScriptEngine.ScriptTypes.Both);
_ScriptEngine.Initialize();
GameObject go = _ScriptEngine.GetObject("Game");
if (go == null)
{
_Game = new Game();
go = new GameObject(_Game, "Game");
_ScriptEngine = new ScriptEngine(_Game, ScriptEngine.ScriptTypes.Both);
}
else
{
_Game = (Game)go.Instance;
_ScriptEngine = new ScriptEngine(_Game, ScriptEngine.ScriptTypes.Both);
}
//TODO: Do I need to Re-initialize _ScriptEngine?
_ProjectFiles = Directory.GetFiles(Environment.CurrentDirectory, "*.ini");
foreach (String filename in _ProjectFiles)
{
if (Path.GetFileNameWithoutExtension(filename).ToLower() == "settings")
continue;
_Game.Load(filename);
lstProjects.Items.Add(_Game.GameTitle);
}
}
private void btnNewProject_Click(object sender, EventArgs e)
{
frmInputBox input = new frmInputBox("Enter the name of your project.");
input.ShowDialog();
if (input.IsCancel)
return;
else if (String.IsNullOrEmpty(input.Input))
return;
lstProjects.Items.Add(input.Input);
_Game.GameTitle = input.Input;
//Setup save data paths.
_Game.DataPaths = new SaveDataPaths(Path.Combine("Projects", _Game.GameTitle, _Game.DataPaths.Environment), Path.Combine("Projects", _Game.GameTitle, _Game.DataPaths.Players));
_Game.Save();
input = null;
ShowDesigner();
}
private void ShowDesigner()
{
frmDesigner form = new frmDesigner(_Game);
form.Show();
this.Hide();
while (form.Visible)
{
Application.DoEvents();
}
this.Show();
form = null;
}
private void btnClose_Click(object sender, EventArgs e)
{
Application.Exit();
}
private void editProjectToolStripMenuItem_Click(object sender, EventArgs e)
{
if (File.Exists(lstProjects.SelectedItem.ToString() + ".ini"))
_Game.Load(lstProjects.SelectedItem.ToString() + ".ini");
ShowDesigner();
}
}
}

View file

@ -0,0 +1,123 @@
<?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>
<metadata name="contextMenuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>

View file

@ -228,6 +228,19 @@ namespace MudEngine.Commands
ParseNameSelection(entry);
break;
case 3://Senses
BuildMenuSenses();
try
{
entry = Convert.ToInt32(player.ReadInput());
}
catch
{
player.Send("Realm Editing Canceled. The supplied value was not numeric!");
return;
}
ParseSensesSelection(entry);
break;
case 4: //Initial Realm
//build the menu and parse their menu selections
@ -633,7 +646,7 @@ namespace MudEngine.Commands
if (p.CurrentRoom.Realm == oldName)
{
p.CurrentRoom.Realm = realm.Filename;
p.Save(player.ActiveGame.DataPaths.Players);
p.Save();
}
}
@ -651,7 +664,7 @@ namespace MudEngine.Commands
if (ch.CurrentRoom.Realm == oldName)
{
ch.CurrentRoom.Realm = realm.Filename;
ch.Save(player.ActiveGame.DataPaths.Players);
ch.Save();
}
}

View file

@ -38,13 +38,24 @@ namespace MudEngine.Commands
if ((player.Role == SecurityRoles.Admin) || (player.Role == SecurityRoles.GM))
{
//Get the admin-entered room filename
String[] tokens = command.Substring("EditRoom".Length).Trim().Split('>');
String[] tokens;
String filename;
//Other scripts calling this script typically don't supply 'EditRoom' within the command argument
if (command.ToLower().StartsWith("editroom"))
tokens = command.Substring("EditRoom".Length).Trim().Split('>');
else
tokens = command.Trim().Split('>');
if (tokens.Length == 0)
{
player.Send("Room Editing canceled. No Room name was supplied.");
return;
}
else if (tokens.Length == 1)
{
filename = tokens[0];
}
else if (tokens.Length <= 2)
{
player.Send("Room Editing canceled. You must use the Rooms fully qualified path.");
@ -52,26 +63,36 @@ namespace MudEngine.Commands
gc.Execute("Help EditRoom", player);
return;
}
String filename = tokens[2]; //Room filename is the 3rd index in the array.
else
filename = tokens[2]; //Room filename is the 3rd index in the array.
//Raise the scope of the player reference to class level instead of method level.
this.player = player;
//We have a filename, retrieve the Room the admin wants to edit.
if ((player.ActiveGame.World.GetRealm(tokens[0]) == null) || (player.ActiveGame.World.GetRealm(tokens[0]).GetZone(tokens[1])[0] == null))
if (tokens.Length == 3)
{
player.Send("Room editing canceled. Rooms owning Realm or Zone does not exists.");
return;
try
{
room = player.ActiveGame.World.GetRealm(tokens[0]).GetZone(tokens[1])[0].GetRoom(filename)[0];
}
catch
{
player.Send("Room Editing canceled. The supplied path does not exist. Did you type the correct names in?");
}
}
if (player.ActiveGame.World.GetRealm(tokens[0]).GetZone(tokens[1])[0].GetRoom(filename).Count == 0)
else
{
player.Send("Room Editing canceled. The supplied Room does not exist.");
return;
}
room = player.ActiveGame.World.GetRealm(tokens[0]).GetZone(tokens[1])[0].GetRoom(filename)[0];
try
{
room = player.ActiveGame.World.GetRealm(player.CurrentRoom.Realm).GetZone(player.CurrentRoom.Zone)[0].GetRoom(filename)[0];
}
catch
{
player.Send("Room Editing canceled. The supplied Room does not exist.");
return;
}
}
//If no Room was retrieved (due to it not existing), let the admin know
//that the Room filename was not valid.
if (room == null)
@ -125,8 +146,8 @@ namespace MudEngine.Commands
player.Send("2: Names");
player.Send("3: Senses");
player.Send("4: Initial Room");
player.Send("5: Settings");
//player.Send("6: Doorways");
//player.Send("5: Settings");
player.Send("6: Doorways");
player.Send("9: Exit");
player.Send("Enter numeric selection: ", false);
}
@ -205,6 +226,22 @@ namespace MudEngine.Commands
player.Send("Enter numeric selection: ", false);
}
private void BuildMenuDoorways()
{
player.FlushConsole();
player.Send(room.Name);
player.Send("Doorway setup.");
player.Send("You may create and edit doorways from the options available below.");
player.Send("Doorways allow you to link two rooms together, giving characters the ability to traverse your game world.");
player.Send("Please select from the available options below:");
player.Send("1: Create a doorway.");
if (room.Doorways.Count != 0)
player.Send("2: Edit a doorway.");
player.Send("9: Exit");
player.Send("Enter a numeric selection: ", false);
}
/// <summary>
/// This method parses the Admin input based off the main editing menu
/// and sends the admin to what-ever sub-menu method we need to.
@ -247,6 +284,19 @@ namespace MudEngine.Commands
ParseNameSelection(entry);
break;
case 3://Senses
BuildMenuSenses();
try
{
entry = Convert.ToInt32(player.ReadInput());
}
catch
{
player.Send("Realm Editing Canceled. The supplied value was not numeric!");
return;
}
ParseSensesSelection(entry);
break;
case 4: //Initial Realm
//build the menu and parse their menu selections
@ -266,9 +316,21 @@ namespace MudEngine.Commands
case 5: //Settings
break;
case 6: //Doorways
BuildMenuDoorways();
try
{
entry = Convert.ToInt32(player.ReadInput());
}
catch
{
player.Send("Room Editing canceled. The supplied value was not numeric!");
}
ParseDoorwaySelection(entry);
break;
case 9:
isEditing = false;
isEditing = false;
break;
default:
break;
@ -651,6 +713,252 @@ namespace MudEngine.Commands
player.ActiveGame.Save();
}
private void ParseDoorwaySelection(Int32 value)
{
Int32 input = 0;
switch (value)
{
case 1: //Create doorway
player.FlushConsole();
player.Send("Link Editor:");
player.Send("If you choose to link to a non-existant Room, the Room will be created for you during the link process.");
player.Send("Please select from one of the available options below:");
player.Send("1: Link to a non-existant Room.");
player.Send("2: Link to a existing Room.");
try
{
input = Convert.ToInt32(player.ReadInput());
}
catch
{
player.Send("Room Editing Canceled. Supplied value was not numeric!");
return;
}
switch (input)
{
case 1:
LinkNewRoom();
break;
case 2:
LinkExistingRoom();
break;
}
break;
case 2: //Edit doorway
break;
}
}
private void LinkNewRoom()
{
player.FlushConsole();
player.Send("Please enter the name for the new Room.");
player.Send("If you want to link to a different Realm or Zone, please supply their full path.");
player.Send("Example: MyRealm>MyZone>NewRoomName");
player.Send("If you supply only a Room name, then the Room will be created within the same Realm/Zone as the current Room being edited.");
player.Send("Enter Name: ", false);
Room r = new Room(player.ActiveGame);
String roomName = player.ReadInput();
if (String.IsNullOrEmpty(roomName))
{
player.Send("Invalid name supplied!");
return;
}
r.Name = roomName;
player.ActiveGame.World.GetRealm(player.CurrentRoom.Realm).GetZone(player.CurrentRoom.Zone)[0].AddRoom(r);
player.FlushConsole();
player.Send("Please select the direction you want to travel from " + room.Name.ToUpper());
Array directions = Enum.GetValues(typeof(AvailableTravelDirections));
Int32 number = 1;
foreach (Int32 value in directions)
{
String direction = Enum.GetName(typeof(AvailableTravelDirections), value);
if (direction == "None")
continue;
Boolean isUsed = false;
foreach (Door door in room.Doorways)
{
if (door.TravelDirection == (AvailableTravelDirections)Enum.Parse(typeof(AvailableTravelDirections), direction))
{
isUsed = true;
}
}
if (isUsed)
continue;
player.Send(number + ": " + direction);
number++;
}
//TODO Get input for travel direction and link the rooms via Zone.LinkRooms()
player.Send("Enter numeric selection: ", false);
Int32 input = 0;
try
{
input = Convert.ToInt32(player.ReadInput());
}
catch
{
player.Send("Room Linking canceled! You must supply a valid numeric selection.");
return;
}
AvailableTravelDirections d = AvailableTravelDirections.None;
String displayName = Enum.GetName(typeof(AvailableTravelDirections), input + room.Doorways.Count);
if ((String.IsNullOrEmpty(displayName)) || (displayName == "None"))
{
player.Send("Invalid direction selected. Linking canceled.");
return;
}
d = (AvailableTravelDirections)Enum.Parse(typeof(AvailableTravelDirections), displayName);
Zone z = new Zone(player.ActiveGame);
z = player.ActiveGame.World.GetRealm(room.Realm).GetZone(room.Zone)[0];
z.LinkRooms(d, r, room);
//z.AddRoom(r);
player.FlushConsole();
player.Send("Would you like to edit the properties for the newly created " + r.Name + " room?");
player.Send("Available Selections:");
player.Send("1: Yes");
player.Send("2: No");
player.Send("Enter selection: ", false);
try
{
input = Convert.ToInt32(player.ReadInput());
}
catch
{
player.Send("Invalid selection!");
player.Send(r.Name + " created and linked to " + room.Name + ", however no properties for " + r.Name + " were set. Please use EditRoom " + r.Realm + ">" + r.Zone + ">" + r.Name + " to edit them.");
return;
}
if (input == 1)
{
IGameCommand gc = CommandEngine.GetCommand("CommandEditRoom");
gc.Execute(r.RoomLocationWithoutExtension, player);
isEditing = true; //Previous EditRoom command sets this to False if the admin exits the editing of the new Room.
}
player.Send(r.Name + " created and linked to " + room.Name);
}
private void LinkExistingRoom()
{
player.FlushConsole();
player.Send("Please enter the name for the existing Room.");
player.Send("If you want to link to a different Realm or Zone, please supply their full path.");
player.Send("Example: MyRealm>MyZone>NewRoomName");
player.Send("If you supply only a Room name, then the Room will be created within the same Realm/Zone as the current Room being edited.");
player.Send("Enter Name: ", false);
Room r = new Room(player.ActiveGame);
String roomName = player.ReadInput();
if (String.IsNullOrEmpty(roomName))
{
player.Send("Invalid name supplied!");
return;
}
r.Name = roomName;
player.ActiveGame.World.GetRealm(player.CurrentRoom.Realm).GetZone(player.CurrentRoom.Zone)[0].AddRoom(r);
player.FlushConsole();
player.Send("Please select the direction you want to travel from " + room.Name.ToUpper());
Array directions = Enum.GetValues(typeof(AvailableTravelDirections));
Int32 number = 1;
foreach (Int32 value in directions)
{
String direction = Enum.GetName(typeof(AvailableTravelDirections), value);
if (direction == "None")
continue;
Boolean isUsed = false;
foreach (Door door in room.Doorways)
{
if (door.TravelDirection == (AvailableTravelDirections)Enum.Parse(typeof(AvailableTravelDirections), direction))
{
isUsed = true;
}
}
if (isUsed)
continue;
player.Send(number + ": " + direction);
number++;
}
//TODO Get input for travel direction and link the rooms via Zone.LinkRooms()
player.Send("Enter numeric selection: ", false);
Int32 input = 0;
try
{
input = Convert.ToInt32(player.ReadInput());
}
catch
{
player.Send("Room Linking canceled! You must supply a valid numeric selection.");
return;
}
AvailableTravelDirections d = AvailableTravelDirections.None;
String displayName = Enum.GetName(typeof(AvailableTravelDirections), input + room.Doorways.Count);
if ((String.IsNullOrEmpty(displayName)) || (displayName == "None"))
{
player.Send("Invalid direction selected. Linking canceled.");
return;
}
d = (AvailableTravelDirections)Enum.Parse(typeof(AvailableTravelDirections), displayName);
Zone z = new Zone(player.ActiveGame);
z = player.ActiveGame.World.GetRealm(room.Realm).GetZone(room.Zone)[0];
z.LinkRooms(d, r, room);
//z.AddRoom(r);
player.FlushConsole();
player.Send("Would you like to edit the properties for the newly created " + r.Name + " room?");
player.Send("Available Selections:");
player.Send("1: Yes");
player.Send("2: No");
player.Send("Enter selection: ", false);
try
{
input = Convert.ToInt32(player.ReadInput());
}
catch
{
player.Send("Invalid selection!");
player.Send(r.Name + " created and linked to " + room.Name + ", however no properties for " + r.Name + " were set. Please use EditRoom " + r.Realm + ">" + r.Zone + ">" + r.Name + " to edit them.");
return;
}
if (input == 1)
{
IGameCommand gc = CommandEngine.GetCommand("CommandEditRoom");
gc.Execute(r.RoomLocationWithoutExtension, player);
isEditing = true; //Previous EditRoom command sets this to False if the admin exits the editing of the new Room.
}
player.Send(r.Name + " created and linked to " + room.Name);
}
/// <summary>
/// This method is used when the Rooms name or filename has changed.
/// It updates all objects that refer to this Rooms filename/roomname
@ -677,7 +985,7 @@ namespace MudEngine.Commands
if (p.CurrentRoom.Filename == oldName)
{
p.CurrentRoom = room;
p.Save(player.ActiveGame.DataPaths.Players);
p.Save();
}
}
@ -695,7 +1003,7 @@ namespace MudEngine.Commands
if (ch.CurrentRoom.Filename == oldName)
{
ch.CurrentRoom = room;
ch.Save(player.ActiveGame.DataPaths.Players);
ch.Save();
}
}

View file

@ -120,7 +120,7 @@ namespace MudEngine.Commands
player.Send("2: Names");
player.Send("3: Senses");
player.Send("4: Initial Zone");
// player.Send("5: Settings");
player.Send("5: Settings");
player.Send("9: Exit");
player.Send("Enter numeric selection: ", false);
}
@ -199,6 +199,20 @@ namespace MudEngine.Commands
player.Send("Enter numeric selection: ", false);
}
private void BuildMenuSettings()
{
player.FlushConsole();
player.Send(zone.Name);
player.Send("Zone Settings.");
player.Send("The following settings are available for you to edit.");
player.Send("Select from the available options below:");
player.Send("");
player.Send("1: Zone is Always Safe.");
//player.Send("2: Zone drains stats.");
player.Send("9: Exit");
player.Send("Enter numeric selection: ", false);
}
/// <summary>
/// This method parses the Admin input based off the main editing menu
/// and sends the admin to what-ever sub-menu method we need to.
@ -241,6 +255,19 @@ namespace MudEngine.Commands
ParseNameSelection(entry);
break;
case 3://Senses
BuildMenuSenses();
try
{
entry = Convert.ToInt32(player.ReadInput());
}
catch
{
player.Send("Realm Editing Canceled. The supplied value was not numeric!");
return;
}
ParseSensesSelection(entry);
break;
case 4: //Initial Realm
//build the menu and parse their menu selections
@ -258,6 +285,18 @@ namespace MudEngine.Commands
ParseInitialSelection(entry);
break;
case 5: //Settings
BuildMenuSettings();
try
{
entry = Convert.ToInt32(player.ReadInput());
}
catch
{
player.Send("Zone Editing canceled. The supplied value was not numeric!");
return;
}
ParseSettingsSelection(entry);
break;
case 9:
isEditing = false;
@ -630,6 +669,92 @@ namespace MudEngine.Commands
player.ActiveGame.Save();
}
private void ParseSettingsSelection(Int32 value)
{
Int32 input = 0;
switch (value)
{
case 1://IsSafe property
player.FlushConsole();
player.Send("Setting a Zone to SAFE will allow players to traverse the Zone without fear of being attacked by Monsters.");
player.Send("Even if there are Monsters in the Zone.");
player.Send("This feature can be extended on by writing a script that checks the current time of day, and disables SAFE zone settings at certain times (such as at night) allowing for monsters to attack players at night, but not day.");
player.Send("All Rooms created within this Zone will default to this value, however a Room may override this option.");
player.Send("Please select from one of the available options below:");
if (zone.IsSafe)
player.Send("1: Disable Safe Zone");
else
player.Send("1: Enable Safe Zone");
player.Send("9: Exit");
try
{
input = Convert.ToInt32(player.ReadInput());
}
catch
{
player.Send("Zone Editor Canceled. Entry must be in a numeric format.");
return;
}
switch (input)
{
case 1:
if (zone.IsSafe)
zone.IsSafe = false;
else
zone.IsSafe = true;
break;
case 9:
break;
}
break;
case 2: //StatDrain property
player.FlushConsole();
player.Send("Enabling STAT DRAIN will cause any Room within the Zone to drain or increase the specified stats on a player.");
player.Send("Please select from the available options below:");
if (zone.StatDrain)
player.Send("1: Disable");
else
player.Send("1: Enable");
player.Send("2: Edit Affected Stats");
player.Send("9: Exit");
try
{
input = Convert.ToInt32(player.ReadInput());
}
catch
{
player.Send("Zone Editor Canceled. Entry must be in a numeric format.");
return;
}
switch (input)
{
case 1:
if (zone.StatDrain)
zone.StatDrain = false;
else
zone.StatDrain = true;
break;
case 2:
player.Send("Select which Stat you would like to edit.");
//TODO: Implement stat affects.
break;
case 9:
break;
}
break;
}
player.ActiveGame.Save();
}
private void UpdateZoneObjects(String oldName)
{
//Check if this Zone is the initial Zone. If so then we need to update the
@ -655,7 +780,7 @@ namespace MudEngine.Commands
if (p.CurrentRoom.Zone == oldName)
{
p.CurrentRoom.Zone = zone.Filename;
p.Save(player.ActiveGame.DataPaths.Players);
p.Save();
}
}
@ -673,7 +798,7 @@ namespace MudEngine.Commands
if (ch.CurrentRoom.Zone == oldName)
{
ch.CurrentRoom.Zone = zone.Filename;
ch.Save(player.ActiveGame.DataPaths.Players);
ch.Save();
}
}

View file

@ -38,7 +38,7 @@ namespace MudEngine.Commands
for (Int32 i = 0; i < player.ActiveGame.GetPlayerCollection().Length; i++)
{
String filename = Path.Combine(path, player.ActiveGame.GetPlayerCollection()[i].Filename);
player.ActiveGame.GetPlayerCollection()[i].Save(filename);
player.ActiveGame.GetPlayerCollection()[i].Save();
}
//player.ActiveGame.Server.EndServer(); //-Handled in Game.Shutdown() below.

View file

@ -1,4 +1,4 @@
//Microsoft .NET Framework
 //Microsoft .NET Framework
using System;
using System.Collections.Generic;
using System.Linq;
@ -84,7 +84,15 @@ namespace MudEngine.GameManagement
if (commandKey.ToLower().Contains(key.ToLower()))
{
IGameCommand cmd = CommandEngine.CommandCollection[key];
cmd.Execute(command, player);
try
{
cmd.Execute(command, player);
}
catch(Exception ex)
{
Log.Write("Fatal Error occured while attempting to execute that command " + command.ToUpper());
Log.Write("Command Error: " + ex.Source + "." + ex.TargetSite.Name + ": " + ex.Message);
}
return;
}
}

View file

@ -198,7 +198,7 @@ namespace MudEngine.GameManagement
InitialRealm = new Realm(this);
//Prepare the Save Paths for all of our Game objects.
DataPaths = new SaveDataPaths("World", "Player");
DataPaths = new SaveDataPaths("World", "Players");
//Setup default settings for the Game
GameTitle = "New Game";
@ -339,7 +339,7 @@ namespace MudEngine.GameManagement
{
if (PlayerCollection[i].Name == "New BaseCharacter")
continue;
PlayerCollection[i].Save(this.DataPaths.Players);
PlayerCollection[i].Save();
}
//Delete the last saved version of the World. We will dump the current version onto disk.
@ -395,6 +395,11 @@ namespace MudEngine.GameManagement
{
String filename = GameTitle + ".ini";
this.Load(filename);
}
public virtual void Load(String filename)
{
if (!File.Exists(filename))
return;

View file

@ -81,7 +81,7 @@ namespace MudEngine.GameManagement
//Save all of the Environments
for (Int32 x = 0; x <= RealmCollection.Count - 1; x++)
{
RealmCollection[x].Save(_Game.DataPaths.Environment);
RealmCollection[x].Save();
}
}

View file

@ -81,6 +81,8 @@ namespace MudEngine.GameObjects
}
String _Filename;
protected virtual String SavePath { get; set; }
[Category("Environment Information")]
[Description("If a user asks to use his/her senses to investigate an area, this is one of the results that will be displayed. Senses can be used to assist blind characters.")]
[DefaultValue("You don't smell anything unsual.")]
@ -177,8 +179,10 @@ namespace MudEngine.GameObjects
{
}
public virtual void Save(String path)
public virtual void Save()
{
string path = this.SavePath;
if (String.IsNullOrEmpty(path))
return;

View file

@ -52,6 +52,13 @@
}
}
protected override string SavePath
{
get
{
return ActiveGame.DataPaths.Players;
}
}
/// <summary>
/// Gets or Sets if this Character is controlled by the user. If not user controlled then it will be AI controlled.
/// </summary>
@ -92,6 +99,12 @@
/// </summary>
public CommandEngine CommandSystem { get; internal set; }
/// <summary>
/// Gets or Sets the characters stats.
/// Note that this will more and likely become Read-Only in the future.
/// </summary>
public BaseStats Stats { get; set; }
public BaseCharacter(Game game) : base(game)
{
ActiveGame = game;
@ -187,11 +200,11 @@
*/
}
public override void Save(String path)
public override void Save()
{
base.Save(path);
base.Save();
path = Path.Combine(path, Filename);
String path = Path.Combine(SavePath, Filename);
FileManager.WriteLine(path, this.Password, "Password");
FileManager.WriteLine(path, this.IsControlled.ToString(), "IsControlled");
@ -281,7 +294,7 @@
Name = playerName;
Password = password;
Save(ActiveGame.DataPaths.Players);
Save();
}
public bool VarifyPassword(string password)
@ -392,7 +405,7 @@
{
if (IsActive)
{
this.Save(ActiveGame.DataPaths.Players);
this.Save();
Send("Goodbye!");
IsActive = false;

View file

@ -30,6 +30,14 @@ namespace MudEngine.GameObjects.Environment
/// </summary>
public Zone InitialZone { get; set; }
protected override string SavePath
{
get
{
return Path.Combine(ActiveGame.DataPaths.Environment, Path.GetFileNameWithoutExtension(this.Filename));
}
}
public Realm(GameManagement.Game game) : base(game)
{
ZoneCollection = new List<Zone>();
@ -57,10 +65,10 @@ namespace MudEngine.GameObjects.Environment
}
}
public override void Save(String path)
public override void Save()
{
path = Path.Combine(path, Path.GetFileNameWithoutExtension(Filename));
base.Save(path);
String path = Path.Combine(ActiveGame.DataPaths.Environment, Path.GetFileNameWithoutExtension(Filename));
base.Save();
String filename = Path.Combine(path, Filename);
@ -73,7 +81,7 @@ namespace MudEngine.GameObjects.Environment
{
FileManager.WriteLine(filename, z.Filename, "ZoneCollection");
z.Save(zonePath);
z.Save();
}
}

View file

@ -86,6 +86,14 @@ namespace MudEngine.GameObjects.Environment
}
}
protected override string SavePath
{
get
{
return Path.Combine(ActiveGame.DataPaths.Environment, Path.GetFileNameWithoutExtension(this.Realm), "Zones", Path.GetFileNameWithoutExtension(this.Zone), "Rooms");
}
}
public Room(Game game) :base(game)
{
Doorways = new List<Door>();
@ -98,11 +106,11 @@ namespace MudEngine.GameObjects.Environment
/// Room is saved within a Realm/Zone/Room directory structure
/// </summary>
/// <param name="path"></param>
public override void Save(String path)
public override void Save()
{
base.Save(path);
base.Save();
String filename = Path.Combine(path, Filename);
String filename = Path.Combine(this.SavePath, Filename);
FileManager.WriteLine(filename, IsInitialRoom.ToString(), "IsInitialRoom");
FileManager.WriteLine(filename, this.IsSafe.ToString(), "IsSafe");

View file

@ -77,6 +77,14 @@ namespace MudEngine.GameObjects.Environment
[Category("Environment Information")]
public Room InitialRoom { get; set; }
protected override String SavePath
{
get
{
return Path.Combine(ActiveGame.DataPaths.Environment, Path.GetFileNameWithoutExtension(this.Realm), "Zones", Path.GetFileNameWithoutExtension(Filename));
}
}
public Zone(GameManagement.Game game)
: base(game)
{
@ -86,13 +94,11 @@ namespace MudEngine.GameObjects.Environment
Realm = "No Realm Associated.";
}
public override void Save(String path)
public override void Save()
{
path = Path.Combine(path, Path.GetFileNameWithoutExtension(Filename));
base.Save();
base.Save(path);
String filename = Path.Combine(path, Filename);
String filename = Path.Combine(SavePath, Filename);
FileManager.WriteLine(filename, this.IsInitialZone.ToString(), "IsInitialZone");
FileManager.WriteLine(filename, this.IsSafe.ToString(), "IsSafe");
@ -103,11 +109,11 @@ namespace MudEngine.GameObjects.Environment
if (this.InitialRoom.Name != "New Room")
FileManager.WriteLine(filename, this.InitialRoom.Filename, "InitialRoom");
String roomPath = Path.Combine(path, "Rooms");
String roomPath = Path.Combine(SavePath, "Rooms");
foreach (Room r in RoomCollection)
{
FileManager.WriteLine(filename, r.Filename, "RoomCollection");
r.Save(roomPath);
r.Save();
}
}

View file

@ -114,6 +114,7 @@ namespace MudEngine.Scripting
InstallPath = Environment.CurrentDirectory;
GameObjects = new List<GameObject>();
_AssemblyCollection = new List<Assembly>();
ObjectCollection = new GameObjectCollection();
ScriptType = scriptTypes;
_Game = game;

View file

@ -52,7 +52,7 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Scripts\AdminCommands\CommandCreateRoom.cs">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="Scripts\PlayerCommands\CommandExit.cs">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
@ -76,7 +76,7 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Scripts\AdminCommands\CommandCreate.cs">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="Scripts\PlayerCommands\CommandSay.cs">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>

View file

@ -64,7 +64,7 @@ public class CommandCreate : IGameCommand
//Split the supplied string up. It wil give us an array of strings with the supplied
//object names if the admin has specified environment objects for creation.
String[] env = command.ToLower().Substring("Create ".Length).Split('>');
String[] env = command.Substring("Create ".Length).Split('>');
//No objects specified, so the admin didn't use the command correctly.
if (env.Length == 0)

View file

@ -1,4 +1,5 @@
/// <summary>

/// <summary>
/// This command creates a Room within the players current Realm>Zone.
/// Admins using this command will not need to supply a fully qualified path like the 'Create' command requires.
/// However, they are restricted to creating Rooms only within their current Realm>Zone.

View file

@ -37,6 +37,6 @@ public class CommandSave : IGameCommand
public void Execute(String command, BaseCharacter player)
{
//Save the player to the hard-disk.
player.Save(player.ActiveGame.DataPaths.Players);
player.Save();
}
}

View file

@ -96,17 +96,18 @@ public class CommandWalk : IGameCommand
//BAD - Don't invoke commands directly by the player as it causes issues for them client-side.
//Always invoke the command internally, passing a reference to the player instead.
//player.CommandSystem.ExecuteCommand("Look", player);
//player.ExecuteCommand("Look");
//Use the Look command to print the contents of the new Room to the Player.
//Good - Correct way of invoking commands automatically for the player.
//The command will be executed for which ever player is passed as a reference.
CommandLook look = new CommandLook();
look.Execute("look", player);
IGameCommand look = CommandEngine.GetCommand("CommandLook");
if (look != null)
look.Execute("look", player);
//If the current Active Game has Auto-Save enabled, we will save the player.
if (player.ActiveGame.AutoSave)
player.Save(player.ActiveGame.DataPaths.Players);
player.Save();
return;
}