احصائياتى

الردود
22

المشاهدات
2981
 
Hazem
.:: المدير العام::.

    غير متواجد

المشاركات
2,311

+التقييم
0.84

تاريخ التسجيل
Apr 2019

الاقامة
Egypt

نظام التشغيل
windows 7

رقم العضوية
1
2019-07-11, 02:19 PM
المشاركة 1
2019-07-11, 02:19 PM
المشاركة 1
افتراضي سستم exchangeshop

السلام عليكم ورحمة الله وبركاته
مرحبا بمسئولين واعضاء وزوار منتدي اكواد الكرام
اليوم جبتلكم سستم ناس كتير كانت بتبحث عنه
اللسستم ده عباره عن ملف شوب بتحدد فيه الحجات المطلوبه علشان تشتري منه
صوره للسستم


يلا ندخل علي التركيب
اعمل كلاس جديد باسم CMsgExchangeShop.cs في فلدر Database
وحط فيهم دول

كود:
using System; 
using System.Collections.Generic; 
using System.IO; 
using System.Linq; 
using System.Text; 
using System.Threading.Tasks; 

namespace 
Alaxx.Database 
{ 
    public class 
CMsgExchangeItems 
    
{ 
        public 
uint ID; 
        public 
uint ItemID; 
        public 
uint UnKnown; 
        public 
uint Remaining; 
        public 
bool Bound; 
        public 
uint NeededItemID; 
        public 
uint NeddedItemCount; 
    } 
    public static class 
CMsgExchangueShopFile 
    
{ 
        public static 
Dictionary<uint, CMsgExchangeItems> Items; 
        public static 
void Load() 
        { 
            
string[] text = File.ReadAllLines(Constants.DataHolderPath + "exchange_shop_goods.txt"); 
            
Items = new Dictionary<uint, CMsgExchangeItems>(); 
            
CMsgExchangeItems Item; 
            for (
int x = 0; x < text.Length; x++) 
            {     
                
string line = text[x]; 
                
string[] split = line.Split(new string[] { "@@" }, StringSplitOptions.RemoveEmptyEntries); 
                
Item = new CMsgExchangeItems(); 
                
Item.ID = uint.Parse(split[0]); 
                
Item.ItemID = uint.Parse(split[1]); 
                
Item.UnKnown = uint.Parse(split[2]); 
                
Item.Remaining = uint.Parse(split[3]); 
                
Item.Bound = uint.Parse(split[4]) != 0 ? true : false; 
                
Item.NeededItemID = uint.Parse(split[5]); 
                
Item.NeddedItemCount = uint.Parse(split[6]); 
                if (!
Items.ContainsKey(Item.ID)) 
                { 
                    
Items.Add(Item.ID, Item); 
                } 
            } 
        } 
    } 
} 

واعمل كلاس تاني
باسم CMsgExchangeShop.cs في المكان ده

كود:
Network.GamePackets 

وحط فيهم دول

كود:
namespace Alaxx.Network.GamePackets 
{ 
using ProtoBuf; 
using System; 
using System.Collections.Generic; 
using System.IO; 
using System.Linq; 
using System.Text; 
using System.Threading.Tasks; 

    public 
unsafe class CMsgExchangeShop 
    
{ 
        private 
byte[] _packet; 
        public 
CMsgExchangeShop(byte[] incoming) 
        { 
            
_packet = incoming; 
        } 
        public 
bool Read() 
        { 
            try 
            { 
                var 
dePacket = new byte[_packet.Length - 8]; 

                for (
int i = 0; i < dePacket.Length; i++) 
                { 
                    
dePacket[i] = _packet[i]; 
                } 
                
Data = Serializer.DeserializeWithLengthPrefix<ProtoExchangeShop>(new System.IO.MemoryStream(dePacket), PrefixStyle.Fixed32); 
                return 
true; 
            } 
            catch 
            { 
                return 
false; 
            } 
        } 
        public 
ProtoExchangeShop Data; 
        public static 
implicit operator byte[](CMsgExchangeShop packet) 
        { 
            return 
packet._packet; 
        } 
        public static 
byte[] FinalizeProtoBuf(ProtoExchangeShop ExchangeShopArgs) 
        { 
            
using (var memoryStream = new MemoryStream()) 
            { 
                
Serializer.SerializeWithLengthPrefix(memoryStream, ExchangeShopArgs, PrefixStyle.Fixed32); 
                var 
pkt = new byte[8 + memoryStream.Length]; 
                
memoryStream.ToArray().CopyTo(pkt, 0); 
                
Writer.WriteUshort((ushort)memoryStream.Length, 0, pkt); 
                
Writer.WriteUshort(2441, 2, pkt); 
                return 
pkt; 
            } 
        } 
    } 
    [
ProtoContract] 
    public class 
ProtoExchangeShop 
    
{ 
        [
ProtoMember(1, IsRequired = true)] 
        public 
uint ShopID; 
        [
ProtoMember(2, IsRequired = true)] 
        public 
uint Action; 
        [
ProtoMember(3, IsRequired = true)] 
        public 
uint TimeIn; 
        [
ProtoMember(4, IsRequired = true)] 
        public 
uint TimeInSeconds; 
    } 
} 

