Mud Designer:

Removed old forms and prepared for new designer layouts

MudEngine:
Server - Now starts and runs, however sending information to the client crashes telnet clients for some reason.
BaseCharacter - Removed OnConnect() source code and changed method into an abstract method.  This is now implemented via MudGame.MudCharacter
BaseCommand - BaseCommand.Name now implemented.  Constructor defaults to the Type name.  Note all command names must begin with 'Command'
BaseGame - Now has a Server propety
BaseServer - Added IsRunning property
ICharacter - Added Send() method
ICommunicate - Added Shutdown() method for use with servers.
CommandSystem - Bug fix.  Was checking to see if the command was an Interface rather than checking if it inherits from one.
CommandSystem - Bug fix.  No longer attempts to add abstract commands to collection
ScriptSystem - Bug fix.  Corrected the name of the Mud Compiler during compiler loading.

MudGame:
Added initial MudCharacter class.  Will be the standard class that all characters will inherit from.
Added CommandLogin for processing user server logins.
MudGame - Now calls Server.Initialize during Game.Initialize()
MudGame - Uses Server.IsRunning property checks rather than Server.EnableServer
MudGame - Added initial code for player connections.
This commit is contained in:
Scionwest_cp 2011-10-02 20:40:51 -07:00
parent 0986d240bf
commit 3bd493c1cd
24 changed files with 316 additions and 436 deletions

View file

@ -10,7 +10,7 @@ using System.Runtime.InteropServices;
[assembly: AssemblyConfiguration("")] [assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Mud Designer")] [assembly: AssemblyCompany("Mud Designer")]
[assembly: AssemblyProduct("Mud Designer Game Engine")] [assembly: AssemblyProduct("Mud Designer Game Engine")]
[assembly: AssemblyCopyright("Copyright © 2010")] [assembly: AssemblyCopyright("Copyright © 2011")]
[assembly: AssemblyTrademark("")] [assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")] [assembly: AssemblyCulture("")]
@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers // You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below: // by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyVersion("0.2.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyFileVersion("0.2.0.0")]

View file

@ -51,16 +51,16 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="Client.cs" /> <Compile Include="Client.cs" />
<Compile Include="frmProjectManager.cs"> <Compile Include="frmDesigner.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
<Compile Include="frmProjectManager.Designer.cs"> <Compile Include="frmDesigner.Designer.cs">
<DependentUpon>frmProjectManager.cs</DependentUpon> <DependentUpon>frmDesigner.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="Program.cs" /> <Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="frmProjectManager.resx"> <EmbeddedResource Include="frmDesigner.resx">
<DependentUpon>frmProjectManager.cs</DependentUpon> <DependentUpon>frmDesigner.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx"> <EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator> <Generator>ResXFileCodeGenerator</Generator>

View file

@ -15,7 +15,7 @@ namespace MudDesigner
{ {
Application.EnableVisualStyles(); Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false); Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new frmProjectManager()); Application.Run(new frmDesigner());
} }
} }
} }

View file

@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers // You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below: // by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyVersion("0.2.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyFileVersion("0.2.0.0")]

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

