Added improved logging through the engine for the server console.

This commit is contained in:
Scionwest_cp 2012-03-08 19:44:18 -08:00
parent 43e93706ab
commit bcd9f46b0a
10 changed files with 115 additions and 27 deletions

View file

@ -6,6 +6,7 @@ using System.Text.RegularExpressions;
using System.IO;
using System.Diagnostics;
using MudEngine.Core;
using MudEngine.Core.Interfaces;
using MudEngine.Game;
using MudEngine.Game.Characters;
@ -43,7 +44,7 @@ namespace MudEngine.GameScripts.Commands
//Don't allow anything other than the Login command to start the
//character creation process.
if (callingType != "CommandLogin")
if (callingType != "Login")
{
character.SendMessage("Invalid Command Used.");
return false;
@ -80,11 +81,19 @@ namespace MudEngine.GameScripts.Commands
}
}
character.Move(game.World.StartLocation);
try
{
//TODO: Create a class and setup Stats.
character.Save(character.Filename, false);
character.Move(game.World.StartLocation);
//TODO: Create a class and setup Stats.
character.Save(character.Filename, false);
}
catch (Exception ex)
{
Logger.WriteLine(ex.Message);
return false;
}
return true;
}
}

View file

@ -39,7 +39,7 @@ namespace MudEngine.GameScripts.Commands
names.Add(match.Value.ToLower());
}
if (names.Count < 1)
if (names.Count < 1 && character.Role == CharacterRoles.Admin)
{
character.SendMessage("You must provide a target character name.");
ShowHelp(character);