احصائياتى

الردود
4

المشاهدات
466
 
ahmeddnasrr131
.:: عضو نشيط ::.
الإجابات المقدمة: 1

    غير متواجد

المشاركات
191

+التقييم
0.08

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

الاقامة

نظام التشغيل

رقم العضوية
3758
2020-07-05, 02:49 AM
المشاركة 1
2020-07-05, 02:49 AM
المشاركة 1
افتراضي تمت الإجابة رانكات وحوش
عندي مشكله في رانكات الوحوش الكبيره زي البنش وكدا لو ضربت فيهم مش بيتسجل ف الرانك الي ف الشاشه ان حد ضرب مثلا او جايب اسكور كام من ضرب الوحوش
محتاج اظبط الرانكات لي اصدار6609


أفضل جواب - كتبه Uchiha T3Alo
اعمل كلاس جديد وسمى الكلاس MsgBossHarmRanking

وارمى فيه الاكواد ده


كود:
// World Conquer Online Project 2.6552 - COPS6 Project Based
// This project has been created by Eslam Abdullah
// Source Infrastructure based on COPS6 Source, written by CptSky
// This source is targeted to Conquer Online, client version 6552
// 
// File Created by: Moustafa  Mahmoud & Moustafa Muhammad & Mahmoud Mohammed
// World Conquer v2 6552 - MsgServer - MsgBossHarmRanking.cs
// Last Edit: 2017/6/15 14:05
// Created: 2010/11/23 10:12

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 COServer;
using COServer.Database;
using System.Threading.Tasks;

namespace 
COServer.Network.GamePackets
{
    public class 
MsgBossHarmRanking
    
{
        public 
MsgBossHarmRanking() { }
        public 
MsgBossHarmRankingProto Info;
        [
ProtoContract]
        public class 
MsgBossHarmRankingProto
        
{
            [
ProtoMember(1, IsRequired = true)]
            public 
uint Type;
            [
ProtoMember(2, IsRequired = true)]
            public 
uint BossUID;
            [
ProtoMember(3, IsRequired = true)]
            public 
Hunter[] Hunters;
        }
        [
ProtoContract]
        public class 
Hunter
        
{
            [
ProtoMember(1, IsRequired = true)]
            public 
uint Rank;
            [
ProtoMember(2, IsRequired = true)]
            public 
uint ServerID;
            [
ProtoMember(3, IsRequired = true)]
            public 
uint UID;
            [
ProtoMember(4, IsRequired = true)]
            public 
string Name;
            [
ProtoMember(5, IsRequired = true)]
            public 
uint Damage;
        }
        public 
bool Read(byte[] packet)
        {
            
using (var memoryStream = new MemoryStream(packet))
            {
                
Info = Serializer.DeserializeWithLengthPrefix<MsgBossHarmRankingProto>(memoryStream, PrefixStyle.Fixed32);
            }
            return 
true;
        }
        public 
void Ready(Client.GameState client)
        {
            var 
proto = new MsgBossHarmRankingProto();
            
proto.BossUID = Info.BossUID;
            
proto.Type = 1;
            
client.Send(Kernel.FinalizeProtoBuf(proto, 1044));
        }
        public 
void Handle(Client.GameState client)
        {
            switch (
Info.Type)
            {
                case 
0:
                    {
                        var 
proto = new MsgBossHarmRankingProto();
                        
proto.BossUID = Info.BossUID;
                        
proto.Type = 1;
                        var 
scores = client.Map.Entities.Where(i => i.Key == proto.BossUID).FirstOrDefault().Value.MonsterInfo.Score.OrderByDescending(i => i.Value).ToArray();
                        if (
scores.Length != 0)
                        {
                            
proto.Hunters = new Hunter[scores.Length];
                            for (
int i = 0; i < proto.Hunters.Length; i++)
                            {
                                
proto.Hunters[i] = new Hunter();
                                
proto.Hunters[i].UID = scores[i].Key.UID;
                                
proto.Hunters[i].Name = scores[i].Key.Name;
                                
proto.Hunters[i].Damage = scores[i].Value;
                                
proto.Hunters[i].ServerID = scores[i].Key.ServerID;
                                
proto.Hunters[i].Rank = (uint)(i + 1);
                            }
                        }
                        
client.Send(Kernel.FinalizeProtoBuf(proto, 1044));
                        break;
                    }
            }
        }
    }
} 

بعد كدا روح على كلاس MonsterTable وارمى السطر ده


كود:
     public Dictionary<Game.Player, uint> Score = new Dictionary<Game.Player, uint>(); 

بعد كدا هتروح على كلاس Handle وتبحث عن الفويد ده وتتاكد ان الفويد الى يخص البلاير نفسه لان فيه اتنين واحد للبلاير وواحد للان بى سى


كود:
public static void ReceiveAttack(Player attacker, Player attacked, 

بعد كدا تحت الفويد هترمى الاكواد ده


كود:
    #region Bosses Scores
            
if (attacked.PlayerFlag == PlayerFlag.Monster)
            {
                if (
attacked.MonsterInfo != null)
                {
                    if (
attacked.MonsterInfo.Score.ContainsKey(attacker))
                        
attacked.MonsterInfo.Score[attacker] += damage;
                    else 
attacked.MonsterInfo.Score.Add(attacker, damage);
                }
            }
            
#endregion 

بعد كدا هتروح على MsgHandler وتحط الاكواد ده


كود:
      #region MsgBossHarmRanking
                
case MsgTypes.MsgBossHarmRanking:
                    {
                        var 
pkt = new MsgBossHarmRanking();
                        var 
myPacket = new byte[Packet.Length - 8];
                        for (
int i = 0; i < myPacket.Length; i++)
                        {
                            
myPacket[i] = Packet[i];
                        }
                        if (
pkt.Read(myPacket))
                            
pkt.Handle(client);
                        break;
                    }
                
#endregion 

طبعا احتمال يجيلك ايرور فى case MsgTypes.MsgBossHarmRanking: هتروح بقا انت لكلاس MsgTypes وترمى فيه الكود ده


كود:
MsgBossHarmRanking = 1044, 

كدا الرنك هيشتغل معاك عادى وكمان هيعمل ريفريش مع نفسه مع كل ما الدمج يزيد ولو عملتلوا ريفريش هيشتغل عادى تمام
قديم 2020-07-05, 02:12 PM
المشاركة 2
Uchiha T3Alo
.:: عضو خبير ::.
الإجابات المقدمة: 97
  • غير متواجد
افتراضي رد: رانكات وحوش
اعمل كلاس جديد وسمى الكلاس MsgBossHarmRanking

وارمى فيه الاكواد ده


كود:
// World Conquer Online Project 2.6552 - COPS6 Project Based
// This project has been created by Eslam Abdullah
// Source Infrastructure based on COPS6 Source, written by CptSky
// This source is targeted to Conquer Online, client version 6552
// 
// File Created by: Moustafa  Mahmoud & Moustafa Muhammad & Mahmoud Mohammed
// World Conquer v2 6552 - MsgServer - MsgBossHarmRanking.cs
// Last Edit: 2017/6/15 14:05
// Created: 2010/11/23 10:12

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 COServer;
using COServer.Database;
using System.Threading.Tasks;

namespace 
COServer.Network.GamePackets
{
    public class 
MsgBossHarmRanking
    
{
        public 
MsgBossHarmRanking() { }
        public 
MsgBossHarmRankingProto Info;
        [
ProtoContract]
        public class 
MsgBossHarmRankingProto
        
{
            [
ProtoMember(1, IsRequired = true)]
            public 
uint Type;
            [
ProtoMember(2, IsRequired = true)]
            public 
uint BossUID;
            [
ProtoMember(3, IsRequired = true)]
            public 
Hunter[] Hunters;
        }
        [
ProtoContract]
        public class 
Hunter
        
{
            [
ProtoMember(1, IsRequired = true)]
            public 
uint Rank;
            [
ProtoMember(2, IsRequired = true)]
            public 
uint ServerID;
            [
ProtoMember(3, IsRequired = true)]
            public 
uint UID;
            [
ProtoMember(4, IsRequired = true)]
            public 
string Name;
            [
ProtoMember(5, IsRequired = true)]
            public 
uint Damage;
        }
        public 
bool Read(byte[] packet)
        {
            
using (var memoryStream = new MemoryStream(packet))
            {
                
Info = Serializer.DeserializeWithLengthPrefix<MsgBossHarmRankingProto>(memoryStream, PrefixStyle.Fixed32);
            }
            return 
true;
        }
        public 
void Ready(Client.GameState client)
        {
            var 
proto = new MsgBossHarmRankingProto();
            
proto.BossUID = Info.BossUID;
            
proto.Type = 1;
            
client.Send(Kernel.FinalizeProtoBuf(proto, 1044));
        }
        public 
void Handle(Client.GameState client)
        {
            switch (
Info.Type)
            {
                case 
0:
                    {
                        var 
proto = new MsgBossHarmRankingProto();
                        
proto.BossUID = Info.BossUID;
                        
proto.Type = 1;
                        var 
scores = client.Map.Entities.Where(i => i.Key == proto.BossUID).FirstOrDefault().Value.MonsterInfo.Score.OrderByDescending(i => i.Value).ToArray();
                        if (
scores.Length != 0)
                        {
                            
proto.Hunters = new Hunter[scores.Length];
                            for (
int i = 0; i < proto.Hunters.Length; i++)
                            {
                                
proto.Hunters[i] = new Hunter();
                                
proto.Hunters[i].UID = scores[i].Key.UID;
                                
proto.Hunters[i].Name = scores[i].Key.Name;
                                
proto.Hunters[i].Damage = scores[i].Value;
                                
proto.Hunters[i].ServerID = scores[i].Key.ServerID;
                                
proto.Hunters[i].Rank = (uint)(i + 1);
                            }
                        }
                        
client.Send(Kernel.FinalizeProtoBuf(proto, 1044));
                        break;
                    }
            }
        }
    }
} 

بعد كدا روح على كلاس MonsterTable وارمى السطر ده


كود:
     public Dictionary<Game.Player, uint> Score = new Dictionary<Game.Player, uint>(); 

بعد كدا هتروح على كلاس Handle وتبحث عن الفويد ده وتتاكد ان الفويد الى يخص البلاير نفسه لان فيه اتنين واحد للبلاير وواحد للان بى سى


كود:
public static void ReceiveAttack(Player attacker, Player attacked, 

بعد كدا تحت الفويد هترمى الاكواد ده


كود:
    #region Bosses Scores
            
if (attacked.PlayerFlag == PlayerFlag.Monster)
            {
                if (
attacked.MonsterInfo != null)
                {
                    if (
attacked.MonsterInfo.Score.ContainsKey(attacker))
                        
attacked.MonsterInfo.Score[attacker] += damage;
                    else 
attacked.MonsterInfo.Score.Add(attacker, damage);
                }
            }
            
#endregion 

بعد كدا هتروح على MsgHandler وتحط الاكواد ده


كود:
      #region MsgBossHarmRanking
                
case MsgTypes.MsgBossHarmRanking:
                    {
                        var 
pkt = new MsgBossHarmRanking();
                        var 
myPacket = new byte[Packet.Length - 8];
                        for (
int i = 0; i < myPacket.Length; i++)
                        {
                            
myPacket[i] = Packet[i];
                        }
                        if (
pkt.Read(myPacket))
                            
pkt.Handle(client);
                        break;
                    }
                
#endregion 

طبعا احتمال يجيلك ايرور فى case MsgTypes.MsgBossHarmRanking: هتروح بقا انت لكلاس MsgTypes وترمى فيه الكود ده


كود:
MsgBossHarmRanking = 1044, 

كدا الرنك هيشتغل معاك عادى وكمان هيعمل ريفريش مع نفسه مع كل ما الدمج يزيد ولو عملتلوا ريفريش هيشتغل عادى تمام

قديم 2020-07-05, 02:30 PM
المشاركة 3
ahmeddnasrr131
.:: عضو نشيط ::.
الإجابات المقدمة: 1
  • غير متواجد
افتراضي رد: رانكات وحوش
طب معلش هوا انا اسف ع تعبك ف الشرح دا بس لو ممكن الاضافات لسورس عادي مش مسج

قديم 2020-07-05, 02:39 PM
المشاركة 4
Uchiha T3Alo
.:: عضو خبير ::.
الإجابات المقدمة: 97
  • غير متواجد
Like رد: رانكات وحوش
طب معلش هوا انا اسف ع تعبك ف الشرح دا بس لو ممكن الاضافات لسورس عادي مش مسج

لسورس عادى نفس الاضافه وحياتك وهتغير كلمه Player خالص الى Entity وبتاعت MsgHandler هتحطها فى PacketHandler وتشيل حتت الMsgTypes وتعمل فى باكت هندل بدل case MsgTypes.MsgBos تخليها case 1044 ونفس الاضافات عادى الى هيتغير كلمه Player بس

قديم 2020-07-05, 03:07 PM
المشاركة 5
ahmeddnasrr131
.:: عضو نشيط ::.
الإجابات المقدمة: 1
  • غير متواجد
افتراضي رد: رانكات وحوش
طيب تمام هحاول واشوف


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



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

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

المواضيع المتشابهه للموضوع: رانكات وحوش
الموضوع كاتب الموضوع المنتدى مشاركات آخر مشاركة
دروب وحوش ahmeddnasrr131 مشكلات السيرفيرات كونكر الشخصيه 10 2020-06-21 02:49 PM
كيفية وضع وحوش في المدينه Rider تطوير سيرفرات كونكر 7 2019-10-31 04:14 AM
تعديل علي دروب وحوش عاديه و وحوش كبيره Rider تطوير سيرفرات كونكر 4 2019-09-26 06:02 PM
شرح التعامل مع وحوش الجيم virus7x تطوير سيرفرات كونكر 3 2019-07-25 07:29 AM
وحوش كبيره بتوقع صول Hazem تطوير سيرفرات كونكر 0 2019-04-19 10:00 PM


الساعة الآن 04:50 PM