diff --git a/FFXIVClassic Map Server/CommandProcessor.cs b/FFXIVClassic Map Server/CommandProcessor.cs index 2bc8453c..36e58202 100644 --- a/FFXIVClassic Map Server/CommandProcessor.cs +++ b/FFXIVClassic Map Server/CommandProcessor.cs @@ -16,17 +16,18 @@ using FFXIVClassic_Map_Server.packets.send; using FFXIVClassic_Map_Server.dataobjects.chara; using FFXIVClassic_Map_Server.Actors; using FFXIVClassic_Map_Server.lua; -using FFXIVClassic_Map_Server.actors.chara.player; - +using FFXIVClassic_Map_Server.actors.chara.player; +using FFXIVClassic_Map_Server.Properties; + namespace FFXIVClassic_Lobby_Server { class CommandProcessor { private Dictionary mConnectedPlayerList; private static WorldManager mWorldManager = Server.getWorldManager(); - private static Dictionary gamedataItems = Server.getItemGamedataList(); - - // For the moment, this is the only predefined item + private static Dictionary gamedataItems = Server.getItemGamedataList(); + + // For the moment, this is the only predefined item // TODO: make a list/enum in the future so that items can be given by name, instead of by id const UInt32 ITEM_GIL = 1000001; @@ -336,6 +337,18 @@ namespace FFXIVClassic_Lobby_Server } } + /// + /// We only use the default options for SendMessagePacket. + /// May as well make it less unwieldly to view + /// + /// + /// + private void sendMessage(ConnectedPlayer client, String message) + { + if (client != null) + client.getActor().queuePacket(SendMessagePacket.buildPacket(client.actorID, client.actorID, SendMessagePacket.MESSAGE_TYPE_GENERAL_INFO, "", message)); + } + internal bool doCommand(string input, ConnectedPlayer client) { input.Trim(); @@ -347,130 +360,50 @@ namespace FFXIVClassic_Lobby_Server // Debug - // if (client != null) - // client.getActor().queuePacket(SendMessagePacket.buildPacket(client.actorID, client.actorID, SendMessagePacket.MESSAGE_TYPE_GENERAL_INFO, "", - // string.Join(",", split) - // )); + //sendMessage(client, string.Join(",", split)); if (split.Length >= 1) { - if (split[0].Equals("help")) { if (split.Length == 1) - { - if (client != null) - client.getActor().queuePacket(SendMessagePacket.buildPacket(client.actorID, client.actorID, SendMessagePacket.MESSAGE_TYPE_GENERAL_INFO, "", - "Use !help (command) for details\n\nAvailable commands:\nStandard: mypos, music, warp\nServer Administration: givecurrency, giveitem, givekeyitem, removecurrency, removekeyitem, reloaditems, resetzone\nDebug: property, property2, sendpacket, setgraphic" - )); + { + sendMessage(client, Resources.CPhelp); } if (split.Length == 2) { if (split[1].Equals("mypos")) - { - if (client != null) - client.getActor().queuePacket(SendMessagePacket.buildPacket(client.actorID, client.actorID, SendMessagePacket.MESSAGE_TYPE_GENERAL_INFO, "", - "Prints out your current location\n\n*Note: The X/Y/Z coordinates do not correspond to the coordinates listed in the in-game map, they are based on the underlying game data" - )); - } + sendMessage(client, Resources.CPmypos); else if (split[1].Equals("music")) - { - if (client != null) - client.getActor().queuePacket(SendMessagePacket.buildPacket(client.actorID, client.actorID, SendMessagePacket.MESSAGE_TYPE_GENERAL_INFO, "", - "Changes the currently playing background music\n\n*Syntax: music \n is the key item's specific id as defined in the server database" - )); - } + sendMessage(client, Resources.CPmusic); else if (split[1].Equals("warp")) - { - if (client != null) - client.getActor().queuePacket(SendMessagePacket.buildPacket(client.actorID, client.actorID, SendMessagePacket.MESSAGE_TYPE_GENERAL_INFO, "", - "Teleports the player to the specified location\n\n*Syntax:\twarp \n\twarp \n\twarp \n is a pre-defined list of locations from the server database\n is an instanced copy of the desired zone that's only visible to the current player" - )); - } - else if (split[1].Equals("givecurrency")) - { - if (client != null) - client.getActor().queuePacket(SendMessagePacket.buildPacket(client.actorID, client.actorID, SendMessagePacket.MESSAGE_TYPE_GENERAL_INFO, "", - "Adds the specified currency to the current player's inventory\n\n*Syntax:\tgivecurrency \n\tgivecurrency \n is the specific type of currency desired, defaults to gil if no type specified" - )); - } + sendMessage(client, Resources.CPwarp); + else if (split[1].Equals("givecurrency")) + sendMessage(client, Resources.CPgivecurrency); else if (split[1].Equals("giveitem")) - { - if (client != null) - client.getActor().queuePacket(SendMessagePacket.buildPacket(client.actorID, client.actorID, SendMessagePacket.MESSAGE_TYPE_GENERAL_INFO, "", - "Adds the specified items to the current player's inventory\n\n*Syntax:\tgiveitem \n\tgiveitem \n\tgiveitem \n is the item's specific id as defined in the server database\n is the type as defined in the server database (defaults to gil if not specified)" - )); - } + sendMessage(client, Resources.CPgiveitem); else if (split[1].Equals("givekeyitem")) - { - if (client != null) - client.getActor().queuePacket(SendMessagePacket.buildPacket(client.actorID, client.actorID, SendMessagePacket.MESSAGE_TYPE_GENERAL_INFO, "", - "Adds the specified key item to the current player's inventory\n\n*Syntax: givekeyitem \n is the key item's specific id as defined in the server database" - )); - } + sendMessage(client, Resources.CPgivekeyitem); else if (split[1].Equals("removecurrency")) - { - if (client != null) - client.getActor().queuePacket(SendMessagePacket.buildPacket(client.actorID, client.actorID, SendMessagePacket.MESSAGE_TYPE_GENERAL_INFO, "", - "Removes the specified currency from the current player's inventory\n\n*Syntax:\tremovecurrency \n\tremovecurrency \n is the specific type of currency desired, defaults to gil if no type specified" - )); - } + sendMessage(client, Resources.CPremovecurrency); else if (split[1].Equals("removeitem")) - { - if (client != null) - client.getActor().queuePacket(SendMessagePacket.buildPacket(client.actorID, client.actorID, SendMessagePacket.MESSAGE_TYPE_GENERAL_INFO, "", - "Removes the specified items to the current player's inventory\n\n*Syntax:\tremoveitem \n\tremoveitem \n is the item's specific id as defined in the server database" - )); - } + sendMessage(client, Resources.CPremoveitem); else if (split[1].Equals("removekeyitem")) - { - if (client != null) - client.getActor().queuePacket(SendMessagePacket.buildPacket(client.actorID, client.actorID, SendMessagePacket.MESSAGE_TYPE_GENERAL_INFO, "", - "Removes the specified key item to the current player's inventory\n\n*Syntax: removekeyitem \n is the key item's specific id as defined in the server database" - )); - } + sendMessage(client, Resources.CPremovekeyitem); else if (split[1].Equals("reloaditems")) - { - if (client != null) - client.getActor().queuePacket(SendMessagePacket.buildPacket(client.actorID, client.actorID, SendMessagePacket.MESSAGE_TYPE_GENERAL_INFO, "", - "Reloads the current item data from the database" - )); - } - else if (split[1].Equals("resetzone")) - { - if (client != null) - client.getActor().queuePacket(SendMessagePacket.buildPacket(client.actorID, client.actorID, SendMessagePacket.MESSAGE_TYPE_GENERAL_INFO, "", - "Reloads the current zone data from the server files" - )); - } - else if (split[1].Equals("property")) - { - if (client != null) - client.getActor().queuePacket(SendMessagePacket.buildPacket(client.actorID, client.actorID, SendMessagePacket.MESSAGE_TYPE_GENERAL_INFO, "", - "\n*Syntax: property " - )); - } - else if (split[1].Equals("property2")) - { - if (client != null) - client.getActor().queuePacket(SendMessagePacket.buildPacket(client.actorID, client.actorID, SendMessagePacket.MESSAGE_TYPE_GENERAL_INFO, "", - "\n*Syntax: property2 " - )); - } - else if (split[1].Equals("sendpacket")) - { - if (client != null) - client.getActor().queuePacket(SendMessagePacket.buildPacket(client.actorID, client.actorID, SendMessagePacket.MESSAGE_TYPE_GENERAL_INFO, "", - "Server sends a special packet to the client\n\n*Syntax: sendpacket \n is the path to the packet, starting in \\packet" - )); - } - else if (split[1].Equals("setgraphic")) - { - if (client != null) - client.getActor().queuePacket(SendMessagePacket.buildPacket(client.actorID, client.actorID, SendMessagePacket.MESSAGE_TYPE_GENERAL_INFO, "", - "Overrides the currently displayed character equipment in a specific slot\n\n*Note: Similar to Glamours in FFXIV:ARR, the overridden graphics are purely cosmetic, they do not affect the underlying stats of whatever is equipped on that slot\n\n*Syntax: sendpacket \n are as defined in the client game data" - )); - } + sendMessage(client, Resources.CPreloaditems); + else if (split[1].Equals("reloadzones")) + sendMessage(client, Resources.CPreloadzones); + /* + else if (split[1].Equals("property")) + sendMessage(client, Resources.CPproperty); + else if (split[1].Equals("property2")) + sendMessage(client, Resources.CPproperty2); + else if (split[1].Equals("sendpacket")) + sendMessage(client, Resources.CPsendpacket); + else if (split[1].Equals("setgraphic")) + sendMessage(client, Resources.CPsetgraphic); + */ } return true; @@ -487,7 +420,7 @@ namespace FFXIVClassic_Lobby_Server Log.error("Could not load packet: " + e); } } - else if (split[0].Equals("resetzone")) + else if (split[0].Equals("reloadzones")) { if (client != null) { diff --git a/FFXIVClassic Map Server/FFXIVClassic Map Server.csproj b/FFXIVClassic Map Server/FFXIVClassic Map Server.csproj index c5ac86aa..d11205d9 100644 --- a/FFXIVClassic Map Server/FFXIVClassic Map Server.csproj +++ b/FFXIVClassic Map Server/FFXIVClassic Map Server.csproj @@ -251,6 +251,11 @@ + + True + True + Resources.resx + @@ -262,7 +267,12 @@ - + + + PublicResXFileCodeGenerator + Resources.Designer.cs + + xcopy "$(SolutionDir)data" "$(SolutionDir)$(ProjectName)\$(OutDir)" /E /C /D diff --git a/FFXIVClassic Map Server/Properties/Resources.Designer.cs b/FFXIVClassic Map Server/Properties/Resources.Designer.cs new file mode 100644 index 00000000..27563937 --- /dev/null +++ b/FFXIVClassic Map Server/Properties/Resources.Designer.cs @@ -0,0 +1,254 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace FFXIVClassic_Map_Server.Properties { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + public class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + public static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("FFXIVClassic_Map_Server.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + public static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized string similar to Adds the specified currency to the current player's inventory + /// + ///*Syntax: givecurrency <quantity> + /// givecurrency <quantity> <type> + ///<type> is the specific type of currency desired, defaults to gil if no type specified. + /// + public static string CPgivecurrency { + get { + return ResourceManager.GetString("CPgivecurrency", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Adds the specified items to the current player's inventory + /// + ///*Syntax: giveitem <item id> + /// giveitem <item id> <quantity> + /// giveitem <item id> <quantity> <type> + ///<item id> is the item's specific id as defined in the server database + ///<type> is the type as defined in the server database (defaults to standard item if not specified). + /// + public static string CPgiveitem { + get { + return ResourceManager.GetString("CPgiveitem", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Adds the specified key item to the current player's inventory + /// + ///*Syntax: givekeyitem <item id> + ///<item id> is the key item's specific id as defined in the server database. + /// + public static string CPgivekeyitem { + get { + return ResourceManager.GetString("CPgivekeyitem", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Use !help(command) for details + /// + ///Available commands: + ///Standard: mypos, music, warp + ///Server Administration: givecurrency, giveitem, givekeyitem, removecurrency, removekeyitem, reloaditems, reloadzones. + /// + public static string CPhelp { + get { + return ResourceManager.GetString("CPhelp", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Changes the currently playing background music + /// + ///*Syntax: music <music id> + ///<music id> is the key item's specific id as defined in the server database. + /// + public static string CPmusic { + get { + return ResourceManager.GetString("CPmusic", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Prints out your current location + /// + ///*Note: The X/Y/Z coordinates do not correspond to the coordinates listed in the in-game map, they are based on the underlying game data. + /// + public static string CPmypos { + get { + return ResourceManager.GetString("CPmypos", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to *Syntax: property <value 1> <value 2> <value 3>. + /// + public static string CPproperty { + get { + return ResourceManager.GetString("CPproperty", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to *Syntax: property2 <value 1> <value 2> <value 3>. + /// + public static string CPproperty2 { + get { + return ResourceManager.GetString("CPproperty2", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Reloads the current item data from the database. + /// + public static string CPreloaditems { + get { + return ResourceManager.GetString("CPreloaditems", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Reloads the current zone data from the database. + /// + public static string CPreloadzones { + get { + return ResourceManager.GetString("CPreloadzones", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removes the specified currency from the current player's inventory + /// + ///*Syntax: removecurrency <quantity> + /// removecurrency <quantity> <type> + ///<type> is the specific type of currency desired, defaults to gil if no type specified. + /// + public static string CPremovecurrency { + get { + return ResourceManager.GetString("CPremovecurrency", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removes the specified items to the current player's inventory + /// + ///*Syntax: removeitem <itemid> + /// removeitem <itemid> <quantity> + ///<item id> is the item's specific id as defined in the server database. + /// + public static string CPremoveitem { + get { + return ResourceManager.GetString("CPremoveitem", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removes the specified key item to the current player's inventory + /// + ///*Syntax: removekeyitem <itemid> + ///<item id> is the key item's specific id as defined in the server database. + /// + public static string CPremovekeyitem { + get { + return ResourceManager.GetString("CPremovekeyitem", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Server sends a special packet to the client + /// + ///*Syntax: sendpacket <path to packet> + ///<Path to packet> is the path to the packet, starting in <map server install location>\packet. + /// + public static string CPsendpacket { + get { + return ResourceManager.GetString("CPsendpacket", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Overrides the currently displayed character equipment in a specific slot + /// + ///*Note: Similar to Glamours in FFXIV:ARR, the overridden graphics are purely cosmetic, they do not affect the underlying stats of whatever is equipped on that slot + /// + ///*Syntax: sendpacket <slot> <wid> <eid> <vid> <cid> + ///<w/e/v/c id> are as defined in the client game data. + /// + public static string CPsetgraphic { + get { + return ResourceManager.GetString("CPsetgraphic", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Teleports the player to the specified location + /// + ///*Syntax: warp <location list> + /// warp <zone id> <X coordinate> <Y coordinate> <Z coordinate> + /// warp <zone id> <instance> <X coordinate> <Y coordinate> <Z coordinate> + ///<location list> is a pre-defined list of locations from the server database + ///<instance> is an instanced copy of the desired zone that's only visible to the current player. + /// + public static string CPwarp { + get { + return ResourceManager.GetString("CPwarp", resourceCulture); + } + } + } +} diff --git a/FFXIVClassic Map Server/Properties/Resources.resx b/FFXIVClassic Map Server/Properties/Resources.resx new file mode 100644 index 00000000..1ce0528a --- /dev/null +++ b/FFXIVClassic Map Server/Properties/Resources.resx @@ -0,0 +1,215 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Adds the specified currency to the current player's inventory + +*Syntax: givecurrency <quantity> + givecurrency <quantity> <type> +<type> is the specific type of currency desired, defaults to gil if no type specified + + + Adds the specified items to the current player's inventory + +*Syntax: giveitem <item id> + giveitem <item id> <quantity> + giveitem <item id> <quantity> <type> +<item id> is the item's specific id as defined in the server database +<type> is the type as defined in the server database (defaults to standard item if not specified) + + + Adds the specified key item to the current player's inventory + +*Syntax: givekeyitem <item id> +<item id> is the key item's specific id as defined in the server database + + + Use !help(command) for details + +Available commands: +Standard: mypos, music, warp +Server Administration: givecurrency, giveitem, givekeyitem, removecurrency, removekeyitem, reloaditems, reloadzones + + + Changes the currently playing background music + +*Syntax: music <music id> +<music id> is the key item's specific id as defined in the server database + + + Prints out your current location + +*Note: The X/Y/Z coordinates do not correspond to the coordinates listed in the in-game map, they are based on the underlying game data + + + *Syntax: property <value 1> <value 2> <value 3> + + + *Syntax: property2 <value 1> <value 2> <value 3> + + + Reloads the current item data from the database + + + Reloads the current zone data from the database + + + Removes the specified currency from the current player's inventory + +*Syntax: removecurrency <quantity> + removecurrency <quantity> <type> +<type> is the specific type of currency desired, defaults to gil if no type specified + + + Removes the specified items to the current player's inventory + +*Syntax: removeitem <itemid> + removeitem <itemid> <quantity> +<item id> is the item's specific id as defined in the server database + + + Removes the specified key item to the current player's inventory + +*Syntax: removekeyitem <itemid> +<item id> is the key item's specific id as defined in the server database + + + Server sends a special packet to the client + +*Syntax: sendpacket <path to packet> +<Path to packet> is the path to the packet, starting in <map server install location>\packet + + + Overrides the currently displayed character equipment in a specific slot + +*Note: Similar to Glamours in FFXIV:ARR, the overridden graphics are purely cosmetic, they do not affect the underlying stats of whatever is equipped on that slot + +*Syntax: sendpacket <slot> <wid> <eid> <vid> <cid> +<w/e/v/c id> are as defined in the client game data + + + Teleports the player to the specified location + +*Syntax: warp <location list> + warp <zone id> <X coordinate> <Y coordinate> <Z coordinate> + warp <zone id> <instance> <X coordinate> <Y coordinate> <Z coordinate> +<location list> is a pre-defined list of locations from the server database +<instance> is an instanced copy of the desired zone that's only visible to the current player + + \ No newline at end of file