[arthea] r464 committed - did some work on the editor

1 view
Skip to first unread message

art...@googlecode.com

unread,
Apr 19, 2011, 6:24:50 PM4/19/11
to arthea-...@googlegroups.com
Revision: 464
Author: c0der78
Date: Tue Apr 19 15:23:35 2011
Log: did some work on the editor
http://code.google.com/p/arthea/source/detail?r=464

Added:
/trunk/ArtheaEditor/AreaEditor.Designer.cs
/trunk/ArtheaEditor/AreaEditor.cs
/trunk/ArtheaEditor/AreaEditor.resx
/trunk/ArtheaEditor/ArtheaSplashScreen.Designer.cs
/trunk/ArtheaEditor/ArtheaSplashScreen.cs
/trunk/ArtheaEditor/ArtheaSplashScreen.resx
/trunk/ArtheaEditor/Import/IImporter.cs
Modified:
/trunk/ArtheaEditor/ArtheaEditor.csproj
/trunk/ArtheaEditor/CollectionEditor.cs
/trunk/ArtheaEditor/EditorForm.Designer.cs
/trunk/ArtheaEditor/EditorForm.cs
/trunk/ArtheaEditor/EditorForm.resx
/trunk/ArtheaEditor/Import/Rom/RomImporter.cs
/trunk/ArtheaEditor/ImportDialog.Designer.cs
/trunk/ArtheaEditor/ImportDialog.cs
/trunk/ArtheaEditor/ImportDialog.resx
/trunk/ArtheaEditor/Program.cs
/trunk/ArtheaEngine/Extensions.cs
/trunk/ArtheaEngine/Model/Account.cs
/trunk/ArtheaEngine/Model/Affect.cs
/trunk/ArtheaEngine/Model/Area.cs
/trunk/ArtheaEngine/Model/Character.cs
/trunk/ArtheaEngine/Model/Exit.cs
/trunk/ArtheaEngine/Model/Help.cs
/trunk/ArtheaEngine/Model/Note.cs
/trunk/ArtheaEngine/Model/Object.cs
/trunk/ArtheaEngine/Model/Reset.cs
/trunk/ArtheaEngine/Model/Room.cs
/trunk/ArtheaEngine/Model/Shop.cs
/trunk/ArtheaEngine/Model/Social.cs
/trunk/ArtheaServer/Creation/Editor.cs
/trunk/ArtheaServer/Creation/ResetEditor.cs
/trunk/ArtheaServer/Creation/TextEditor.cs
/trunk/ArtheaServer/MainForm.cs

