حل مشكلة Refinary سورس TroZenA

اذهب الى الأسفل

21102016

مُساهمة 

حل مشكلة Refinary سورس TroZenA Empty حل مشكلة Refinary سورس TroZenA




طبعآ الحل هيظبطلك حكاية قيم ال Refinary كلها وهتنساها خالص بعد كدا 

شرح المشكله : 

قيم الرفيناري مكانتش مظبوطه يعني بتدي القيم في تفاصيل الشخصيه 

أو القيم أحيانآ بتبقا وهميه فقط 


المهم أول حاجه ارفع دا في النافي كات 

[ندعوك للتسجيل في المنتدى أو التعريف بنفسك لمعاينة هذا الرابط]

حل مشكلة Refinary سورس TroZenA 13491422012

بدل كلاس Refinery

بدا 


PHP


الكود:
using System; 
using System.Collections.Generic; 
using System.Linq; 
using System.Text; 

using TroZenA.Database; 

namespace TroZenA 

    public class Refinery 
    { 
        public class RefineryBoxes 
        { 
            public UInt32 Identifier, Position; 
            public Boolean Untradable; 
            public RefineryItem.RefineryType Type; 
        } 
        public class RefineryItem 
        { 
            public UInt32 Identifier, Position, Percent; 
            public Byte Level; 
            public Boolean Untradable; 
            public RefineryType Type; 

            public enum RefineryType 
            { 
                MDefence = 1, 
                Critical = 2, 
                SCritical = 3, 
                Immunity = 4, 
                BreakThrough = 5, 
                Counteraction = 6, 
                Detoxication = 7, 
                Block = 8, 
                Penetration = 9, 
                Intensification = 11 
            } 
        } 
        public static void LoadItems() 
        { 
            using (var cmd = new MySqlCommand(MySqlCommandType.SELECT).Select("refinery")) 
            using (var reader = cmd.CreateReader()) 
            { 
                while (reader.Read()) 
                { 
                    RefineryItem ri = new RefineryItem(); 
                    ri.Identifier = reader.ReadUInt32("Identifier"); 
                    ri.Level = reader.ReadByte("Level"); 
                    ri.Percent = reader.ReadUInt32("Percent"); 
                    ri.Position = reader.ReadUInt32("Position"); 
                    ri.Type = (RefineryItem.RefineryType)reader.ReadUInt32("RefineType"); 
                    ri.Untradable = reader.ReadBoolean("Untradable"); 
                    Kernel.DatabaseRefinery.Add(ri.Identifier, ri); 
                } 
            } 
            Console.WriteLine(String.Format("Loaded Database Refinery Items ({0}).", Kernel.DatabaseRefinery.Count)); 
            LoadBoxes(); 
        } 
        public static void LoadBoxes() 
        { 
            using (var cmd = new MySqlCommand(MySqlCommandType.SELECT).Select("refineryboxes")) 
            using (var reader = cmd.CreateReader()) 
            { 
                while (reader.Read()) 
                { 
                    RefineryBoxes ri = new RefineryBoxes(); 
                    ri.Identifier = reader.ReadUInt32("Identifier"); 
                    ri.Position = reader.ReadUInt32("Position"); 
                    ri.Type = (RefineryItem.RefineryType)reader.ReadUInt32("RefineType"); 
                    ri.Untradable = reader.ReadBoolean("Untradable"); 

                    Kernel.DatabaseRefineryBoxes.Add(ri.Identifier, ri); 
                } 
            } 
            Console.WriteLine(String.Format("Loaded Database Refinery Boxes ({0}).", Kernel.DatabaseRefinery.Count)); 
        } 
    } 
}  

حل مشكلة Refinary سورس TroZenA 13491422012

بدل كلاس ItemAdding

بدا 


PHP


الكود:
using System; 

