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
|
||||
startup.dat
|
||||
temp
|
||||
Scripts.dll
|
||||
</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();
|
||||
str = enc.GetString(data);
|
||||
|
||||
if (Game.IsDebug)
|
||||
Log.Write("Client entered command: " + str);
|
||||
|
||||
// execute, and get result
|
||||
str = ExecuteCommand(str);
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@ using System.Net.Sockets;
|
|||
using System.Threading;
|
||||
|
||||
using MudEngine.GameObjects.Characters;
|
||||
using MudEngine.GameManagement;
|
||||
|
||||
/* Usage:
|
||||
* Server MUDServer = new Server();
|
||||
|
@ -84,6 +85,7 @@ namespace MudEngine.Networking
|
|||
} while (sub < 0);
|
||||
players[sub].client = server.Accept();
|
||||
players[sub].Initialize();
|
||||
Log.Write("New Player Connected.");
|
||||
//ParameterizedThreadStart start = new ParameterizedThreadStart(ReceiveThread);
|
||||
clientThreads[sub] = new Thread(ReceiveThread);
|
||||
clientThreads[sub].Start((object)sub);
|
||||
|
@ -92,7 +94,6 @@ namespace MudEngine.Networking
|
|||
private void ReceiveThread(object obj)
|
||||
{
|
||||
int sub = (int)obj;
|
||||
MudEngine.GameManagement.Log.Write("Receiving client data...");
|
||||
while (stage == 2 && players[sub].IsActive)
|
||||
{
|
||||
try
|
||||
|
|
|
@ -6,6 +6,7 @@ using System.Text;
|
|||
|
||||
using MudEngine.FileSystem;
|
||||
using MudEngine.GameManagement;
|
||||
using MudEngine.GameObjects.Characters;
|
||||
using MUDGame; //Pulling this from the example game, no sense re-writing what already exists.
|
||||
|
||||
namespace MudServer
|
||||
|
@ -16,9 +17,11 @@ namespace MudServer
|
|||
{
|
||||
Game game = new Game();
|
||||
Zeroth realm = new Zeroth(game);
|
||||
|
||||
|
||||
realm.BuildZeroth();
|
||||
|
||||
BaseCharacter serverAdmin = new BaseCharacter(game);
|
||||
|
||||
//Setup the game
|
||||
game.AutoSave = true;
|
||||
game.BaseCurrencyName = "Copper";
|
||||
|
@ -40,12 +43,23 @@ namespace MudServer
|
|||
Game.IsDebug = true;
|
||||
|
||||
game.Start();
|
||||
string command = "";
|
||||
|
||||
while (game.IsRunning)
|
||||
{
|
||||
Console.Write(Log.GetMessages());
|
||||
Log.FlushMessages();
|
||||
System.Threading.Thread.Sleep(1);
|
||||
if (!Console.KeyAvailable)
|
||||
{
|
||||
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