@ -0,0 +1,155 @@
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.tabControl1 = new System.Windows.Forms.TabControl();
this.tabPage1 = new System.Windows.Forms.TabPage();
this.tabPage2 = new System.Windows.Forms.TabPage();
this.tabPage3 = new System.Windows.Forms.TabPage();
this.tabPage4 = new System.Windows.Forms.TabPage();
this.tabControl2 = new System.Windows.Forms.TabControl();
this.tabPage5 = new System.Windows.Forms.TabPage();
this.tabPage6 = new System.Windows.Forms.TabPage();
this.tabControl1.SuspendLayout();
this.tabPage2.SuspendLayout();
this.tabControl2.SuspendLayout();
this.SuspendLayout();
//
// tabControl1
//
this.tabControl1.Controls.Add(this.tabPage1);
this.tabControl1.Controls.Add(this.tabPage2);
this.tabControl1.Controls.Add(this.tabPage3);
this.tabControl1.Controls.Add(this.tabPage4);
this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill;
this.tabControl1.Location = new System.Drawing.Point(0, 0);
this.tabControl1.Name = "tabControl1";
this.tabControl1.SelectedIndex = 0;
this.tabControl1.Size = new System.Drawing.Size(784, 562);
this.tabControl1.TabIndex = 0;
//
// tabPage1
//
this.tabPage1.Location = new System.Drawing.Point(4, 22);
this.tabPage1.Name = "tabPage1";
this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
this.tabPage1.Size = new System.Drawing.Size(776, 536);
this.tabPage1.TabIndex = 0;
this.tabPage1.Text = "Game Settings";
this.tabPage1.UseVisualStyleBackColor = true;
//
// tabPage2
//
this.tabPage2.Controls.Add(this.tabControl2);
this.tabPage2.Location = new System.Drawing.Point(4, 22);
this.tabPage2.Name = "tabPage2";
this.tabPage2.Padding = new System.Windows.Forms.Padding(3);
this.tabPage2.Size = new System.Drawing.Size(776, 536);
this.tabPage2.TabIndex = 1;
this.tabPage2.Text = "Environments";
this.tabPage2.UseVisualStyleBackColor = true;
//
// tabPage3
//
this.tabPage3.Location = new System.Drawing.Point(4, 22);
this.tabPage3.Name = "tabPage3";
this.tabPage3.Size = new System.Drawing.Size(192, 74);
this.tabPage3.TabIndex = 2;
this.tabPage3.Text = "Characters";
this.tabPage3.UseVisualStyleBackColor = true;
//
// tabPage4
//
this.tabPage4.Location = new System.Drawing.Point(4, 22);
this.tabPage4.Name = "tabPage4";
this.tabPage4.Size = new System.Drawing.Size(192, 74);
this.tabPage4.TabIndex = 3;
this.tabPage4.Text = "Items";
this.tabPage4.UseVisualStyleBackColor = true;
//
// tabControl2
//
this.tabControl2.Controls.Add(this.tabPage5);
this.tabControl2.Controls.Add(this.tabPage6);
this.tabControl2.Location = new System.Drawing.Point(0, 0);
this.tabControl2.Name = "tabControl2";
this.tabControl2.SelectedIndex = 0;
this.tabControl2.Size = new System.Drawing.Size(200, 100);
this.tabControl2.TabIndex = 0;
//
// tabPage5
//
this.tabPage5.Location = new System.Drawing.Point(4, 22);
this.tabPage5.Name = "tabPage5";
this.tabPage5.Padding = new System.Windows.Forms.Padding(3);
this.tabPage5.Size = new System.Drawing.Size(192, 74);
this.tabPage5.TabIndex = 0;
this.tabPage5.Text = "tabPage5";
this.tabPage5.UseVisualStyleBackColor = true;
//
// tabPage6
//
this.tabPage6.Location = new System.Drawing.Point(4, 22);
this.tabPage6.Name = "tabPage6";
this.tabPage6.Padding = new System.Windows.Forms.Padding(3);
this.tabPage6.Size = new System.Drawing.Size(192, 74);
this.tabPage6.TabIndex = 1;
this.tabPage6.Text = "tabPage6";
this.tabPage6.UseVisualStyleBackColor = true;
//
// frmDesigner
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(784, 562);
this.Controls.Add(this.tabControl1);
this.Name = "frmDesigner";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Mud Designer";
this.tabControl1.ResumeLayout(false);
this.tabPage2.ResumeLayout(false);
this.tabControl2.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.TabControl tabControl1;
private System.Windows.Forms.TabPage tabPage1;
private System.Windows.Forms.TabPage tabPage2;
private System.Windows.Forms.TabPage tabPage3;
private System.Windows.Forms.TabPage tabPage4;
private System.Windows.Forms.TabControl tabControl2;
private System.Windows.Forms.TabPage tabPage5;
private System.Windows.Forms.TabPage tabPage6;
}
}

View file

@ -0,0 +1,19 @@
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 frmDesigner : Form
{
public frmDesigner()
{
InitializeComponent();
}
}
}

View file

@ -117,7 +117,4 @@
<resheader name="writer"> <resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </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> </root>

View file

@ -1,293 +0,0 @@
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.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();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.btnClose = new System.Windows.Forms.Button();
this.btnNewProject = new System.Windows.Forms.Button();
this.groupBox3 = new System.Windows.Forms.GroupBox();
this.comServerType = new System.Windows.Forms.ComboBox();
((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.contextMenuStrip1.SuspendLayout();
this.groupBox2.SuspendLayout();
this.groupBox3.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, 461);
this.splitContainer1.SplitterDistance = 175;
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, 175);
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, 282);
this.splitContainer2.SplitterDistance = 224;
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, 224);
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, 205);
this.lstProjects.TabIndex = 0;
//
// 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";
//
// groupBox2
//
this.groupBox2.Controls.Add(this.groupBox3);
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, 54);
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);
//
// groupBox3
//
this.groupBox3.Controls.Add(this.comServerType);
this.groupBox3.Location = new System.Drawing.Point(121, 10);
this.groupBox3.Name = "groupBox3";
this.groupBox3.Size = new System.Drawing.Size(195, 41);
this.groupBox3.TabIndex = 3;
this.groupBox3.TabStop = false;
this.groupBox3.Text = "Server Type";
//
// comServerType
//
this.comServerType.Dock = System.Windows.Forms.DockStyle.Fill;
this.comServerType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.comServerType.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.comServerType.FormattingEnabled = true;
this.comServerType.Location = new System.Drawing.Point(3, 16);
this.comServerType.Name = "comServerType";
this.comServerType.Size = new System.Drawing.Size(189, 21);
this.comServerType.TabIndex = 0;
//
// 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, 461);
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.contextMenuStrip1.ResumeLayout(false);
this.groupBox2.ResumeLayout(false);
this.groupBox3.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;
private System.Windows.Forms.GroupBox groupBox3;
private System.Windows.Forms.ComboBox comServerType;
}
}

View file

@ -1,42 +0,0 @@
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 System.Threading;
namespace MudDesigner
{
public partial class frmProjectManager : Form
{
public frmProjectManager()
{
InitializeComponent();
}
private void RefreshProjects()
{
}
private void btnNewProject_Click(object sender, EventArgs e)
{
}
private void ShowDesigner()
{
}
private void btnClose_Click(object sender, EventArgs e)
{
Application.Exit();
}
private void editProjectToolStripMenuItem_Click(object sender, EventArgs e)
{
}
}
}

View file

@ -27,7 +27,6 @@ namespace MudEngine.Communication
public Server(BaseGame game) : base(game) public Server(BaseGame game) : base(game)
{ {
this._Listener = new TcpListener(IPAddress.Any, 555); this._Listener = new TcpListener(IPAddress.Any, 555);
this._Connect = new Thread(new ThreadStart(ListenForConnections));
this._ClientCollection = new Dictionary<BaseCharacter, Thread>(); this._ClientCollection = new Dictionary<BaseCharacter, Thread>();
} }
@ -40,7 +39,6 @@ namespace MudEngine.Communication
: base(game) : base(game)
{ {
this._Listener = new TcpListener(IPAddress.Any, port); this._Listener = new TcpListener(IPAddress.Any, port);
this._Connect = new Thread(new ThreadStart(ListenForConnections));
this._ClientCollection = new Dictionary<BaseCharacter, Thread>(); this._ClientCollection = new Dictionary<BaseCharacter, Thread>();
} }
@ -61,12 +59,22 @@ namespace MudEngine.Communication
public override void Initialize() public override void Initialize()
{ {
this._Connect = new Thread(new ThreadStart(ListenForConnections));
this._Connect.Start(); this._Connect.Start();
} }
public override void Shutdown()
{
}
public override void OnConnect(object client) public override void OnConnect(object client)
{ {
this.ActiveGame.OnConnect((TcpClient)client); TcpClient c = (TcpClient)client;
NetworkStream ns = c.GetStream();
ASCIIEncoding encoder = new ASCIIEncoding();
ns.Write(encoder.GetBytes("WELCOME!!!!"), 0, "WELCOME!!!!".Length);
ns.Flush();
// this.ActiveGame.OnConnect((TcpClient)client);
} }
public override void OnDisconnect(object client) public override void OnDisconnect(object client)

