* StandardCharacter now automatically invokes the Login command upon connection to the server. Login command not implemented completely yet.
* Telnet client header information is now successfully (finally) stripped out of the first stream received. * Command System underwent some optimizations along with now always returning a Boolean value once execution of a command is completed. * ICommand interface now forces all ICommand.Execute methods to return a Boolean value. * DataPaths class re-wrote and is now simi in-use by StandardGame and the Login command * Minor adjustments to how characters are initialized upon connection in various classes.
This commit is contained in:
parent
0720393626
commit
ec5a674062
10 changed files with 185 additions and 74 deletions
|
@ -2,32 +2,62 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Reflection;
|
||||
using System.IO;
|
||||
|
||||
namespace MudEngine.DAL
|
||||
{
|
||||
public enum DataTypes
|
||||
{
|
||||
Players,
|
||||
Environments,
|
||||
Characters,
|
||||
Equipment
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Contains the paths for the engines file storage.
|
||||
/// </summary>
|
||||
public struct DataPaths
|
||||
public class DataPaths
|
||||
{
|
||||
/// <summary>
|
||||
/// Path to the engines Script directory
|
||||
/// </summary>
|
||||
public String Scripts { get; set; }
|
||||
public DataPaths()
|
||||
{
|
||||
String path = Assembly.GetExecutingAssembly().Location;
|
||||
String assemblyFile = Path.GetFileName(path);
|
||||
this._InstallRoot = path.Substring(0, path.Length - assemblyFile.Length);
|
||||
|
||||
/// <summary>
|
||||
/// Path to the engines Environment files.
|
||||
/// </summary>
|
||||
public String Environments { get; set; }
|
||||
this.SetAbsolutePath(Path.Combine(this._InstallRoot, "Players"), DataTypes.Players);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the Path to the Characters save directory
|
||||
/// </summary>
|
||||
public String Characters { get; set; }
|
||||
public void SetAbsolutePath(String path, DataTypes objectType)
|
||||
{
|
||||
if (!path.EndsWith(@"\"))
|
||||
path = path.Insert(path.Length, @"\");
|
||||
|
||||
/// <summary>
|
||||
/// Gets the path to the saved players directory.
|
||||
/// </summary>
|
||||
public String Players { get; set; }
|
||||
switch (objectType)
|
||||
{
|
||||
case DataTypes.Players:
|
||||
this._Players = path;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void SetRelativePath(String path, DataTypes objectType)
|
||||
{
|
||||
}
|
||||
|
||||
public String GetPath(DataTypes objectType)
|
||||
{
|
||||
if (objectType == DataTypes.Players)
|
||||
return this._Players;
|
||||
else
|
||||
return String.Empty;
|
||||
}
|
||||
|
||||
private String _InstallRoot;
|
||||
private String _Players;
|
||||
private String _Environments;
|
||||
private String _Characters;
|
||||
private String _Equipment;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue