قديم 2020-04-23, 01:54 PM
المشاركة 2
Users
.:: عضو خبير ::.
  • غير متواجد
افتراضي رد: طلب سستم
قسم التطويى فى طلبك

قديم 2020-04-23, 03:07 PM
المشاركة 3
medo2020
.:: عضو نشيط ::.
  • غير متواجد
افتراضي رد: طلب سستم
ممكن تبعتوا هنا يا ريزوا معلش

قديم 2020-04-23, 07:29 PM
المشاركة 4
medo2020
.:: عضو نشيط ::.
  • غير متواجد
افتراضي رد: طلب سستم
هات لينك الطلب يا ريزوا معلش

قديم 2020-04-23, 10:59 PM
المشاركة 5
Users
.:: عضو خبير ::.
  • غير متواجد
افتراضي رد: طلب سستم
انت مكسل تدور ؟؟؟

قديم 2020-04-24, 12:36 AM
المشاركة 6
medo2020
.:: عضو نشيط ::.
  • غير متواجد
افتراضي رد: طلب سستم
مش مكسل والله بس مش لقيه انا

قديم 2020-04-24, 12:46 AM
المشاركة 7
ElSaher
.:: عضو خبير ::.
  • غير متواجد
افتراضي رد: طلب سستم
لو سيستم الوير دروب عندك وناقص ابحث عن


كود:
ublic class WardrobeTable 

امسح كل الي فيها وبدلها بي دول

كود:
using System;
using System.Collections.Generic;
using System.Linq;

namespace 
XMeGo.Database
{
    public class 
WardrobeTable
    
{
        public class 
StorageItem
        
{
            public 
uint ID;
            public 
uint Points;
            public 
uint Stars;
            public 
byte Type;
        }

        public class 
StorageAttribute
        
{
            public 
uint ID;
            public 
uint Type;
            public 
ushort CountReq;
            public 
Dictionary<byteuintAttributes;
        }
      
        public class 
Title
        
{
            public 
ushort Type;
            public 
ushort ID;
            public 
string Name;
            public 
ushort Points;
        }

        public static 
Dictionary<uintStorageAttributeStorageAttributes = new Dictionary<uintStorageAttribute>();
        public static 
Dictionary<uintTitleTitles = new Dictionary<uintTitle>();
        public static 
Dictionary<uintStorageItemGarments = new Dictionary<uintStorageItem>();
        public static 
Dictionary<uintStorageItemMounts = new Dictionary<uintStorageItem>();
        private 
StorageAttribute FakeGarment;
        private 
uint MyOldGarment;
        public 
StorageAttribute MyGarment;
        public 
StorageAttribute MySteedArmor;
        
Dictionary<uintStorageAttributeitems;
        
StorageAttribute[] objects;
        public 
StorageAttribute[] Objects
        
{
            
get
            
{
                return 
objects;
            }
        }
        public static 
void LoadCoat()
        {
            
string[] baseText System.IO.File.ReadAllLines((Constants.DataHolderPath "coat_storage_type.txt"));
            foreach (var 
bas_line in baseText)
            {
                var 
line bas_line.Split(new string[] { "@@" }, StringSplitOptions.RemoveEmptyEntries);
                
StorageItem item = new StorageItem();
                
item.ID uint.Parse(line[0]);
                
item.Points uint.Parse(line[1]);
                
item.Stars uint.Parse(line[7]);
                
item.Type byte.Parse(line[2]);
                if (
item.Type == 1)
                    
Garments.Add(item.IDitem);
                else
                    
Mounts.Add(item.IDitem);
            }
            
baseText System.IO.File.ReadAllLines((Constants.DataHolderPath "coat_storage_attr.txt"));
            foreach (var 
bas_line in baseText)
            {
                var 
line bas_line.Split(new string[] { "@@" }, StringSplitOptions.RemoveEmptyEntries);
                
StorageAttribute item = new StorageAttribute();
                
item.ID uint.Parse(line[0]);
                
item.Type uint.Parse(line[1]);
                
item.CountReq ushort.Parse(line[7]);
                
item.Type byte.Parse(line[2]);
                
item.Attributes = new Dictionary<byteuint>();
                for (
int x 3line.Length; )
                {
                    
byte y byte.Parse(line[x++]);
                    
uint u uint.Parse(line[x++]);
                    if (
!= 0)
                        
item.Attributes.Add(yu);
                }
                
StorageAttributes.Add(item.IDitem);
            }
        }

        public static 
void GetAttributes(Client.GameState client)
        {
            if (
client != null && client.Entity != null && client.Entity.StorageItems != null)
            {
                
int GarmentsCount client.Entity.StorageItems.Values.Where(=> Network.PacketHandler.GetPositionFromID(i.ID) == Network.PacketHandler.Positions.Garment).Count();
                
int SteedArmorsCount client.Entity.StorageItems.Values.Where(=> Network.PacketHandler.GetPositionFromID(i.ID) == Network.PacketHandler.Positions.SteedArmor).Count();
                foreach (var 
item in StorageAttributes.Values.Reverse().Where(=> i.Type == && i.CountReq <= GarmentsCount || i.Type == && i.CountReq <= SteedArmorsCount))
                {
                    foreach (var 
attr in item.Attributes)
                    {
                        if (
attr.Key == 2) { client.Entity.BaseMinAttack += attr.Valueclient.Entity.BaseMaxAttack += attr.Value; }
                        else if (
attr.Key == 3client.Entity.BaseMagicAttack += attr.Value;
                        else if (
attr.Key == 4client.Entity.BaseDefence += (ushort)attr.Value;
                        else if (
attr.Key == 5client.Entity.BaseMagicDefence += attr.Value;
                    }
                }
            }
        }

        public static 
void LoadTitle()
        {
            
string[] baseText System.IO.File.ReadAllLines((Constants.DataHolderPath "title_type.txt"));
            foreach (var 
bas_line in baseText)
            {
                var 
line bas_line.Split(new string[] { "@@" }, StringSplitOptions.RemoveEmptyEntries);
                
Title item = new Title();
                
item.Type ushort.Parse(line[0]);
                
item.ID ushort.Parse(line[1]);
                
item.Name line[2];
                
item.Points ushort.Parse(line[7]);
                
Titles.Add(item.Typeitem);
            }
        }

        public static 
void Load()
        {
            
LoadCoat();
            
LoadTitle();
        }

        public static 
uint AmountStarGarments(Client.GameState clientbyte Star)
        {
            
uint Count 0;
            if (
client == null || client.Entity == null || client.Entity.StorageItems == null) return 0;
            foreach (var 
Garment in client.Entity.StorageItems.Values)
            {
                
StorageItem item;
                if (
Garments.TryGetValue(Garment.IDout item))
                {
                    if (
item.Type != 1)
                        continue;
                    if (
item.Stars >= Star)
                        
Count++;
                }
            }
            return 
Count;
        }

        public static 
uint PerfectionPoints(Client.GameState clientbool Garment)
        {
            
uint Count 0;
            if (
client == null || client.Entity == null || client.Entity.StorageItems == null) return 0;
            foreach (var 
item2 in client.Entity.StorageItems.Values)
            {
                
StorageItem item;
                if (
Garment)
                {
                    if (
Garments.TryGetValue(item2.IDout item))
                    {
                        if (
item.Type != 1)
                            continue;
                        
/* if (item.Points == 1)
                             Count += 50;
                         else if (item.Points >= 2 && item.Points <= 10)
                             Count += 100;
                         else if (item.Points >= 11 && item.Points <= 50)
                             Count += 200;
                         else if (item.Points >= 51 && item.Points <= 100)
                             Count += 300;
                         else if (item.Points >= 100 && item.Points <= 200)
                             Count += 500;*/
                        
Count += 50;
                    }
                }
                else
                {
                    if (
Mounts.TryGetValue(item2.IDout item))
                    {
                        if (
item.Type != 2)
                            continue;
                        
/* if (item.Points == 1)
                             Count += 50;
                         else if (item.Points >= 2 && item.Points <= 10)
                             Count += 100;
                         else if (item.Points >= 11 && item.Points <= 50)
                             Count += 200;
                         else if (item.Points >= 51 && item.Points <= 100)
                             Count += 300;
                         else if (item.Points >= 100 && item.Points <= 200)
                             Count += 500;*/
                        
Count += 50;
                    }
                }
            }
            return 
Count;
        }

        public static 
uint AmountStarMounts(Client.GameState clientbyte Star)
        {
            
uint Count 0;
            if (
client == null || client.Entity == null || client.Entity.StorageItems == null) return 0;
            foreach (var 
Mount in client.Entity.StorageItems.Values)
            {
                
StorageItem item;
                if (
Mounts.TryGetValue(Mount.IDout item))
                {
                    if (
item.Type != 2)
                        continue;
                    if (
item.Stars >= Star)
                        
Count++;
                }
            }
            return 
Count;
        }
    }


بعدها ابحث عن

كود:
public sealed class CoatStorage 

امسح كل الي فيها وبدلها بي دول

كود:
using ProtoBuf;
using System;
using System.Runtime.InteropServices;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Collections.Concurrent;
using System.Text;
using System.Threading.Tasks;

namespace 
XMeGo.Network.GamePackets
{
    public 
sealed class CoatStorage
    
{
        public 
CoatStorage() { }
        public 
bool Read(byte[] packet)
        {
            
using (var memoryStream = new MemoryStream(packet))
            {
                
Info Serializer.DeserializeWithLengthPrefix<CoatStorageProto>(memoryStreamPrefixStyle.Fixed32);
            }
            return 
true;
        }
        public 
void Handle(Client.GameState client)
        {
            switch (
Info.ActionId)
            {
                case 
Action.Combine:
                    {
                        
ConquerItem ItemInInventory null;
                        
ConquerItem ItemInSystem null;
                        if (
client.Inventory.TryGetItem((uint)Info.ItemIdout ItemInInventory))
                        {
                            if (
client.Entity.StorageItems.TryGetValue((uint)Info.ItemGuidout ItemInSystem))
                            {
                                
ItemInSystem.Minutes += ItemInInventory.Minutes;
                                
Database.ConquerItemTable.UpdateMinutes(ItemInSystem);
                                if (
ItemInSystem.Minutes != 0)
                                {
                                    
uint num;
                                    if (
DateTime.Now >= ItemInSystem.TimeStamp.AddMinutes(ItemInSystem.Minutes))
                                    {
                                        
Database.ConquerItemTable.DeleteItem(ItemInSystem.UID);
                                    }
                                    else
                                    {
                                        
TimeSpan span = new TimeSpan(ItemInSystem.TimeStamp.AddMinutes(ItemInSystem.Minutes).Ticks);
                                        
TimeSpan span2 = new TimeSpan(DateTime.Now.Ticks);
                                        
num = (uint)(span.TotalSeconds span2.TotalSeconds);
                                        
ItemInSystem.TimeLeftInMinutes num;
                                    }
                                }

                                
client.Inventory.Remove(ItemInInventoryGame.Enums.ItemUse.Remove);
                                var 
proto = new CoatStorageProto();
                                
proto.ActionId Action.Combine;
                                
proto.ItemGuid Info.ItemGuid;
                                
proto.ItemId = (int)ItemInSystem.ID;
                                
proto.AddItem(ItemInSystem1);
                                
client.Send(FinalizeProtoBuf(proto));
                            }
                        }
                        break;

                    }
                case 
Action.Equipcheck:

                    if (
Illegal(Infoclient))
                        return;

                    
ConquerItem myItem;
                    if (
client.Inventory.TryGetItem(Info.ItemGuidout myItem))
                    {
                        var 
packet FinalizeProtoBuf(new CoatStorageProto()
                        {
                            
ActionId Info.ActionId,
                            
ItemGuid Info.ItemGuid,
                        });
                        
client.Send(packet);
                    }
                    break;
                case 
Action.Addtowardrobe:
                    {
                        if (
Illegal(Infoclient))
                            return;

                        if (
client.Inventory.TryGetItem(Info.ItemGuidout myItem) ||
                            
client.Entity.StorageItems.TryGetValue(Info.ItemGuidout myItem))
                        {
                            if (!
client.Entity.StorageItems.ContainsKey(myItem.UID))
                            {
                                
client.Entity.StorageItems.Add(myItem.UIDmyItem);
                                
myItem.InWardrobe true;
                                
Database.ConquerItemTable.UpdateWardrobe(myItem.InWardrobemyItem.UID);
                                
client.Inventory.Remove(myItemGame.Enums.ItemUse.None);
                            }
                            var 
dbInfo Database.ConquerItemInformation.BaseInformations[myItem.ID];
                            var 
pos = (byte)PacketHandler.GetPositionFromID(myItem.ID);
                            if (
pos == 17)
                            {
                                if (
client.Entity.SubClasses.Classes.ContainsKey(9))
                                    if (
client.Entity.SubClasses.Classes[9].Phase >= dbInfo.Proficiency)
                                    {
                                        
client.Send(FinalizeProtoBuf(new CoatStorageProto()
                                        {
                                            
ActionId Info.ActionId,
                                            
ItemGuid Info.ItemGuid,
                                            
ItemId = (int)myItem.ID
                                        
}));
                                        foreach (var 
i in client.Entity.StorageItems.Values)
                                            if (
i.Position != && i.Position == (byte)PacketHandler.GetPositionFromID(myItem.ID))
                                            {
                                                
i.Position 0;
                                                
Database.ConquerItemTable.UpdateLocation(iclient);
                                            }
                                        
myItem.Position = (byte)PacketHandler.GetPositionFromID(myItem.ID);

                                        if (!
client.Equipment.Add(myItem))
                                        {
                                            
client.Equipment.Remove((byte)myItem.Positiontrue);
                                            if (!
client.Equipment.Add(myItem))
                                                new 
Exception();
                                        }
                                        var 
iu = new ItemUsage(true);
                                        
iu.ID 5;
                                        
iu.UID myItem.UID;
                                        
iu.dwParam myItem.Position;
                                        
client.Send(iu.ToArray());

                                        
ClientEquip equips = new ClientEquip();
                                        
equips.DoEquips(client);
                                        
client.Send(equips.ToArray());

                                        
Database.ConquerItemTable.UpdateLocation(myItemclient);
                                        
client.Equipment.UpdateEntityPacket();
                                    }
                                    else
                                        break;

                            }
                            if (
pos == 9)
                            {
                                
client.Send(FinalizeProtoBuf(new CoatStorageProto()
                                {
                                    
ActionId Info.ActionId,
                                    
ItemGuid Info.ItemGuid,
                                    
ItemId = (int)myItem.ID
                                
}));
                                foreach (var 
i in client.Entity.StorageItems.Values)
                                    if (
i.Position != && i.Position == (byte)PacketHandler.GetPositionFromID(myItem.ID))
                                    {
                                        
i.Position 0;
                                        
Database.ConquerItemTable.UpdateLocation(iclient);
                                    }
                                
myItem.Position = (byte)PacketHandler.GetPositionFromID(myItem.ID);

                                if (!
client.Equipment.Add(myItem))
                                {
                                    
client.Equipment.Remove((byte)myItem.Positiontrue);
                                    if (!
client.Equipment.Add(myItem))
                                        new 
Exception();
                                }



                                var 
iu = new ItemUsage(true);
                                
iu.ID 5;
                                
iu.UID myItem.UID;
                                
iu.dwParam myItem.Position;
                                
client.Send(iu.ToArray());

                                
ClientEquip equips = new ClientEquip();
                                
equips.DoEquips(client);

                                if ((
equips.Garment == || equips.Garment && equips.Garment != myItem.UID) && myItem.Position != 17)
                                    
equips.Garment myItem.UID;

                                
client.Send(equips.ToArray());

                                
Database.ConquerItemTable.UpdateLocation(myItemclient);
                                
client.Equipment.UpdateEntityPacket();
                            }
                            break;
                        }
                        break;
                    }
                case 
Action.Takeoff:
                    if (
client.Inventory.TryGetItem(Info.ItemGuidout myItem) ||
                        
client.Entity.StorageItems.TryGetValue(Info.ItemGuidout myItem) || client.Equipment.TryGetItem(Info.ItemGuidout myItem))
                    {
                        
client.Send(FinalizeProtoBuf(new CoatStorageProto()
                        {
                            
ActionId Info.ActionId,
                            
ItemGuid Info.ItemGuid,
                            
ItemId = (int)myItem.ID
                        
}));

                        var 
pos = (byte)PacketHandler.GetPositionFromID(myItem.ID);


                        
ClientEquip equips = new ClientEquip();
                        
equips.DoEquips(client);
                        if (
pos == 17)
                            
equips.SteedArmor 0;
                        else 
equips.Garment 0;
                        
client.Send(equips.ToArray());

                        if (
myItem != null && !client.Entity.StorageItems.ContainsKey(myItem.UID))
                            
client.Entity.StorageItems.Add(myItem.UIDmyItem);

                    }
                    break;
                case 
Action.Retrieve:
                    if (
client.Entity.StorageItems.TryGetValue(Info.ItemGuidout myItem))
                    {
                        
client.Send(FinalizeProtoBuf(new CoatStorageProto()
                        {
                            
ActionId Info.ActionId,
                            
ItemGuid Info.ItemGuid,
                            
ItemId = (int)myItem.ID
                        
}));

                        
client.Entity.StorageItems.Remove(myItem.UID);
                        
myItem.InWardrobe false;
                        var 
pos = (byte)PacketHandler.GetPositionFromID(myItem.ID);

                        if (
client.Inventory.ContainsUID(myItem.UID))
                        {
                            
client.Inventory.Remove(myItemGame.Enums.ItemUse.Move);
                            if (
client.Equipment.TryGetItem(pos) != null && client.Equipment.TryGetItem(pos).UID == myItem.UID)
                                
client.Equipment.Remove(pos);
                            else 
client.Inventory.Add(myItemGame.Enums.ItemUse.Move);
                        }
                        else
                        {
                            if (
client.Equipment.TryGetItem(pos) != null && client.Equipment.TryGetItem(pos).UID == myItem.UID)
                                
client.Equipment.Remove(pos);
                            else 
client.Inventory.Add(myItemGame.Enums.ItemUse.Move);
                        }


                        
Database.ConquerItemTable.UpdateWardrobe(myItem.InWardrobemyItem.UID);

                    }
                    break;
            }
        }

        private 
bool Illegal(CoatStorageProto InfoClient.GameState client)
        {
            
ConquerItem myItem;
            if (
client.Inventory.TryGetItem(Info.ItemGuidout myItem) ||
            
client.Entity.StorageItems.TryGetValue(Info.ItemGuidout myItem) ||
            
client.Equipment.TryGetItem(Info.ItemGuidout myItem))
            {
                var 
dbInfo Database.ConquerItemInformation.BaseInformations.ContainsKey(myItem.ID) ?
                
Database.ConquerItemInformation.BaseInformations[myItem.ID] : null;
                if (
dbInfo == null)
                    return 
true;
                var 
charSex = (client.Entity.Body == 1003 || client.Entity.Body == 1004) ? "Male" "Female";
                if (
dbInfo.Gender == 2)
                {
                    if (
charSex != "Female")
                        return 
true;
                }
                else if (
dbInfo.Gender == 1)
                    if (
charSex != "Male")
                        return 
true;
            }
            else return 
true;
            return 
false;
        }

        private 
byte[] FinalizeProtoBuf(CoatStorageProto coatStorageProto)
        {
            
using (var memoryStream = new MemoryStream())
            {
                
Serializer.SerializeWithLengthPrefix(memoryStreamcoatStorageProtoPrefixStyle.Fixed32);
                var 
pkt = new byte[memoryStream.Length];
                
memoryStream.ToArray().CopyTo(pkt0);
                
Writer.WriteUshort((ushort)memoryStream.Length0pkt);
                
Writer.WriteUshort((ushort)33002pkt);

                return 
pkt;
            }
        }
        public 
void Login(Client.GameState client)
        {
            var 
pkt = new CoatStorageProto();
            foreach (var 
item in client.Entity.StorageItems.Values)
            {
                
pkt.AddItem(item,
                    
client.Entity.StorageItems.Values.Where(=> i.ID == item.ID).Count());
                
client.Send(FinalizeProtoBuf(pkt));

                if (
item.Position != 0)
                {

                    
client.Equipment.Add(item);

                    var 
iu = new ItemUsage(true);
                    
iu.ID ItemUsage.Unknown5;
                    
iu.UID item.UID;
                    
iu.dwParam item.Position;
                    
client.Send(iu.ToArray());

                    
ClientEquip equips = new ClientEquip();
                    
equips.DoEquips(client);
                    
client.Send(equips.ToArray());

                    
Database.ConquerItemTable.UpdateLocation(itemclient);
                    
client.Equipment.UpdateEntityPacket();
                }

            }
            var 
currentGarment client.Equipment.TryGetItem((byte)PacketHandler.Positions.Garment);
            if (
currentGarment != null && !client.Entity.StorageItems.ContainsKey(currentGarment.UID))
            {
                
client.Entity.StorageItems.Add(currentGarment.UIDcurrentGarment);
                
pkt.AddItem(currentGarment,
                    
client.Entity.StorageItems.Values.Where(=> i.ID == currentGarment.ID).Count());
                
pkt.Item.Equipped true;
                
client.Send(FinalizeProtoBuf(pkt));
            }
            var 
currentMountArmor client.Equipment.TryGetItem((byte)PacketHandler.Positions.SteedArmor);
            if (
currentMountArmor != null && !client.Entity.StorageItems.ContainsKey(currentMountArmor.UID))
            {
                
client.Entity.StorageItems.Add(currentMountArmor.UIDcurrentMountArmor);
                
pkt.AddItem(currentMountArmor,
                    
client.Entity.StorageItems.Values.Where(=> i.ID == currentMountArmor.ID).Count());
                
pkt.Item.Equipped true;
                
client.Send(FinalizeProtoBuf(pkt));
            }
        }


        public 
CoatStorageProto Info;

        public 
enum Action int
        
{
            
/// <summary> 
            /// Load items in storage ... 
            /// </summary> 
            
Login 0,
            
Equipcheck 1,
            
Retrieve 2,
            
Combine 4,
            
Addtowardrobe 5,
            
Takeoff 6,
        }
    }
    [
ProtoContract]
    public class 
CoatStorageProto
    
{
        [
ProtoMember(1IsRequired true)]
        public 
CoatStorage.Action ActionId;
        [
ProtoMember(2IsRequired true)]
        public 
uint ItemGuid;
        [
ProtoMember(3IsRequired true)]
        public 
int ItemId;
        [
ProtoMember(4IsRequired true)]
        public 
int Junk;
        [
ProtoMember(5IsRequired true)]
        public 
ItemStorage Item;
        public 
void AddItem(ConquerItem itemint stack)
        {
            
Item = new ItemStorage();
            
Item.ItemUID item.UID;
            
Item.ItemID = (int)item.ID;
            
Item.Maximumdurability Item.Minimumdurability item.MaximDurability;
            
Item.Stack stack;
            
Item.FirstSocket = (int)item.SocketOne;
            
Item.SecondSocket = (int)item.SocketTwo;
            
Item.Plus item.Plus;
            
Item.Protection item.Bless;
            
Item.Bound item.Bound;
            
Item.Health item.Enchant;
            
Item.SocketProgress = (int)item.SocketProgress;
            
Item.Effect item.Effect;
            
Item.Color item.Color;
            
Item.CraftProgress = (int)item.PlusProgress;
            
Item.Locked item.Lock == true false;
            
Item.Suspicious false;
            
Item.Inscribed false;
            
Item.dwParam7 0;
            
Item.Equipped item.Position != 0;
            
Item.dwParam15 0;
            
Item.Time 0;
            
Item.SubTime 0;
        }

    }
    [
ProtoContract]
    public class 
ItemStorage
    
{
        [
ProtoMember(1IsRequired true)]
        public 
uint ItemUID;
        [
ProtoMember(2IsRequired true)]
        public 
int ItemID;
        [
ProtoMember(3IsRequired true)]
        public 
int SocketProgress;
        [
ProtoMember(4IsRequired true)]
        public 
int FirstSocket;
        [
ProtoMember(5IsRequired true)]
        public 
int SecondSocket;
        [
ProtoMember(6IsRequired true)]
        public 
Game.Enums.ItemEffect Effect;
        [
ProtoMember(7IsRequired true)]
        public 
int dwParam7;
        [
ProtoMember(8IsRequired true)]
        public 
int Plus;
        [
ProtoMember(9IsRequired true)]
        public 
int Protection;
        [
ProtoMember(10IsRequired true)]
        public 
bool Bound;
        [
ProtoMember(11IsRequired true)]
        public 
int Health;
        [
ProtoMember(12IsRequired true)]
        public 
bool Equipped;
        [
ProtoMember(13IsRequired true)]
        public 
bool Suspicious;
        [
ProtoMember(14IsRequired true)]
        public 
bool Locked;
        [
ProtoMember(15IsRequired true)]
        public 
int dwParam15;
        [
ProtoMember(16IsRequired true)]
        public 
Game.Enums.Color Color;
        [
ProtoMember(17IsRequired true)]
        public 
int CraftProgress;
        
/// <summary>
        /// Inscribed in guild arsenal 
        /// This class is for wardrobe items which are garments or mount armors so this filed is always false
        /// </summary>
        
[ProtoMember(18IsRequired true)]
        public 
bool Inscribed;
        
/// <summary>
        /// Time left in seconds !
        /// </summary>
        
[ProtoMember(19IsRequired true)]
        public 
int Time;
        
/// <summary>
        /// Time left in minutes (if item not activated only)
        /// </summary>
        
[ProtoMember(20IsRequired true)]
        public 
int SubTime;
        [
ProtoMember(21IsRequired true)]
        public 
int Stack;
        [
ProtoMember(22IsRequired true)]
        public 
int Minimumdurability;
        [
ProtoMember(23IsRequired true)]
        public 
int Maximumdurability;
    }
    public static class 
Storage
    
{
        private static 
string Path Constants.DataHolderPath "Storage.ini";

        public static 
void Read(out StorageInfo storageInfo)
        {
            
storageInfo = new StorageInfo();
            var 
reader = new IniFile(Path);
            {
                
storageInfo.Count reader.ReadInt32("Storage""StorageTypeCount"0);
                
storageInfo.Storages = new StorageInfo.Storage[storageInfo.Count];
                for (
int i 0storageInfo.Counti++)
                {
                    var 
mySection = (1).ToString();
                    
storageInfo.Storages[i] = new StorageInfo.Storage();
                    
storageInfo.Storages[i].Type reader.ReadInt32(mySection"Type"0);
                    
storageInfo.Storages[i].UnitCount reader.ReadInt32(mySection"UnitCount"0);
                    
storageInfo.Storages[i].ViewType reader.ReadInt32(mySection"ViewType"0);
                    
storageInfo.Storages[i].Units = new StorageInfo.Storage.Unit[storageInfo.Storages[i].UnitCount];
                    for (
int u 0storageInfo.Storages[i].UnitCountu++)
                    {
                        var 
unitSection mySection "-" + (1).ToString();
                        
storageInfo.Storages[i].Units[u] = new StorageInfo.Storage.Unit();
                        
storageInfo.Storages[i].Units[u].ID reader.ReadInt32(unitSection"ID"0);
                        
storageInfo.Storages[i].Units[u].AniSection reader.ReadString(unitSection"AniSection");
                        
storageInfo.Storages[i].Units[u].GetWayType3 reader.ReadInt32(unitSection"GetWayType3"0);
                        
storageInfo.Storages[i].Units[u].GetWayText3 reader.ReadString(unitSection"GetWayText3");
                        
storageInfo.Storages[i].Units[u].Param reader.ReadString(unitSection"Param");
                        
storageInfo.Storages[i].Units[u].Intro reader.ReadString(unitSection"Intro");
                    }

                }
            }
            
//Console.WriteLine("Storages loaded");
        
}
    }
    [
StructLayout(LayoutKind.Sequential)]
    public class 
StorageInfo
    
{
        public 
int Count;
        public 
Storage[] Storages;
        public class 
Storage
        
{
            public 
int Type;
            public 
int UnitCount;
            public 
int ViewType;
            public 
Unit[] Units;
            public class 
Unit
            
{
                public 
int ID;
                public 
string AniSection;
                public 
int GetWayType3;
                public 
string GetWayText3;
                public 
string Param;
                public 
string Intro;
            }
        }
        public 
Storage GetStorageByType(int Type)
        {
            foreach (var 
storage in Storages)
                if (
storage != null && storage.Type == Type)
                    return 
storage;
            return 
null;
        }
        public 
Storage.Unit GetUnitByID(int IDStorage _storage null)
        {
            if (
_storage != null)
            {
                foreach (var 
unit in _storage.Units)
                    if (
unit.ID == ID)
                        return 
unit;
            }
            else
            {
                foreach (var 
storage in Storages)
                    if (
storage != null)
                        foreach (var 
unit in storage.Units)
                            if (
unit.ID == ID)
                                return 
unit;
            }
            return 
null;
        }
    }
    public 
sealed class StorageManager
    
{
        public static 
StorageInfo Info;

        public static 
void Load()
        {
            try
            {
                
Storage.Read(out Info);
            }
            catch (
Exception e)
            {
                
Console.WriteLine(e);
            }
        }

        public static 
T Wing<T>(int _typeint _id)
        {
            
object value null;
            
int trash 0;
            if (
typeof(T) == typeof(bool))
            {
                
value int.TryParse(Info.GetUnitByID(_idInfo.GetStorageByType(_type)).Paramout trash);
            }
            else if (
typeof(T) == typeof(int))
            {
                var 
myType _type.ToString();
                var 
myID _id.ToString();


                while (
myID.Length 4)
                    
myID "0" myID;
                
value int.Parse(myType myID);
            }
            else
                throw new 
Exception("Unknow type : " typeof(T).Name);
            return (
T)Convert.ChangeType(valuetypeof(T));
        }

        public static 
int GetTitlePoints(short _typeshort _id)
        {
            var 
title Database.WardrobeTable.Titles.Values.Where(=> i.Type == (ushort)_type && i.ID == (ushort)_id).FirstOrDefault();
            if (
title != null)
                return 
title.Points;
            return 
150;
        }

        public static 
T Title<T>(int _typeint _id)
        {
            
object value null;
            
int trash 0;
            if (
typeof(T) == typeof(bool))
            {
                
value = !int.TryParse(Info.GetUnitByID(_idInfo.GetStorageByType(_type)).Paramout trash);
            }
            else if (
typeof(T) == typeof(int))
            {
                var 
myType _type.ToString();
                var 
myID _id.ToString();

                while (
myID.Length 4)
                    
myID "0" myID;
                
value int.Parse(myType myID);
            }
            else
                throw new 
Exception("Unknow type : " typeof(T).Name);
            return (
T)Convert.ChangeType(valuetypeof(T));
        }
    }
    public 
sealed class TitleStorage
    
{
        public 
TitleStorage() { }
        public 
bool Read(byte[] packet)
        {
            
using (var memoryStream = new MemoryStream(packet))
            {
                
Info Serializer.DeserializeWithLengthPrefix<TitleStorageProto>(memoryStreamPrefixStyle.Fixed32);
            }
            return 
true;
        }
        private 
bool CollectedRandMonkey(Client.GameState client)
        {
            return 
client.Entity.StorageItems.Values.Where(=> MonkeysValues.Contains(p.ID)).ToList().Count true false;
        }
        private 
bool CollectedCelestialFox(Client.GameState client)
        {
            return 
client.Entity.StorageItems.Values.Where(=> p.ID == 200595).ToList().Count true false;
        }
        private 
bool CollectedCelestialFoxFantasy(Client.GameState client)
        {
            return 
client.Entity.StorageItems.Values.Where(=> p.ID == 200596).ToList().Count true false;
        }
        List<
uintMonkeysValues = new List<uint>()
        {
            
200553,
            
200554,
            
200555,
            
200556,
            
200557,
            
200558,
            
200559,
            
200560
        
};
        private 
bool Collected8TypesMonkey(Client.GameState client)
        {
            List<
uintIDs = new List<uint>();
            var 
Dict client.Entity.StorageItems.Values.ToList();
            for (
int x 0Dict.Countx++)
            {
                if (
MonkeysValues.Contains(Dict[x].ID) && !IDs.Contains(Dict[x].ID))
                {
                    
IDs.Add(Dict[x].ID);
                }
            }
            return 
IDs.Count == true false;
        }
        private 
bool CollectedMonkey(Client.GameState clientuint ID)
        {
            return 
client.Entity.StorageItems.Values.Where(=> p.ID == ID).ToList().Count true false;
        }
        public 
void CheckTitles(Client.GameState client)
        {
            if (
client.Entity.haveallTitles) { GetAll(client); return; }
            
#region Titles And Wings Equips
            #region Wings
            #region Union Emperor
            
if (client.Union != null)
                if (
client.Union.IsKingdom())
                    if (
client.Union.IsLeader(client.Entity.UID))
                        new 
TitleStorage().AddTitle(client40011000false);
                    else
                        new 
TitleStorage().RemoveTitle(client40011000false);
                else
                    new 
TitleStorage().RemoveTitle(client40011000false);
            else
                new 
TitleStorage().RemoveTitle(client40011000false);
            
#endregion
            //#region The Champion Of Elite Pk Tournament
            //if (client.Entity.Titles.ContainsKey(TitlePacket.Titles.ElitePKChamption_High))
            //{
            //    DateTime date = DateTime.Now;
            //    for (int i = DateTime.Now.Day; i < 31; i++)
            //    {
            //        date = new DateTime(DateTime.Now.Year, DateTime.Now.Month, i);
            //        if (date.DayOfWeek == DayOfWeek.Friday)
            //        {
            //            date = new DateTime(DateTime.Now.Year, DateTime.Now.Month, i, 19, 55, 0);
            //            break;
            //        }
            //    }
            //    if (date.Day == DateTime.Now.Day && date.Hour == DateTime.Now.Hour && date.Year == DateTime.Now.Year && date.Minute == date.Minute && DateTime.Now.DayOfWeek != DayOfWeek.Friday)
            //    {
            //        for (int i = 1; i < 31; i++)
            //        {
            //            date = new DateTime(DateTime.Now.Year, DateTime.Now.Month + 1, i);
            //            if (date.DayOfWeek == DayOfWeek.Friday)
            //            {
            //                date = new DateTime(DateTime.Now.Year, DateTime.Now.Month + 1, i, 19, 55, 0);
            //                break;
            //            }
            //        }
            //    }
            //    TimeSpan timespan = date - DateTime.Now;
            //    int time = (int)(timespan.TotalSeconds);
            //    new TitleStorage().AddTitle(client, 6001, 20, false, time);
            //}
            //else
            //    new TitleStorage().RemoveTitle(client, 6001, 20, false);
            //#endregion
            #region Own a 5-star garment
            
if (Database.WardrobeTable.AmountStarGarments(client5) >= 1)
            {
                new 
TitleStorage().AddTitle(client600322false);
            }
            else
                new 
TitleStorage().RemoveTitle(client600322false);
            
#endregion
            #region Own a 5-star Mount armor
            
if (Database.WardrobeTable.AmountStarMounts(client5) >= 1)
            {
                new 
TitleStorage().AddTitle(client600423false);
            }
            else
                new 
TitleStorage().RemoveTitle(client600423false);
            
#endregion
            #region Prestige Score reaches 600,000
            
if (client.Entity.TotalPerfectionScore >= 600000)
            {
                new 
TitleStorage().AddTitle(client20262026false);
            }
            else
                new 
TitleStorage().RemoveTitle(client20262026false);
            
#endregion
            #region Stars Score reaches 324
            
if (client.Equipment.TotalStars >= 324)
            {
                new 
TitleStorage().AddTitle(client60076007false);
            }
            else
                new 
TitleStorage().RemoveTitle(client60076007false);
            
#endregion
            #region Stars Score reaches 216
            
if (client.Equipment.TotalStars >= 216)
            {
                new 
TitleStorage().AddTitle(client60086008false);
            }
            else
                new 
TitleStorage().RemoveTitle(client60086008false);
            
#endregion
            #endregion
            #region Titles
            #region Union Emperor
            
if (client.Union != null)
                if (
client.Union.IsKingdom())
                    if (
client.Union.IsLeader(client.Entity.UID))
                        new 
TitleStorage().AddTitle(client11000false);
                    else
                        new 
TitleStorage().RemoveTitle(client11000false);
                else
                    new 
TitleStorage().RemoveTitle(client11000false);
            else
                new 
TitleStorage().RemoveTitle(client11000false);
            
#endregion
            #region VIP
            
if (client.Entity.VIPLevel 0)
            {
                switch (
client.Entity.VIPLevel)
                {
                    case 
1:
                    case 
2:
                    case 
3:
                    case 
4:
                        {
                            new 
TitleStorage().AddTitle(client20302030false);
                            break;
                        }
                    case 
5:
                    case 
6:
                        {
                            new 
TitleStorage().AddTitle(client20292029false);
                            break;
                        }
                    case 
7:
                        {
                            new 
TitleStorage().AddTitle(client20312031false);
                            break;
                        }
                }
            }
            else
            {
                new 
TitleStorage().RemoveTitle(client20302030false);
                new 
TitleStorage().RemoveTitle(client20292029false);
                new 
TitleStorage().RemoveTitle(client20312031false);
            }
            
#endregion
            #region CollectedRandMonkey
            
if (CollectedRandMonkey(client))
            {
                new 
TitleStorage().AddTitle(client201314false);
            }
            else
            {
                new 
TitleStorage().RemoveTitle(client201314false);
            }
            
#endregion
            #region Collect 8 kinds of permanent saint monkeys (can be activated via the Wardrobe after the event)
            
if (Collected8TypesMonkey(client))
            {
                new 
TitleStorage().AddTitle(client201617false);
            }
            else
            {
                new 
TitleStorage().RemoveTitle(client201617false);
            }
            
#endregion
            #region Collect a permanent Solar Monkey
            
if (CollectedMonkey(client200559))
            {
                new 
TitleStorage().AddTitle(client201415false);
            }
            else
            {
                new 
TitleStorage().RemoveTitle(client201415false);
            }
            
#endregion
            #region Collect a permanent Lunar Monkey
            
if (CollectedMonkey(client200560))
            {
                new 
TitleStorage().AddTitle(client201516false);
            }
            else
            {
                new 
TitleStorage().RemoveTitle(client201516false);
            }
            
#endregion
            #region Tulip
            
if (client.Entity.MyFlowers != null && client.Entity.MyFlowers.RankTuilps == 1)
            {
                new 
TitleStorage().AddTitle(client60056005false);
            }
            else
            {
                new 
TitleStorage().RemoveTitle(client60056005false);
            }
            
#endregion
            #region The Total Score of Chi Study Reaches 1.600 Points
            
if (client.ChiData.DragonPoints == 400 && client.ChiData.PhoenixPoints == 400 && client.ChiData.TigerPoints == 400 && client.ChiData.TurtlePoints == 400)
            {
                new 
TitleStorage().AddTitle(client20181false);
            }
            else
            {
                new 
TitleStorage().RemoveTitle(client20181false);
            }
            
#endregion
            #region Prestige Score reaches 400,000
            
if (client.Entity.TotalPerfectionScore >= 400000)
            {
                new 
TitleStorage().AddTitle(client20272027false);
            }
            else
            {
                new 
TitleStorage().RemoveTitle(client20272027false);
            }
            
#endregion
            #region The Total Score Of Jiang hu training reaches 81,000 points(Title)
            
if (client.Entity.MyJiang != null && client.Entity.MyJiang.Inner_Strength >= 81000)
            {
                new 
TitleStorage().AddTitle(client20045false);
            }
            else
            {
                new 
TitleStorage().RemoveTitle(client20045false);
            }
            
#endregion
            #region Complete 320 Achievement
            
if (client.Entity.MyAchievement.Count(client.Entity.UID) >= 320)
            {
                new 
TitleStorage().AddTitle(client20012false);
            }
            else
            {
                new 
TitleStorage().RemoveTitle(client20012false);
            }
            
#endregion
            #region Own 5 garments of 4-star or 5-star
            
if (Database.WardrobeTable.AmountStarGarments(client4) >= 5)
            {
                new 
TitleStorage().AddTitle(client20056false);
            }
            else
            {
                new 
TitleStorage().RemoveTitle(client20056false);
            }
            
#endregion
            #region Own 5 Mount of 4-star or 5-star
            
if (Database.WardrobeTable.AmountStarMounts(client4) >= 5)
            {
                new 
TitleStorage().AddTitle(client20067false);
            }
            else
            {
                new 
TitleStorage().RemoveTitle(client20067false);
            }
            
#endregion
            #region CelestialFox(200595)
            
if (CollectedCelestialFox(client))
            {
                new 
TitleStorage().AddTitle(client20502050false);
            }
            else
            {
                new 
TitleStorage().RemoveTitle(client20502050false);
            }
            
#endregion
            #region CelestialFox(Fantasy)(200596)
            
if (CollectedCelestialFoxFantasy(client))
            {
                new 
TitleStorage().AddTitle(client20512051false);
            }
            else
            {
                new 
TitleStorage().RemoveTitle(client20512051false);
            }
            
#endregion
            #endregion
            #endregion
            #region GM
            /*if (client.Account.State == Database.AccountTable.AccountState.GameMaster)
            {
                foreach (var title in Database.WardrobeTable.Titles.Values)
                {
                    AddTitle(client, (short)title.Type, (short)title.ID);
                }
            }*/
            #endregion
        
}
        public 
void Login(Client.GameState clientbool Crossed falsestring val "")
        {
            if (!
Crossed)
            {
                
CheckTitles(client);
                
using (var cmd = new Database.MySqlCommand(Database.MySqlCommandType.SELECT).Select("entities").Where("UID"client.Account.EntityID))
                
using (var reader = new Database.MySqlReader(cmd))
                {
                    if (
reader.Read())
                    {
                        if (
reader.ReadString("Wardrobe") != "")
                        {
                            if (
reader.ReadString("Wardrobe").Contains("~"))
                            {
                                var 
wing reader.ReadString("Wardrobe").Split('~')[0];
                                
int type Convert.ToInt32(wing.Split('-')[0]);
                                
int id Convert.ToInt32(wing.Split('-')[1]);
                                if (
client.Entity.Wings.ContainsKey((uint)type) && client.Entity.Wings.ContainsValue((uint)id))
                                {
                                    var 
pkt = new TitleStorageProto()
                                    {
                                        
ActionId Action.Update,
                                        
Points client.Entity.UTitlePoints,
                                        
Type type,
                                        
Id id,
                                        
Value = new TitleValue()
                                        {
                                            
Type type,
                                            
Id id,
                                            
Equipped true
                                        
}
                                    };
                                    
client.Send(FinalizeProtoBuf(pkt));
                                    
client.Entity.EquippedWing StorageManager.Wing<int>(typeid);
                                    
client.Entity.NowEquippedWing.Clear();
                                    
client.Entity.NowEquippedWing.Add(type "~" id);
                                }
                                var 
title reader.ReadString("Wardrobe").Split('~')[1];
                                
int type2 Convert.ToInt32(title.Split('-')[0]);
                                
int id2 Convert.ToInt32(title.Split('-')[1]);
                                if (
client.Entity.WTitles.ContainsKey((uint)type2) && client.Entity.WTitles.ContainsValue((uint)id2))
                                {
                                    var 
pkt = new TitleStorageProto()
                                    {
                                        
ActionId Action.Update,
                                        
Points client.Entity.UTitlePoints,
                                        
Type type2,
                                        
Id id2,
                                        
Value = new TitleValue()
                                        {
                                            
Type type2,
                                            
Id id2,
                                            
Equipped true
                                        
}
                                    };
                                    
client.Send(FinalizeProtoBuf(pkt));
                                    
client.Entity.EquippedTitle StorageManager.Title<int>(type2id2);
                                    
client.Entity.NowEquippedTitle.Clear();
                                    
client.Entity.NowEquippedTitle.Add(type2 "~" id2);
                                }
                            }
                        }

                    }
                }
            }
            else
            {
                if (
val != "")
                {
                    if (
val.Contains("~"))
                    {
                        
CheckTitles(client);
                        var 
wing val.Split('~')[0];
                        
int type Convert.ToInt32(wing.Split('-')[0]);
                        
int id Convert.ToInt32(wing.Split('-')[1]);
                        var 
pkt = new TitleStorageProto()
                        {
                            
ActionId Action.Update,
                            
Points client.Entity.UTitlePoints,
                            
Type type,
                            
Id id,
                            
Value = new TitleValue()
                            {
                                
Type type,
                                
Id id,
                                
Equipped true
                            
}
                        };
                        
client.Send(FinalizeProtoBuf(pkt));
                        
client.Entity.EquippedWing StorageManager.Wing<int>(typeid);
                        
client.Entity.NowEquippedWing.Clear();
                        
client.Entity.NowEquippedWing.Add(type "~" id);

                        var 
title val.Split('~')[1];
                        
int type2 Convert.ToInt32(title.Split('-')[0]);
                        
int id2 Convert.ToInt32(title.Split('-')[1]);
                        
pkt.Type type2;
                        
pkt.Id id2;
                        
pkt.Value.Type type2;
                        
pkt.Value.Id id2;
                        
client.Send(FinalizeProtoBuf(pkt));
                        
client.Entity.EquippedTitle StorageManager.Title<int>(type2id2);
                        
client.Entity.NowEquippedTitle.Clear();
                        
client.Entity.NowEquippedTitle.Add(type2 "~" id2);
                    }
                }
            }

        }
        public 
void Handle(Client.GameState client)
        {
            switch (
Info.ActionId)
            {
                case 
Action.Unequip:
                    {
                        if (
StorageManager.Wing<bool>(Info.TypeInfo.Id))
                        {
                            
client.Entity.EquippedWing 0;
                            
client.Entity.NowEquippedWing.Clear();
                        }
                        else if (
StorageManager.Title<bool>(Info.TypeInfo.Id))
                        {
                            
client.Entity.EquippedTitle 0;
                            
client.Entity.NowEquippedTitle.Clear();
                        }
                        
client.Send(FinalizeProtoBuf(Info));
                        break;
                    }
                case 
Action.Equip:
                    {
                        if (
client.Entity.UTitlePoints StorageManager.GetTitlePoints((short)Info.Type, (short)Info.Id))
                            break;
                        if (
StorageManager.Wing<bool>(Info.TypeInfo.Id))
                        {
                            
client.Entity.EquippedWing StorageManager.Wing<int>(Info.TypeInfo.Id);
                            
client.Entity.NowEquippedWing.Clear();
                            
client.Entity.NowEquippedWing.Add(Info.Type "~" Info.Id);
                        }
                        else if (
StorageManager.Title<bool>(Info.TypeInfo.Id))
                        {
                            
client.Entity.EquippedTitle StorageManager.Title<int>(Info.TypeInfo.Id);
                            
client.Entity.NowEquippedTitle.Clear();
                            
client.Entity.NowEquippedTitle.Add(Info.Type "~" Info.Id);
                        }

                        
Info = new TitleStorageProto()
                        {
                            
ActionId Action.Equip,
                            
Points client.Entity.UTitlePoints,
                            
Type Info.Type,
                            
Id Info.Id,
                        };

                        
client.Send(FinalizeProtoBuf(Info));
                        break;
                    }
            }
            new 
TitleStorage().CheckTitles(client);
        }
        public 
void GetAll(Client.GameState client)
        {
            foreach (var 
title in Database.WardrobeTable.Titles.Values)
            {
                
AddTitle(client, (short)title.Type, (short)title.IDfalse);
            }
            
client.Entity.haveallTitles true;
        }
        public 
void AddTitle(Client.GameState clientshort _typeshort _idbool equipped falseint TimeInSeconds 0)
        {
            if (
StorageManager.Wing<bool>(_type_id))
            {
                if (!
client.Entity.Wings.ContainsValue((uint)_id))
                    
client.Entity.Wings.Add((uint)_type, (uint)_id);
                else return;
            }
            else
            {
                if (!
client.Entity.WTitles.ContainsValue((uint)_id))
                    
client.Entity.WTitles.Add((uint)_type, (uint)_id);
                else return;
            }
            
client.Entity.UTitlePoints += StorageManager.GetTitlePoints(_type_id);
            var 
pkt = new TitleStorageProto()
            {
                
ActionId Action.Update,
                
Points client.Entity.UTitlePoints,
                
Value = new TitleValue()
                {
                    
Type _type,
                    
Id _id,
                    
Equipped equipped,
                    
Time TimeInSeconds,
                }
            };

            
client.Send(FinalizeProtoBuf(pkt));
            if (
equipped)
            {
                if (
StorageManager.Wing<bool>(_type_id))
                {
                    
client.Entity.EquippedWing StorageManager.Wing<int>(_type_id);
                    
client.Entity.NowEquippedWing.Clear();
                    
client.Entity.NowEquippedWing.Add(_type "~" _id);
                }
                else if (
StorageManager.Title<bool>(_type_id))
                {
                    
client.Entity.EquippedTitle StorageManager.Title<int>(_type_id);
                    
client.Entity.NowEquippedTitle.Clear();
                    
client.Entity.NowEquippedTitle.Add(_type "~" _id);
                }
            }
        }
        public 
void RemoveTitle(Client.GameState clientshort _typeshort _idbool equipped false)
        {
            if (
StorageManager.Wing<bool>(_type_id))
            {
                if (
client.Entity.Wings.ContainsValue((uint)_id))
                {
                    
client.Entity.Wings.Remove((uint)_type);
                    if (
client.Entity.EquippedWing == StorageManager.Wing<int>(_type_id))
                    {
                        
client.Entity.EquippedWing 0;
                        
client.Entity.NowEquippedWing.Clear();

                        var 
pkt = new TitleStorageProto()
                        {
                            
ActionId Action.Unequip,
                            
Id _id,
                            
Type _type,
                            
Points client.Entity.UTitlePoints,
                            
Value = new TitleValue()
                            {
                                
Type _type,
                                
Id _id,
                                
Equipped false
                            
}

                        };
                        
client.Send(FinalizeProtoBuf(pkt));

                    }
                    
client.Entity.UTitlePoints -= StorageManager.GetTitlePoints(_type_id);
                    var 
pkt2 = new TitleStorageProto()
                    {
                        
ActionId Action.RemoveTitle,
                        
Id _id,
                        
Type _type,
                        
Points client.Entity.UTitlePoints,
                        
Value = new TitleValue()
                        {
                            
Type _type,
                            
Id _id,
                            
Equipped false
                        
}
                    };
                    
client.Send(FinalizeProtoBuf(pkt2));
                }
                else return;
            }
            else
            {
                if (
client.Entity.WTitles.ContainsValue((uint)_id))
                {
                    
client.Entity.WTitles.Remove((uint)_type);
                    if (
client.Entity.EquippedTitle == StorageManager.Title<int>(_type_id))
                    {
                        
client.Entity.EquippedTitle 0;
                        
client.Entity.NowEquippedTitle.Clear();
                        var 
pkt = new TitleStorageProto()
                        {
                            
ActionId Action.Unequip,
                            
Id _id,
                            
Type _type,
                            
Points client.Entity.UTitlePoints,
                            
Value = new TitleValue()
                            {
                                
Type _type,
                                
Id _id,
                                
Equipped false
                            
}
                        };
                        
client.Send(FinalizeProtoBuf(pkt));
                    }
                    
client.Entity.UTitlePoints -= StorageManager.GetTitlePoints(_type_id);
                    var 
pkt2 = new TitleStorageProto()
                    {
                        
ActionId Action.RemoveTitle,
                        
Id _id,
                        
Type _type,
                        
Points client.Entity.UTitlePoints,
                        
Value = new TitleValue()
                        {
                            
Type _type,
                            
Id _id,
                            
Equipped false
                        
}
                    };
                    
client.Send(FinalizeProtoBuf(pkt2));
                }
                else return;
            }
        }
        public 
byte[] FinalizeProtoBuf(TitleStorageProto titleStorageProto)
        {
            
using (var memoryStream = new MemoryStream())
            {
                
Serializer.SerializeWithLengthPrefix(memoryStreamtitleStorageProtoPrefixStyle.Fixed32);
                var 
pkt = new byte[memoryStream.Length];
                
memoryStream.ToArray().CopyTo(pkt0);
                
Writer.Write((ushort)memoryStream.Length0pkt);
                
Writer.Write((ushort)33012pkt);

                return 
pkt;
            }
        }


        public 
TitleStorageProto Info;
        [
Flags]
        public 
enum Action int
        
{
            
Update 0,
            
UseTitle 1,
            
RemoveTitle 3,
            
Equip 4,
            
Unequip 5,
        }
    }
    [
ProtoContract]
    public class 
TitleStorageProto
    
{
        [
ProtoMember(1IsRequired true)]
        public 
TitleStorage.Action ActionId;
        [
ProtoMember(2IsRequired true)]
        public 
int Points;
        [
ProtoMember(3IsRequired true)]
        public 
int Type;
        [
ProtoMember(4IsRequired true)]
        public 
int Id;
        [
ProtoMember(5IsRequired true)]
        public 
TitleValue Value;
    }
    [
ProtoContract]
    public class 
TitleValue
    
{
        [
ProtoMember(1IsRequired true)]
        public 
int Type;
        [
ProtoMember(2IsRequired true)]
        public 
int Id;
        [
ProtoMember(3IsRequired true)]
        public 
bool Equipped;
        [
ProtoMember(4IsRequired true)]
        public 
int Time;
    }



اي ايرور يجيلك قولو وهديلك الحل

غير اسم البروجكت بي الاسم بتاعك

قديم 2020-04-24, 06:01 AM
المشاركة 8
medo2020
.:: عضو نشيط ::.
  • غير متواجد
افتراضي رد: طلب سستم
هشوف

قديم 2020-04-24, 01:24 PM
المشاركة 9
medo2020
.:: عضو نشيط ::.
  • غير متواجد
افتراضي رد: طلب سستم
بعدها ابحث عن

كود:
public sealed class CoatStorage

امسح كل الي فيها وبدلها بي دول

لو سيستم الوير دروب عندك وناقص ابحث عن


كود:
ublic class WardrobeTable

امسح كل الي فيها وبدلها بي دول
كلاسكت دى ولا ايه وابحث فين

قديم 2020-04-24, 02:40 PM
المشاركة 10
ElSaher
.:: عضو خبير ::.
  • غير متواجد
افتراضي رد: طلب سستم
ابحث في السي شارب يا حوب السورس


العلامات المرجعية



الذين يشاهدون محتوى الموضوع الآن : 1 ( الأعضاء 0 والزوار 1)
 

الانتقال السريع

المواضيع المتشابهه للموضوع: طلب سستم
الموضوع كاتب الموضوع المنتدى مشاركات آخر مشاركة
سستم المطلوب كونكر محمد ياسر تطوير سيرفرات كونكر 2 2023-10-10 02:01 AM
سستم الطقس Mero تطوير سيرفرات كونكر 3 2021-12-20 06:30 AM
سستم تريد لوج كامل Tefa تطوير سيرفرات كونكر 2 2020-04-19 05:57 AM
سستم exchangeshop محمد ياسر تطوير سيرفرات كونكر 19 2019-12-07 09:25 PM
طلب سستم taha مشكلات السيرفيرات كونكر الشخصيه 2 2019-08-02 01:10 AM


الساعة الآن 08:20 PM

Powered by vBulletin® Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.