View file

@ -91,51 +91,13 @@ namespace MudEngine.Core
throw new NotImplementedException(); throw new NotImplementedException();
} }
public void OnConnect(TcpClient client) public abstract void OnConnect(TcpClient client);
{
this._ConnectedClient = client;
NetworkStream clientStream = this._ConnectedClient.GetStream(); public abstract void OnTravel(World.AvailableTravelDirections travelDirection);
//Stores messages recieved from the client public abstract void OnTalk(string message, ICharacter instigator);
byte[] message = new byte[4096];
int bytesRead;
while (true)
{
bytesRead = 0;
try public abstract void Send(string message);
{
bytesRead = clientStream.Read(message, 0, 4096);
}
catch
{
break; //error occured. Re-try
}
if (bytesRead == 0)
{
break; //Disconnected.
}
ASCIIEncoding encoder = new ASCIIEncoding();
string data = encoder.GetString(message, 0, bytesRead);
//RecieveData(data);
}
//TODO: Call ActiveGame.OnDisconnect();
//newClient.Close(); //Disconnect the client.
}
public void OnTravel(World.AvailableTravelDirections travelDirection)
{
throw new NotImplementedException();
}
public void OnTalk(string message, ICharacter instigator)
{
throw new NotImplementedException();
}
} }
} }

View file

