Hey pvpers!
(Questions will be answered)
I've been wondering from time to time and it's time to move on on this forum,
In this guide i will explain how to upgrade to 5156.
Let's check the following recent changes
What's the DHKey packet?
[B]There is a sort of encryption that waits for a value in a packet to continue with the authentication. It waits for 2 strings in this case (5156):
First : "A320A85EDD79171C341459E94807D71D39BB3B3F3B5161CA8 4894F3AC3FC7FEC317A2DDEC83B66D30C29261C6492643061A ECFCF4A051816D7C359A6A7B7D8FB\0"
Second "5"
You can simply send them by using the ManagedOpenSSL library and then use it like this:
Packet values
There are some recent changes but the most needed packets at the moment to connect and move are :
First off all i will compare the functions of NewestCoServer of the packetbuilder, to CoEmu's.
NewestCoServer -> CoEmu
Then second of all this is how lengths and types work in the source:
To save some failures some time correct values of the packets (I'm gonna regret this ) :
**General
public static byte[] General(int Identifier, int Value1, int Value2, int Value3, int Value4, int Value5, Struct.DataType PacketType)
{
PacketBuilder Packet = new PacketBuilder(10010, 28);
Packet.Long(Identifier);
Packet.Long(Value1);
Packet.Long(Timer);
Packet.Long((int)PacketType);
Packet.Short(Value2);
Packet.Short(Value3);
Packet.Long(4);
return Packet.getFinal();
}
**SpawnChar
public static byte[] SpawnCharacter(ClientSocket CSocket)
{
PacketBuilder P = new PacketBuilder(10014, 138 + CSocket.Client.Name.Length);
P.Long(CSocket.Client.Model);// Model/Mesh
P.Long(CSocket.Client.ID); // CharID
P.Short(CSocket.Client.GuildID); // Guild ID
P.Int(1); // unknown
P.Int((byte)CSocket.Client.GuildRank); // Guld rank
P.Long(0); // Status effect value
if (!CSocket.Client.Dead && !CSocket.Client.Transformed)
{
int Garment = 0;
int Head = 0;
int Armor = 0;
int RH = 0;
int LH = 0;
int Steed = 0;
foreach (KeyValuePair<int, Struct.ItemInfo> Item in CSocket.Client.Equipment)
{
if (Item.Value.Position == 1)
Head = Item.Value.ItemID;
else if (Item.Value.Position == 3 && Armor == 0)
Armor = Item.Value.ItemID;
else if (Item.Value.Position == 4)
RH = Item.Value.ItemID;
else if (Item.Value.Position == 5)
LH = Item.Value.ItemID;
else if (Item.Value.Position == 9)
Garment = Item.Value.ItemID;
else if (Item.Value.Position == 12)
Steed = Item.Value.ItemID;
}
P.Long(Head); // Headgear
P.Long(Garment); // Garment
P.Long(Armor); // Armor
P.Long(LH); // LH
P.Long(RH); // RH
P.Long(Steed); // Steed
}
else
{
P.Long(0); // Headgear
P.Long(0); // Garment
P.Long(0); // Armor
P.Long(0); // LH
P.Long(0); // RH
P.Long(0); // Steed
}
P.Long(12);
P.Short(0);
P.Short(0);
P.Short(CSocket.Client.Hair); // hair
P.Short(CSocket.Client.X); // X
P.Short(CSocket.Client.Y); // Y
P.Int(CSocket.Client.Direction); // Direction
P.Int(CSocket.Client.Action); // Action
P.Int(4);
P.Int(CSocket.Client.Reborn); // Reborn
P.Short(CSocket.Client.Level); // Level
P.Int(0); // 0 = screen / 1 = window
P.Int(16);
P.Long((byte)Nano.Nobility[CSocket.Client.ID].NobilityStage); // nobility rank
if (CSocket.Client.Equipment.ContainsKey(3))
{
Struct.ItemInfo Item = CSocket.Client.Equipment[3];
P.Short(Item.Color); // ARMOR color
P.Short(Item.Color); // LH color
P.Short(Item.Color); // Headgear color
}
P.Long(CSocket.Client.UPoints); // University points
P.Short(0); // Steed plus
P.Long(0);
P.Long(0); // Talisman progress
P.Int(24);
P.Int(1);
P.Int(CSocket.Client.Name.Length); // Name Length
P.Text(CSocket.Client.Name); // Name
return P.getFinal();
}
**CharInfo
public static byte[] CharacterInfo(ClientSocket CSocket)
{
PacketBuilder Packet = new PacketBuilder(1006, 78 + CSocket.Client.Name.Length + CSocket.Client.Spouse.Length);
Packet.Long(CSocket.Client.ID);
Packet.Long(CSocket.Client.Model);
Packet.Short(CSocket.Client.Hair); //Hairstyle
Packet.Long(CSocket.Client.Money); // Money
Packet.Long(CSocket.Client.CPs); // Conquer Points
Packet.Long(CSocket.Client.Exp);
Packet.Long(0);
Packet.Long(3);// ""
Packet.Long(3);// ""
Packet.Long(3);// ""
Packet.Long(3);// ""
Packet.Long(3);// ""
Packet.Short(CSocket.Client.Strength); // STR
Packet.Short(CSocket.Client.Dexterity); // DEX
Packet.Short(CSocket.Client.Vitality); // VIT
Packet.Short(CSocket.Client.Spirit); // SPI
Packet.Short(CSocket.Client.StatPoints); //Attribute Points
Packet.Short(CSocket.Client.CurrentHP); // Current HP
Packet.Short(CSocket.Client.CurrentMP); // Current MP
Packet.Short(CSocket.Client.PkPoints); // PK Points
Packet.Int(CSocket.Client.Level); // Level
Packet.Int((int)CSocket.Client.Class);//Class
Packet.Int(3); // Unknown
Packet.Int(CSocket.Client.Reborn); // Reborn count
Packet.Int(3); // Unknown
Packet.Long(CSocket.Client.QuizShowPoints); // Quiz Show Points!
Packet.Int(2); // String count
Packet.Int(CSocket.Client.Name.Length);
Packet.Text(CSocket.Client.Name);
Packet.Int(CSocket.Client.Spouse.Length);
Packet.Text(CSocket.Client.Spouse);
return Packet.getFinal();
}
**Walk
public static byte[] Walk(int Direction, int UID)
{
Random Rnd = new Random();
PacketBuilder Packet = new PacketBuilder(10005, 16);
Packet.Long(Direction);
Packet.Long(UID);
Packet.Long(Timer);
return Packet.getFinal();
}
Blocked IP's
See you later.