Save a players old account when they log into the new one.
Include latest bin.
This commit is contained in:
parent
4a4d5c8080
commit
991e8a4c0a
2 changed files with 8 additions and 1 deletions
|
|
@ -252,7 +252,8 @@ namespace TShockAPI
|
|||
ServerApi.Hooks.WorldSave.Register(this, SaveManager.Instance.OnSaveWorld);
|
||||
ServerApi.Hooks.WorldChristmasCheck.Register(this, OnXmasCheck);
|
||||
ServerApi.Hooks.NetNameCollision.Register(this, NetHooks_NameCollision);
|
||||
TShockAPI.Hooks.PlayerHooks.PlayerPostLogin += OnPlayerLogin;
|
||||
TShockAPI.Hooks.PlayerHooks.PlayerPreLogin += OnPlayerPreLogin;
|
||||
TShockAPI.Hooks.PlayerHooks.PlayerPostLogin += OnPlayerLogin;
|
||||
|
||||
GetDataHandlers.InitGetDataHandler();
|
||||
Commands.InitCommands();
|
||||
|
|
@ -365,6 +366,12 @@ namespace TShockAPI
|
|||
Users.UpdateLogin(u);
|
||||
}
|
||||
|
||||
private void OnPlayerPreLogin(Hooks.PlayerPreLoginEventArgs args)
|
||||
{
|
||||
if (args.Player.IsLoggedIn)
|
||||
args.Player.SaveServerCharacter();
|
||||
}
|
||||
|
||||
private void NetHooks_NameCollision(NameCollisionEventArgs args)
|
||||
{
|
||||
string ip = TShock.Utils.GetRealIP(Netplay.serverSock[args.Who].tcpClient.Client.RemoteEndPoint.ToString());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue