Server: Comet, Open Source

61
Comet has been upgraded to .NET 6 / C# 10. Some asynchronous patterns have also been updated, but should be easy to merge into existing projects.

Edit: Also added docker support.
Interested in my work?

If you wanna learn more about me and my projects: visit my portfolio website. There, you can find my free, open-source work and articles about game development. Due to contractual restrictions: I am not available for job requests or volunteer work.

About Me | GitLab Profile | Website

Server: Comet, Open Source

65
roo7 wrote: Tue Dec 22, 2020 5:14 am
Spirited wrote: Mon Dec 21, 2020 11:38 pm Just to confirm, you're not using the same character ID as the character already on screen, right? Have you tried using a different name as well?
I have tried different names / UID / Mesh ... about every value that I could change in all kinds of combinations. Have tried spawn monster.
@Spirited
Edit: patch - 4274
Hey man. Can you help me with the monster spawn packet? I can't seem to find the right packet structure to spawn one on the screen. I tried to copy CoFuture4267/RedemptionCo 1014 structure but no cookie. I have tried to brute-force some random packet sizes and values aswell.

Code: Select all

short packetL = 0x39;//(short)new Random().Next(54, 70);
            string name = "Pheasant";

            PacketBuilder Packet = new PacketBuilder(new byte[packetL + name.Length]);
            Packet.WriteUInt16(packetL + name.Length);
            Packet.WriteUInt16(1014);
            Packet.WriteUInt32((uint)new Random().Next(1000, 90000));
            Packet.WriteUInt32(104);

            Packet.WriteUInt32(0);
            Packet.WriteUInt32(0);
            Packet.WriteUInt32(0);
            Packet.WriteUInt32(0);
            Packet.WriteUInt32(0);
            Packet.WriteUInt32(0);
            Packet.WriteUInt32(0);

            Packet.WriteUInt16(33);
            Packet.WriteUInt16(1);

            Packet.WriteUInt16(character.X);
            Packet.WriteUInt16(character.Y);

            Packet.WriteUInt16(0);
            Packet.WriteByte(7);
            Packet.WriteByte(100);
            Packet.WriteByte(1);
            Packet.WriteStringWithLength(name);

            return Packet.Packet;

Server: Comet, Open Source

66
roo7 wrote: Wed Aug 23, 2023 12:18 pm
roo7 wrote: Tue Dec 22, 2020 5:14 am
Spirited wrote: Mon Dec 21, 2020 11:38 pm Just to confirm, you're not using the same character ID as the character already on screen, right? Have you tried using a different name as well?
I have tried different names / UID / Mesh ... about every value that I could change in all kinds of combinations. Have tried spawn monster.
@Spirited
Edit: patch - 4274
Hey man. Can you help me with the monster spawn packet? I can't seem to find the right packet structure to spawn one on the screen. I tried to copy CoFuture4267/RedemptionCo 1014 structure but no cookie. I have tried to brute-force some random packet sizes and values aswell.

Code: Select all

short packetL = 0x39;//(short)new Random().Next(54, 70);
            string name = "Pheasant";

            PacketBuilder Packet = new PacketBuilder(new byte[packetL + name.Length]);
            Packet.WriteUInt16(packetL + name.Length);
            Packet.WriteUInt16(1014);
            Packet.WriteUInt32((uint)new Random().Next(1000, 90000));
            Packet.WriteUInt32(104);

            Packet.WriteUInt32(0);
            Packet.WriteUInt32(0);
            Packet.WriteUInt32(0);
            Packet.WriteUInt32(0);
            Packet.WriteUInt32(0);
            Packet.WriteUInt32(0);
            Packet.WriteUInt32(0);

            Packet.WriteUInt16(33);
            Packet.WriteUInt16(1);

            Packet.WriteUInt16(character.X);
            Packet.WriteUInt16(character.Y);

            Packet.WriteUInt16(0);
            Packet.WriteByte(7);
            Packet.WriteByte(100);
            Packet.WriteByte(1);
            Packet.WriteStringWithLength(name);

            return Packet.Packet;
On Comet you don't need to set the packet size, it will be done when the packet is being sent.
Image

Don't PM me, I won't give Canyon 6192 complete lua or database.

Server: Comet, Open Source

67
Konichu wrote: Wed Aug 23, 2023 3:15 pm On Comet you don't need to set the packet size, it will be done when the packet is being sent.
An example is not using PacketWriter. It just shows an imported packet structure from another source that doesn't work either.

Using the PackteWriter I have same result

Code: Select all

 public override byte[] Encode()
        {
            Console.WriteLine("Sending MsgPlayer packet");

            string name = "Pheasant";

            var writer = new PacketWriter();
            writer.Write((ushort)1014); //PacketType.MsgPlayer);// 2 - packet type
            uint newId = (uint)new Random().Next(200000, 600000);
            writer.Write(newId); // 4 - UID
            writer.Write(104); //Pheasant 8 - MODEL
            writer.Write((uint)0); // character status // 12 - STATUS FLAG

            //guild
            writer.Write((ushort)0); // Guild // 16 - GuildID
            writer.Write((byte)0); // // 18 ??
            writer.Write((byte)0); // guild rank  // 19 - guild position

            //items
            writer.Write((uint)0); // 20 - left
            writer.Write((uint)0); // 24 - right
            writer.Write((uint)0); // 28 - arrmor
            writer.Write((uint)0); // 32 - head

            //unknown?
            writer.Write((uint)0); // 36

            // hp
            writer.Write((ushort)33); // 40 - hitpoints
            writer.Write((ushort)1); // 42 - level 

            //cords
            writer.Write((ushort)65); // 44 - X
            writer.Write((ushort)105); //46 - Y 

            //hairstyle
            writer.Write((ushort)0); // 48 - Hairstyle

            writer.Write((byte)3); // direction // 50 - facinng angle
            writer.Write((byte)100); // 51 - action


            //writer.Write((byte)1); // 52 - How many strings?
            //writer.Write(name);// Legth + 53 
            // name = 54 + 8 = 62
            writer.Write(new List<string>{
                name
            });

            return writer.ToArray();

        }

Code: Select all

Length:62
0000:  3E 00 F6 03 B6 0B 06 00  68 00 00 00 00 00 00 00  | >.......h....... |
0010:  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  | ................ |
0020:  00 00 00 00 00 00 00 00  21 00 01 00 41 00 69 00  | ........!...A.i. |
0030:  00 00 03 64 01 08 50 68  65 61 73 61 6E 74        | ...d..Pheasant |