Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Conquer Online 2 > CO2 Private Server
You last visited: Today at 21:17

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Guilds impulse source(5165)

Discussion on Guilds impulse source(5165) within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
U2_Caparzo's Avatar
 
elite*gold: 0
Join Date: Aug 2011
Posts: 314
Received Thanks: 90
Guilds impulse source(5165)

Hey everyone.

well maybe u will see this thread and will think "wtf is this guy doing!", but this is the first time i try to structure a packet.
I'm trying to see a guild's status window, but i know i'm missing something but don't know what :c

this is the packet

Code:
using System;

namespace Conquer_Online_Server.Network.GamePackets
{
    class GuildInfo : Writer, Interfaces.IPacket
    {
        public byte[] ToArray()
        {
            return Buffer;
        }
        byte[] Buffer;
        public uint UID
        {
            get { return BitConverter.ToUInt32(Buffer, 4); }
            set { Writer.WriteUInt32(value, 4, Buffer); }
        }
        public void Deserialize(byte[] Packet)
        {
            this.Buffer = Packet;
        }
        public byte[] Serialize()
        {
            return Buffer;
        }
        public void Send(Client.GameState Hero)
        {
            Hero.Send(Buffer);
        }
        public ushort Lenght
        {
            set
            {
                WriteUInt16(value, 0, Buffer);
            }
        }
        public uint ID
        {
            set
            {
                WriteUInt16((ushort)value, 2, Buffer);
            }
        }
        public uint Donation
        {
            set { WriteUInt32(value, 8, Buffer); }
            get { return BitConverter.ToUInt16(Buffer, 8); }
        }
        public uint Fund
        {
            set { WriteUInt32(value, 12, Buffer); }
            get { return BitConverter.ToUInt16(Buffer, 12); }
        }
        public uint Members
        {
            set { WriteUInt32(value, 20, Buffer); }
        }
        public byte Rank
        {
            set { WriteByte(value, 24, Buffer); }
        }
        public string LeaderName
        {
            set { WriteString(value, 25, Buffer); }
        }

    }
}
and this is my Guild class

Code:
using System.Collections.Generic;

namespace Conquer_Online_Server.Game.ConquerStructures
{
    public class Guild
    {
        uint guildfund;
        string guildleader, bulletin;
        public string GuildName;
        public uint GuildID;
        public Dictionary<uint, Entity> Members;
        public List <uint> Allies, Enemies;
        public string Bulletin
        {
            get
            {
                return bulletin;
            }
            set
            {
                bulletin = value;
                foreach (Entity entity in Members.Values)
                {
                    //sendpacket
                }
            }
        }
        public string GuildLeader
        {
            get
            {
                return guildleader;
            }
            set
            {
                guildleader = value;
                //for send packet purposes
            }
        }
        public uint GuildFund
        {
            get
            {
                return guildfund;
            }
            set
            {
                guildfund = value;
                //for send packet purposes
            }
        }
        public uint MembersCount
        {
            get
            {
                return (uint)Members.Count;
            }
        }
        public Guild(string Name, Entity entity, uint ID)
        {
            GuildID = 12;
            GuildFund = 1000000;
            GuildLeader = entity.Name;
            GuildName = Name;
            Bulletin = "Una guild";
            Members.Add(entity.UID, entity);
            Network.GamePackets.GuildInfo GuildPacket = new Network.GamePackets.GuildInfo();
            GuildPacket.ID = ID;
            GuildPacket.Donation = entity.GuildDonation;
            GuildPacket.Fund = GuildFund;
            GuildPacket.LeaderName = GuildLeader;
            GuildPacket.Lenght = (ushort)(28 + GuildLeader.Length);
            GuildPacket.Members = MembersCount;
            GuildPacket.Rank = (byte)entity.GuildPosition;
            GuildPacket.UID = GuildID;
            GuildPacket.Send(entity.Owner);
        }


    }
}
i'm added this to the packethandler.cs

Code:
                    case 1106:
                        {
                            client.Entity.guild = new Game.ConquerStructures.Guild("Xdd", client.Entity, 1106);
                            break;
                        }
                    case 1107:
                        {
                            client.Entity.guild = new Game.ConquerStructures.Guild("Xdd", client.Entity, 1107);
                            break;
                        }
hope someone can help me a bit to make this work, ofc this is a "testing" class.

i got the structure frome here if it matters

thanks
U2_Caparzo is offline  
Reply


Similar Threads Similar Threads
CoolEffect 5165 (impulse)
05/21/2012 - CO2 PServer Guides & Releases - 5 Replies
emmm yes, this a noob release i know, but i'm starting to "work" in this source and i want to share somethings including when they are easy to do, so maybe u can help me to improve the code and improve my skills at coding :p look for this in entity.cs public Enums.ConquerAction Action under the set statment (i dk how to call it :c) HandleCoolEffect((Enums.ConquerAction)SpawnPacket );
[Help]i need code for fix monster in impulse source 5165
04/06/2011 - CO2 Private Server - 0 Replies
i need code for fix monster in impulse source 5165 or nobility and vinding
i got a problem in 5165 impulse source
02/21/2011 - CO2 Private Server - 13 Replies
hi, i have a co pserver 5165 impulse " http://www.elitepvpers.com/forum/co2-pserver-guides -releases/741395-5165-source.html " i followed the guide , but when i made server on i got an error, well i gone to C# and i debugged , and i got the same thing , look: http://img713.imageshack.us/img713/3217/sdfsdft.p ng and "coserver" is the name of database "coserver.sql" there is "coserver" written in OldCODB
Guilds in 5165
06/07/2010 - CO2 Private Server - 5 Replies
This problem is really REALLY weird. Last week I ran GW fine. No problems whatsoever. This week I try and run GW and all of a sudden i get a null reference exception in sendscore.. I tried stuff like resetting the guilds.dat and what not.



All times are GMT +1. The time now is 21:18.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.