コード例 #1
0
        public static void PopulateDefaults(NewPlayerInfo info)
        {
            SettingsStore.Set(Setting_Health, info.Health);
            SettingsStore.Set(Setting_MaxHealth, info.MaxHealth);
            SettingsStore.Set(Setting_Mana, info.Mana);
            SettingsStore.Set(Setting_MaxMana, info.MaxMana);

            if (info.Inventory != null)
            {
                foreach (var item in info.Inventory)
                {
                    var id = ItemTable.NewItem(CharacterManager.ItemType.Inventory, item.NetId, item.Stack, item.Prefix, item.Slot);
                    AddItem(id);
                }
            }

            if (info.Armor != null)
            {
                foreach (var item in info.Armor)
                {
                    var id = ItemTable.NewItem(CharacterManager.ItemType.Armor, item.NetId, item.Stack, item.Prefix, item.Slot);
                    AddItem(id);
                }
            }

            if (info.Dye != null)
            {
                foreach (var item in info.Dye)
                {
                    var id = ItemTable.NewItem(CharacterManager.ItemType.Dye, item.NetId, item.Stack, item.Prefix, item.Slot);
                    AddItem(id);
                }
            }
        }
コード例 #2
0
        public ServerCharacter(NewPlayerInfo info, Player player)
        {
            //I need to test this soon. I'm not sure that the first time a player authenticates whether we use the existing player data (ie male, colours etc)
            //At this stage, it'll clone

            //this.Male = player.male;

            this.Mana      = info.Mana;
            this.Health    = info.Health;
            this.MaxHealth = info.Health;

            this.SpawnX = player.SpawnX;
            this.SpawnY = player.SpawnY;

            this.HideVisual = player.hideVisual;
            this.HairDye    = player.hairDye;

            this.Hair       = player.hair;
            this.Difficulty = player.difficulty;

            this.HairColor       = player.hairColor;
            this.SkinColor       = player.skinColor;
            this.EyeColor        = player.eyeColor;
            this.ShirtColor      = player.shirtColor;
            this.UnderShirtColor = player.underShirtColor;
            this.PantsColor      = player.pantsColor;
            this.ShoeColor       = player.shoeColor;

            this.Inventory = info.Inventory
                             .Select((item, index) => item == null ? null : new SlotItem(item.NetId, item.Stack, item.Prefix, index))
                             .ToList();
        }
コード例 #3
0
        public ServerCharacter(NewPlayerInfo info, Player player)
        {
            this.Health    = info.Health;
            this.MaxHealth = info.MaxHealth;

            this.Mana    = info.Mana;
            this.MaxMana = info.MaxMana;

            this.SpawnX = player.SpawnX;
            this.SpawnY = player.SpawnY;

            this.HideVisual = player.hideVisual;
            this.HairDye    = player.hairDye;

            this.Hair       = player.hair;
            this.Difficulty = player.difficulty;

            this.HairColor       = player.hairColor;
            this.SkinColor       = player.skinColor;
            this.EyeColor        = player.eyeColor;
            this.ShirtColor      = player.shirtColor;
            this.UnderShirtColor = player.underShirtColor;
            this.PantsColor      = player.pantsColor;
            this.ShoeColor       = player.shoeColor;

            this.AnglerQuests = player.anglerQuestsFinished;

            if (info.Inventory != null)
            {
                this.Inventory = info.Inventory.ToList();
            }
            if (info.Armor != null)
            {
                this.Armor = info.Armor.ToList();
            }
            if (info.Dye != null)
            {
                this.Dye = info.Dye.ToList();
            }

            this.Buffs    = player.buffType;
            this.BuffTime = player.buffTime;

//            player.anglerQuestsFinished
        }
コード例 #4
0
        public ServerCharacter(NewPlayerInfo info, Player player)
        {
            this.Health = info.Health;
            this.MaxHealth = info.MaxHealth;

            this.Mana = info.Mana;
            this.MaxMana = info.MaxMana;

            this.SpawnX = player.SpawnX;
            this.SpawnY = player.SpawnY;

            this.HideVisual = player.hideVisual;
            this.HairDye = player.hairDye;

            this.Hair = player.hair;
            this.Difficulty = player.difficulty;

            this.HairColor = player.hairColor;
            this.SkinColor = player.skinColor;
            this.EyeColor = player.eyeColor;
            this.ShirtColor = player.shirtColor;
            this.UnderShirtColor = player.underShirtColor;
            this.PantsColor = player.pantsColor;
            this.ShoeColor = player.shoeColor;

            this.AnglerQuests = player.anglerQuestsFinished;

            if (info.Inventory != null) this.Inventory = info.Inventory.ToList();
            if (info.Armor != null) this.Armor = info.Armor.ToList();
            if (info.Dye != null) this.Dye = info.Dye.ToList();
            if (info.Equipment != null) this.Equipment = info.Equipment.ToList();
            if (info.MiscDyes != null) this.MiscDyes = info.MiscDyes.ToList();
            if (info.Bank != null) this.Bank = info.Bank.ToList();
            if (info.Bank2 != null) this.Bank2 = info.Bank2.ToList();

            this.Buffs = player.buffType;
            this.BuffTime = player.buffTime;

            //            player.anglerQuestsFinished
        }
コード例 #5
0
        public ServerCharacter(NewPlayerInfo info, Player player)
        {
            //I need to test this soon. I'm not sure that the first time a player authenticates whether we use the existing player data (ie male, colours etc)
            //At this stage, it'll clone

            //this.Male = player.male;

            this.Mana = info.Mana;
            this.Health = info.Health;
            this.MaxHealth = info.Health;

            this.SpawnX = player.SpawnX;
            this.SpawnY = player.SpawnY;

            this.HideVisual = player.hideVisual;
            this.HairDye = player.hairDye;

            this.Hair = player.hair;
            this.Difficulty = player.difficulty;

            this.HairColor = player.hairColor;
            this.SkinColor = player.skinColor;
            this.EyeColor = player.eyeColor;
            this.ShirtColor = player.shirtColor;
            this.UnderShirtColor = player.underShirtColor;
            this.PantsColor = player.pantsColor;
            this.ShoeColor = player.shoeColor;

            this.Inventory = info.Inventory
                .Select((item, index) => item == null ? null : new SlotItem(item.NetId, item.Stack, item.Prefix, index))
                .ToList();
        }