4.2.7 Code Freeze
Merge branch 'general-devel'
This commit is contained in:
commit
5dfb1a806c
4 changed files with 71 additions and 83 deletions
|
|
@ -18,6 +18,7 @@ Feeling like helping out? Want to find an awesome server? Some awesome plugins?
|
|||
|
||||
* [Website & Forums](https://tshock.co/xf/)
|
||||
* [Wiki](https://tshock.atlassian.net/wiki/display/TSHOCKPLUGINS/Home)
|
||||
* [Join our chat (supports IRC, XMPP, iOS, Android, Web)](http://chat.tshock.co/)
|
||||
|
||||
## Download
|
||||
|
||||
|
|
|
|||
|
|
@ -623,7 +623,7 @@ namespace TShockAPI
|
|||
|
||||
IEnumerable<Command> cmds = ChatCommands.FindAll(c => c.HasAlias(cmdName));
|
||||
|
||||
if (Hooks.PlayerHooks.OnPlayerCommand(player, cmdName, cmdText, args, ref cmds))
|
||||
if (Hooks.PlayerHooks.OnPlayerCommand(player, cmdName, cmdText, args, ref cmds, cmdPrefix))
|
||||
return true;
|
||||
|
||||
if (cmds.Count() == 0)
|
||||
|
|
|
|||
|
|
@ -44,6 +44,7 @@ namespace TShockAPI.Hooks
|
|||
public string CommandText { get; set; }
|
||||
public List<string> Parameters { get; set; }
|
||||
public IEnumerable<Command> CommandList { get; set; }
|
||||
public string CommandPrefix { get; set; }
|
||||
}
|
||||
|
||||
public class PlayerChatEventArgs : HandledEventArgs
|
||||
|
|
@ -78,7 +79,7 @@ namespace TShockAPI.Hooks
|
|||
PlayerPostLogin(args);
|
||||
}
|
||||
|
||||
public static bool OnPlayerCommand(TSPlayer player, string cmdName, string cmdText, List<string> args, ref IEnumerable<Command> commands)
|
||||
public static bool OnPlayerCommand(TSPlayer player, string cmdName, string cmdText, List<string> args, ref IEnumerable<Command> commands, string cmdPrefix)
|
||||
{
|
||||
if (PlayerCommand == null)
|
||||
{
|
||||
|
|
@ -90,10 +91,10 @@ namespace TShockAPI.Hooks
|
|||
CommandName = cmdName,
|
||||
CommandText = cmdText,
|
||||
Parameters = args,
|
||||
CommandList = commands
|
||||
CommandList = commands,
|
||||
CommandPrefix = cmdPrefix,
|
||||
};
|
||||
PlayerCommand(playerCommandEventArgs);
|
||||
commands = playerCommandEventArgs.CommandList;
|
||||
return playerCommandEventArgs.Handled;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1132,26 +1132,12 @@ namespace TShockAPI
|
|||
WorldGen.genRand = new Random();
|
||||
}
|
||||
|
||||
if (args.Command.StartsWith("playing") || args.Command.StartsWith("{0}playing".SFormat(Commands.Specifier)))
|
||||
{
|
||||
int count = 0;
|
||||
foreach (TSPlayer player in Players)
|
||||
{
|
||||
if (player != null && player.Active)
|
||||
{
|
||||
count++;
|
||||
TSPlayer.Server.SendInfoMessage("{0} ({1}) [{2}] <{3}>", player.Name, player.IP,
|
||||
player.Group.Name, player.UserAccountName);
|
||||
}
|
||||
}
|
||||
TSPlayer.Server.SendInfoMessage("{0} players connected.", count);
|
||||
}
|
||||
else if (args.Command == "autosave")
|
||||
if (args.Command == "autosave")
|
||||
{
|
||||
Main.autoSave = Config.AutoSave = !Config.AutoSave;
|
||||
Log.ConsoleInfo("AutoSave " + (Config.AutoSave ? "Enabled" : "Disabled"));
|
||||
}
|
||||
else if (args.Command.StartsWith(Commands.Specifier))
|
||||
else if (args.Command.StartsWith(Commands.Specifier) || args.Command.StartsWith(Commands.SilentSpecifier))
|
||||
{
|
||||
Commands.HandleCommand(TSPlayer.Server, args.Command);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue