本文整理汇总了C#中Terraria.Player.SetSSCReadyForSave方法的典型用法代码示例。如果您正苦于以下问题:C# Player.SetSSCReadyForSave方法的具体用法?C# Player.SetSSCReadyForSave怎么用?C# Player.SetSSCReadyForSave使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Terraria.Player
的用法示例。
在下文中一共展示了Player.SetSSCReadyForSave方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ApplyToPlayer
//.........这里部分代码省略.........
// try
// {
// //Reset and populate inventory
// // player.inventory = Enumerable.Repeat(new Item(){ name = String.Empty }, player.inventory.Length).ToArray();
// player.inventory = new Item[player.inventory.Length];
// for (var i = 0; i < player.inventory.Length; i++)
// {
// player.inventory[i] = new Item();
// player.inventory[i].name = String.Empty;
// player.inventory[i].SetDefaults(0);
// }
//
// if (this.Inventory != null)
// foreach (var slotItem in this.Inventory)
// {
// var item = player.inventory[slotItem.Slot];
//
// item.netDefaults(slotItem.NetId);
// item.stack = slotItem.Stack;
// item.Prefix(slotItem.Prefix);
// item.favorited = slotItem.Favorite;
//
// player.inventory[slotItem.Slot] = item;
// }
// }
// catch (Exception e)
// {
// ProgramLog.Log(e, "Failed to apply player inventory");
// }
//
// try
// {
// //Reset and populate dye
// // player.dye = Enumerable.Repeat(new Item(){ name = String.Empty }, player.dye.Length).ToArray();
// player.dye = new Item[player.dye.Length];
// for (var i = 0; i < player.dye.Length; i++)
// {
// player.dye[i] = new Item();
// player.dye[i].name = String.Empty;
// player.dye[i].SetDefaults(0);
// }
// if (this.Dye != null)
// foreach (var slotItem in this.Dye)
// {
// var item = player.dye[slotItem.Slot];
//
// item.netDefaults(slotItem.NetId);
// item.stack = slotItem.Stack;
// item.Prefix(slotItem.Prefix);
// item.favorited = slotItem.Favorite;
//
// player.dye[slotItem.Slot] = item;
// }
// }
// catch (Exception e)
// {
// ProgramLog.Log(e, "Failed to apply player dye");
// }
//
// try
// {
// //Reset and populate armor
// // player.armor = Enumerable.Repeat(new Item(){ name = String.Empty }, player.armor.Length).ToArray();
// player.armor = new Item[player.armor.Length];
// for (var i = 0; i < player.armor.Length; i++)
// {
// player.armor[i] = new Item();
// player.armor[i].name = String.Empty;
// player.armor[i].SetDefaults(0);
// }
// if (this.Armor != null)
// foreach (var slotItem in this.Armor)
// {
// var item = player.armor[slotItem.Slot];
//
// item.netDefaults(slotItem.NetId);
// item.stack = slotItem.Stack;
// item.Prefix(slotItem.Prefix);
// item.favorited = slotItem.Favorite;
//
// player.armor[slotItem.Slot] = item;
// }
// }
// catch (Exception e)
// {
// ProgramLog.Log(e, "Failed to apply player armor");
// }
try
{
//Update client
this.Send(player);
}
catch (Exception e)
{
ProgramLog.Log(e, "Failed to send player data");
}
player.SetSSCReadyForSave(true);
}
示例2: ApplyToPlayer
//.........这里部分代码省略.........
player.hair = this.Hair;
player.difficulty = this.Difficulty;
player.hairColor = this.HairColor;
player.skinColor = this.SkinColor;
player.eyeColor = this.EyeColor;
player.shirtColor = this.ShirtColor;
player.underShirtColor = this.UnderShirtColor;
player.pantsColor = this.PantsColor;
player.shoeColor = this.ShoeColor;
player.anglerQuestsFinished = this.AnglerQuests;
//Trash
player.trashItem = new Item();
player.trashItem.name = String.Empty;
player.trashItem.SetDefaults(0);
if (this.Trash != null)
{
player.trashItem.netDefaults(this.Trash.NetId);
player.trashItem.stack = this.Trash.Stack;
player.trashItem.Prefix(this.Trash.Prefix);
player.trashItem.favorited = this.Trash.Favorite;
}
}
catch (Exception e)
{
ProgramLog.Log(e, "Failed to apply player settings");
}
try
{
ApplyItems(ref player.inventory, this.Inventory);
}
catch (Exception e)
{
ProgramLog.Log(e, "Failed to apply player inventory");
}
try
{
ApplyItems(ref player.armor, this.Armor);
}
catch (Exception e)
{
ProgramLog.Log(e, "Failed to apply player armor");
}
try
{
ApplyItems(ref player.dye, this.Dye);
}
catch (Exception e)
{
ProgramLog.Log(e, "Failed to apply player dye");
}
try
{
ApplyItems(ref player.miscEquips, this.Equipment);
}
catch (Exception e)
{
ProgramLog.Log(e, "Failed to apply player equipment");
}
try
{
ApplyItems(ref player.miscDyes, this.MiscDyes);
}
catch (Exception e)
{
ProgramLog.Log(e, "Failed to apply player misc dyes");
}
try
{
ApplyItems(ref player.bank.item, this.Bank);
}
catch (Exception e)
{
ProgramLog.Log(e, "Failed to apply player bank items");
}
try
{
ApplyItems(ref player.bank2.item, this.Bank2);
}
catch (Exception e)
{
ProgramLog.Log(e, "Failed to apply player bank (2) items");
}
try
{
//Update client
this.Send(player);
}
catch (Exception e)
{
ProgramLog.Log(e, "Failed to send player data");
}
player.SetSSCReadyForSave(true);
}