From 62daa4db89af35ac13ee77f8c9d646e26ece90b3 Mon Sep 17 00:00:00 2001 From: Filip Maj Date: Mon, 29 Aug 2016 12:48:23 -0400 Subject: [PATCH] Removed duplicate CommandProcessor. It is held by the Server object now. GetSession by name now ignores case. --- FFXIVClassic Map Server/PacketProcessor.cs | 4 +--- FFXIVClassic Map Server/Program.cs | 4 ++-- FFXIVClassic Map Server/Server.cs | 8 +++++++- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/FFXIVClassic Map Server/PacketProcessor.cs b/FFXIVClassic Map Server/PacketProcessor.cs index 8cf4237c..88ae4b18 100644 --- a/FFXIVClassic Map Server/PacketProcessor.cs +++ b/FFXIVClassic Map Server/PacketProcessor.cs @@ -24,12 +24,10 @@ namespace FFXIVClassic_Map_Server class PacketProcessor { Server mServer; - CommandProcessor cp; public PacketProcessor(Server server) { mServer = server; - cp = new CommandProcessor(); } public void ProcessPacket(ZoneConnection client, SubPacket subpacket) @@ -69,7 +67,7 @@ namespace FFXIVClassic_Map_Server if (chatMessage.message.StartsWith("!")) { - if (cp.DoCommand(chatMessage.message, session)) + if (Server.GetCommandProcessor().DoCommand(chatMessage.message, session)) return; ; } diff --git a/FFXIVClassic Map Server/Program.cs b/FFXIVClassic Map Server/Program.cs index 25f24287..921278a1 100644 --- a/FFXIVClassic Map Server/Program.cs +++ b/FFXIVClassic Map Server/Program.cs @@ -63,14 +63,14 @@ namespace FFXIVClassic_Map_Server if (startServer) { Server server = new Server(); - CommandProcessor cp = new CommandProcessor(); + server.StartServer(); while (startServer) { String input = Console.ReadLine(); Log.Info("[Console Input] " + input); - cp.DoCommand(input, null); + Server.GetCommandProcessor().DoCommand(input, null); } } diff --git a/FFXIVClassic Map Server/Server.cs b/FFXIVClassic Map Server/Server.cs index d0af47a5..8bf0c2a2 100644 --- a/FFXIVClassic Map Server/Server.cs +++ b/FFXIVClassic Map Server/Server.cs @@ -25,6 +25,7 @@ namespace FFXIVClassic_Map_Server private Dictionary mSessionList = new Dictionary(); private LuaEngine mLuaEngine = new LuaEngine(); + private static CommandProcessor mCommandProcessor = new CommandProcessor(); private static ZoneConnection mWorldConnection = new ZoneConnection(); private static WorldManager mWorldManager; private static Dictionary mGamedataItems; @@ -120,7 +121,7 @@ namespace FFXIVClassic_Map_Server { foreach (Session s in mSessionList.Values) { - if (s.GetActor().customDisplayName.Equals(name)) + if (s.GetActor().customDisplayName.ToLower().Equals(name.ToLower())) return s; } return null; @@ -248,6 +249,11 @@ namespace FFXIVClassic_Map_Server return mSelf; } + public static CommandProcessor GetCommandProcessor() + { + return mCommandProcessor; + } + public static ZoneConnection GetWorldConnection() { return mWorldConnection;