=======================================
--- /dev/null
+++ /trunk/ArtheaEditor/AreaEditor.Designer.cs Tue Apr 19 15:23:35 2011
@@ -0,0 +1,62 @@
+namespace ArtheaEditor
+{
+ partial class AreaEditor
+ {
+ /// <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 Component 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.tableLayoutPanel1 = new
System.Windows.Forms.TableLayoutPanel();
+ this.SuspendLayout();
+ //
+ // tableLayoutPanel1
+ //
+ this.tableLayoutPanel1.ColumnCount = 2;
+ this.tableLayoutPanel1.ColumnStyles.Add(new
System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent,
50F));
+ this.tableLayoutPanel1.ColumnStyles.Add(new
System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent,
50F));
+ this.tableLayoutPanel1.Dock =
System.Windows.Forms.DockStyle.Fill;
+ this.tableLayoutPanel1.Location = new System.Drawing.Point(0,
0);
+ this.tableLayoutPanel1.Name = "tableLayoutPanel1";
+ this.tableLayoutPanel1.RowCount = 2;
+ this.tableLayoutPanel1.RowStyles.Add(new
System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
+ this.tableLayoutPanel1.RowStyles.Add(new
System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
+ this.tableLayoutPanel1.Size = new System.Drawing.Size(150,
150);
+ this.tableLayoutPanel1.TabIndex = 0;
+ //
+ // AreaEditor
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.Controls.Add(this.tableLayoutPanel1);
+ this.Name = "AreaEditor";
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
+ }
+}
=======================================
--- /dev/null
+++ /trunk/ArtheaEditor/AreaEditor.cs Tue Apr 19 15:23:35 2011
@@ -0,0 +1,45 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Drawing;
+using System.Data;
+using System.Linq;
+using System.Text;
+using System.Windows.Forms;
+using ArtheaEngine.Model;
+using System.Collections;
+using System.Reflection;
+
+namespace ArtheaEditor
+{
+ public partial class AreaEditor : UserControl
+ {
+ private Dictionary<PropertyInfo, Control> _fields = new
Dictionary<PropertyInfo, Control>();
+
+ public AreaEditor()
+ {
+ InitializeComponent();
+ }
+
+ protected override void OnLoad(EventArgs e)
+ {
+ base.OnLoad(e);
+
+ foreach (var pi in typeof(Area).GetProperties())
+ {
+ if (!pi.CanRead)
+ continue;
+
+ var label = new Label { Text = pi.Name };
+
+ tableLayoutPanel1.Controls.Add(label);
+
+ var valctl = new TextBox();
+
+ _fields.Add(pi, valctl);
+
+ tableLayoutPanel1.Controls.Add(valctl);
+ }
+ }
+ }
+}
=======================================
--- /dev/null
+++ /trunk/ArtheaEditor/AreaEditor.resx Tue Apr 19 15:23:35 2011
@@ -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>
=======================================
--- /dev/null
+++ /trunk/ArtheaEditor/ArtheaSplashScreen.Designer.cs Tue Apr 19 15:23:35
2011
@@ -0,0 +1,69 @@
+namespace ArtheaEditor
+{
+ partial class ArtheaSplashScreen
+ {
+ /// <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.label1 = new System.Windows.Forms.Label();
+ this.SuspendLayout();
+ //
+ // label1
+ //
+ this.label1.AutoSize = true;
+ this.label1.Font = new System.Drawing.Font("Microsoft Sans
Serif", 28F, System.Drawing.FontStyle.Regular,
System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.label1.Location = new System.Drawing.Point(6, 94);
+ this.label1.Name = "label1";
+ this.label1.Size = new System.Drawing.Size(310, 44);
+ this.label1.TabIndex = 0;
+ this.label1.Text = "Loading Arthea...";
+ //
+ // ArtheaSplashScreen
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.BackColor = System.Drawing.SystemColors.ActiveCaption;
+ this.ClientSize = new System.Drawing.Size(320, 240);
+ this.ControlBox = false;
+ this.Controls.Add(this.label1);
+ this.FormBorderStyle =
System.Windows.Forms.FormBorderStyle.None;
+ this.Name = "ArtheaSplashScreen";
+ this.Opacity = 0.65D;
+ this.ShowIcon = false;
+ this.ShowInTaskbar = false;
+ this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
+ this.StartPosition =
System.Windows.Forms.FormStartPosition.CenterScreen;
+ this.Text = "ArtheaSplashScreen";
+ this.ResumeLayout(false);
+ this.PerformLayout();
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.Label label1;
+ }
+}
=======================================
--- /dev/null
+++ /trunk/ArtheaEditor/ArtheaSplashScreen.cs Tue Apr 19 15:23:35 2011
@@ -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 ArtheaEditor
+{
+ public partial class ArtheaSplashScreen : Form
+ {
+ public ArtheaSplashScreen()
+ {
+ InitializeComponent();
+ }
+ }
+}
=======================================
--- /dev/null
+++ /trunk/ArtheaEditor/ArtheaSplashScreen.resx Tue Apr 19 15:23:35 2011
@@ -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>
=======================================
--- /dev/null
+++ /trunk/ArtheaEditor/Import/IImporter.cs Tue Apr 19 15:23:35 2011
@@ -0,0 +1,14 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.IO;
+
+namespace ArtheaEditor.Import
+{
+ public interface IImporter
+ {
+ void Commit();
+ void Process(FileInfo fi);
+ }
+}
=======================================
--- /trunk/ArtheaEditor/ArtheaEditor.csproj Mon Mar 28 23:33:46 2011
+++ /trunk/ArtheaEditor/ArtheaEditor.csproj Tue Apr 19 15:23:35 2011
@@ -37,6 +37,7 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
+ <Reference Include="Microsoft.VisualBasic" />
<Reference Include="MySql.Data, Version=6.3.6.0, Culture=neutral,
PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\Program Files\MySQL\MySQL Connector Net
6.3.6\Assemblies\v4.0\MySql.Data.dll</HintPath>
@@ -54,8 +55,21 @@
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
+ <Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
+ <Compile Include="AreaEditor.cs">
+ <SubType>UserControl</SubType>
+ </Compile>
+ <Compile Include="AreaEditor.Designer.cs">
+ <DependentUpon>AreaEditor.cs</DependentUpon>
+ </Compile>
+ <Compile Include="ArtheaSplashScreen.cs">
+ <SubType>Form</SubType>
+ </Compile>
+ <Compile Include="ArtheaSplashScreen.Designer.cs">
+ <DependentUpon>ArtheaSplashScreen.cs</DependentUpon>
+ </Compile>
<Compile Include="CollectionEditor.cs">
<SubType>UserControl</SubType>
</Compile>
@@ -76,6 +90,7 @@
</Compile>
<Compile Include="Import\FileReader.cs" />
<Compile Include="Import\IFileReader.cs" />
+ <Compile Include="Import\IImporter.cs" />
<Compile Include="Import\ImportException.cs" />
<Compile Include="Import\Rom\AreaSection.cs" />
<Compile Include="Import\Rom\Converter.cs" />
@@ -90,6 +105,12 @@
<Compile Include="Import\Rom\SpecialSection.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
+ <EmbeddedResource Include="AreaEditor.resx">
+ <DependentUpon>AreaEditor.cs</DependentUpon>
+ </EmbeddedResource>
+ <EmbeddedResource Include="ArtheaSplashScreen.resx">
+ <DependentUpon>ArtheaSplashScreen.cs</DependentUpon>
+ </EmbeddedResource>
<EmbeddedResource Include="CollectionEditor.resx">
<DependentUpon>CollectionEditor.cs</DependentUpon>
<SubType>Designer</SubType>
@@ -139,7 +160,7 @@
-->
<ProjectExtensions>
<VisualStudio>
- <UserProperties BuildVersion_UpdateAssemblyVersion="True"
BuildVersion_UpdateFileVersion="True"
BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs"
BuildVersion_BuildVersioningStyle="YearStamp.MonthStamp.TimeStamp.None" />
+ <UserProperties
BuildVersion_BuildVersioningStyle="YearStamp.MonthStamp.TimeStamp.None"
BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs"
BuildVersion_UpdateFileVersion="True"
BuildVersion_UpdateAssemblyVersion="True" />
</VisualStudio>
</ProjectExtensions>
</Project>
=======================================
--- /trunk/ArtheaEditor/CollectionEditor.cs Mon Mar 28 23:33:46 2011
+++ /trunk/ArtheaEditor/CollectionEditor.cs Tue Apr 19 15:23:35 2011
@@ -20,7 +20,7 @@
{
}

- public void SetCollection<T>(IEnumerable<T> items) where T : class
+ public void SetCollection<T>(IList<T> items) where T : class
{
lstCollection.DataSource = items;
}
=======================================
--- /trunk/ArtheaEditor/EditorForm.Designer.cs Mon Mar 28 23:33:46 2011
+++ /trunk/ArtheaEditor/EditorForm.Designer.cs Tue Apr 19 15:23:35 2011
@@ -32,13 +32,19 @@
this.menuStrip1 = new System.Windows.Forms.MenuStrip();
this.fileToolStripMenuItem = new
System.Windows.Forms.ToolStripMenuItem();
this.importToolStripMenuItem = new
System.Windows.Forms.ToolStripMenuItem();
+ this.saveToolStripMenuItem = new
System.Windows.Forms.ToolStripMenuItem();
this.exitToolStripMenuItem = new
System.Windows.Forms.ToolStripMenuItem();
this.editorToolStripMenuItem = new
System.Windows.Forms.ToolStripMenuItem();
- this.roomsToolStripMenuItem = new
System.Windows.Forms.ToolStripMenuItem();
this.helpToolStripMenuItem = new
System.Windows.Forms.ToolStripMenuItem();
this.aboutToolStripMenuItem = new
System.Windows.Forms.ToolStripMenuItem();
this.openFileDialog1 = new
System.Windows.Forms.OpenFileDialog();
- this.saveToolStripMenuItem = new
System.Windows.Forms.ToolStripMenuItem();
+ this.riversOfMudToolStripMenuItem = new
System.Windows.Forms.ToolStripMenuItem();
+ this.smaugToolStripMenuItem = new
System.Windows.Forms.ToolStripMenuItem();
+ this.circleToolStripMenuItem = new
System.Windows.Forms.ToolStripMenuItem();
+ this.rOTToolStripMenuItem = new
System.Windows.Forms.ToolStripMenuItem();
+ this.areasToolStripMenuItem = new
System.Windows.Forms.ToolStripMenuItem();
+ this.helpsToolStripMenuItem = new
System.Windows.Forms.ToolStripMenuItem();
+ this.socialsToolStripMenuItem = new
System.Windows.Forms.ToolStripMenuItem();
this.menuStrip1.SuspendLayout();
this.SuspendLayout();
//
@@ -66,10 +72,21 @@
//
// importToolStripMenuItem
//
+ this.importToolStripMenuItem.DropDownItems.AddRange(new
System.Windows.Forms.ToolStripItem[] {
+ this.riversOfMudToolStripMenuItem,
+ this.smaugToolStripMenuItem,
+ this.circleToolStripMenuItem,
+ this.rOTToolStripMenuItem});
this.importToolStripMenuItem.Name = "importToolStripMenuItem";
this.importToolStripMenuItem.Size = new
System.Drawing.Size(152, 22);
- this.importToolStripMenuItem.Text = "&Import...";
- this.importToolStripMenuItem.Click += new
System.EventHandler(this.importToolStripMenuItem_Click);
+ this.importToolStripMenuItem.Text = "&Import";
+ //
+ // saveToolStripMenuItem
+ //
+ this.saveToolStripMenuItem.Name = "saveToolStripMenuItem";
+ this.saveToolStripMenuItem.Size = new System.Drawing.Size(152,
22);
+ this.saveToolStripMenuItem.Text = "&Save";
+ this.saveToolStripMenuItem.Click += new
System.EventHandler(this.saveToolStripMenuItem_Click);
//
// exitToolStripMenuItem
//
@@ -80,18 +97,13 @@
// editorToolStripMenuItem
//
this.editorToolStripMenuItem.DropDownItems.AddRange(new
System.Windows.Forms.ToolStripItem[] {
- this.roomsToolStripMenuItem});
+ this.areasToolStripMenuItem,
+ this.helpsToolStripMenuItem,
+ this.socialsToolStripMenuItem});
this.editorToolStripMenuItem.Name = "editorToolStripMenuItem";
this.editorToolStripMenuItem.Size = new
System.Drawing.Size(50, 20);
this.editorToolStripMenuItem.Text = "&Editor";
//
- // roomsToolStripMenuItem
- //
- this.roomsToolStripMenuItem.Name = "roomsToolStripMenuItem";
- this.roomsToolStripMenuItem.Size = new
System.Drawing.Size(152, 22);
- this.roomsToolStripMenuItem.Text = "&Rooms";
- this.roomsToolStripMenuItem.Click += new
System.EventHandler(this.roomsToolStripMenuItem_Click);
- //
// helpToolStripMenuItem
//
this.helpToolStripMenuItem.DropDownItems.AddRange(new
System.Windows.Forms.ToolStripItem[] {
@@ -110,12 +122,52 @@
//
this.openFileDialog1.FileName = "openFileDialog1";
//
- // saveToolStripMenuItem
+ // riversOfMudToolStripMenuItem
//
- this.saveToolStripMenuItem.Name = "saveToolStripMenuItem";
- this.saveToolStripMenuItem.Size = new System.Drawing.Size(152,
22);
- this.saveToolStripMenuItem.Text = "&Save";
- this.saveToolStripMenuItem.Click += new
System.EventHandler(this.saveToolStripMenuItem_Click);
+ this.riversOfMudToolStripMenuItem.Name
= "riversOfMudToolStripMenuItem";
+ this.riversOfMudToolStripMenuItem.Size = new
System.Drawing.Size(152, 22);
+ this.riversOfMudToolStripMenuItem.Text = "RO&M";
+ this.riversOfMudToolStripMenuItem.Click += new
System.EventHandler(this.riversOfMudToolStripMenuItem_Click);
+ //
+ // smaugToolStripMenuItem
+ //
+ this.smaugToolStripMenuItem.Name = "smaugToolStripMenuItem";
+ this.smaugToolStripMenuItem.Size = new
System.Drawing.Size(152, 22);
+ this.smaugToolStripMenuItem.Text = "Smau&g";
+ this.smaugToolStripMenuItem.Click += new
System.EventHandler(this.smaugToolStripMenuItem_Click);
+ //
+ // circleToolStripMenuItem
+ //
+ this.circleToolStripMenuItem.Name = "circleToolStripMenuItem";
+ this.circleToolStripMenuItem.Size = new
System.Drawing.Size(152, 22);
+ this.circleToolStripMenuItem.Text = "&Circle";
+ this.circleToolStripMenuItem.Click += new
System.EventHandler(this.circleToolStripMenuItem_Click);
+ //
+ // rOTToolStripMenuItem
+ //
+ this.rOTToolStripMenuItem.Name = "rOTToolStripMenuItem";
+ this.rOTToolStripMenuItem.Size = new System.Drawing.Size(152,
22);
+ this.rOTToolStripMenuItem.Text = "RO&T";
+ this.rOTToolStripMenuItem.Click += new
System.EventHandler(this.rOTToolStripMenuItem_Click);
+ //
+ // areasToolStripMenuItem
+ //
+ this.areasToolStripMenuItem.Name = "areasToolStripMenuItem";
+ this.areasToolStripMenuItem.Size = new
System.Drawing.Size(152, 22);
+ this.areasToolStripMenuItem.Text = "&Areas";
+ this.areasToolStripMenuItem.Click += new
System.EventHandler(this.areasToolStripMenuItem_Click);
+ //
+ // helpsToolStripMenuItem
+ //
+ this.helpsToolStripMenuItem.Name = "helpsToolStripMenuItem";
+ this.helpsToolStripMenuItem.Size = new
System.Drawing.Size(152, 22);
+ this.helpsToolStripMenuItem.Text = "&Helps";
+ //
+ // socialsToolStripMenuItem
+ //
+ this.socialsToolStripMenuItem.Name
= "socialsToolStripMenuItem";
+ this.socialsToolStripMenuItem.Size = new
System.Drawing.Size(152, 22);
+ this.socialsToolStripMenuItem.Text = "&Socials";
//
// EditorForm
//
@@ -144,8 +196,14 @@
private System.Windows.Forms.ToolStripMenuItem
importToolStripMenuItem;
private System.Windows.Forms.OpenFileDialog openFileDialog1;
private System.Windows.Forms.ToolStripMenuItem
editorToolStripMenuItem;
- private System.Windows.Forms.ToolStripMenuItem
roomsToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem
saveToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem
riversOfMudToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem
smaugToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem
circleToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem
rOTToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem
areasToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem
helpsToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem
socialsToolStripMenuItem;
}
}

=======================================
--- /trunk/ArtheaEditor/EditorForm.cs Mon Mar 28 23:33:46 2011
+++ /trunk/ArtheaEditor/EditorForm.cs Tue Apr 19 15:23:35 2011
@@ -5,6 +5,8 @@
using System.Linq;
using System.Windows.Forms;
using ArtheaEngine.Model;
+using ArtheaEditor.Import.Rom;
+using Object = ArtheaEngine.Model.Object;

#endregion

@@ -49,25 +51,41 @@
return layout;
}

- private void importToolStripMenuItem_Click(object sender,
EventArgs e)
- {
- new ImportDialog().ShowDialog();
+ private void saveToolStripMenuItem_Click(object sender, EventArgs
e)
+ {
}

- private void roomsToolStripMenuItem_Click(object sender, EventArgs
e)
- {
- var ed = new CollectionEditor();
-
- ed.SetCollection(new List<Room>());
-
- ed.SetEditor(CreateFieldEditor<Room>(ed.SelectedItem));
-
- Controls.Clear();
- Controls.Add(ed);
+ private void riversOfMudToolStripMenuItem_Click(object sender,
EventArgs e)
+ {
+
+ new ImportDialog(new RomImporter()).ShowDialog();
+ }
+
+ private void smaugToolStripMenuItem_Click(object sender, EventArgs
e)
+ {
+ MessageBox.Show("Not Supported Yet.", "Unsupported",
MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
+ }
+
+ private void circleToolStripMenuItem_Click(object sender,
EventArgs e)
+ {
+ MessageBox.Show("Not Supported Yet.", "Unsupported",
MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
}

- private void saveToolStripMenuItem_Click(object sender, EventArgs
e)
- {
+ private void rOTToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ MessageBox.Show("Not Supported Yet.", "Unsupported",
MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
+ }
+
+ private void areasToolStripMenuItem_Click(object sender, EventArgs
e)
+ {
+ var ed = new CollectionEditor();
+
+ ed.SetCollection(Area.List.ToList());
+
+ ed.SetEditor(new AreaEditor());
+
+ Controls.Clear();
+ Controls.Add(ed);
}
}
}
=======================================
--- /trunk/ArtheaEditor/EditorForm.resx Mon Mar 28 23:33:46 2011
+++ /trunk/ArtheaEditor/EditorForm.resx Tue Apr 19 15:23:35 2011
@@ -112,21 +112,21 @@
<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>
+ <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=2.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>
- <metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point,
System.Drawing, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a">
+ <metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point,
System.Drawing, Version=4.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
- <metadata name="openFileDialog1.TrayLocation"
type="System.Drawing.Point, System.Drawing, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+ <metadata name="openFileDialog1.TrayLocation"
type="System.Drawing.Point, System.Drawing, Version=4.0.0.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>132, 17</value>
</metadata>
- <metadata name="$this.TrayHeight" type="System.Int32, mscorlib,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <metadata name="$this.TrayHeight" type="System.Int32, mscorlib,
Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>43</value>
</metadata>
- <assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+ <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing"
mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>

AAABAAEAICAAAAEAIACoEAAAFgAAACgAAAAgAAAAQAAAAAEAIAAAAAAAgBAAAAAAAAAAAAAAAAAAAAAA
=======================================
--- /trunk/ArtheaEditor/Import/Rom/RomImporter.cs Mon Mar 28 23:33:46 2011
+++ /trunk/ArtheaEditor/Import/Rom/RomImporter.cs Tue Apr 19 15:23:35 2011
@@ -15,7 +15,7 @@

namespace ArtheaEditor.Import.Rom
{
- public class RomImporter
+ public class RomImporter : IImporter
{
private static readonly Logger Log =
LogManager.GetCurrentClassLogger();
private readonly Dictionary<int, NonPlayer> _characterIndexes =
new Dictionary<int, NonPlayer>();
@@ -32,6 +32,11 @@
Objects = new ObjectSection();
Helps = new HelpSection();
Resets = new ResetSection(this);
+ Socials = new SocialSection();
+ Rooms = new RoomSection();
+ Areas = new AreaSection();
+ Shops = new ShopSection(this);
+ Specials = new SpecialSection();
}

public HelpSection Helps
@@ -82,6 +87,36 @@
private set;
}

+ public void Commit()
+ {
+ using (var conn = ArtheaHelper.NewConnection())
+ {
+ var tx = conn.BeginTransaction();
+
+ try
+ {
+
+ Areas.Commit(conn);
+ Mobiles.Commit(conn);
+ Objects.Commit(conn);
+ Rooms.Commit(conn);
+ Resets.Commit(conn);
+ Shops.Commit(conn);
+ Helps.Commit(conn);
+ Socials.Commit(conn);
+ Specials.Commit(conn);
+
+ tx.Commit();
+
+ Log.Info("Commit Complete.");
+ }
+ catch (Exception ex)
+ {
+ Log.Error(ex.Message);
+ tx.Rollback();
+ }
+ }
+ }
public static Area CurrentArea { get; set; }

public void Process(FileInfo fileInfo)
=======================================
--- /trunk/ArtheaEditor/ImportDialog.Designer.cs Mon Mar 28 23:33:46 2011
+++ /trunk/ArtheaEditor/ImportDialog.Designer.cs Tue Apr 19 15:23:35 2011
@@ -34,6 +34,7 @@
this.button2 = new System.Windows.Forms.Button();
this.txtImportLog = new System.Windows.Forms.RichTextBox();
this.openFileDialog1 = new
System.Windows.Forms.OpenFileDialog();
+ this.btnCommit = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// label1
@@ -65,7 +66,7 @@
//
// button2
//
- this.button2.Location = new System.Drawing.Point(168, 38);
+ this.button2.Location = new System.Drawing.Point(125, 38);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(75, 23);
this.button2.TabIndex = 3;
@@ -90,11 +91,23 @@
this.openFileDialog1.FileName = "openFileDialog1";
this.openFileDialog1.Filter = "Area Files (*.are)|*.are|Area
Lists (*.lst)|*.lst";
//
+ // btnCommit
+ //
+ this.btnCommit.Enabled = false;
+ this.btnCommit.Location = new System.Drawing.Point(206, 38);
+ this.btnCommit.Name = "btnCommit";
+ this.btnCommit.Size = new System.Drawing.Size(75, 23);
+ this.btnCommit.TabIndex = 5;
+ this.btnCommit.Text = "Commit";
+ this.btnCommit.UseVisualStyleBackColor = true;
+ this.btnCommit.Click += new
System.EventHandler(this.btnCommit_Click);
+ //
// ImportDialog
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(412, 292);
+ this.Controls.Add(this.btnCommit);
this.Controls.Add(this.txtImportLog);
this.Controls.Add(this.button2);
this.Controls.Add(this.button1);
@@ -120,5 +133,6 @@
private System.Windows.Forms.Button button2;
private System.Windows.Forms.RichTextBox txtImportLog;
private System.Windows.Forms.OpenFileDialog openFileDialog1;
+ private System.Windows.Forms.Button btnCommit;
}
}
=======================================
--- /trunk/ArtheaEditor/ImportDialog.cs Mon Mar 28 23:33:46 2011
+++ /trunk/ArtheaEditor/ImportDialog.cs Tue Apr 19 15:23:35 2011
@@ -5,6 +5,9 @@
using System.Windows.Forms;
using ArtheaEditor.Import;
using ArtheaEditor.Import.Rom;
+using NLog.Config;
+using NLog.Targets;
+using NLog;

#endregion

@@ -12,9 +15,15 @@
{
public partial class ImportDialog : Form
{
- public ImportDialog()
+ private IImporter _importer;
+
+ public ImportDialog(IImporter importer)
{
InitializeComponent();
+
+ _importer = importer;
+
+
}

private void button1_Click(object sender, EventArgs e)
@@ -29,10 +38,20 @@
{
try
{
+
+ RichTextBoxTarget target = new RichTextBoxTarget();
+ target.ControlName = txtImportLog.Name;
+ target.FormName = this.Name;
+
+ target.Layout = "${date:format=HH\\:MM\\:ss} ${logger}
${message}";
+
+ SimpleConfigurator.ConfigureForTargetLogging(target);
+
var fi = new FileInfo(textBox1.Text);

- var importer = new RomImporter();
- importer.Process(fi);
+ _importer.Process(fi);
+
+ btnCommit.Enabled = true;
}
catch (ArgumentException)
{
@@ -43,5 +62,10 @@
MessageBox.Show(ex.Message);
}
}
+
+ private void btnCommit_Click(object sender, EventArgs e)
+ {
+ _importer.Commit();
+ }
}
}
=======================================
--- /trunk/ArtheaEditor/ImportDialog.resx Mon Mar 28 23:33:46 2011
+++ /trunk/ArtheaEditor/ImportDialog.resx Tue Apr 19 15:23:35 2011
@@ -112,12 +112,12 @@
<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>
+ <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=2.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>
- <metadata name="openFileDialog1.TrayLocation"
type="System.Drawing.Point, System.Drawing, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+ <metadata name="openFileDialog1.TrayLocation"
type="System.Drawing.Point, System.Drawing, Version=4.0.0.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>
=======================================
--- /trunk/ArtheaEditor/Program.cs Mon Mar 28 23:33:46 2011
+++ /trunk/ArtheaEditor/Program.cs Tue Apr 19 15:23:35 2011
@@ -2,6 +2,8 @@

using System;
using System.Windows.Forms;
+using Microsoft.VisualBasic.ApplicationServices;
+using ArtheaEngine.Model;

#endregion

@@ -9,15 +11,33 @@
{
internal static class Program
{
- /// <summary>
- /// The main entry point for the application.
- /// </summary>
- [STAThread]
- private static void Main()
- {
- Application.EnableVisualStyles();
- Application.SetCompatibleTextRenderingDefault(false);
- Application.Run(new EditorForm());
+ [STAThread]
+ static void Main(string[] args)
+ {
+ Application.EnableVisualStyles();
+ Application.SetCompatibleTextRenderingDefault(false);
+ new MyApp().Run(args);
+ }
+
+ public class MyApp : WindowsFormsApplicationBase
+ {
+ protected override void OnCreateSplashScreen()
+ {
+ this.SplashScreen = new ArtheaSplashScreen();
+ }
+ protected override void OnCreateMainForm()
+ {
+
+ // Do your initialization here
+
+ if (World.List.Count == 0)
+ {
+ World.GetDefault();
+ }
+
+ // Then create the main form, the splash screen will
automatically close
+ this.MainForm = new EditorForm();
+ }
}
}
}
=======================================
--- /trunk/ArtheaEngine/Extensions.cs Mon Apr 18 15:16:31 2011
+++ /trunk/ArtheaEngine/Extensions.cs Tue Apr 19 15:23:35 2011
@@ -267,7 +267,7 @@
public static string[] GetLines(this string mString)
{
if (mString == null) return new string[0];
- return mString.Split(new[] { Environment.NewLine },
StringSplitOptions.None);
+ return mString.Split(new[] { Environment.NewLine },
StringSplitOptions.RemoveEmptyEntries);
}

public static int CountLines(this string mString)
=======================================
--- /trunk/ArtheaEngine/Model/Account.cs Mon Apr 18 15:16:31 2011
+++ /trunk/ArtheaEngine/Model/Account.cs Tue Apr 19 15:23:35 2011
@@ -178,7 +178,7 @@
var res = cmd.ExecuteNonQuery() > 0;
if (Id == 0 && res)
{
- Id = (long)conn.LastInsertId();
+ Id = Convert.ToInt64(conn.LastInsertId());
}

return res;
=======================================
--- /trunk/ArtheaEngine/Model/Affect.cs Wed Apr 13 16:20:00 2011
+++ /trunk/ArtheaEngine/Model/Affect.cs Tue Apr 19 15:23:35 2011
@@ -94,7 +94,7 @@
var res = cmd.ExecuteNonQuery() > 0;

if (Id == 0 && res)
- Id = (long)conn.LastInsertId();
+ Id = Convert.ToInt64(conn.LastInsertId());

return res;
}
=======================================
--- /trunk/ArtheaEngine/Model/Area.cs Tue Apr 19 13:25:38 2011
+++ /trunk/ArtheaEngine/Model/Area.cs Tue Apr 19 15:23:35 2011
@@ -83,6 +83,11 @@
Rooms.Add(room);
}
}
+
+ foreach (var room in Rooms)
+ {
+ room.LoadReset(conn);
+ }

}
public void LoadObjects(IDbConnection conn)
@@ -187,7 +192,7 @@

