Register for your free account! | Forgot your password?

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

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

Advertisement



Character info packet 5017

Discussion on Character info packet 5017 within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1

 
Kiyono's Avatar
 
elite*gold: 20
Join Date: Jun 2006
Posts: 3,296
Received Thanks: 925
Character info packet 5017

I'm certain that all the values up till the string packer are correct since I just took them from Hybrid's source but I'm not too sure about the string packer part but it should be correct too yet it appears to be wrong and characters don't have names.
Code:
using System.Text;
using Albetros.Core.Enum;

namespace Albetros.Game.Packet
{
    public unsafe struct PlayerInfoPacket
    {
        public uint Id;
        public uint Lookface;
        public ushort Hair;
        public uint Money;
        public uint EMoney;
        public ulong Experience;
        public uint Unknown1;
        public uint Unknown2;
        public uint Unknown3;
        public uint Unknown4;
        public ushort Strength;
        public ushort Agility;
        public ushort Vitality;
        public ushort Spirit;
        public ushort AdditionalPoint;
        public ushort Life;
        public ushort Mana;
        public short Pk;
        public byte Level;
        public byte Profession;
        public byte Unknown5;
        public byte Metempsychosis;
        public byte NamesDisplayed;
        public byte Unknown6;
        public NetStringPacker StringPacker;

        public static PlayerInfoPacket Create(Player player)
        {
            var packet = new PlayerInfoPacket();

            packet.Id = player.UID;
            packet.Lookface = player.Mesh;
            packet.Hair = player.Hair;
            packet.Money = player.Money;
            packet.EMoney = player.CP;
            packet.Experience = player.Experience;
            packet.Strength = player.Strength;
            packet.Agility = player.Agility;
            packet.Vitality = player.Vitality;
            packet.Spirit = player.Spirit;
            packet.AdditionalPoint = player.StatPoint;
            packet.Life = (ushort)player.Health;
            packet.Mana = (ushort)player.Mana;
            packet.Pk = 0;
            packet.Level = player.Level;
            packet.Profession = player.Profession;
            packet.Metempsychosis = player.Reborn;
            packet.NamesDisplayed = 1;
            packet.StringPacker = new NetStringPacker();
            packet.StringPacker.AddString(player.Name);
            packet.StringPacker.AddString(player.Spouse);

            return packet;
        }

        public static implicit operator PlayerInfoPacket(byte* ptr)
        {
            var packet = new PlayerInfoPacket();
            packet.Id = *((uint*)(ptr + 4));
            packet.Lookface = *((uint*)(ptr + 8));
            packet.Hair = *((ushort*)(ptr + 12));
            packet.Money = *((uint*)(ptr + 14));
            packet.EMoney = *((uint*)(ptr + 18));
            packet.Experience = *((ulong*)(ptr + 22));
            packet.Unknown1 = *((uint*)(ptr + 30));
            packet.Unknown2 = *((uint*)(ptr + 34));
            packet.Unknown3 = *((uint*)(ptr + 38));
            packet.Unknown4 = *((uint*)(ptr + 42));
            packet.Strength = *((ushort*)(ptr + 46));
            packet.Agility = *((ushort*)(ptr + 48));
            packet.Vitality = *((ushort*)(ptr + 50));
            packet.Spirit = *((ushort*)(ptr + 52));
            packet.AdditionalPoint = *((ushort*)(ptr + 54));
            packet.Life = *((ushort*)(ptr + 56));
            packet.Mana = *((ushort*)(ptr + 58));
            packet.Pk = *((short*)(ptr + 60));
            packet.Level = *(ptr + 62);
            packet.Profession = *(ptr + 63);
            packet.Unknown5 = *(ptr + 64);
            packet.Metempsychosis = *(ptr + 65);
            packet.NamesDisplayed = *(ptr + 66);
            packet.Unknown6 = *(ptr + 67);
            packet.StringPacker = new NetStringPacker(ptr + 68);
            return packet;
        }

        public static implicit operator byte[](PlayerInfoPacket packet)
        {//108
            var buffer = new byte[68 + packet.StringPacker.Length];
            fixed (byte* ptr = buffer)
            {
                PacketBuilder.AppendHeader(ptr, buffer.Length, 1006);
                *((uint*)(ptr + 4)) = packet.Id;
                //new ushort for what?
                *((uint*)(ptr + 8)) = packet.Lookface;
                *((ushort*)(ptr + 12)) = packet.Hair;
                *((uint*)(ptr + 14)) = packet.Money;
                *((uint*)(ptr + 18)) = packet.EMoney;
                *((ulong*)(ptr + 22)) = packet.Experience;
                *((uint*)(ptr + 30)) = packet.Unknown1;
                *((uint*)(ptr + 34)) = packet.Unknown2;
                *((uint*)(ptr + 38)) = packet.Unknown3;
                *((uint*)(ptr + 42)) = packet.Unknown4;
                *((ushort*)(ptr + 46)) = packet.Strength;
                *((ushort*)(ptr + 48)) = packet.Agility;
                *((ushort*)(ptr + 50)) = packet.Vitality;
                *((ushort*)(ptr + 52)) = packet.Spirit;
                *((ushort*)(ptr + 54)) = packet.AdditionalPoint;
                *((ushort*)(ptr + 56)) = packet.Life;
                *((ushort*)(ptr + 58)) = packet.Mana;
                *((short*)(ptr + 60)) = packet.Pk;
                *(ptr + 62) = packet.Level;
                *(ptr + 63) = packet.Profession;
                *(ptr + 64) = packet.Unknown5;
                *(ptr + 65) = packet.Metempsychosis;
                *(ptr + 66) = packet.NamesDisplayed;
                *(ptr + 67) = packet.Unknown6;
                PacketBuilder.AppendNetStringPacker(ptr + 68, packet.StringPacker);
            }
            return buffer;
        }

