قديم 2019-07-25, 04:02 PM
المشاركة 2
Tefa
.:: عضو خبير ::.
  • غير متواجد
افتراضي رد: مشكلة في الاكسسوري
اكسيسوري و المانه بس ولا كل الاصتف ؟

قديم 2019-07-27, 12:25 AM
المشاركة 3
manshestar
.:: عضو نشيط ::.
  • غير متواجد
افتراضي رد: مشكلة في الاكسسوري
لا كل الاصطفة و رانك البرفكشن مش شغال و نفس الكلام البوكر فيه مشكلة انه مش بيريس بالرقم الي طالبه و كمان الايتم مش بيشيل اكتر من 2 مليار و الدونشين مش بيرفع بملايين دي كلها مشاكل عاوزلها حل

قديم 2019-07-27, 04:38 AM
المشاركة 4
Tefa
.:: عضو خبير ::.
  • غير متواجد
افتراضي رد: مشكلة في الاكسسوري
بالنسبه للصول

جرب تفتح كلاس ConquerItemTable.cs و تبدل كل الي جواه ب ده

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




كود:
using System;
using System.Linq;
using KhaledMohamed.Network.GamePackets;
using System.Collections.Generic;
using KhaledMohamed.Game;
using KhaledMohamed.Network;

namespace 
KhaledMohamed.Database
{
    public class 
ConquerItemTable
    
{
        
#region Blob
        #region Main

        
public Network.GamePackets.ConquerItem ReadItem(System.IO.BinaryReader reader)
        {
            
Network.GamePackets.ConquerItem item = new ConquerItem(true);
            
item.ID reader.ReadUInt32();//4
            
item.UID reader.ReadUInt32();//8
            
item.Durability reader.ReadUInt16();//10
            
item.MaximDurability reader.ReadUInt16();//12
            
item.Position reader.ReadUInt16();//14
            
item.SocketProgress reader.ReadUInt32();//18
            
item.PlusProgress reader.ReadUInt32();//22
            
item.SocketOne = (Game.Enums.Gem)reader.ReadUInt16();//24
            
item.SocketTwo = (Game.Enums.Gem)reader.ReadUInt16();//26
            
item.Effect = (Game.Enums.ItemEffect)reader.ReadUInt16();//28
            
item.Mode Game.Enums.ItemMode.Default;
            
item.Plus reader.ReadByte();//29
            
item.Bless reader.ReadByte();//30
            
item.Bound reader.ReadBoolean();//31
            
item.Enchant reader.ReadByte();//32
            
item.Lock reader.ReadByte();//33

            
item.UnlockEnd DateTime.FromBinary(reader.ReadInt64());//41
            
item.Suspicious reader.ReadBoolean();//42
            
item.SuspiciousStart DateTime.FromBinary(reader.ReadInt64());//50

            
item.Color = (Game.Enums.Color)reader.ReadUInt32();//54
            
if ((byte)item.Color || (byte)item.Color 2)
                
item.Color = (Game.Enums.Color)Kernel.Random.Next(28);
            
item.Warehouse reader.ReadUInt16();//56
            
item.StackSize reader.ReadUInt16();//58


            
if (item.Lock == 2)
                if (
DateTime.Now >= item.UnlockEnd)
                    
item.Lock 0;

            return 
item;
        }

        
#endregion

        #region other

        
public void WriteItem(System.IO.BinaryWriter writerNetwork.GamePackets.ConquerItem item)
        {
            
writer.Write(item.ID); //= reader.ReadUInt32();
            
writer.Write(item.UID);
            
writer.Write(item.Durability);
            
writer.Write(item.MaximDurability);
            
writer.Write(item.Position);
            
writer.Write(item.SocketProgress);
            
writer.Write(item.PlusProgress);
            
writer.Write((ushort)item.SocketOne);
            
writer.Write((ushort)item.SocketTwo);
            
writer.Write((ushort)item.Effect);
            
writer.Write(item.Plus);
            
writer.Write(item.Bless);
            
writer.Write(item.Bound);
            
writer.Write(item.Enchant);
            
writer.Write(item.Lock);
            
writer.Write(item.UnlockEnd.Ticks);
            
writer.Write(item.Suspicious);
            
writer.Write(item.SuspiciousStart.Ticks);
            
writer.Write((uint)item.Color);
            
writer.Write(item.Warehouse);
            
writer.Write(item.StackSize);
            
// writer.Write((uint)(item.NextGreen | (item.NextBlue << 8) | (item.NextRed << 16)));
        
}
        
#endregion

        #endregion
        
public static ConquerItem LoadItem(uint OwnerUIduint Position)
        {
            
ConquerItem item null;
            
using (var cn = new MySql.Data.MySqlClient.MySqlConnection(DataHolder.MySqlConnection.ConnectionString))
            
using (var cm = new MySql.Data.MySqlClient.MySqlCommand("SELECT * FROM items WHERE EntityID = @u AND Position =@p"cn))
            {
                
cn.Open();
                
cm.Parameters.AddWithValue("@u"OwnerUId);
                
cm.Parameters.AddWithValue("@p"Position);
                
using (MySql.Data.MySqlClient.MySqlDataReader rdr cm.ExecuteReader())
                    if (
rdr.Read())
                        
item deserialzeItem(rdr);
            }
            return 
item;
        }
        public static 
ConquerItem deserialzeItem(MySql.Data.MySqlClient.MySqlDataReader reader)
        {
            
ConquerItem item = new Network.GamePackets.ConquerItem(true);
            
item.ID reader.GetUInt32("Id");
            
item.UID reader.GetUInt32("Uid");
            
item.Stars = (byte)reader.GetUInt32("Stars");
            
item.Owner reader.GetString("Owner");
            
item.OwnerUID reader.GetUInt32("OwnerUID");
            
item.Signature reader.GetString("Signature");
            
item.Durability reader.GetUInt16("Durability");
            if (
item.ID == 750000)
            {
                
item.MaximDurability reader.GetUInt16("MaximDurability");
            }
            else
            {
                
item.MaximDurability reader.GetUInt16("MaximDurability");
                
item.Durability item.MaximDurability;
            }
            
item.Position reader.GetUInt16("Position");
            
item.SocketProgress reader.GetUInt32("SocketProgress");
            
item.PlusProgress reader.GetUInt32("PlusProgress");
            
item.SocketOne = (Game.Enums.Gem)reader.GetUInt16("SocketOne");
            
item.SocketTwo = (Game.Enums.Gem)reader.GetUInt16("SocketTwo");
            
item.Effect = (Game.Enums.ItemEffect)reader.GetUInt16("Effect");
            
item.Mode Game.Enums.ItemMode.Default;
            
item.Plus = (byte)(reader.GetUInt16("Plus"));
            
item.Bless = (byte)(reader.GetUInt16("Bless"));
            
item.Bound reader.GetBoolean("Bound");
            
item.Enchant = (byte)(reader.GetUInt16("Enchant"));
            
item.Lock = (byte)(reader.GetUInt16("Locked"));
            
item.UnlockEnd DateTime.FromBinary(reader.GetInt64("UnlockEnd"));
            
item.Suspicious reader.GetBoolean("Suspicious");
            
item.SuspiciousStart DateTime.FromBinary(reader.GetInt64("SuspiciousStart"));
            
item.Color = (Game.Enums.Color)reader.GetUInt32("Color");
            
item.Warehouse reader.GetUInt16("Warehouse");
            
item.StackSize reader.GetUInt16("StackSize");

            
item.SuspiciousStart DateTime.FromBinary(reader.GetInt64("SuspiciousStart"));
            if (
item.StackSize 10)
                
item.StackSize 0;
            
item.RefineItem reader.GetUInt32("RefineryItem");

            if (
item.ID == 300000)
            {
                
uint NextSteedColor reader.GetUInt32("NextSteedColor");
                
item.NextGreen = (byte)(NextSteedColor 0xFF);
                
item.NextBlue = (byte)((NextSteedColor >> 8) & 0xFF);
                
item.NextRed = (byte)((NextSteedColor >> 16) & 0xFF);
            }

            
Int64 rTime reader.GetInt64("RefineryTime");
            if (
item.RefineItem && rTime != 0)
            {
                
item.RefineryTime DateTime.FromBinary(rTime);
                if (
DateTime.Now item.RefineryTime)
                {
                    
item.RefineryTime = new DateTime(0);
                    
item.RefineItem 0;
                }
            }
            if (
item.Lock == 2)
                if (
DateTime.Now >= item.UnlockEnd)
                    
item.Lock 0;
            return 
item;
        }
        public static 
void UpdateItemID(ConquerItem Item)
        {
            
UpdateData(Item"ID"Item.ID);
        }
        public static 
void LoadItems(Client.GameState client)
        {
            
client.Entity.StorageItems = new Dictionary<uintConquerItem>();
            
using (var cmd = new MySqlCommand(MySqlCommandType.SELECT).Select("items").Where("EntityID"client.Entity.UID))
            
using (var reader = new MySqlReader(cmd))
            {
                while (
reader.Read())
                {
                    var 
item deserialzeItem(reader);
                    if (!
ConquerItemInformation.BaseInformations.ContainsKey(item.ID))
                        continue;
                    
HandleInscribing(itemclient);
                    
ItemAddingTable.GetAddingsForItem(item);
                    if ((
byte)Network.PacketHandler.GetPositionFromID(item.ID) == ConquerItem.Garment || (byte)Network.PacketHandler.GetPositionFromID(item.UID) == ConquerItem.SteedArmor || (byte)Network.PacketHandler.GetPositionFromID(item.UID) == ConquerItem.Bottle)
                    {
                        if (
item.SocketOne != Game.Enums.Gem.NoSocket || item.SocketTwo != Game.Enums.Gem.NoSocket)
                        {
                            
item.SocketOne Game.Enums.Gem.NoSocket;
                            
item.SocketTwo Game.Enums.Gem.NoSocket;
                            
UpdateSockets(item);
                        }
                    }
                    
                    
#region*WareHouse

                    
if (item.Warehouse == 0)//Mr.khled
                    
{
                        switch (
item.Position)
                        {
                            case 
0:
                                {
                                    if (
item.InWardrobe)
                                        
client.Entity.StorageItems.Add(item.UIDitem);
                                    else
                                    {
                                        
client.Inventory.Add(itemGame.Enums.ItemUse.None);
                                        break;
                                    }
                                    break;
                                }
                            default:
                                if (
item.Position 40) continue;
                                if (
client.Equipment.Free((byte)item.Position))
                                    
client.Equipment.Add(itemGame.Enums.ItemUse.None);
                                else
                                {
                                    if (
client.Inventory.Count 40)
                                    {
                                        if (
item.InWardrobe)
                                        {

                                        }
                                        
item.Position 0;
                                        
client.Inventory.Add(itemGame.Enums.ItemUse.None);
                                        if (
client.Warehouses[KhaledMohamed.Game.ConquerStructures.Warehouse.WarehouseID.StoneCity].Count 20)
                                            
client.Warehouses[KhaledMohamed.Game.ConquerStructures.Warehouse.WarehouseID.StoneCity].Add(item);
                                        
UpdatePosition(item);
                                    }
                                }
                                break;
                        }
                    }
                    else
                    {
                        if (
item != null)
                        {
                            
KhaledMohamed.Game.ConquerStructures.Warehouse.WarehouseID whID = (Game.ConquerStructures.Warehouse.WarehouseID)item.Warehouse;
                            if (
client.Warehouses.ContainsKey(whID))
                            {
                                
client.Warehouses[whID].Add(item);
                            }
                            else
                            {
                                
using (var cmdx = new MySqlCommand(MySqlCommandType.SELECT).Select("items").Where("Uid", (uint)item.Warehouse))
                                
using (var readerx = new MySqlReader(cmdx))
                                    if (
readerx.Read())
                                    {
                                        
client.Warehouses.Add((KhaledMohamed.Game.ConquerStructures.Warehouse.WarehouseID)(uint)item.Warehouse, new KhaledMohamed.Game.ConquerStructures.Warehouse(client, (KhaledMohamed.Game.ConquerStructures.Warehouse.WarehouseID)(uint)item.Warehouse));
                                        
client.Warehouses[(KhaledMohamed.Game.ConquerStructures.Warehouse.WarehouseID)(uint)whID].Add(item);
                                    }
                            }
                        }
                    }
                    
#endregion*WareHouse*
                    
                    
if (item.Minutes != 0)
                    {
                        
uint num;
                        if (
DateTime.Now >= item.TimeStamp.AddMinutes(item.Minutes))
                        {
                            
DeleteItem(item.UID);
                        }
                        else
                        {
                            
TimeSpan span = new TimeSpan(item.TimeStamp.AddMinutes(item.Minutes).Ticks);
                            
TimeSpan span2 = new TimeSpan(DateTime.Now.Ticks);
                            
num = (uint)(span.TotalSeconds span2.TotalSeconds);
                            
item.TimeLeftInMinutes num;
                        }
                    }
                    
item.TimeStamp DateTime.FromBinary(reader.ReadInt64("TimeStamp"));
                    
item.Minutes reader.ReadUInt64("MinutesLeft");
                    if (
item.ID == 720828)
                    {
                        
string str reader.ReadString("agate");
                        
uint key 0;
                        
string[] strArray str.Split(new char[] { '#' });
                        foreach (
string str2 in strArray)
                        {
                            if (
str2.Length 6)
                            {
                                
item.Agate_map.Add(keystr2);
                                
key++;
                            }
                        }
                    }
                }
            }
        }

        public static 
ConquerItem deserialzeItem(MySqlReader reader)
        {
            
ConquerItem item = new Network.GamePackets.ConquerItem(true);
            
item.ID reader.ReadUInt32("Id");
            
item.UID reader.ReadUInt32("Uid");
            
item.Durability reader.ReadUInt16("Durability");
            
item.MaximDurability reader.ReadUInt16("MaximDurability");
            
//  item.Durability = item.MaximDurability;
            
item.Position reader.ReadUInt16("Position");
            
item.Agate reader.ReadString("Agate");
            
item.SocketProgress reader.ReadUInt32("SocketProgress");
            
item.PlusProgress reader.ReadUInt32("PlusProgress");
            
item.SocketOne = (Game.Enums.Gem)reader.ReadUInt16("SocketOne");
            
item.SocketTwo = (Game.Enums.Gem)reader.ReadUInt16("SocketTwo");
            
item.Effect = (Game.Enums.ItemEffect)reader.ReadUInt16("Effect");
            
item.Mode Game.Enums.ItemMode.Default;
            
item.Plus reader.ReadByte("Plus");
            
item.Bless reader.ReadByte("Bless");
            
item.Bound reader.ReadBoolean("Bound");
            
item.Enchant reader.ReadByte("Enchant");
            
item.Signature reader.ReadString("Signature");
            
item.Stars reader.ReadByte("Stars");
            
item.PerfectionProgress reader.ReadUInt32("PerfectionProgress");
            
item.Owner reader.ReadString("Owner");
            
item.OwnerUID reader.ReadUInt32("OwnerUID");
            
item.Lock reader.ReadByte("Locked");
            
item.UnlockEnd DateTime.FromBinary(reader.ReadInt64("UnlockEnd"));
            
item.Suspicious reader.ReadBoolean("Suspicious");
            
item.SuspiciousStart DateTime.FromBinary(reader.ReadInt64("SuspiciousStart"));
            
item.Color = (Game.Enums.Color)reader.ReadUInt32("Color");
            
item.Warehouse reader.ReadUInt32("Warehouse");
            
item.StackSize reader.ReadUInt16("StackSize");
            
item.RefineItem reader.ReadUInt32("RefineryItem");
            
Int64 rTime reader.ReadInt64("RefineryTime");
            
item.InWardrobe reader.ReadBoolean("InWardrobe");

            if (
item.ID == 300000)
            {
                
uint NextSteedColor reader.ReadUInt32("NextSteedColor");
                
item.NextGreen = (byte)(NextSteedColor 0xFF);
                
item.NextBlue = (byte)((NextSteedColor >> 8) & 0xFF);
                
item.NextRed = (byte)((NextSteedColor >> 16) & 0xFF);
            }
            if (
item.RefineItem && rTime != 0)
            {
                
item.RefineryTime DateTime.FromBinary(rTime);
                if (
DateTime.Now item.RefineryTime)
                {
                    
item.RefineryTime = new DateTime(0);
                    
item.RefineItem 0;
                }
            }
            if (
item.Lock == 2)
                if (
DateTime.Now >= item.UnlockEnd)
                    
item.Lock 0;

            
item.DayStamp DateTime.FromBinary(reader.ReadInt64("DayStamp"));
            
item.Days reader.ReadByte("Days");
            return 
item;
        }

        public static 
void UpdateDurabilityItem2(ConquerItem Itemuint ItemID)
        {
            if (
Item != null)
            {
                
using (var cmd = new MySqlCommand(MySqlCommandType.UPDATE))
                    
cmd.Update("items").Set("Durability", (long)Item.Durability).Where("UID", (long)Item.UID).And("ID", (long)ItemID).Execute();
            }
        }

        public static 
void SetDurabilityItem0(ConquerItem Item)
        {
            
using (MySql.Data.MySqlClient.MySqlConnection connection DataHolder.MySqlConnection)
            {
                
connection.Open();
                
using (var cmd = new MySqlCommand(MySqlCommandType.UPDATE))
                    
cmd.Update("items").Set("Durability", (long)0L).Where("UID", (long)Item.UID).Execute(connection);
                
connection.Close();
            }
        }

        public static 
void HandleInscribing(ConquerItem itemClient.GameState clientbool detained false)
        {
            if (
client.Entity.GuildID != 0)
            {
                if (
client.Guild != null)
                {
                    
int itemPosition Network.PacketHandler.ArsenalPosition(item.ID);
                    if (
itemPosition != -1)
                    {
                        var 
arsenal client.Guild.Arsenals[itemPosition];
                        if (
arsenal.Unlocked)
                        {
                            if (
arsenal.ItemDictionary.ContainsKey(item.UID))
                            {
                                var 
arsenalItem arsenal.ItemDictionary[item.UID];
                                
arsenalItem.Update(itemclient);
                                
item.Inscribed true;
                                
client.ArsenalDonations[itemPosition] += arsenalItem.DonationWorth;
                            }
                        }
                    }
                }
            }
        }
        public static 
ConquerItem LoadItem(uint UID)
        {
            
using (var cmd = new MySqlCommand(MySqlCommandType.SELECT).Select("items").Where("UID"UID))
            
using (var reader = new MySqlReader(cmd))
                if (
reader.Read())
                    return 
deserialzeItem(reader);
            return new 
ConquerItem(true);
        }
        public static 
void AddItem(ref ConquerItem ItemClient.GameState client)
        {
            try
            {
                
using (var cmd = new MySqlCommand(MySqlCommandType.INSERT).Insert("items"))
                    
cmd.Insert("ID"Item.ID).Insert("UID"Item.UID)
                   .
Insert("Plus"Item.Plus).Insert("Bless"Item.Bless)
                   .
Insert("Enchant"Item.Enchant).Insert("SocketOne", (byte)Item.SocketOne)
                   .
Insert("SocketTwo", (byte)Item.SocketTwo).Insert("Durability"Item.Durability)
                   .
Insert("MaximDurability"Item.MaximDurability).Insert("SocketProgress"Item.SocketProgress)
                   .
Insert("PlusProgress"Item.PlusProgress).Insert("Effect", (ushort)Item.Effect)
                   .
Insert("TimeStamp"Item.TimeStamp.Ticks).Insert("MinutesLeft"Item.Minutes)
                   .
Insert("Bound"Item.Bound).Insert("DayStamp"Item.DayStamp.Ticks).Insert("Days"Item.Days).Insert("Locked"Item.Lock).Insert("UnlockEnd"Item.UnlockEnd.Ticks)
                   .
Insert("Suspicious"Item.Suspicious).Insert("SuspiciousStart"Item.SuspiciousStart.Ticks)
                   .
Insert("Color", (ushort)Item.Color).Insert("Position"Item.Position).Insert("StackSize"Item.StackSize)
                   .
Insert("RefineryItem"Item.RefineItem).Insert("RefineryTime"Item.RefineryTime.Ticks).Insert("EntityID"client.Entity.UID)
                   .
Insert("Warehouse"Item.Warehouse).Execute();
            }
            catch (
Exception e)
            {
                
Console.WriteLine(e);
                
DeleteItem(Item.UID);
                
AddItem(ref Itemclient);
            }
        }
        private static 
void UpdateData(ConquerItem Itemstring columnobject value)
        {
            
UpdateData(Item.UIDcolumnvalue);
        }
        private static 
void UpdateData(uint UIDstring columnobject value)
        {
            
using (var cmd = new MySqlCommand(MySqlCommandType.UPDATE))
                
cmd.Update("items").Set(columnvalue.ToString())
                    .
Where("UID"UID).Execute();
        }
        public static 
void UpdateBless(ConquerItem Item)
        {
            
UpdateData(Item"Bless"Item.Bless);
        }
        public static 
void UpdateRefineryItem(ConquerItem Item)
        {
            
UpdateData(Item"RefineryItem"Item.RefineItem);
        }
        public static 
void UpdateRefineryTime(ConquerItem Item)
        {
            
UpdateData(Item"RefineryTime"Item.RefineryTime.Ticks);
        }
        public static 
void UpdateMinutes(ConquerItem Item)
        {
            
UpdateData(Item"MinutesLeft"Item.Minutes);
        }
        public static 
void UpdateTimeStamp(ConquerItem Item)
        {
            
UpdateData(Item"TimeStamp"Item.TimeStamp);
        }
        public static 
void UpdateItemAgate(ConquerItem Item)
        {
            
string agate "";
            if (
Item.ID == 720828)
            {
                foreach (
string coord in Item.Agate_map.Values)
                {
                    
agate += coord "#";
                    
UpdateData(Item"agate"agate);
                }
            }
        }
        public static 
void UpdateWardrobe(bool inWardrobeuint UID)
        {
            
using (MySqlCommand command = new MySqlCommand(MySqlCommandType.UPDATE))
            {
                
command.Update("items")
                    .
Set("InWardrobe"inWardrobe)
                    .
Where("UID"UID).Execute();
            }
        }
        public static 
void UpdateColor(ConquerItem Item)
        {
            
UpdateData(Item"Color", (uint)Item.Color);
        }
        public static 
void UpdateStack(ConquerItem Item)
        {
            
UpdateData(Item"StackSize"Item.StackSize);
        }
        public static 
void UpdateEnchant(ConquerItem Item)
        {
            
UpdateData(Item"Enchant"Item.Enchant);
        }
        public static 
void UpdateLock(ConquerItem Item)
        {
            
UpdateData(Item"Locked"Item.Lock);
            
UpdateData(Item"UnlockEnd"Item.UnlockEnd.ToBinary());
        }
        public static 
void UpdateSockets(ConquerItem Item)
        {
            
UpdateData(Item"SocketOne", (byte)Item.SocketOne);
            
UpdateData(Item"SocketTwo", (byte)Item.SocketTwo);
        }
        public static 
void UpdateSocketProgress(ConquerItem Item)
        {
            
UpdateData(Item"SocketProgress"Item.SocketProgress);
        }
        public static 
void UpdateNextSteedColor(ConquerItem Item)
        {
            
UpdateData(Item"NextSteedColor"Item.NextGreen | (Item.NextBlue << 8) | (Item.NextRed << 16));
        }
        public static 
void UpdateDurabilityItem(ConquerItem Item)
        {
        }
        public static 
void UpdateLocation(ConquerItem ItemClient.GameState client)
        {
            if (
IsThere(Item.UID))
            {
                
using (var cmd = new MySqlCommand(MySqlCommandType.UPDATE))
                    
cmd.Update("items").Set("EntityID"client.Entity.UID)
                        .
Set("Position"Item.Position).Set("Warehouse", (uint)Item.Warehouse)
                        .
Where("UID"Item.UID).Execute();
            }
            else
            {
                
using (var cmd = new MySqlCommand(MySqlCommandType.INSERT).Insert("items"))
                    
cmd.Insert("ID"Item.ID).Insert("UID"Item.UID)
                        .
Insert("Plus"Item.Plus).Insert("Bless"Item.Bless)
                        .
Insert("Enchant"Item.Enchant).Insert("SocketOne", (byte)Item.SocketOne)
                        .
Insert("SocketTwo", (byte)Item.SocketTwo).Insert("Durability"Item.Durability)
                        .
Insert("MaximDurability"Item.MaximDurability).Insert("SocketProgress"Item.SocketProgress)
                        .
Insert("PlusProgress"Item.PlusProgress).Insert("Effect", (ushort)Item.Effect)
                        .
Insert("Bound"Item.Bound).Insert("DayStamp"Item.DayStamp.ToString()).Insert("Days"Item.Days).Insert("Locked"Item.Lock).Insert("UnlockEnd"Item.UnlockEnd.Ticks)
                        .
Insert("Suspicious"Item.Suspicious).Insert("SuspiciousStart"Item.SuspiciousStart.Ticks)
                        .
Insert("Color", (ushort)Item.Color).Insert("Position"Item.Position).Insert("StackSize"Item.StackSize)
                        .
Insert("RefineryItem"Item.RefineItem).Insert("RefineryTime"Item.RefineryTime.Ticks).Insert("EntityID"client.Entity.UID)
                        .
Execute();
            }
        }
        public static 
void UpdatePosition(ConquerItem Item)
        {
            
using (var cmd = new MySqlCommand(MySqlCommandType.UPDATE))
                
cmd.Update("items").Set("Position"Item.Position).Set("Warehouse"Item.Warehouse)
                .
Where("UID"Item.UID).Execute();

        }
        public static 
void UpdatePlus(ConquerItem Item)
        {
            
UpdateData(Item"Plus"Item.Plus);
        }

        public static 
void UpdateBound(ConquerItem Item)
        {
            
UpdateData(Item"Bound"0);
        }
        public static 
void UpdatePlusProgress(ConquerItem Item)
        {
            
UpdateData(Item"PlusProgress"Item.PlusProgress);
        }
        public static 
void UpdatePerfection(ConquerItem Item)
        {
            
UpdateData(Item"PerfectionProgress"Item.PerfectionProgress);
            
UpdateData(Item"Stars"Item.Stars);
            
UpdateData(Item"Owner"Item.Owner);
            
UpdateData(Item"OwnerUID"Item.OwnerUID);
            
UpdateData(Item"Signature"Item.Signature);
        }
        public static 
void UpdateItemID(ConquerItem ItemClient.GameState client)
        {
            
UpdateData(Item"ID"Item.ID);
        }
        public static 
void RemoveItem(uint UID)
        {
            
using (var cmd = new MySqlCommand(MySqlCommandType.UPDATE))
                
cmd.Update("items").Set("EntityID"0)
                    .
Set("Position"0).Where("UID"UID).Execute();
        }
        public static 
void DeleteItem(uint UID)
        {
            
using (var cmd = new MySqlCommand(MySqlCommandType.DELETE))
                
cmd.Delete("items""UID"UID).Execute();
        }
        public static 
void ClearPosition(uint EntityIDbyte position)
        {
            
using (var cmd = new MySqlCommand(MySqlCommandType.UPDATE))
                
cmd.Update("items").Set("EntityID"0).Set("Position"0)
                    .
Where("EntityID"EntityID).And("Position"position).Execute();
        }
        public static 
void RefineryUpdate(ConquerItem ItemClient.GameState client)
        {
        }

        public static 
void ClearNulledItems()
        {
            
Dictionary<uintintdict = new Dictionary<uintint>();
            
using (var = new MySqlCommand(MySqlCommandType.SELECT).Select("detaineditems"))
            
using (var c.CreateReader())
                while (
r.Read())
                    
dict[r.ReadUInt32("ItemUID")] = 0;
            
using (var = new MySqlCommand(MySqlCommandType.SELECT).Select("claimitems"))
            
using (var c.CreateReader())
                while (
r.Read())
                    
dict[r.ReadUInt32("ItemUID")] = 0;

            var array = 
dict.Keys.ToArray();
            foreach (var 
item in array)
                
using (var cmd = new MySqlCommand(MySqlCommandType.UPDATE).Update("items")
                    .
Set("entityid"1).Where("entityid"0).And("uid"item))
                    
cmd.Execute();

            
using (var cmd = new MySqlCommand(MySqlCommandType.DELETE).Delete("items""entityid"0))
                
cmd.Execute();
        }  

        public static 
bool IsThere(uint uid)
        {
            
MySqlCommand command = new MySqlCommand(MySqlCommandType.SELECT);
            
command.Select("items").Where("UID", (long)uid);
            
MySqlReader reader = new MySqlReader(command);
            if (
reader.Read())
            {
                
//  Reader.Close();
                ////  Reader.Dispose();
                
return true;
            }
            
//  Reader.Close();
            ////  Reader.Dispose();
            
return false;
        }

        public static 
void Update_Free(ConquerItem ItemClient.GameState client)
        {
            
MySqlCommand command = new MySqlCommand(MySqlCommandType.UPDATE);
            
command.Update("items").Set("EntityID"client.Entity.UID).Set("DayStamp"Item.DayStamp.Ticks).Set("Days"Item.Days).Where("UID"Item.UID).Execute();
        }
    }



قديم 2019-07-27, 04:40 AM
المشاركة 5
Tefa
.:: عضو خبير ::.
  • غير متواجد
افتراضي رد: مشكلة في الاكسسوري
قديم 2019-07-27, 04:43 AM
المشاركة 6
Tefa
.:: عضو خبير ::.
  • غير متواجد
افتراضي رد: مشكلة في الاكسسوري
دونيشن هنعمل سيرش علي

public class Nobility
هننزل لحد
case NobilityInfo.Donate:
هنمسح كل الي تحت لحد ما تلاقي كلمة
case :
و غالبا هتكون case NobilityInfo.List:
المهم بعد ما خلاص مسحناه هنحط ده مكانه

كود:
case NobilityInfo.Donate:
                    {
                        if (
client.Trade.InTrade)
                            return;

                        
ulong silvers information.dwParam;
                        
bool newDonator false;
                        
client.NobilityInformation.Gender = (byte)(client.Entity.Body 10);
                        if (
client.NobilityInformation.Donation == 0)
                            
newDonator true;
                        if (
information.MoneyType == 1)
                        {
                            
ulong cps silvers 1;
                            if (
client.Entity.ConquerPoints >= cps && client.PokerPlayer == null)
                            {
                                
client.Entity.ConquerPoints -= (uint)cps;
                                
client.NobilityInformation.Donation += silvers;
                            }
                        }
                        else
                        {
                            if (
client.Entity.Money >= silvers && client.PokerPlayer == null)
                            {
                                
client.Entity.Money -= (ulong)silvers;
                                
client.NobilityInformation.Donation += silvers;
                            }
                        }

                        if (!
Board.ContainsKey(client.Entity.UID) && client.NobilityInformation.Donation == silvers && newDonator)
                        {
                            
Board.Add(client.Entity.UIDclient.NobilityInformation);
                            try
                            {
                                
Database.NobilityTable.InsertNobilityInformation(client.NobilityInformation);
                            }
                            catch
                            {
                                
Database.NobilityTable.UpdateNobilityInformation(client.NobilityInformation);
                            }
                        }
                        else
                        {
                            
Database.NobilityTable.UpdateNobilityInformation(client.NobilityInformation);
                        }
                        
Sort(client.Entity.UID);
                        break;
                    } 

طب انا جالي ايرور في كلمة Entity هنحط مكانها كلمة Player


قديم 2019-07-27, 04:49 AM
المشاركة 7
Tefa
.:: عضو خبير ::.
  • غير متواجد
افتراضي رد: مشكلة في الاكسسوري
بوكر و اينم و البنك
_____________
هندخل علي
Entity.cs

هنبحث عن
return _money;
فوقها هتلاقي public uint money
او اي كلمه غير uint
هنمسح الكلمه دي و هنخليها

public ulong Money
هيجيلك ايرور في
_money
كلك يمين عليها و دوس go to defenation
نفس الكلام امسح الكلمه و خليها
public ulong Money
بس كده و ان شاء الله هتظبط لو مظبطش بوكر ابقي ابعتلي ملفه هشيكلك عليه




قديم 2019-07-27, 04:50 AM
المشاركة 8
Tefa
.:: عضو خبير ::.
  • غير متواجد
افتراضي رد: مشكلة في الاكسسوري
مغلق لتعدد الطلبات


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



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

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

المواضيع المتشابهه للموضوع: مشكلة في الاكسسوري
الموضوع كاتب الموضوع المنتدى مشاركات آخر مشاركة
مشكلة فى الاكسسورى بيزود الاسترايك ViORX مشكلات السيرفيرات كونكر الشخصيه 8 2019-09-05 02:43 AM


الساعة الآن 01:34 AM

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