- Fixed strange errors with client

- No longer holds on startup for other Players
- Was crashing when I exited with multiple players because the filename was "", so I uncommented the line making the filename and that did the trick.
- Fix: Does it really save? lol.
- Fix: On startup I get a spam of "Loaded MudDesigner.dll", I'd fix but I don't know where it is o.O
This commit is contained in:
u8sand_cp 2010-08-02 06:40:18 -07:00
parent 368cdb00ee
commit 5c8c5b6ba1
3 changed files with 5 additions and 7 deletions

View file

@ -32,7 +32,7 @@ namespace MudEngine.Commands
foreach (BaseCharacter bc in player.ActiveGame.PlayerCollection)
{
if (bc.Name == input) // TODO: Check if that player is still online
if (bc.Name == input)
{
player.Send("Character name already taken.");
foundName = true;

View file

@ -38,7 +38,7 @@ namespace MudEngine.GameObjects.Characters
/// <summary>
/// Gets or if this character is active.
/// </summary>
public Boolean IsActive { get; private set; }
public Boolean IsActive { get; internal set; }
/// <summary>
/// Gets the current inventory of the character
@ -50,7 +50,7 @@ namespace MudEngine.GameObjects.Characters
/// </summary>
public CommandEngine CommandSystem { get; internal set; }
public BaseCharacter(Game game) : base(game)
public BaseCharacter(Game game)// : base(game)
{
ActiveGame = game;
IsActive = false;
@ -168,7 +168,6 @@ namespace MudEngine.GameObjects.Characters
CurrentRoom = ActiveGame.InitialRealm.InitialZone.InitialRoom;
IsActive = true;
}
internal void Receive(string data)
{
@ -212,12 +211,11 @@ namespace MudEngine.GameObjects.Characters
{
if (IsActive)
{
string filePath ="" /*= Path.Combine(ActiveGame.DataPaths.Players, Filename)*/;
string filePath = Path.Combine(ActiveGame.DataPaths.Players, Filename);
this.Save(filePath);
IsActive = false;
client.Close();
// TODO: Reset game so it can be used again
Log.Write("Player " + this.Name + " disconnected.");
}

View file

@ -78,7 +78,7 @@ namespace MudEngine.Networking
}
} while (sub < 0);
players[sub].client = server.Accept();
//players[sub].Initialize();
players[sub].IsActive = true;
clientThreads[sub] = new Thread(ReceiveThread);
clientThreads[sub].Start((object)sub);
}