* Re-wrote the Server code again. Now much more reliable and passes all connections to the ConnectionManager properly.

* StandardCharacter re-wrote to support the new Server code.  Also added event method support for various states.
* ConnectionManager re-wrote to support the new server.
* Work on Log message importance started
* INetworked.Connect now requires a Socket as its parameter.
* StandardGame no longer has Properties for MaxConnections and MaxQueuedConnections.  This is handle via StandardGame.Start() parameters.
* CommandLogin command added.  Initial check-in and not fully implemented.
This commit is contained in:
Scionwest_cp 2012-03-03 11:17:01 -08:00
parent 5b141c62ed
commit 27f7e31772
12 changed files with 314 additions and 163 deletions

View file

@ -59,20 +59,20 @@ namespace MudEngine.GameScripts
return true;
}
public virtual Boolean Load(String filename)
public virtual void Load(String filename)
{
try
{
if (!File.Exists(filename))
return false;
return;
XElement data = XElement.Load(filename);
}
catch
{
return false;
return;
}
return true;
return;
}
public override string ToString()

View file

@ -0,0 +1,42 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MudEngine.Core.Interface;
using MudEngine.Game;
using MudEngine.Game.Characters;
using MudEngine.Game.Environment;
using MudEngine.GameScripts;
namespace MudEngine.GameScripts.Commands
{
public class CommandLogin : ICommand
{
public string Name { get; set; }
public string Description { get; set; }
public List<string> Help { get; set; }
public CommandLogin()
{
Help = new List<string>();
Name = "Login";
Description = "Account login command.";
}
public void Execute(string command, Game.Characters.StandardCharacter character)
{
character.SendMessage("Please enter character name: ");
String name = String.Empty;
while (String.IsNullOrEmpty(name))
{
name = character.GetInput();
}
}
}
}

View file

@ -33,7 +33,7 @@ namespace MudEngine.GameScripts.Commands
//Loop through each character on the server and broadcast the message.
//TODO: This should only broadcast to characters that are in the same Environment.
foreach (StandardCharacter c in ConnectionManager.Connections)
foreach (StandardCharacter c in character.Game.Server.ConnectionManager.GetConnectedCharacters())
{
//Only broadcast this message to those that are not the broadcastor.
if (c != character)