Register for your free account! | Forgot your password?

You last visited: Today at 13:18

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

Advertisement



4267 question

Discussion on 4267 question within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1


 
KraHen's Avatar
 
elite*gold: 0
Join Date: Jul 2006
Posts: 2,216
Received Thanks: 794
4267 question

I can`t believe I`m actually asking this, but I have a problem with spawning players. I never had this problem before. I have the spawn packet (1014) structured after Korvacs` wiki, but I can`t seem to spawn anything between my players (screening works as intended, I can chat). Nothing appears, not even shadows, names, nothing at all. I`m setting the 4 item ids to 0 (no equipment implemented yet), guildid to 0 and guildrank to 0 (for the same reason).

Could anyone tell me what I`m missing here?
KraHen is offline  
Old 03/10/2013, 21:43   #2
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,379
Assuming you can breakpoint and verify the packets are being sent to the client properly then the only remaining possibility is that you are not structuring the packet well.
pro4never is offline  
Old 03/10/2013, 22:20   #3


 
KraHen's Avatar
 
elite*gold: 0
Join Date: Jul 2006
Posts: 2,216
Received Thanks: 794
The packets are being sent and encrypted correctly, I checked that like a hundred times. I`m structuring the packet like this currently :

0 - header // length, type:1014
4 - UID
8 - Mesh
12 - Status
16 - Guild ID // these dont match with the offsets on conquerwiki
19 - Guild Rank // but these aren`t the problem since they are 0 anyway
20 - 0
24 - 0
28 - 0
32 - 0
44 - Coord.X
46 - Coord.Y
48 - Hair
50 - direction
51 - action
52 - 1
53 - name length
54 - name
KraHen is offline  
Old 03/11/2013, 00:04   #4
 
elite*gold: 0
Join Date: Sep 2012
Posts: 775
Received Thanks: 329
Quote:
Originally Posted by KraHen View Post
The packets are being sent and encrypted correctly, I checked that like a hundred times. I`m structuring the packet like this currently :

0 - header // length, type:1014
4 - UID
8 - Mesh
12 - Status
16 - Guild ID // these dont match with the offsets on conquerwiki
19 - Guild Rank // but these aren`t the problem since they are 0 anyway
20 - 0
24 - 0
28 - 0
32 - 0
44 - Coord.X
46 - Coord.Y
48 - Hair
50 - direction
51 - action
52 - 1
53 - name length
54 - name
that 4267 wiki is kinda ****** up at this packet

8 uint Character_ModelID
12 uint Character_Status
14 ushort Character_GuildID
16 ushort Character_GuildRank

it says that status is uint and the guildid is at 14 not 16

maybe you could try to make it a ushort and shift it all back starting from guild id by 2
aka


0 ushort 57 + Character_Name
2 ushort 1014
4 uint Character_ID
8 uint Character_ModelID
12 ushort Character_Status
14 ushort Character_GuildID
16 ushort Character_GuildRank
20 uint Character_Helm_ID
24 uint Character_Armour_ID
28 uint Character_RightHand_ID
32 uint Character_LeftHand_ID
44 ushort Character_CordX
46 ushort Character_CordY
48 ushort Character_HairStyle
50 byte Character_Direction
51 byte Character_Action
52 bool Show_Names
53 byte Character_Name_Length
54 string Character_Name
go for it is offline  
Old 03/11/2013, 00:09   #5


 
KraHen's Avatar
 
elite*gold: 0
Join Date: Jul 2006
Posts: 2,216
Received Thanks: 794
Tried that before, didn`t work, but this isn`t a surprise, since those 3 variables you mentioned are all 0s.

I still don`t get what am I missing. Is there a range of a particular variable or something that I`m not taking into account? UIDs are correct, mesh is correct, those should be out.
KraHen is offline  
Old 03/11/2013, 00:21   #6
 
Spirited's Avatar
 
elite*gold: 12
Join Date: Jul 2011
Posts: 8,282
Received Thanks: 4,190
Quote:
Originally Posted by go for it View Post
that 4267 wiki is kinda ****** up at this packet

8 uint Character_ModelID
12 uint Character_Status
14 ushort Character_GuildID
16 ushort Character_GuildRank

it says that status is uint and the guildid is at 14 not 16

maybe you could try to make it a ushort and shift it all back starting from guild id by 2
aka


0 ushort 57 + Character_Name
2 ushort 1014
4 uint Character_ID
8 uint Character_ModelID
12 ushort Character_Status
14 ushort Character_GuildID
16 ushort Character_GuildRank
20 uint Character_Helm_ID
24 uint Character_Armour_ID
28 uint Character_RightHand_ID
32 uint Character_LeftHand_ID
44 ushort Character_CordX
46 ushort Character_CordY
48 ushort Character_HairStyle
50 byte Character_Direction
51 byte Character_Action
52 bool Show_Names
53 byte Character_Name_Length
54 string Character_Name
Either way, the character would still appear on the screen. The only thing that would prevent the packet from showing up (assuming that it is being sent correctly), would be the structure of the first few bytes, the x and y offsets, and the total length of the packet.

Here's my suggestion - double check that the length being built into offset 0 is the total length of the packet plus the character name (54 + Name Length). The packet size might be correct, but if that size isn't, the client won't accept it (as you're probably well aware). Can you give us a hex dump of the packet you're sending?
Spirited is offline  
Old 03/11/2013, 00:21   #7
 
elite*gold: 0
Join Date: Sep 2012
Posts: 775
Received Thanks: 329
that should fix everything , i was playing around with most of sources around to see how people think and how they program stuff and i remember fusion source was working pretty fine
don't forget to thank korvacs
this is from fusion
Quote:
Code:
        public static Packet SpawnCharacter(Account Acc, uint ConnectionID)
        {
            byte[] Buffer = new byte[57 + Acc.characterName.Length];
            fixed (byte* PTR = Buffer)
            {
                *(ushort*)PTR = (ushort)Buffer.Length;
                *((ushort*)(PTR + 2)) = 1014;
                *((uint*)(PTR + 4)) = Acc.characterID;
                *((uint*)(PTR + 8)) = (uint)(Acc.avatar * 10000) + Acc.modelID;
                *((StatusFlags*)(PTR + 12)) = Acc.status;
                *((ushort*)(PTR + 16)) = Acc.guildID;
                *((ushort*)(PTR + 18)) = Acc.guildRank;

                *((uint*)(PTR + 20)) = Acc.Equipment.ItemStore[(byte)ItemLocation.HeadGear - 1].StaticID;
                *((uint*)(PTR + 24)) = Acc.Equipment.ItemStore[(byte)ItemLocation.Armour - 1].StaticID;
                *((uint*)(PTR + 28)) = Acc.Equipment.ItemStore[(byte)ItemLocation.RightHand - 1].StaticID;
                *((uint*)(PTR + 32)) = Acc.Equipment.ItemStore[(byte)ItemLocation.LeftHand - 1].StaticID;

                *((ushort*)(PTR + 44)) = (ushort)Acc.cords.X;
                *((ushort*)(PTR + 46)) = (ushort)Acc.cords.Y;
                *((ushort*)(PTR + 48)) = Acc.hairStyle;
                *((DirectionEnum*)(PTR + 50)) = Acc.direction;
                *((byte*)(PTR + 51)) = 100;
                *((byte*)(PTR + 52)) = 1;
                *((byte*)(PTR + 53)) = (byte)Acc.characterName.Length;
                byte Pos = 54;
                for (int i = 0; i < Acc.characterName.Length; i++)
                {
                    *((byte*)(PTR + Pos)) = (byte)Acc.characterName[i];
                    Pos++;
                }
            }
            return new Packet(Buffer, ConnectionID);
        }
go for it is offline  
Old 03/11/2013, 00:33   #8


 
KraHen's Avatar
 
elite*gold: 0
Join Date: Jul 2006
Posts: 2,216
Received Thanks: 794
I tried that version as well before, couldn`t get it to spawn with it. Btw I just realized my client is actually v4274, but I don`t suppose that should be the problem.

@Fang, here you go : this is with length 54 + Name_Length, it doesnt change if I put 55+Name_Length or anything_Name_Length, it seems that it checks only until it finds a null character/buffer ends

Quote:
42 00 F6 03 42 42 0F 00 EB 03 00 00 00 00 00 00 B...BB..........
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00 00 00 00 00 00 00 00 00 00 00 00 59 00 26 00 ............Y.&.
9A 01 00 00 01 0C 53 63 72 65 65 6E 54 65 73 74 ......ScreenTest
65 72 [er] - this is in the ASCII part
KraHen is offline  
Old 03/11/2013, 00:48   #9
 
elite*gold: 0
Join Date: Sep 2012
Posts: 775
Received Thanks: 329
i don't see any thing wrong with the packet , so sure the packet structure was changed
i couldn't find any information on epvp and the next source at fangs topic is 4348
here is the spawn packet at the 4348 cofuture source
i duno if they updated but most likely that won't work :\ but you may try it
duno how may this be helpful but anyway here it is
Code:
public byte[] SpawnChar(Character Char)
        {
            int[] Item;
            int ItemID;
            Length((64 + Char.Name.Length));
            Type(1014);
            Long(Char.CharID);
            if (Char.IsGhost == false)
            {
                Long(Char.Model);
            }
            else
            {
                Long(Char.Ghost);
            }
            Long(Char.Status);
            Long(0);
            Short(Char.GuildID);
            ByteInt(0);
            ByteInt(Char.GuildRank);
            Long(0);
            if (Char.IsGhost == false)
            {
                //Send Helm
                Item = Char.Equipment[0];
                ItemID = Item[1];
                Long(ItemID);

                //Send Armor or Garment
                if (Char.Garment == false)
                {
                    Item = Char.Equipment[2];
                    ItemID = Item[1];
                    Long(ItemID);
                }
                else
                {
                    Item = Char.Equipment[8];
                    ItemID = Item[1];
                    Long(ItemID);
                }

                //Send Right Hand
                Item = Char.Equipment[3];
                ItemID = Item[1];
                Long(ItemID);

                //Send Left Hand
                Item = Char.Equipment[4];
                ItemID = Item[1];
                Long(ItemID);
            }
            else
            {
                Long(0);
                Long(0);
                Long(0);
                Long(0);
                Long(0);
            }
            Long(0);
            Long(0);
            Short(Char.CurrentLoc.X);
            Short(Char.CurrentLoc.Y);
            Short(Char.HairStyle);
            ByteInt(Char.Direction);
            ByteInt(Char.Action);
            Short(0);
            ByteInt(1);
            ByteInt(Char.Name.Length);
            for (int x = 0; x < Char.Name.Length; x++)
            {
                Byte(Convert.ToByte(Char.Name[x]));
            }
            return getBytes();
        }
if i were you i were to see the new packet structure and maybe shift everything and increase length by 2 until it work out
all you can do i guess is RE or trail and error :\
go for it is offline  
Old 03/11/2013, 01:09   #10
 
Spirited's Avatar
 
elite*gold: 12
Join Date: Jul 2011
Posts: 8,282
Received Thanks: 4,190
I don't see anything wrong with that packet either. Do you think you're sending too many packets too quickly? The C# Socket class's send method isn't thread safe. Also, you could try the 4267 client if you want: . If I remember correctly though, there isn't a difference.
Spirited is offline  
Old 03/11/2013, 05:42   #11
 
InfamousNoone's Avatar
 
elite*gold: 20
Join Date: Jan 2008
Posts: 2,012
Received Thanks: 2,885
Quote:
Originally Posted by Fаng View Post
I don't see anything wrong with that packet either. Do you think you're sending too many packets too quickly? The C# Socket class's send method isn't thread safe. Also, you could try the 4267 client if you want: . If I remember correctly though, there isn't a difference.
it's not ts but sending p-packets over q-threads doesn't mean the bytes will be intermingled, just that the packets might not be sent in the order you started the threads
InfamousNoone is offline  
Old 03/11/2013, 05:56   #12


 
KraHen's Avatar
 
elite*gold: 0
Join Date: Jul 2006
Posts: 2,216
Received Thanks: 794
@go_for_it : I tried that before as well, it just crashes the client.

@Fang : I`m using a queue-based system, and I double-checked, the order of the packets isn`t wrong either. Also tried that client too, still nothing (it`s still 4274 though).

Do I need to send anything extra before I can spawn? Here`s what I`m doing :

ANSWER_OK
Handle the uberpacket(General Data)
At subtype 0xAA load the given player`s screen and send spawn packets
Handle the rest of the data packets (mainly just echoing back, except for subtype 0x99)
KraHen is offline  
Old 03/11/2013, 07:16   #13
 
Lateralus's Avatar
 
elite*gold: 0
Join Date: May 2005
Posts: 1,892
Received Thanks: 920
Open the client in olly and set a breakpoint where it processes the packet and trace through it to see exactly where it crashes, or trace the call stack back when it crashes. Are you using my structures from the underground? I can verify that my 1006 structure is correct.
Lateralus is offline  
Old 03/11/2013, 11:20   #14


 
KraHen's Avatar
 
elite*gold: 0
Join Date: Jul 2006
Posts: 2,216
Received Thanks: 794
@Lateralus : There is no crashing, the client just doesn`t spawn other characters when I tell it to do so. 1006 is working fine. Also, yes, I`m using the structure from the underground.

The problem must be with the packet itself, or the values I`m putting in it, since screening for NPCs works as intended, and spawning as well.

#EDIT :

FIXED. Turns out it`s really really easy to block the boost io_service if misused.
KraHen is offline  
Reply


Similar Threads Similar Threads
4267 itemtype
02/26/2013 - CO2 Private Server - 4 Replies
I have a question regarding some of the values in the 4267 itemtype. This is the structure I have for it, but the value after price, and the five values after status are something I don't know. Can anyone give a hand? dword StaticID; char Name; char Class; char Proficiency; char Level; char RequiredGender; word StrengthRequirement;
i have question in conquer 4267
04/09/2011 - CO2 Private Server - 8 Replies
when i vending in market i click my Shop ... only show the buyButton i can't add item and remove item in my shop... why that? and how to fix that? this is the screen ... http://am.img1001.com/uu_1104_2/newzf_4_1_45d6b0b b6614a1c.png
I need 4267 source!!!!please
09/27/2010 - CO2 Private Server - 6 Replies
some one give me the 4267 source?? thx ....please
[?] 5017 to 4267
02/14/2010 - CO2 Private Server - 4 Replies
I haven't asked a question in a while. I am trying to convert the CharacterInfo packet to work on a 4267. I attempted to convert but I am still failing! So if anyone can help, it will be well appreciated thank you. Here is my attempt below. public static byte CharacterInfo(GameClient Client) { byte Packet = new byte; WriteUInt16((ushort)Packet.Length, Packet, 0); WriteUInt16(1006, Packet, 2); WriteUInt32(Client.Entity.UID,...



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


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.