if (Id == 0 && res)
{
- Id = (int)conn.LastInsertId();
+ Id = Convert.ToInt32(conn.LastInsertId());
List.Add(this);
}

=======================================
--- /trunk/ArtheaEngine/Model/Character.cs Tue Apr 19 13:25:38 2011
+++ /trunk/ArtheaEngine/Model/Character.cs Tue Apr 19 15:23:35 2011
@@ -271,7 +271,7 @@

if (Id == 0 && res)
{
- Id = (long)conn.LastInsertId();
+ Id = Convert.ToInt64(conn.LastInsertId());
List.Add(this);
}

@@ -337,7 +337,7 @@

if (Id == 0 && res)
{
- Id = (long)conn.LastInsertId();
+ Id = Convert.ToInt64(conn.LastInsertId());
}

return res;
=======================================
--- /trunk/ArtheaEngine/Model/Exit.cs Sun Apr 3 22:15:32 2011
+++ /trunk/ArtheaEngine/Model/Exit.cs Tue Apr 19 15:23:35 2011
@@ -51,7 +51,7 @@
var res = cmd.ExecuteNonQuery() > 0;

if (Id == 0 && res)
- Id = (long)conn.LastInsertId();
+ Id = Convert.ToInt64(conn.LastInsertId());

return res;
}
=======================================
--- /trunk/ArtheaEngine/Model/Help.cs Mon Apr 18 15:16:31 2011
+++ /trunk/ArtheaEngine/Model/Help.cs Tue Apr 19 15:23:35 2011
@@ -164,7 +164,7 @@

