- Fixed server

- Works for multiplayer now, exit doesn't shut down everything.
- Less memory usage.
- TODO: If startup message, handle it.
This commit is contained in:
u8sand_cp 2010-07-30 16:41:54 -07:00
parent e822537128
commit 7f39821216
3 changed files with 21 additions and 10 deletions

View file

@ -119,7 +119,7 @@ namespace MudEngine.GameObjects.Characters
System.Text.ASCIIEncoding encoding = new System.Text.ASCIIEncoding();
Send(encoding.GetBytes(str));
if (!ActiveGame.IsRunning)
Clear();
Disconnect();
}
internal void Send(byte[] data)
@ -130,10 +130,10 @@ namespace MudEngine.GameObjects.Characters
}
catch (Exception) // error, connection failed: close client
{
Clear();
Disconnect();
}
}
internal void Clear()
internal void Disconnect()
{
// TODO: Save();
Save();
@ -142,6 +142,7 @@ namespace MudEngine.GameObjects.Characters
client.Close();
// TODO: Reset game so it can be used again
}
internal Socket client;
}
}