قديم 2020-04-01, 02:37 AM
المشاركة 2
ElSaher
.:: عضو خبير ::.
  • غير متواجد
افتراضي رد: بعد اذنكو عايز اخلي الكينج مياخدش البرنس 1 هت وياخدو 2 هت
دي بتحددها من Handle من الاسكلات

قديم 2020-04-01, 03:38 AM
المشاركة 3
Tyranny-Team's
.:: عضو نشيط ::.
  • غير متواجد
افتراضي رد: بعد اذنكو عايز اخلي الكينج مياخدش البرنس 1 هت وياخدو 2 هت
دي بتحددها من handle من الاسكلات
ايوه تمام عارف عايز اعرف الأكواد اللي هكتبها ع كده

قديم 2020-04-01, 03:53 AM
المشاركة 4
ElSaher
.:: عضو خبير ::.
  • غير متواجد
افتراضي رد: بعد اذنكو عايز اخلي الكينج مياخدش البرنس 1 هت وياخدو 2 هت
ايوه تمام عارف عايز اعرف الأكواد اللي هكتبها ع كده
للاسف ولله معرفشي بس جرب كدا اعمل دي

هتخوش علي كلاس Nobility.cs

هتمسح كل الي فيه وتضيف دا


كود:
using System;
using System.Linq;
using System.Collections.Generic;
using Mr_Panda.Network.GamePackets;
using System.IO;


namespace 
Mr_Panda.Game.ConquerStructures
{
    public class 
Nobility Mr_Panda.Network.Writer
    
{


        public static 
ulong MaxDonation 0;
        public static 
ulong MaxDonation1 0;
        public static 
ulong MaxDonation2 0;
        public static 
SafeDictionary<uintNobilityInformationBoard = new SafeDictionary<uintNobilityInformation>(10000);
        public static List<
NobilityInformationBoardList = new List<NobilityInformation>(10000);
        public static 
void Handle(NobilityInfo informationClient.GameState client)
        {
            if (
information.Type == NobilityInfo.Donate)
                return;

            switch (
information.Type)
            {
                case 
NobilityInfo.Donate:
                    {
                        if (
client.Trade.InTrade)
                            return;
                        if (
client.Player.DonateTime)
                            return;
                        
ulong silvers information.dwParam;
                        
bool newDonator false;
                        
client.NobilityInformation.Gender = (byte)(client.Player.Body 10);
                        if (
client.NobilityInformation.Donation == 0)
                            
newDonator true;
                        if (
information.MoneyType == 1)
                        {
                            
ulong cps silvers 50000;
                            if (
client.Player.ConquerPoints >= 10000)
                            {
                                
client.Player.ConquerPoints -= 10000;
                                
client.NobilityInformation.Donation += silvers;
                            }
                        }
                        else
                        {
                            if (
client.Player.Money >= silvers)
                            {
                                
client.Player.Money -= (uint)silvers;
                                
client.NobilityInformation.Donation += silvers;
                            }
                        }

                        if (!
Board.ContainsKey(client.Player.UID) && client.NobilityInformation.Donation == silvers && newDonator)
                        {
                            
Board.Add(client.Player.UIDclient.NobilityInformation);
                            try
                            {
                                
Database.NobilityTable.InsertNobilityInformation(client.NobilityInformation);
                            }
                            catch
                            {
                                
Database.NobilityTable.UpdateNobilityInformation(client.NobilityInformation);
                            }
                        }
                        else
                        {
                            
Database.NobilityTable.UpdateNobilityInformation(client.NobilityInformation);
                        }
                        
Sort(client.Player.UID);
                        break;
                    }
                case 
NobilityInfo.List:
                    {
                        
byte[] packet = new byte[600 8];
                        
Network.Writer.WriteUInt16(6000packet);
                        
Network.Writer.WriteUInt16(20642packet);
                        
Network.Writer.WriteUInt16(24packet);
                        
Network.Writer.WriteUInt16(510packet);
                        
Network.Writer.WriteUInt16(2012packet);
                        
int offset 120;
                        for (
int i = (int)(information.wParam1 10); information.wParam1 10 10 && BoardList.Counti++)
                        {
                            var 
nob BoardList[i];
                            
Network.Writer.WriteUInt32(nob.EntityUIDoffsetpacket);
                            
offset += 4;
                            if (
Kernel.GamePool.ContainsKey(nob.EntityUID))
                            {
                                
Network.Writer.WriteUInt32(1offsetpacket);
                                
offset += 4;
                                
Network.Writer.WriteUInt32(nob.Meshoffsetpacket);
                                
offset += 4;
                            }
                            else
                            {
                                
offset += 8;
                            }
                            
Network.Writer.WriteString(nob.Nameoffsetpacket);
                            
offset += 20;
                            
Network.Writer.WriteUInt64(nob.Donationoffsetpacket);
                            
offset += 8;
                            
Network.Writer.WriteUInt32((uint)nob.Rankoffsetpacket);
                            
offset += 4;
                            
Network.Writer.WriteUInt32((uint)ioffsetpacket);
                            
offset += 4;
                        }
                        
client.Send(packet);
                        break;
                    }
            }
        }
        public static 
void Donate(ulong silversClient.GameState clientbool Npc false)
        {
            if (
Npc == false)
                return;
            
bool newDonator false;
            
client.NobilityInformation.Gender = (byte)(client.Player.Body 10);
            if (
client.NobilityInformation.Donation == 0)
                
newDonator true;

            
client.NobilityInformation.Donation += silvers;

            if (!
Board.ContainsKey(client.Player.UID) && client.NobilityInformation.Donation == silvers && newDonator)
            {
                
Board.Add(client.Player.UIDclient.NobilityInformation);
                try
                {
                    
Database.NobilityTable.InsertNobilityInformation(client.NobilityInformation);
                }
                catch
                {
                    
Database.NobilityTable.UpdateNobilityInformation(client.NobilityInformation);
                }
            }
            else
            {
                
Database.NobilityTable.UpdateNobilityInformation(client.NobilityInformation);
            }
            
Sort(client.Player.UID);
        }
        public static 
void Sort(uint updateUID)
        {
            
SafeDictionary<uintNobilityInformationsortedBoard = new SafeDictionary<uintNobilityInformation>();

            
int Place 0;
            foreach (
NobilityInformation entry in Board.Values.OrderByDescending((p) => p.Donation))
            {
                
Client.GameState client null;
                try
                {
                    
int previousPlace entry.Position;
                    
entry.Position Place;
                    
NobilityRank Rank NobilityRank.Serf;

                    if (
Place >= 10000)
                    {
                        if (
entry.Donation >= 200000)
                        {
                            
Rank NobilityRank.Earl;
                        }
                        else if (
entry.Donation >= 100000)
                        {
                            
Rank NobilityRank.Baron;
                        }
                        else if (
entry.Donation >= 300000)
                        {
                            
Rank NobilityRank.Knight;
                        }
                    }
                    else
                    {
                        if (
Place 10)
                        {
                            
Rank NobilityRank.King;
                            if (
Place < (10))
                            {
                                
MaxDonation entry.Donation;
                            }
                        }
                        else if (
Place 20)
                        {
                            
Rank NobilityRank.Prince;
                            if (
Place 20)
                            {
                                
MaxDonation1 entry.Donation;
                            }
                        }
                        else
                        {
                            if (
Place 9999)
                            {
                            }
                            
Rank NobilityRank.Duke;
                            if (
Place < (9999))
                            {
                                
MaxDonation2 entry.Donation;
                            }
                        }
                    }
                    var 
oldRank entry.Rank;
                    
entry.Rank Rank;
                    if (
Kernel.GamePool.TryGetValue(entry.EntityUIDout client))
                    {
                        
bool updateTheClient false;
                        if (
oldRank != Rank)
                        {
                            
updateTheClient true;
                            if (
Rank == NobilityRank.Baron)
                            {
                                
Kernel.SendWorldMessage(new Message(" Congratulation " client.Player.Name " has the Baron In Pharaohs-Eu "System.Drawing.Color.WhiteMessage.TopLeft), Program.Values);
                            }
                            if (
Rank == NobilityRank.Earl)
                            {
                                
Kernel.SendWorldMessage(new Message(" Congratulation " client.Player.Name " has the Earl In Pharaohs-Eu "System.Drawing.Color.WhiteMessage.TopLeft), Program.Values);
                            }
                            if (
Rank == NobilityRank.Duke)
                            {
                                
Kernel.SendWorldMessage(new Message(" Congratulation " client.Player.Name " has the Duke In Pharaohs-Eu "System.Drawing.Color.WhiteMessage.Center), Program.Values);
                            }
                            if (
Rank == NobilityRank.Prince)
                            {
                                
Kernel.SendWorldMessage(new Message(" Congratulation " client.Player.Name " has the Prince In Pharaohs-Eu "System.Drawing.Color.WhiteMessage.Center), Program.Values);
                            }
                            if (
Rank == NobilityRank.King)
                            {
                                
Kernel.SendWorldMessage(new Message(" Congratulation " client.Player.Name " has become the new King/Queen In Pharaohs-Eu "System.Drawing.Color.WhiteMessage.Center), Program.Values);
                            }
                            if (
Rank == NobilityRank.Knight)
                            {
                                
Kernel.SendWorldMessage(new Message(" Congratulation " client.Player.Name " has become a Knight By In Pharaohs-Eu "System.Drawing.Color.WhiteMessage.TopLeft), Program.Values);
                            }
                        }
                        else
                        {
                            if (
previousPlace != Place)
                            {
                                
updateTheClient true;
                            }
                        }
                        if (
updateTheClient || client.Player.UID == updateUID)
                        {
                            
NobilityInfo update = new NobilityInfo(true);
                            
update.Type NobilityInfo.Icon;
                            
update.dwParam entry.EntityUID;
                            
update.UpdateString(entry);
                            
client.SendScreen(updatetrue);
                            
client.Player.NobilityRank entry.Rank;
                        }
                    }
                    
sortedBoard.Add(entry.EntityUIDentry);
                    
Place++;
                }
                catch { }
            }
            
Board sortedBoard;
            
lock (BoardList)
                
BoardList Board.Values.ToList();
        }
    }
    public class 
NobilityInformation
    
{
        public 
string Name;
        public 
uint EntityUID;
        public 
uint Mesh;
        public 
ulong Donation;
        public 
byte Gender;
        public 
int Position;
        public 
NobilityRank Rank;
        public 
bool king;
        public 
DateTime KingDays;
    }

    public 
enum NobilityRank byte
    
{
        
Serf 0,
        
Knight 1,
        
Baron 3,
        
Earl 5,
        
Duke 7,
        
Prince 9,
        
King 12
    
}


هتغير اسم البروكجت Mr_Panda بي اسم البروجكت بتاعك
ولو جالك ايرور في Player خليها Entity

جرب كدا وقولي

قديم 2020-04-01, 04:05 AM
المشاركة 5
Tyranny-Team's
.:: عضو نشيط ::.
  • غير متواجد
افتراضي رد: بعد اذنكو عايز اخلي الكينج مياخدش البرنس 1 هت وياخدو 2 هت
للاسف ولله معرفشي بس جرب كدا اعمل دي

هتخوش علي كلاس nobility.cs

هتمسح كل الي فيه وتضيف دا


كود:
using system;
using system.linq;
using system.collections.generic;
using mr_panda.network.gamepackets;
using system.io;


namespace 
mr_panda.game.conquerstructures
{
    public class 
nobility Mr_panda.network.writer
    
{


        public static 
ulong maxdonation 0;
        public static 
ulong maxdonation1 0;
        public static 
ulong maxdonation2 0;
        public static 
safedictionary<uintnobilityinformationboard = new safedictionary<uintnobilityinformation>(10000);
        public static list<
nobilityinformationboardlist = new list<nobilityinformation>(10000);
        public static 
void handle(nobilityinfo informationclient.gamestate client)
        {
            if (
information.type == nobilityinfo.donate)
                return;

            switch (
information.type)
            {
                case 
nobilityinfo.donate:
                    {
                        if (
client.trade.intrade)
                            return;
                        if (
client.player.donatetime)
                            return;
                        
ulong silvers information.dwparam;
                        
bool newdonator false;
                        
client.nobilityinformation.gender = (byte)(client.player.body 10);
                        if (
client.nobilityinformation.donation == 0)
                            
newdonator true;
                        if (
information.moneytype == 1)
                        {
                            
ulong cps silvers 50000;
                            if (
client.player.conquerpoints >= 10000)
                            {
                                
client.player.conquerpoints -= 10000;
                                
client.nobilityinformation.donation += silvers;
                            }
                        }
                        else
                        {
                            if (
client.player.money >= silvers)
                            {
                                
client.player.money -= (uint)silvers;
                                
client.nobilityinformation.donation += silvers;
                            }
                        }

                        if (!
board.containskey(client.player.uid) && client.nobilityinformation.donation == silvers && newdonator)
                        {
                            
board.add(client.player.uidclient.nobilityinformation);
                            try
                            {
                                
database.nobilitytable.insertnobilityinformation(client.nobilityinformation);
                            }
                            catch
                            {
                                
database.nobilitytable.updatenobilityinformation(client.nobilityinformation);
                            }
                        }
                        else
                        {
                            
database.nobilitytable.updatenobilityinformation(client.nobilityinformation);
                        }
                        
sort(client.player.uid);
                        break;
                    }
                case 
nobilityinfo.list:
                    {
                        
byte[] packet = new byte[600 8];
                        
network.writer.writeuint16(6000packet);
                        
network.writer.writeuint16(20642packet);
                        
network.writer.writeuint16(24packet);
                        
network.writer.writeuint16(510packet);
                        
network.writer.writeuint16(2012packet);
                        
int offset 120;
                        for (
int i = (int)(information.wparam1 10); information.wparam1 10 10 && boardlist.counti++)
                        {
                            var 
nob boardlist[i];
                            
network.writer.writeuint32(nob.entityuidoffsetpacket);
                            
offset += 4;
                            if (
kernel.gamepool.containskey(nob.entityuid))
                            {
                                
network.writer.writeuint32(1offsetpacket);
                                
offset += 4;
                                
network.writer.writeuint32(nob.meshoffsetpacket);
                                
offset += 4;
                            }
                            else
                            {
                                
offset += 8;
                            }
                            
network.writer.writestring(nob.nameoffsetpacket);
                            
offset += 20;
                            
network.writer.writeuint64(nob.donationoffsetpacket);
                            
offset += 8;
                            
network.writer.writeuint32((uint)nob.rankoffsetpacket);
                            
offset += 4;
                            
network.writer.writeuint32((uint)ioffsetpacket);
                            
offset += 4;
                        }
                        
client.send(packet);
                        break;
                    }
            }
        }
        public static 
void donate(ulong silversclient.gamestate clientbool npc false)
        {
            if (
npc == false)
                return;
            
bool newdonator false;
            
client.nobilityinformation.gender = (byte)(client.player.body 10);
            if (
client.nobilityinformation.donation == 0)
                
newdonator true;

            
client.nobilityinformation.donation += silvers;

            if (!
board.containskey(client.player.uid) && client.nobilityinformation.donation == silvers && newdonator)
            {
                
board.add(client.player.uidclient.nobilityinformation);
                try
                {
                    
database.nobilitytable.insertnobilityinformation(client.nobilityinformation);
                }
                catch
                {
                    
database.nobilitytable.updatenobilityinformation(client.nobilityinformation);
                }
            }
            else
            {
                
database.nobilitytable.updatenobilityinformation(client.nobilityinformation);
            }
            
sort(client.player.uid);
        }
        public static 
void sort(uint updateuid)
        {
            
safedictionary<uintnobilityinformationsortedboard = new safedictionary<uintnobilityinformation>();

            
int place 0;
            foreach (
nobilityinformation entry in board.values.orderbydescending((p) => p.donation))
            {
                
client.gamestate client null;
                try
                {
                    
int previousplace entry.position;
                    
entry.position place;
                    
nobilityrank rank nobilityrank.serf;

                    if (
place >= 10000)
                    {
                        if (
entry.donation >= 200000)
                        {
                            
rank nobilityrank.earl;
                        }
                        else if (
entry.donation >= 100000)
                        {
                            
rank nobilityrank.baron;
                        }
                        else if (
entry.donation >= 300000)
                        {
                            
rank nobilityrank.knight;
                        }
                    }
                    else
                    {
                        if (
place 10)
                        {
                            
rank nobilityrank.king;
                            if (
place < (10))
                            {
                                
maxdonation entry.donation;
                            }
                        }
                        else if (
place 20)
                        {
                            
rank nobilityrank.prince;
                            if (
place 20)
                            {
                                
maxdonation1 entry.donation;
                            }
                        }
                        else
                        {
                            if (
place 9999)
                            {
                            }
                            
rank nobilityrank.duke;
                            if (
place < (9999))
                            {
                                
maxdonation2 entry.donation;
                            }
                        }
                    }
                    var 
oldrank entry.rank;
                    
entry.rank rank;
                    if (
kernel.gamepool.trygetvalue(entry.entityuidout client))
                    {
                        
bool updatetheclient false;
                        if (
oldrank != rank)
                        {
                            
updatetheclient true;
                            if (
rank == nobilityrank.baron)
                            {
                                
kernel.sendworldmessage(new message(" congratulation " client.player.name " has the baron in pharaohs-eu "system.drawing.color.whitemessage.topleft), program.values);
                            }
                            if (
rank == nobilityrank.earl)
                            {
                                
kernel.sendworldmessage(new message(" congratulation " client.player.name " has the earl in pharaohs-eu "system.drawing.color.whitemessage.topleft), program.values);
                            }
                            if (
rank == nobilityrank.duke)
                            {
                                
kernel.sendworldmessage(new message(" congratulation " client.player.name " has the duke in pharaohs-eu "system.drawing.color.whitemessage.center), program.values);
                            }
                            if (
rank == nobilityrank.prince)
                            {
                                
kernel.sendworldmessage(new message(" congratulation " client.player.name " has the prince in pharaohs-eu "system.drawing.color.whitemessage.center), program.values);
                            }
                            if (
rank == nobilityrank.king)
                            {
                                
kernel.sendworldmessage(new message(" congratulation " client.player.name " has become the new king/queen in pharaohs-eu "system.drawing.color.whitemessage.center), program.values);
                            }
                            if (
rank == nobilityrank.knight)
                            {
                                
kernel.sendworldmessage(new message(" congratulation " client.player.name " has become a knight by in pharaohs-eu "system.drawing.color.whitemessage.topleft), program.values);
                            }
                        }
                        else
                        {
                            if (
previousplace != place)
                            {
                                
updatetheclient true;
                            }
                        }
                        if (
updatetheclient || client.player.uid == updateuid)
                        {
                            
nobilityinfo update = new nobilityinfo(true);
                            
update.type nobilityinfo.icon;
                            
update.dwparam entry.entityuid;
                            
update.updatestring(entry);
                            
client.sendscreen(updatetrue);
                            
client.player.nobilityrank entry.rank;
                        }
                    }
                    
sortedboard.add(entry.entityuidentry);
                    
place++;
                }
                catch { }
            }
            
board sortedboard;
            
lock (boardlist)
                
boardlist board.values.tolist();
        }
    }
    public class 
nobilityinformation
    
{
        public 
string name;
        public 
uint entityuid;
        public 
uint mesh;
        public 
ulong donation;
        public 
byte gender;
        public 
int position;
        public 
nobilityrank rank;
        public 
bool king;
        public 
datetime kingdays;
    }

    public 
enum nobilityrank Byte
    
{
        
serf 0,
        
knight 1,
        
baron 3,
        
earl 5,
        
duke 7,
        
prince 9,
        
king 12
    
}


هتغير اسم البروكجت mr_panda بي اسم البروجكت بتاعك
ولو جالك ايرور في player خليها entity

جرب كدا وقولي
بس بصراحه انا شايف انو مفيش اي علاقه بينو وبين الأتاك

قديم 2020-04-01, 04:18 AM
المشاركة 6
ElSaher
.:: عضو خبير ::.
  • غير متواجد
افتراضي رد: بعد اذنكو عايز اخلي الكينج مياخدش البرنس 1 هت وياخدو 2 هت
بس بصراحه انا شايف انو مفيش اي علاقه بينو وبين الأتاك
جرب بس

قديم 2020-04-01, 10:55 AM
المشاركة 7
Users
.:: عضو خبير ::.
  • غير متواجد
افتراضي رد: بعد اذنكو عايز اخلي الكينج مياخدش البرنس 1 هت وياخدو 2 هت
بس بصراحه انا شايف انو مفيش اي علاقه بينو وبين الأتاك
عندك حق 😂😂😂

قديم 2020-04-01, 11:15 AM
المشاركة 8
ElSaher
.:: عضو خبير ::.
  • غير متواجد
افتراضي رد: بعد اذنكو عايز اخلي الكينج مياخدش البرنس 1 هت وياخدو 2 هت
انا بجرب بس ولله يا ايمن يمكن تطلع صح اصل

قديم 2020-04-01, 12:42 PM
المشاركة 9
Tyranny-Team's
.:: عضو نشيط ::.
  • غير متواجد
افتراضي رد: بعد اذنكو عايز اخلي الكينج مياخدش البرنس 1 هت وياخدو 2 هت
تسلمو ي روح قلبي انا كودت الاكواد ع ايدي واشتغلت انتظرووها في المنتدي

قديم 2020-04-01, 01:00 PM
المشاركة 10
ElSaher
.:: عضو خبير ::.
  • غير متواجد
افتراضي رد: بعد اذنكو عايز اخلي الكينج مياخدش البرنس 1 هت وياخدو 2 هت
تسلمو ي روح قلبي انا كودت الاكواد ع ايدي واشتغلت انتظرووها في المنتدي
تمام يا حوب


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



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

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

المواضيع المتشابهه للموضوع: بعد اذنكو عايز اخلي الكينج مياخدش البرنس 1 هت وياخدو 2 هت
الموضوع كاتب الموضوع المنتدى مشاركات آخر مشاركة
خلي الكينج الاول اقوي من الثاني والثاني اقوي من الثالث وهكذا محمد ياسر تطوير سيرفرات كونكر 5 2023-07-22 01:47 AM
ازاى اعمل فرق بين اتاك الكينج و البرنس في سورس اليكس Tofan مشكلات السيرفيرات كونكر الشخصيه 4 2020-04-19 03:00 PM
عايز حل الايرور ده يا جماعه في سورس احمد فتحي Tyranny-Team's مشكلات السيرفيرات كونكر الشخصيه 7 2020-03-28 07:10 AM
طلب بعد اذنكو ممكن حرب كابتشر فلاج كامله ابو مروان مشكلات السيرفيرات كونكر الشخصيه 2 2019-09-29 05:00 AM
عايز اخلي الوار كل يوم ElSaher مشكلات السيرفيرات كونكر الشخصيه 7 2019-07-25 03:15 AM


الساعة الآن 01:38 PM

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