في المكان ده

كود:
Network.GamePackets 

اعمل كلاس باسم CMsgExchangeShopRespond.cs

كود:
using CMsgConquer.Client; 
using CMsgConquer.Database; 
using ProtoBuf; 
using System; 
using System.Collections.Generic; 
using System.IO; 
using System.Linq; 
using System.Text; 
using System.Threading.Tasks; 

namespace 
Alaxx.Network.GamePackets 
{ 
    public class 
CMsgExchangeShopRespond 
    
{ 
        private 
byte[] _packet; 
        public 
CMsgExchangeShopRespond(byte[] incoming) 
        { 
            
int newLegnth = incoming.Length - 12; 
            
byte[] Incoming = new byte[newLegnth]; 
            Array.
Copy(incoming, 4, Incoming, 0, Incoming.Length); 
            
_packet = Incoming; 
        } 
        public 
ExchangeShopRespondProto Data = null; 
        public 
void Handle(GameClient client) 
        { 
            
uint[] ptr = Read7BitEncodedInt(_packet); 
            
int index = 0; 
            
Data = new ExchangeShopRespondProto(); 
            
Data.ShopID = ptr[index]; 
            
index++; 
            
Data.Action = ptr[index]; 
            
index++; 
            
Data.Amount = ptr[index]; 
            
index++; 
            
Data.ItemID = ptr[index]; 
            if (
Data != null) 
            { 
                if (
CMsgExchangueShopFile.Items.ContainsKey(Data.ItemID)) 
                { 
                    
CMsgExchangeItems Item = null; 
                    
CMsgExchangueShopFile.Items.TryGetValue(Data.ItemID, out Item); 
                    if (
Item == null) 
                        return; 
                    if (
Data.Amount > Item.Remaining) 
                        return; 
                    
uint Count = Item.NeddedItemCount * Data.Amount; 
                    
uint PriceItem = Item.NeededItemID; 
                    if (
client.Inventory.Contains(PriceItem, Count)) 
                    { 
                        if (
client.Inventory.Remove(PriceItem, Count)) 
                        { 
                            
client.Inventory.Add(Item.ItemID, 0, (byte)Data.Amount, Item.Bound); 
                        } 
                    } 
                } 
            } 
        } 
        public static 
uint[] Read7BitEncodedInt(byte[] buffer) 
        { 
            List<
uint> ptr2 = new List<uint>(); 

            for (
int i = 0; i < buffer.Length; ) 
            { 
                if (
i + 2 <= buffer.Length) 
                { 
                    
int tmp = buffer[i++]; 

                    if (
tmp % 8 == 0) 
                        while (
true) 
                        { 
                            if (
i + 1 > buffer.Length) break; 
                            
tmp = buffer[i++]; 
                            if (
tmp < 128) 
                            { 
                                
ptr2.Add((uint)tmp); 
                                break; 
                            } 
                            else 
                            { 
                                
int result = tmp & 0x7f; 
                                if ((
tmp = buffer[i++]) < 128) 
                                { 
                                    
result |= tmp << 7; 
                                    
ptr2.Add((uint)result); 
                                    break; 
                                } 
                                else 
                                { 
                                    
result |= (tmp & 0x7f) << 7; 
                                    if ((
tmp = buffer[i++]) < 128) 
                                    { 
                                        
result |= tmp << 14; 
                                        
ptr2.Add((uint)result); 
                                        break; 
                                    } 
                                    else 
                                    { 
                                        
result |= (tmp & 0x7f) << 14; 
                                        if ((
tmp = buffer[i++]) < 128) 
                                        { 
                                            
result |= tmp << 21; 
                                            
ptr2.Add((uint)result); 
                                            break; 
                                        } 
                                        else 
                                        { 
                                            
result |= (tmp & 0x7f) << 21; 
                                            
result |= (tmp = buffer[i++]) << 28; 
                                            
ptr2.Add((uint)result); 
                                            break; 
                                        } 
                                    } 
                                } 
                            } 
                        } 
                } 
                else break; 
            } 
            return 
ptr2.ToArray(); 
        } 
    } 
    public class 
ExchangeShopRespondProto 
    
{ 
        public 
uint ShopID; 
        public 
uint Action; 
        public 
uint Amount; 
        public 
uint ItemID; 
        public 
uint U1; 
        public 
uint U2; 
    } 
} 

افتح كلاس program او server
وحط ده علشان يقراء القنصل

كود:
CMsgExchangueShopFile.Load(); 

في المسار ده

كود:
bin\Debug\database 

اعمل ملف باسم
exchange_shop_goods.txt

ونحط فيهم الايتمات ده

كود:
1@@3300036@@1@@1@@0@@3300035@@1000@@0@@0@@0@@0@@0@@0@@ 
2@@3300045@@1@@1@@0@@3300035@@588@@0@@0@@0@@0@@0@@0@@ 
3@@3300049@@1@@1@@0@@3300035@@188@@0@@0@@0@@0@@0@@0@@ 
4@@3300056@@1@@1@@0@@3300035@@188@@0@@0@@0@@0@@0@@0@@ 
5@@3008727@@1@@3@@0@@3300035@@50@@0@@0@@0@@0@@0@@0@@ 
6@@3300050@@1@@1@@0@@3300035@@88@@0@@0@@0@@0@@0@@0@@ 
7@@729242@@1@@100@@1@@3300035@@299@@0@@0@@0@@0@@0@@0@@ 
8@@3300051@@1@@100@@0@@3300035@@10@@0@@0@@0@@0@@0@@0@@ 
9@@3300052@@1@@10@@0@@3300035@@100@@0@@0@@0@@0@@0@@0@@ 
10@@730001@@1@@100@@1@@3300035@@10@@0@@0@@0@@0@@0@@0@@ 
11@@730003@@1@@10@@1@@3300035@@120@@0@@0@@0@@0@@0@@0@@ 
12@@3004895@@1@@1@@0@@3300035@@88@@0@@0@@0@@0@@0@@0@@ 
13@@3004898@@1@@1@@0@@3300035@@88@@0@@0@@0@@0@@0@@0@@ 
14@@3004897@@1@@1@@0@@3300035@@88@@0@@0@@0@@0@@0@@0@@ 
15@@3004896@@1@@1@@0@@3300035@@88@@0@@0@@0@@0@@0@@0@@ 
17@@3004247@@1@@1@@0@@3300035@@588@@0@@0@@0@@0@@0@@0@@ 
18@@3004248@@1@@1@@0@@3300035@@588@@0@@0@@0@@0@@0@@0@@ 
19@@3008058@@1@@1@@0@@3300035@@588@@0@@0@@0@@0@@0@@0@@ 
20@@3300036@@2@@1@@0@@3300035@@1000@@0@@0@@0@@0@@0@@0@@ 
21@@3300045@@2@@1@@0@@3300035@@588@@0@@0@@0@@0@@0@@0@@ 
22@@3300049@@2@@1@@0@@3300035@@188@@0@@0@@0@@0@@0@@0@@ 
23@@3300056@@2@@1@@0@@3300035@@188@@0@@0@@0@@0@@0@@0@@ 
24@@3008727@@2@@3@@0@@3300035@@50@@0@@0@@0@@0@@0@@0@@ 
25@@3300050@@2@@1@@0@@3300035@@88@@0@@0@@0@@0@@0@@0@@ 
26@@729242@@2@@100@@1@@3300035@@299@@0@@0@@0@@0@@0@@0@@ 
27@@3300051@@2@@100@@0@@3300035@@10@@0@@0@@0@@0@@0@@0@@ 
28@@3300052@@2@@10@@0@@3300035@@100@@0@@0@@0@@0@@0@@0@@ 
29@@730001@@2@@100@@1@@3300035@@10@@0@@0@@0@@0@@0@@0@@ 
30@@730003@@2@@10@@1@@3300035@@120@@0@@0@@0@@0@@0@@0@@ 
31@@3004895@@2@@1@@0@@3300035@@88@@0@@0@@0@@0@@0@@0@@ 
32@@3004898@@2@@1@@0@@3300035@@88@@0@@0@@0@@0@@0@@0@@ 
33@@3004897@@2@@1@@0@@3300035@@88@@0@@0@@0@@0@@0@@0@@ 
34@@3004896@@2@@1@@0@@3300035@@88@@0@@0@@0@@0@@0@@0@@ 
35@@3004247@@2@@1@@0@@3300035@@588@@0@@0@@0@@0@@0@@0@@ 
36@@3004248@@2@@1@@0@@3300035@@588@@0@@0@@0@@0@@0@@0@@ 
37@@3008058@@2@@1@@0@@3300035@@588@@0@@0@@0@@0@@0@@0@@ 

وضيف ده في shop

كود:
case 50: 
                                    { 
                                        var 
shop = new ProtoExchangeShop() 
                                        { 
                                            
ShopID = 19424, 
                                            
Action = 1, 
                                            
TimeIn = 1714178, 
                                            
TimeInSeconds = 46389, 
                                        }; 
                                        
client.Send(CMsgExchangeShop.FinalizeProtoBuf(shop)); 
                                        break; 
                                    } 

ده اي دي الشوب 19424 الي ايتحط في npc وايكون 1 بدل 2
في NpcServer
ضيف ده

كود:
 case 50: 
                                    { 
                                        var 
shop = new ProtoExchangeShop() 
                                        { 
                                            
ShopID = 19424, 
                                            
Action = 1, 
                                            
TimeIn = 1714178, 
                                            
TimeInSeconds = 46389, 
                                        }; 
                                        
client.Send(CMsgExchangeShop.FinalizeProtoBuf(shop)); 
                                        break; 
                                    } 

كده انتهيت وبالتوفيق للجميع


قديم 2019-07-11, 02:35 PM
المشاركة 2
virus7x
.:: عضو خبير ::.
  • غير متواجد
افتراضي رد: سستم exchangeshop


جميل


قديم 2019-07-11, 02:41 PM
المشاركة 3
Hassan Emprator
.:: مشرف قسم المشاكل ::.
  • غير متواجد
افتراضي رد: سستم exchangeshop
هههههههه اه وبتقولي مش معاك اه بتموت في الكذب انت احازم

قديم 2019-07-11, 03:40 PM
المشاركة 4
MohamedModyAdel
.:: عضو مميز ::.
  • غير متواجد
افتراضي رد: سستم exchangeshop
تسلم

قديم 2019-07-11, 04:22 PM
المشاركة 5
Hazem
.:: المدير العام::.
  • غير متواجد
افتراضي رد: سستم exchangeshop
عفواً لايمكن عرض الرابط إلا بعد الرد على الموضوع
هههههههه اه وبتقولي مش معاك اه بتموت في الكذب انت احازم
ههههههههههه علشان متنزلهوش انت

قديم 2019-07-11, 04:23 PM
المشاركة 6
Hassan Emprator
.:: مشرف قسم المشاكل ::.
  • غير متواجد
افتراضي رد: سستم exchangeshop
عفواً لايمكن عرض الرابط إلا بعد الرد على الموضوع
ههههههههههه علشان متنزلهوش انت

ههههه اه يبن اللزينه

قديم 2019-07-11, 04:25 PM
المشاركة 7
Hazem
.:: المدير العام::.
  • غير متواجد
افتراضي رد: سستم exchangeshop
انت لو معاك حاجه نزله قبل ما انزله انا ههههههههه

قديم 2019-07-11, 05:25 PM
المشاركة 8
Hassan Emprator
.:: مشرف قسم المشاكل ::.
  • غير متواجد
افتراضي رد: سستم exchangeshop
عفواً لايمكن عرض الرابط إلا بعد الرد على الموضوع
انت لو معاك حاجه نزله قبل ما انزله انا ههههههههه

هغههغهغهغه ماشي ماشي الصبر حلو

قديم 2019-07-11, 06:38 PM
المشاركة 9
Mr~Rayzo
::. المدير العام ::.
  • غير متواجد
افتراضي رد: سستم exchangeshop
الله ينور والله

قديم 2019-07-11, 06:48 PM
المشاركة 10
anwer1
موقوف لمخالفة الشروط
  • غير متواجد
افتراضي رد: سستم exchangeshop
عاش يا حازم بس عاوز حل بعض الوندزات اللغه العربيه هتبقى علامات ووندوزات تانيه سليمه


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



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

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

المواضيع المتشابهه للموضوع: سستم exchangeshop
الموضوع كاتب الموضوع المنتدى مشاركات آخر مشاركة
سستم الترجمه للعبه بالكامل Hazem تطوير سيرفرات كونكر 26 2020-07-31 12:20 PM
سستم تريد لوج كامل Rider تطوير سيرفرات كونكر 2 2020-04-19 05:57 AM
طلب سستم taha مشكلات السيرفيرات كونكر الشخصيه 2 2019-08-02 01:10 AM
سستم الطقس Mero تطوير سيرفرات كونكر 2 2019-06-28 11:20 PM
سستم المطلوب كونكر Hazem تطوير سيرفرات كونكر 0 2019-04-23 11:20 AM


الساعة الآن 11:16 PM