- 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:
parent
368cdb00ee
commit
5c8c5b6ba1
3 changed files with 5 additions and 7 deletions
|
@ -32,7 +32,7 @@ namespace MudEngine.Commands
|
||||||
|
|
||||||
foreach (BaseCharacter bc in player.ActiveGame.PlayerCollection)
|
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.");
|
player.Send("Character name already taken.");
|
||||||
foundName = true;
|
foundName = true;
|
||||||
|
|
|
@ -38,7 +38,7 @@ namespace MudEngine.GameObjects.Characters
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or if this character is active.
|
/// Gets or if this character is active.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Boolean IsActive { get; private set; }
|
public Boolean IsActive { get; internal set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the current inventory of the character
|
/// Gets the current inventory of the character
|
||||||
|
@ -50,7 +50,7 @@ namespace MudEngine.GameObjects.Characters
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public CommandEngine CommandSystem { get; internal set; }
|
public CommandEngine CommandSystem { get; internal set; }
|
||||||
|
|
||||||
public BaseCharacter(Game game) : base(game)
|
public BaseCharacter(Game game)// : base(game)
|
||||||
{
|
{
|
||||||
ActiveGame = game;
|
ActiveGame = game;
|
||||||
IsActive = false;
|
IsActive = false;
|
||||||
|
@ -168,7 +168,6 @@ namespace MudEngine.GameObjects.Characters
|
||||||
|
|
||||||
|
|
||||||
CurrentRoom = ActiveGame.InitialRealm.InitialZone.InitialRoom;
|
CurrentRoom = ActiveGame.InitialRealm.InitialZone.InitialRoom;
|
||||||
IsActive = true;
|
|
||||||
}
|
}
|
||||||
internal void Receive(string data)
|
internal void Receive(string data)
|
||||||
{
|
{
|
||||||
|
@ -212,12 +211,11 @@ namespace MudEngine.GameObjects.Characters
|
||||||
{
|
{
|
||||||
if (IsActive)
|
if (IsActive)
|
||||||
{
|
{
|
||||||
string filePath ="" /*= Path.Combine(ActiveGame.DataPaths.Players, Filename)*/;
|
string filePath = Path.Combine(ActiveGame.DataPaths.Players, Filename);
|
||||||
this.Save(filePath);
|
this.Save(filePath);
|
||||||
|
|
||||||
IsActive = false;
|
IsActive = false;
|
||||||
client.Close();
|
client.Close();
|
||||||
// TODO: Reset game so it can be used again
|
|
||||||
|
|
||||||
Log.Write("Player " + this.Name + " disconnected.");
|
Log.Write("Player " + this.Name + " disconnected.");
|
||||||
}
|
}
|
||||||
|
|
|
@ -78,7 +78,7 @@ namespace MudEngine.Networking
|
||||||
}
|
}
|
||||||
} while (sub < 0);
|
} while (sub < 0);
|
||||||
players[sub].client = server.Accept();
|
players[sub].client = server.Accept();
|
||||||
//players[sub].Initialize();
|
players[sub].IsActive = true;
|
||||||
clientThreads[sub] = new Thread(ReceiveThread);
|
clientThreads[sub] = new Thread(ReceiveThread);
|
||||||
clientThreads[sub].Start((object)sub);
|
clientThreads[sub].Start((object)sub);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue