Add logout command and pos command. Closes #872 and Closes #887

This commit is contained in:
Zack Piispanen 2015-03-25 21:17:11 -04:00
parent 42a505e18f
commit 015cf61b77
3 changed files with 83 additions and 0 deletions

View file

@ -37,6 +37,16 @@ namespace TShockAPI.Hooks
public string Password { get; set; }
}
public class PlayerLogoutEventArgs
{
public TSPlayer Player { get; set; }
public PlayerLogoutEventArgs(TSPlayer player)
{
Player = player;
}
}
public class PlayerCommandEventArgs : HandledEventArgs
{
public TSPlayer Player { get; set; }
@ -62,6 +72,9 @@ namespace TShockAPI.Hooks
public delegate void PlayerPreLoginD(PlayerPreLoginEventArgs e);
public static event PlayerPreLoginD PlayerPreLogin;
public delegate void PlayerLogoutD(PlayerLogoutEventArgs e);
public static event PlayerLogoutD PlayerLogout;
public delegate void PlayerCommandD(PlayerCommandEventArgs e);
public static event PlayerCommandD PlayerCommand;
@ -108,6 +121,15 @@ namespace TShockAPI.Hooks
return args.Handled;
}
public static void OnPlayerLogout(TSPlayer ply)
{
if (PlayerLogout == null)
return;
var args = new PlayerLogoutEventArgs(ply);
PlayerLogout(args);
}
public static void OnPlayerChat(TSPlayer ply, string rawtext, ref string tshockText)
{
if (PlayerChat == null)