if (Id == 0 && res)
{
- Id = (long)conn.LastInsertId();
+ Id = Convert.ToInt64(conn.LastInsertId());
List.Add(this);
}

=======================================
--- /trunk/ArtheaEngine/Model/Note.cs Tue Apr 19 13:25:38 2011
+++ /trunk/ArtheaEngine/Model/Note.cs Tue Apr 19 15:23:35 2011
@@ -181,7 +181,7 @@
var res = cmd.ExecuteNonQuery() > 0;

if (Id == 0 && res)
- Id = (long)conn.LastInsertId();
+ Id = Convert.ToInt64(conn.LastInsertId());

return res;
}
=======================================
--- /trunk/ArtheaEngine/Model/Object.cs Tue Apr 19 13:25:38 2011
+++ /trunk/ArtheaEngine/Model/Object.cs Tue Apr 19 15:23:35 2011
@@ -148,7 +148,7 @@

if (Id == 0 && res)
{
- Id = (long)conn.LastInsertId();
+ Id = Convert.ToInt64(conn.LastInsertId());
List.Add(this);
}

=======================================
--- /trunk/ArtheaEngine/Model/Reset.cs Sun Apr 3 22:15:32 2011
+++ /trunk/ArtheaEngine/Model/Reset.cs Tue Apr 19 15:23:35 2011
@@ -195,7 +195,7 @@
var res = cmd.ExecuteNonQuery() > 0;

if (Id == 0 && res)
- Id = (long)conn.LastInsertId();
+ Id = Convert.ToInt64(conn.LastInsertId());

return res;
}
=======================================
--- /trunk/ArtheaEngine/Model/Room.cs Tue Apr 19 13:25:38 2011
+++ /trunk/ArtheaEngine/Model/Room.cs Tue Apr 19 15:23:35 2011
@@ -51,6 +51,22 @@
return room;
}

+ public void LoadReset(IDbConnection conn)
+ {
+ var cmd = conn.CreateCommand("select_room_reset");
+
+ cmd.AddParameter("@id", DbType.Int32, Id);
+
+ using (var reader = cmd.ExecuteReader())
+ {
+
+ if (!reader.Read()) return;
+
+
+ Reset = new Reset(this);
+ Reset.MapRow(reader);
+ }
+ }
public long Id { get; set; }

public Area Area { get; set; }
@@ -165,10 +181,14 @@

if (Id == 0 && res)
{
- Id = (long)conn.LastInsertId();
+ Id = Convert.ToInt64(conn.LastInsertId());
List.Add(this);
}

+ if (Reset != null)
+ {
+ Reset.Save(conn);
+ }
return res;
}

=======================================
--- /trunk/ArtheaEngine/Model/Shop.cs Sun Apr 3 22:15:32 2011
+++ /trunk/ArtheaEngine/Model/Shop.cs Tue Apr 19 15:23:35 2011
@@ -51,7 +51,7 @@
var res = cmd.ExecuteNonQuery() > 0;

if (Id == 0 && res)
- Id = (long)conn.LastInsertId();
+ Id = Convert.ToInt64(conn.LastInsertId());

return res;
}
=======================================
--- /trunk/ArtheaEngine/Model/Social.cs Mon Apr 18 15:16:31 2011
+++ /trunk/ArtheaEngine/Model/Social.cs Tue Apr 19 15:23:35 2011
@@ -153,16 +153,16 @@
cmd.AddParameter("@char_self", DbType.String, CharSelf);
cmd.AddParameter("@name", DbType.String, Name);
cmd.AddParameter("@others_found", DbType.String, OthersFound);
- cmd.AddParameter("@!others_no_arg", DbType.String,
OthersNoArg);
+ cmd.AddParameter("@others_no_arg", DbType.String, OthersNoArg);
cmd.AddParameter("@others_obj_found", DbType.String,
OthersObjFound);
cmd.AddParameter("@others_self", DbType.String, OthersSelf);
- cmd.AddParameter("@vict_found", DbType.String, VictFound);
+ cmd.AddParameter("@victim_found", DbType.String, VictFound);

var res = cmd.ExecuteNonQuery() > 0;

if (Id == 0 && res)
{
- Id = (int)conn.LastInsertId();
+ Id = Convert.ToInt32(conn.LastInsertId());
List.Add(this);
}

=======================================
--- /trunk/ArtheaServer/Creation/Editor.cs Mon Apr 18 15:16:31 2011
+++ /trunk/ArtheaServer/Creation/Editor.cs Tue Apr 19 15:23:35 2011
@@ -13,6 +13,10 @@

public abstract class Editor : IWritable
{
+ public delegate void ActionHandler();
+
+ public event ActionHandler OnBack;
+
#region Fields

protected TelnetConnection _connection;
@@ -46,6 +50,10 @@

public void Back()
{
+ if (OnBack != null)
+ {
+ OnBack();
+ }
_connection.Editing = Next;
if (Next != null)
{
=======================================
--- /trunk/ArtheaServer/Creation/ResetEditor.cs Tue Apr 19 09:23:59 2011
+++ /trunk/ArtheaServer/Creation/ResetEditor.cs Tue Apr 19 15:23:35 2011
@@ -21,6 +21,11 @@
: base(conn)
{
_data = data;
+ OnBack += new ActionHandler(() =>
+ {
+ if (_data.Room.Reset != _data)
+ _data.Room.Reset = _data;
+ });
}

#endregion Constructors
@@ -58,8 +63,7 @@
_connection.WriteLine("Reset saved.");
else
_connection.WriteLine("Reset not saved. See logs for
details.");
- if (_data.Room.Reset != _data)
- _data.Room.Reset = _data;
+
}

public override void Show()
=======================================
--- /trunk/ArtheaServer/Creation/TextEditor.cs Mon Apr 18 15:16:31 2011
+++ /trunk/ArtheaServer/Creation/TextEditor.cs Tue Apr 19 15:23:35 2011
@@ -69,13 +69,14 @@

pos += temp.Length;

- while (++count <= 3 && pos < pstr.Length)
+ while (++count <= 2 && pos < pstr.Length)
{
lineLen = Math.Min(pstr.GetLineCountLength(pos, 1), width
- indent);
if (count == 3)
lineLen -= Environment.NewLine.Length;
temp = pstr.Substring(pos, lineLen);
output.AppendFormat("{0}~C{1,2}. ~W{2}~x", new string(' ',
indent), count, temp);
+ pos += temp.Length;
}
return output.ToString();
}
=======================================
--- /trunk/ArtheaServer/MainForm.cs Tue Apr 19 13:25:38 2011
+++ /trunk/ArtheaServer/MainForm.cs Tue Apr 19 15:23:35 2011
@@ -160,7 +160,7 @@
output.Dock = DockStyle.Fill;
tabPage.Controls.Add(output);

- WorldLogTarget target = new WorldLogTarget(output);
+ RTLogTarget target = new RTLogTarget(output);
target.Layout = "${date:format=HH\\:MM\\:ss} ${logger}
${message}";

SimpleConfigurator.ConfigureForTargetLogging(target);
@@ -233,11 +233,11 @@
public SocketInformation SockInfo { get; set; }
}

- public sealed class WorldLogTarget : TargetWithLayout
+ public sealed class RTLogTarget : TargetWithLayout
{
#region Constructors

- public WorldLogTarget(RichTextBox box)
+ public RTLogTarget(RichTextBox box)
{
this.Display = box;
}
Reply all
Reply to author
Forward
0 new messages