namespace TroZenA.Network.GamePackets 

    public class ItemAdding : Writer, Interfaces.IPacket 
    { 
        public struct Purification_ 
        { 
            public bool Available; 
            public uint ItemUID; 
            public uint PurificationItemID; 
            public uint PurificationLevel; 
            /// <summary> 
            /// In minutes. 
            /// </summary> 
            public uint PurificationDuration; 
            public DateTime AddedOn; 
        } 
        public struct Refinery_ 
        { 
            public bool Available; 
            public uint ItemUID; 
            public uint EffectID; 
            public uint EffectLevel; 
            public uint EffectPercent; 
            /// <summary> 
            /// In minutes. 
            /// </summary> 
            public uint EffectDuration; 
            public DateTime AddedOn; 
        } 

        public const uint ExtraEffect = 2, PurificationAdding = 6; 
        public const uint PermanentRefinery = 3, StabilizationEffectRefined = 4, PurificationEffect = 5, ExpireTime = 7, StabilizationEffect = 9, Warehause = 10; 


        byte[] Buffer; 
        const byte minBufferSize = 8; 
        public ItemAdding(bool Create) 
        { 
            if (Create) 
            { 
                Buffer = new byte[minBufferSize + 8]; 
                WriteUInt16(minBufferSize, 0, Buffer); 
                WriteUInt16(2077, 2, Buffer); 
            } 
        } 

        public uint Type 
        { 
            get { return BitConverter.ToUInt32(Buffer, 12); } 
            set { WriteUInt32(value, 12, Buffer); } 
        } 

        public uint UpdateCount 
        { 
            get { return BitConverter.ToUInt32(Buffer, 4); } 
            set 
            { 
                byte[] buffer = new byte[minBufferSize + 8 + 32 * value]; 
                int count = buffer.Length; 
                if (count > Buffer.Length) 
                    count = Buffer.Length; 
                System.Buffer.BlockCopy(Buffer, 0, buffer, 0, count); 
                WriteUInt16((ushort)(minBufferSize + 32 * value), 0, buffer); 
                Buffer = buffer; 
                WriteUInt32(value, 4, Buffer); 
            } 
        } 

        public bool Append(Purification_ purify) 
        { 
            UpdateCount = UpdateCount + 1; 
            ushort offset = (ushort)(8 + (UpdateCount - 1) * 32); 
            WriteUInt32(purify.ItemUID, offset, Buffer); 
            WriteUInt32(PurificationAdding, offset + 4, Buffer); 
            WriteUInt32(purify.PurificationItemID, offset + 8, Buffer); 
            WriteUInt32(purify.PurificationLevel, offset + 12, Buffer); 
            if (purify.PurificationDuration != 0) 
            { 
                TimeSpan span1 = new TimeSpan(purify.AddedOn.AddSeconds(purify.PurificationDuration).Ticks); 
                TimeSpan span2 = new TimeSpan(DateTime.Now.Ticks); 
                int secondsleft = (int)(span1.TotalSeconds - span2.TotalSeconds); 
                if (secondsleft <= 0) 
                { 
                    purify.Available = false; 
                    UpdateCount = UpdateCount - 1; 
                    return false; 
                } 
                WriteUInt32((uint)secondsleft, offset + 24, Buffer); 
            } 
            return true; 
        } 

        public bool Append(Refinery_ effect) 
        { 
            UpdateCount = UpdateCount + 1; 
            ushort offset = (ushort)(8 + (UpdateCount - 1) * 32); 
            WriteUInt32(effect.ItemUID, offset, Buffer); 
            if (effect.EffectDuration == 0) 
                WriteUInt32(PermanentRefinery, offset + 4, Buffer); 
            else 
                WriteUInt32(ExtraEffect, offset + 4, Buffer); 
            if (effect.EffectID >= 724440 && effect.EffectID <= 724444 || effect.EffectID == 3004140) effect.EffectID = 301; 
            WriteUInt32(effect.EffectID, offset + 8, Buffer); 
            WriteUInt32(effect.EffectLevel, offset + 12, Buffer); 
            WriteUInt32(effect.EffectPercent, offset + 16, Buffer); 
            if (effect.EffectPercent != 0) 
            { 
                TimeSpan span1 = new TimeSpan(effect.AddedOn.AddSeconds(effect.EffectDuration).Ticks); 
                TimeSpan span2 = new TimeSpan(DateTime.Now.Ticks); 
                int secondsleft = (int)(span1.TotalSeconds - span2.TotalSeconds); 
                if (secondsleft <= 0 && effect.EffectDuration != 0) 
                { 
                    effect.Available = false; 
                    UpdateCount -= 1; 
                    return false; 
                } 
                WriteUInt32((uint)secondsleft, offset + 24, Buffer); 
            } 
            return true; 
        } 

        public bool Append2(Purification_ purify) 
        { 
            this.UpdateCount++; 
            ushort offset = (ushort)(8 + ((this.UpdateCount - 1) * 32)); 
            Writer.WriteUInt32(purify.ItemUID, offset, this.Buffer); 
            Writer.WriteUInt32(Type, offset + 4, this.Buffer); 
            Writer.WriteUInt32(purify.PurificationItemID, offset + 8, this.Buffer); 
            Writer.WriteUInt32(purify.PurificationLevel, offset + 12, this.Buffer); 
            if (purify.PurificationDuration != 0) 
            { 
                TimeSpan span = new TimeSpan(purify.AddedOn.AddSeconds((double)purify.PurificationDuration).Ticks); 
                TimeSpan span2 = new TimeSpan(DateTime.Now.Ticks); 
                int num2 = (int)(span.TotalSeconds - span2.TotalSeconds); 
                if (num2 <= 0) 
                { 
                    purify.Available = false; 
                    this.UpdateCount--; 
                    return false; 
                } 
                Writer.WriteUInt32((uint)num2, offset + 24, this.Buffer); 
            } 
            return true; 
        } 
        public bool Append2(Refinery_ effect) 
        { 
            this.UpdateCount++; 
            ushort offset = (ushort)(8 + ((this.UpdateCount - 1) * 32)); 
            Writer.WriteUInt32(effect.ItemUID, offset, this.Buffer); 
            Writer.WriteUInt32(Type, offset + 4, this.Buffer); 
            Writer.WriteUInt32(effect.EffectID, offset + 8, this.Buffer); 
            Writer.WriteUInt32(effect.EffectLevel, offset + 12, this.Buffer); 
            Writer.WriteUInt32(effect.EffectPercent, offset + 0x10, this.Buffer); 
            if (effect.EffectPercent != 0) 
            { 
                TimeSpan span = new TimeSpan(effect.AddedOn.AddSeconds((double)effect.EffectDuration).Ticks); 
                TimeSpan span2 = new TimeSpan(DateTime.Now.Ticks); 
                int num2 = (int)(span.TotalSeconds - span2.TotalSeconds); 
                if (num2 <= 0 && effect.EffectDuration != 0) 
                { 
                    effect.Available = false; 
                    this.UpdateCount--; 
                    return false; 
                } 
                Writer.WriteUInt32((uint)num2, offset + 24, this.Buffer); 
            } 
            return true; 
        } 

        public byte[] ToArray() 
        { 
            return Buffer; 
        } 

        public void Deserialize(byte[] buffer) 
        { 
            Buffer = buffer; 
        } 

        public void Send(Client.GameClient client) 
        { 
            client.Send(Buffer); 
        } 
    } 
}  


كدا السستم كامل ان شاء الله حل مشكلة Refinary سورس TroZenA Regular_smile

في رعاية الله 

حل مشكلة Refinary سورس TroZenA 13491422016
Amin Ebrahim
Amin Ebrahim
Admin
Admin

حصل Amin Ebrahim علي
البلد : مصر
الثور النمر
عدد المساهمات : 75
النشاط : 222
تاريخ الميلاد : 10/05/1998
تاريخ التسجيل : 17/07/2016
العمر : 26
الموقع : www.vps7hkayat.com
العمل/الترفيه : عاشق للتصميم
المزاج : جيد

https://my-games.rigala.net

الرجوع الى أعلى الصفحة اذهب الى الأسفل

مُشاطرة هذه المقالة على: reddit

حل مشكلة Refinary سورس TroZenA :: تعاليق

لا يوجد حالياً أي تعليق

الرجوع الى أعلى الصفحة


 
صلاحيات هذا المنتدى:
لاتستطيع الرد على المواضيع في هذا المنتدى