        public override string ToString()
        {
            var builder = new StringBuilder();
            builder.AppendFormat("{0} {1} {2} {3} {4} {5}\r\n", Id, Lookface, Hair, Money, EMoney, Experience);
            builder.AppendFormat("{0} {1} {2} {3} {4}\r\n", Unknown1, Unknown2, Unknown3, Unknown4, Unknown5);
            builder.AppendFormat("{0} {1} {2} {3} {4} {5} {6} {7}\r\n", Strength, Agility, Vitality, Spirit, AdditionalPoint, Life, Mana, Pk);
            builder.AppendFormat("{0} {1} {2} {3} {4} {5}\r\n", Level, Profession, Unknown6, Metempsychosis, NamesDisplayed, Unknown6);

            for (byte i = 0; i < StringPacker.Count; i++)
            {
                string str;
                if (StringPacker.GetString(i, out str))
                {
                    builder.AppendLine(string.IsNullOrEmpty(str) ? "null" : str);
                }
            }

            return builder.ToString();
        }
    }

}
This should be correct right? I more or less tried random offsets for the stringpacker but it just refuses to work.
Kiyono is offline  
Old 12/22/2011, 17:27   #2


 
CptSky's Avatar
 
elite*gold: 0
Join Date: Jan 2008
Posts: 1,445
Received Thanks: 1,176
Code:
                    *((Byte*)(p + 66)) = (Byte)0x01; //Show Name
                    *((Byte*)(p + 67)) = (Byte)0x02; //String Count
                    *((Byte*)(p + 68)) = (Byte)User.Name.Length;
                    for (Byte i = 0; i < User.Name.Length; i++)
                        *((Byte*)(p + 69 + i)) = (Byte)User.Name[i];
                    *((Byte*)(p + 69 + (Byte)User.Name.Length)) = (Byte)User.Spouse.Length;
                    for (Byte i = 0; i < User.Spouse.Length; i++)
                        *((Byte*)(p + 70 + (Byte)User.Name.Length + i)) = (Byte)User.Spouse[i];
CptSky is offline  
Old 12/22/2011, 17:44   #3

 
Kiyono's Avatar
 
elite*gold: 20
Join Date: Jun 2006
Posts: 3,296
Received Thanks: 925
Oh, forgot to set the stringcount, well now it works, thanks.
Kiyono is offline  
Reply


Similar Threads Similar Threads
Entity Spawn packet 5017
12/22/2011 - CO2 Private Server - 7 Replies
So I checked different sources and it seems that not one public source unless I missed it has the complete Entity Spawn packet for 5017. Taking bits and pieces from sources I got the following offsets and really random different packet sizes. UID = 4 overlaymesh = 8 //all 8? wtf? Mesh = 8 Avatar = 8 Model = 8 Status = 12
[5017] Looking for packet enums...
11/03/2011 - CO2 Private Server - 13 Replies
Hello all, I want to know how to get enums, and I`d like to know if someone knows it, whats the status enum for disguise/transformations? EDIT: Yes I already checked the wiki... Thanks in advanced, Jobdvh!
[Release] New character info packet
07/22/2011 - CO2 PServer Guides & Releases - 13 Replies
Many of the ppl who are upgrading to the new crypto should be getting a fuck3d up screen after login... so here goes the fix : find you Character Info packet (Dunno where it is of course...) and then update the values: public partial class Msg : Writer {
Help with Character Info Packet
06/23/2011 - CO2 Programming - 17 Replies
Ok So I'm working on a proxy, and I'm able to login and have a simple logger working. For some reason I don't seem to be receiving the 1006 packet that holds my login characters info. It must be getting through because the client is setup properly with my character name, etc... Heres a screeny of the beginning of the login. Packet Structer: http://wiki.fusionorigins.com/index.php?title=CO_P acket_CharacterInformation#Version_5295 Edit: I think the info might be in the 2079 packet,...
[5017] Item Packet Subtype for Special Effects
05/09/2011 - CO2 Private Server - 10 Replies
Heya, I would need both Enum and Packet for Reborn Effects like: Shield AddHP ... Thanks for reading



All times are GMT +1. The time now is 22:47.


Powered by vBulletin®
Copyright ©2000 - 2026, 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 ©2026 elitepvpers All Rights Reserved.