Skip to content

Commit

Permalink
Now /plugins uses plugin name, instead of type name
Browse files Browse the repository at this point in the history
  • Loading branch information
UnknownShadow200 committed May 21, 2017
1 parent 29cf24e commit cfb6a88
Showing 1 changed file with 9 additions and 17 deletions.
26 changes: 9 additions & 17 deletions fCraft/Commands/InfoCommands.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2066,23 +2066,15 @@ static void clpHandler(Player player, CommandReader cmd)
Permissions = new Permission[] { Permission.Chat },
IsConsoleSafe = true,
Usage = "/Plugins",
Help = "Displays all plugins on the server.",
Handler = PluginsHandler
};

static void PluginsHandler(Player player, CommandReader cmd) {
List<string> plugins = new List<string>();
player.Message("&c_Current plugins on {0}&c_", ConfigKey.ServerName.GetString());

//Sloppy :P, PluginManager.Plugins adds ".Init", so this should split the ".Init" from the plugin name
foreach (Plugin plugin in PluginManager.Plugins) {
String pluginString = plugin.ToString();
string[] splitPluginString = pluginString.Split('.');
plugins.Add(splitPluginString[0]);
}
player.Message(String.Join(", ", plugins.ToArray()));
}
#endregion
Help = "Displays all plugins on the server.",
Handler = PluginsHandler
};

static void PluginsHandler(Player player, CommandReader cmd) {
player.Message("Plugins in {0}&S:", ConfigKey.ServerName.GetString());
player.Message(PluginManager.Plugins.JoinToString(plugin => plugin.Name));
}
#endregion
#region PingList

static readonly CommandDescriptor CdPingList = new CommandDescriptor {
Expand Down

0 comments on commit cfb6a88

Please sign in to comment.