@ -13,12 +13,13 @@ namespace MudEngine.Core
/// </summary> /// </summary>
[Browsable(false)] [Browsable(false)]
public List<string> Help { get; set; } public List<string> Help { get; set; }
public BaseCommand() public BaseCommand()
{ {
Help = new List<string>(); Help = new List<string>();
this.Name = this.GetType().Name.Substring("Command".Length);
} }
/// <summary> /// <summary>
/// Executes the command for the character supplied. /// Executes the command for the character supplied.
/// </summary> /// </summary>
@ -26,17 +27,7 @@ namespace MudEngine.Core
/// <param name="character"></param> /// <param name="character"></param>
public abstract void Execute(string command, ICharacter character); public abstract void Execute(string command, ICharacter character);
public string Name public string Name {get;set;}
{
get
{
throw new NotImplementedException();
}
set
{
throw new NotImplementedException();
}
}
public string Description public string Description
{ {

View file

@ -10,12 +10,7 @@ namespace MudEngine.Core
{ {
public abstract class BaseGame : BaseObject public abstract class BaseGame : BaseObject
{ {
/// <summary> private bool _EnableServer;
/// Enables or Disables the server.
/// </summary>
[Category("Game Settings")]
[Description("Enables or Disabels the server.")]
public bool EnableServer { get; set; }
/// <summary> /// <summary>
/// Enables or Disables the Auto Save feature. /// Enables or Disables the Auto Save feature.
@ -49,6 +44,10 @@ namespace MudEngine.Core
/// </summary> /// </summary>
public Dictionary<TcpClient, ICharacter> ConnectedPlayers { get; private set; } public Dictionary<TcpClient, ICharacter> ConnectedPlayers { get; private set; }
public BaseServer Server { get; protected set; }
public bool EnableServer { get; set; }
/// <summary> /// <summary>
/// Gets or Sets the current version of the game. /// Gets or Sets the current version of the game.
/// </summary> /// </summary>

View file

@ -15,7 +15,9 @@ namespace MudEngine.Core
public ICommand LoginCommand { get; set; } public ICommand LoginCommand { get; set; }
public BaseGame ActiveGame { get; private set; } public BaseGame ActiveGame { get; private set; }
public bool IsRunning { get; private set; }
public BaseServer(BaseGame game) public BaseServer(BaseGame game)
{ {
this.ActiveGame = game; this.ActiveGame = game;
@ -24,10 +26,11 @@ namespace MudEngine.Core
public virtual void Initialize() public virtual void Initialize()
{ {
} }
public abstract void Shutdown();
public virtual void Update() public virtual void Update()
{ {
throw new NotImplementedException(); return; //stub.
} }
public abstract void OnConnect(object client); public abstract void OnConnect(object client);

View file

@ -20,5 +20,6 @@ namespace MudEngine.Core
void OnTravel(AvailableTravelDirections travelDirection); void OnTravel(AvailableTravelDirections travelDirection);
void OnTalk(string message, ICharacter instigator); void OnTalk(string message, ICharacter instigator);
void OnConnect(TcpClient client); void OnConnect(TcpClient client);
void Send(string message);
} }
} }

View file

@ -12,6 +12,7 @@ namespace MudEngine.Core
int Port { get; set; } int Port { get; set; }
ICommand LoginCommand { get; set; } ICommand LoginCommand { get; set; }
void Shutdown();
void OnConnect(object client); void OnConnect(object client);
void OnDisconnect(object client); void OnDisconnect(object client);
void RecieveData(string data); void RecieveData(string data);

View file

@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers // You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below: // by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyVersion("0.2.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyFileVersion("0.2.0.0")]

View file

@ -94,11 +94,10 @@ namespace MudEngine.Runtime
{ {
//All commands implement the ICommand interface. //All commands implement the ICommand interface.
//If that interface is not present on this Type, skip and go to the next one. //If that interface is not present on this Type, skip and go to the next one.
if (!type.IsInterface)
continue;
if (type.GetInterface("ICommand") == null) if (type.GetInterface("ICommand") == null)
continue; continue;
else if (type.IsAbstract)
continue;
ICommand cmd = (ICommand)Activator.CreateInstance(type); ICommand cmd = (ICommand)Activator.CreateInstance(type);

View file

@ -359,7 +359,7 @@ namespace MudEngine.Runtime
Type compiler = typeof(ICompiler); Type compiler = typeof(ICompiler);
//Internal CSharpRaw compiler Type specified, so we'll use that. //Internal CSharpRaw compiler Type specified, so we'll use that.
if ((this.Compiler.ToLower() == "MudCompiler") || (this.Compiler.ToLower() == "mc")) if ((this.Compiler.ToLower() == "mudcompiler") || (this.Compiler.ToLower() == "mc"))
{ {
compiler = typeof(MudCompiler); compiler = typeof(MudCompiler);
return compiler; return compiler;

View file

@ -0,0 +1,53 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Sockets;
using System.Text;
using MudEngine.Core;
namespace MudGame.Characters
{
public class MudCharacter : BaseCharacter
{
private TcpClient client;
public MudCharacter(BaseGame game)
: base(game)
{
this.Role = CharacterRoles.NPC;
}
public override void OnConnect(TcpClient client)
{
this.client = client;
}
public override void OnTravel(MudEngine.World.AvailableTravelDirections travelDirection)
{
throw new NotImplementedException();
}
public override void Send(string message)
{
NetworkStream ns = this.client.GetStream();
ASCIIEncoding encoder = new ASCIIEncoding();
byte[] buffer = encoder.GetBytes(message);
ns.Write(buffer, 0, buffer.Length);
ns.Flush();
}
public override void OnTalk(string message, ICharacter instigator)
{
if (instigator == this)
{
}
}
}
}

View file

@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MudEngine.Core;
using MudEngine.Runtime;
namespace MudGame.Commands
{
public class CommandLogin : BaseCommand
{
public override void Execute(string command, ICharacter character)
{
character.Send("Welcome to " + character.ActiveGame.Name);
}
}
}

View file

@ -8,6 +8,7 @@ using System.Text;
using MudEngine.Core; using MudEngine.Core;
using MudEngine.Runtime; using MudEngine.Runtime;
using MudEngine.Communication; using MudEngine.Communication;
using MudGame.Characters;
namespace MudGame namespace MudGame
{ {
@ -23,11 +24,6 @@ namespace MudGame
/// </summary> /// </summary>
protected CommandSystem CommandSystem { get; private set; } protected CommandSystem CommandSystem { get; private set; }
/// <summary>
/// Gets a reference to the games networking server.
/// </summary>
public Server Server { get; private set; }
public MudGame() public MudGame()
: base() : base()
{ {
@ -47,31 +43,36 @@ namespace MudGame
this.Version = "Alpha 2.0"; this.Version = "Alpha 2.0";
//Add the engine.dll. //Add the engine.dll.
this.ScriptSystem.AddAssemblyReference(Assembly.GetExecutingAssembly().GetName().Name + ".dll"); string assembly = Assembly.GetExecutingAssembly().GetName().Name + ".dll";
this.ScriptSystem.AddAssemblyReference(assembly);
//If a scripts directory exists, compile them. //If a scripts directory exists, compile them.
if (Directory.Exists("Scripts")) if (Directory.Exists("Scripts"))
{ {
this.ScriptSystem.Compile("Scripts"); this.ScriptSystem.Compile("Scripts");
if (this.ScriptSystem.HasErrors) // if (this.ScriptSystem.HasErrors)
//TODO: Output script system compile errors //TODO: Output script system compile errors
return; //temp. Shouldn't return. //return; //temp. Shouldn't return.
} }
//Scripts are compiled, now load all of the commands, if any script commands exist. //Scripts are compiled, now load all of the commands, if any script commands exist.
CommandSystem.LoadCommandLibrary(Assembly.GetExecutingAssembly());
CommandSystem.LoadCommandLibrary(ScriptSystem.CompiledAssembly); CommandSystem.LoadCommandLibrary(ScriptSystem.CompiledAssembly);
//TODO: Iitialize the game world. //TODO: Initialize the game world.
//TODO: Load previously saved state. //TODO: Load previously saved state.
//TODO: Enable server. //TODO: Enable server.
this.EnableServer = true; //Starts the server. if (this.EnableServer)
this.Server.Initialize();
this.IsRunning = true;
} }
public override void Shutdown() public override void Shutdown()
{ {
if (this.EnableServer) if (Server.IsRunning)
this.EnableServer = false; this.EnableServer = false;
this.Save(); this.Save();
@ -79,12 +80,15 @@ namespace MudGame
public override void Update() public override void Update()
{ {
throw new NotImplementedException(); if (this.Server.IsRunning)
this.Server.Update();
} }
public override void OnConnect(System.Net.Sockets.TcpClient client) public override void OnConnect(System.Net.Sockets.TcpClient client)
{ {
throw new NotImplementedException(); MudCharacter character = new MudCharacter(this);
character.Role = CharacterRoles.Player;
character.OnConnect(client);
} }
public override void OnDisconnect(System.Net.Sockets.TcpClient client) public override void OnDisconnect(System.Net.Sockets.TcpClient client)

View file

@ -47,6 +47,8 @@
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="Characters\MudCharacter.cs" />
<Compile Include="Commands\CommandLogin.cs" />
<Compile Include="MudGame.cs" /> <Compile Include="MudGame.cs" />
<Compile Include="Program.cs" /> <Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
@ -57,6 +59,9 @@
<Name>MudEngine</Name> <Name>MudEngine</Name>
</ProjectReference> </ProjectReference>
</ItemGroup> </ItemGroup>
<ItemGroup>
<Folder Include="Items\" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- 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. Other similar extension points exist, see Microsoft.Common.targets.

View file

@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers // You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below: // by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyVersion("0.2.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyFileVersion("0.2.0.0")]