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,6 +252,7 @@ namespace TShockAPI
|
||||||
ServerApi.Hooks.WorldSave.Register(this, SaveManager.Instance.OnSaveWorld);
|
ServerApi.Hooks.WorldSave.Register(this, SaveManager.Instance.OnSaveWorld);
|
||||||
ServerApi.Hooks.WorldChristmasCheck.Register(this, OnXmasCheck);
|
ServerApi.Hooks.WorldChristmasCheck.Register(this, OnXmasCheck);
|
||||||
ServerApi.Hooks.NetNameCollision.Register(this, NetHooks_NameCollision);
|
ServerApi.Hooks.NetNameCollision.Register(this, NetHooks_NameCollision);
|
||||||
|
TShockAPI.Hooks.PlayerHooks.PlayerPreLogin += OnPlayerPreLogin;
|
||||||
TShockAPI.Hooks.PlayerHooks.PlayerPostLogin += OnPlayerLogin;
|
TShockAPI.Hooks.PlayerHooks.PlayerPostLogin += OnPlayerLogin;
|
||||||
|
|
||||||
GetDataHandlers.InitGetDataHandler();
|
GetDataHandlers.InitGetDataHandler();
|
||||||
|
|
@ -365,6 +366,12 @@ namespace TShockAPI
|
||||||
Users.UpdateLogin(u);
|
Users.UpdateLogin(u);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void OnPlayerPreLogin(Hooks.PlayerPreLoginEventArgs args)
|
||||||
|
{
|
||||||
|
if (args.Player.IsLoggedIn)
|
||||||
|
args.Player.SaveServerCharacter();
|
||||||
|
}
|
||||||
|
|
||||||
private void NetHooks_NameCollision(NameCollisionEventArgs args)
|
private void NetHooks_NameCollision(NameCollisionEventArgs args)
|
||||||
{
|
{
|
||||||
string ip = TShock.Utils.GetRealIP(Netplay.serverSock[args.Who].tcpClient.Client.RemoteEndPoint.ToString());
|
string ip = TShock.Utils.GetRealIP(Netplay.serverSock[args.Who].tcpClient.Client.RemoteEndPoint.ToString());
|
||||||
|
|
|
||||||
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue