Implement logic to store the data of a player when they join, and allow for a command to be run that will upload that data in place of their existing SSC data.
This commit is contained in:
parent
156df47777
commit
f1ce158efd
4 changed files with 39 additions and 12 deletions
|
|
@ -298,6 +298,11 @@ namespace TShockAPI
|
|||
{
|
||||
HelpText = "Saves all serverside characters."
|
||||
});
|
||||
add(new Command(Permissions.uploaddata, UploadJoinData, "uploadssc")
|
||||
{
|
||||
HelpText = "Upload the account information when you joined the server as your Server Side Character data.",
|
||||
AllowServer = false
|
||||
});
|
||||
add(new Command(Permissions.settempgroup, TempGroup, "tempgroup")
|
||||
{
|
||||
HelpText = "Temporarily sets another player's group."
|
||||
|
|
@ -1691,6 +1696,18 @@ namespace TShockAPI
|
|||
args.Player.SendSuccessMessage("SSC of player \"{0}\" has been overriden.", matchedPlayer.Name);
|
||||
}
|
||||
|
||||
private static void UploadJoinData(CommandArgs args)
|
||||
{
|
||||
if (TShock.CharacterDB.InsertSpecificPlayerData(args.Player, args.Player.DataWhenJoined)) {
|
||||
args.Player.DataWhenJoined.RestoreCharacter(args.Player);
|
||||
args.Player.SendSuccessMessage("Your Join Data has been uploaded to the server.");
|
||||
}
|
||||
else
|
||||
{
|
||||
args.Player.SendErrorMessage("Failed to upload your data, please find an admin.");
|
||||
}
|
||||
}
|
||||
|
||||
private static void ForceHalloween(CommandArgs args)
|
||||
{
|
||||
TShock.Config.ForceHalloween = !TShock.Config.ForceHalloween;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue