Added Hook for player login, for plugin sake, now they can utilize the login before join.
This commit is contained in:
parent
673f25f881
commit
c37cc91ca0
4 changed files with 37 additions and 1 deletions
32
TShockAPI/Hooks/PlayerLoginEvent.cs
Normal file
32
TShockAPI/Hooks/PlayerLoginEvent.cs
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace TShockAPI.Hooks
|
||||
{
|
||||
class PlayerLoginEventArgs
|
||||
{
|
||||
public TSPlayer Player { get; set; }
|
||||
public PlayerLoginEventArgs(TSPlayer ply)
|
||||
{
|
||||
Player = ply;
|
||||
}
|
||||
}
|
||||
|
||||
class PlayerLoginEvent
|
||||
{
|
||||
public delegate void PlayerLoginD(PlayerLoginEventArgs e);
|
||||
public static event PlayerLoginD PlayerLogin;
|
||||
public static void OnPlayerLogin(TSPlayer ply)
|
||||
{
|
||||
if(PlayerLogin == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
PlayerLoginEventArgs args = new PlayerLoginEventArgs(ply);
|
||||
PlayerLogin(args);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue