MudServer:
- Began working on in-line commands. MudEngine: - Now logs when a player connects. MudServer prints this to the console via Log.GetMessages() MudCompiler: - Added /bin/debug to ignore list.
This commit is contained in:
parent
d488a41822
commit
23e5efb58e
6 changed files with 32 additions and 8 deletions
|
@ -6,4 +6,5 @@ MudEngine.dll
|
||||||
MudEngine.pdb
|
MudEngine.pdb
|
||||||
startup.dat
|
startup.dat
|
||||||
temp
|
temp
|
||||||
|
Scripts.dll
|
||||||
</Value></Property></Properties></ItemProperties>
|
</Value></Property></Properties></ItemProperties>
|
2
MUDCompiler/bin/Debug/Scripts/..svnbridge/.svnbridge
Normal file
2
MUDCompiler/bin/Debug/Scripts/..svnbridge/.svnbridge
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?><ItemProperties xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><Properties><Property><Name>svn:ignore</Name><Value>CommandChat.mud
|
||||||
|
</Value></Property></Properties></ItemProperties>
|
|
@ -110,9 +110,6 @@ namespace MudEngine.GameObjects.Characters
|
||||||
System.Text.UTF8Encoding enc = new System.Text.UTF8Encoding();
|
System.Text.UTF8Encoding enc = new System.Text.UTF8Encoding();
|
||||||
str = enc.GetString(data);
|
str = enc.GetString(data);
|
||||||
|
|
||||||
if (Game.IsDebug)
|
|
||||||
Log.Write("Client entered command: " + str);
|
|
||||||
|
|
||||||
// execute, and get result
|
// execute, and get result
|
||||||
str = ExecuteCommand(str);
|
str = ExecuteCommand(str);
|
||||||
|
|
||||||
|
|
|
@ -7,6 +7,7 @@ using System.Net.Sockets;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
|
|
||||||
using MudEngine.GameObjects.Characters;
|
using MudEngine.GameObjects.Characters;
|
||||||
|
using MudEngine.GameManagement;
|
||||||
|
|
||||||
/* Usage:
|
/* Usage:
|
||||||
* Server MUDServer = new Server();
|
* Server MUDServer = new Server();
|
||||||
|
@ -84,6 +85,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].Initialize();
|
||||||
|
Log.Write("New Player Connected.");
|
||||||
//ParameterizedThreadStart start = new ParameterizedThreadStart(ReceiveThread);
|
//ParameterizedThreadStart start = new ParameterizedThreadStart(ReceiveThread);
|
||||||
clientThreads[sub] = new Thread(ReceiveThread);
|
clientThreads[sub] = new Thread(ReceiveThread);
|
||||||
clientThreads[sub].Start((object)sub);
|
clientThreads[sub].Start((object)sub);
|
||||||
|
@ -92,7 +94,6 @@ namespace MudEngine.Networking
|
||||||
private void ReceiveThread(object obj)
|
private void ReceiveThread(object obj)
|
||||||
{
|
{
|
||||||
int sub = (int)obj;
|
int sub = (int)obj;
|
||||||
MudEngine.GameManagement.Log.Write("Receiving client data...");
|
|
||||||
while (stage == 2 && players[sub].IsActive)
|
while (stage == 2 && players[sub].IsActive)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
|
|
@ -6,6 +6,7 @@ using System.Text;
|
||||||
|
|
||||||
using MudEngine.FileSystem;
|
using MudEngine.FileSystem;
|
||||||
using MudEngine.GameManagement;
|
using MudEngine.GameManagement;
|
||||||
|
using MudEngine.GameObjects.Characters;
|
||||||
using MUDGame; //Pulling this from the example game, no sense re-writing what already exists.
|
using MUDGame; //Pulling this from the example game, no sense re-writing what already exists.
|
||||||
|
|
||||||
namespace MudServer
|
namespace MudServer
|
||||||
|
@ -19,6 +20,8 @@ namespace MudServer
|
||||||
|
|
||||||
realm.BuildZeroth();
|
realm.BuildZeroth();
|
||||||
|
|
||||||
|
BaseCharacter serverAdmin = new BaseCharacter(game);
|
||||||
|
|
||||||
//Setup the game
|
//Setup the game
|
||||||
game.AutoSave = true;
|
game.AutoSave = true;
|
||||||
game.BaseCurrencyName = "Copper";
|
game.BaseCurrencyName = "Copper";
|
||||||
|
@ -40,12 +43,23 @@ namespace MudServer
|
||||||
Game.IsDebug = true;
|
Game.IsDebug = true;
|
||||||
|
|
||||||
game.Start();
|
game.Start();
|
||||||
|
string command = "";
|
||||||
|
|
||||||
while (game.IsRunning)
|
while (game.IsRunning)
|
||||||
{
|
{
|
||||||
Console.Write(Log.GetMessages());
|
if (!Console.KeyAvailable)
|
||||||
Log.FlushMessages();
|
{
|
||||||
System.Threading.Thread.Sleep(1);
|
Console.Write(Log.GetMessages());
|
||||||
|
Log.FlushMessages();
|
||||||
|
System.Threading.Thread.Sleep(1);
|
||||||
|
}
|
||||||
|
//TODO: Fix Me D:
|
||||||
|
else if (Console.ReadKey().Key == ConsoleKey.Enter)
|
||||||
|
CommandEngine.ExecuteCommand(command, serverAdmin);
|
||||||
|
else if (Console.ReadKey().Key == ConsoleKey.Backspace)
|
||||||
|
Log.Write("Backspace is not currently supported :(");
|
||||||
|
else
|
||||||
|
command += Console.ReadKey().KeyChar;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
9
MudServer/bin/Debug/..svnbridge/.svnbridge
Normal file
9
MudServer/bin/Debug/..svnbridge/.svnbridge
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?><ItemProperties xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><Properties><Property><Name>svn:ignore</Name><Value>Log.txt
|
||||||
|
MudEngine.dll
|
||||||
|
MudEngine.pdb
|
||||||
|
MudServer.exe
|
||||||
|
MudServer.pdb
|
||||||
|
MudServer.vshost.exe
|
||||||
|
MudServer.vshost.exe.manifest
|
||||||
|
startup.dat
|
||||||
|
</Value></Property></Properties></ItemProperties>
|
Loading…
Add table
Add a link
Reference in a new issue