Hey1 every1
Can any one Explain To me What spawnPackets is ??
Ty For ur Time
:handsdown::handsdown:;)
Can any one Explain To me What spawnPackets is ??
Ty For ur Time
:handsdown::handsdown:;)
Quote:
A packet that spawns something. Likely you're referring to entity spawn packet.
It's the server saying "There's someone on your screen with this information". The client can then display that object (monster, client, item, etc)
Quote:
Spawn packet is the packet responsible for Appearence of Monsters / Other Players its type is 10014 and its length depends on Name length of Character , Clan name length too.. once there is smthing wrong in any of those offsets (Body / Name / X / Y) the Player Or monster will be Invisible for u although they exist in server .. Hope i helped u
I'm asking to know what change in 5700+ patchQuote:
version ?
Quote:
U can use 5696 to make the new class
Just spawnPackets changed in this patch
So Most changes is in Entity FileQuote:
u should +2 on name, clan name, X, Y and HitPoints
thats it ;)
public string Name
{
get
{
return _Name;
}
set
{
this._Name = value;
int index = 234;
if (this.ClanName != "")
{
this.SpawnPacket = new byte[((((8 + index) + 3) + this.Name.Length) + this.ClanName.Length) + 2];
Writer.WriteUInt16((ushort)((((index + 3) + this.Name.Length) + this.ClanName.Length) + 2), 0, this.SpawnPacket);
Writer.WriteUInt16(0x271e, 2, this.SpawnPacket);
Writer.WriteUInt32(this.Flag, index - 7, this.SpawnPacket);
this.SpawnPacket[index] = 4;
this.SpawnPacket[index + 1] = (byte)this._Name.Length;
Writer.WriteString(this._Name, index + 2, this.SpawnPacket);
this.SpawnPacket[((index + 1) + this.SpawnPacket[index + 1]) + 2] = (byte)this.ClanName.Length;
Writer.WriteString(this.ClanName, ((index + 1) + this.SpawnPacket[index + 1]) + 3, this.SpawnPacket);
}
else
{
this.SpawnPacket = new byte[((8 + index) + 3) + this.Name.Length];
Writer.WriteUInt16((ushort)((index + 3) + this.Name.Length), 0, this.SpawnPacket);
Writer.WriteUInt16(0x271e, 2, this.SpawnPacket);
Writer.WriteUInt32(this.Flag, index - 7, this.SpawnPacket);
this.SpawnPacket[index] = 4;
this.SpawnPacket[index + 1] = (byte)this._Name.Length;
Writer.WriteString(this._Name, index + 2, this.SpawnPacket);
}
}
}
______________________________________________________________________________________________________
public ushort X
{
get
{
return this._x;
}
set
{
this._x = value;
Writer.WriteUInt16(value, 94, this.SpawnPacket);
}
}
______________________________________________________________________________________________________
public ushort Y
{
get
{
return this._y;
}
set
{
this._y = value;
Writer.WriteUInt16(value, 96, this.SpawnPacket);
}
}
_______________________________________________________________________________________________________
public uint Hitpoints
{
get
{
return this._hitpoints;
}
set
{
if (this.EntityFlag == Conquer_Online_Server.Game.EntityFlag.Player)
{
this.Update(0, value, false);
}
this._hitpoints = value;
if (this.Boss > 0)
{
uint num = this.MaxHitpoints / 10000;
if (num != 0)
{
Writer.WriteUInt16((ushort)(value / num), 86, this.SpawnPacket);
}
else
{
Writer.WriteUInt16((ushort)(((double)((value * this.MaxHitpoints) / 1000)) / 1.09), 86, this.SpawnPacket);
}
}
else
{
Writer.WriteUInt16((ushort)value, 86, this.SpawnPacket);
}
}
}
Is IT All >>>> Spawn PacketsQuote:
X , Y , Actions , Angle , First Class , 2nd & 3rd Classes , ClanName , PlayerName ... btw Name spawn packet is coded Badly ... too useless Codes
X , Y , Actions , Angle , First Class , 2nd & 3rd Classes , ClanName , PlayerName
i mean its badly coded :S .. it changed for sure and about what i mentioned they arent all spawn packet Variables but these are the changed OnesQuote:
Is IT All >>>> Spawn Packets
PHP Code:X , Y , Actions , Angle , First Class , 2nd & 3rd Classes , ClanName , PlayerName
Dont get the highlights
do u mean it bad coded or it is still the same unchanged
/// <summary>
/// Creates the spawnpacket associated with the client.
/// </summary>
public Packets.SpawnPacket CreateSpawnPacket()
{
Packets.SpawnPacket spawn = new ProjectX_V3_Game.Packets.SpawnPacket(
new ProjectX_V3_Game.Packets.StringPacker(Name, "", ""));
spawn.Mesh = Mesh;
spawn.EntityUID = EntityUID;
spawn.GuildRank = Enums.GuildRank.None;
Data.ItemInfo head = Equipments[Enums.ItemLocation.Head];
if (head != null)
spawn.HelmetID = head.ItemID;
Data.ItemInfo garment = Equipments[Enums.ItemLocation.Garment];
if (garment != null)
spawn.GarmentID = garment.ItemID;
Data.ItemInfo armor = Equipments[Enums.ItemLocation.Armor];
if (armor != null)
spawn.ArmorID = armor.ItemID;
Data.ItemInfo right = Equipments[Enums.ItemLocation.WeaponR];
if (right != null)
spawn.RightHandID = right.ItemID;
Data.ItemInfo left = Equipments[Enums.ItemLocation.WeaponL];
if (left != null)
spawn.LeftHandID = left.ItemID;
Data.ItemInfo steed = Equipments[Enums.ItemLocation.Steed];
if (steed != null)
{
spawn.SteedID = steed.ItemID;
spawn.MountColor = steed.SocketAndRGB;
}
spawn.HP = HP;
spawn.HairStyle = HairStyle;
spawn.X = X;
spawn.Y = Y;
spawn.Direction = Direction;
spawn.Action = Action;
spawn.Reborns = Reborns;
spawn.Level = Level;
spawn.Job = Class;
return spawn;
}
Quote:
People need to stop writing their spawnpacket in the properties and just make a method to generate the spawnpacket whenever needed.
Much easier to control.
Ex.
Note: ^Uncompleted.Code:/// <summary> /// Creates the spawnpacket associated with the client. /// </summary> public Packets.SpawnPacket CreateSpawnPacket() { Packets.SpawnPacket spawn = new ProjectX_V3_Game.Packets.SpawnPacket( new ProjectX_V3_Game.Packets.StringPacker(Name, "", "")); spawn.Mesh = Mesh; spawn.EntityUID = EntityUID; spawn.GuildRank = Enums.GuildRank.None; Data.ItemInfo head = Equipments[Enums.ItemLocation.Head]; if (head != null) spawn.HelmetID = head.ItemID; Data.ItemInfo garment = Equipments[Enums.ItemLocation.Garment]; if (garment != null) spawn.GarmentID = garment.ItemID; Data.ItemInfo armor = Equipments[Enums.ItemLocation.Armor]; if (armor != null) spawn.ArmorID = armor.ItemID; Data.ItemInfo right = Equipments[Enums.ItemLocation.WeaponR]; if (right != null) spawn.RightHandID = right.ItemID; Data.ItemInfo left = Equipments[Enums.ItemLocation.WeaponL]; if (left != null) spawn.LeftHandID = left.ItemID; Data.ItemInfo steed = Equipments[Enums.ItemLocation.Steed]; if (steed != null) { spawn.SteedID = steed.ItemID; spawn.MountColor = steed.SocketAndRGB; } spawn.HP = HP; spawn.HairStyle = HairStyle; spawn.X = X; spawn.Y = Y; spawn.Direction = Direction; spawn.Action = Action; spawn.Reborns = Reborns; spawn.Level = Level; spawn.Job = Class; return spawn; }
public static void NewEntity(Entity Target, Entity client)
{
byte[] Buffer;
byte Length = w.e;
Buffer = new byte[8 + Length];
Writer.WriteUInt16(Length, 0, Buffer);
Writer.WriteUInt16(10014, 2, Buffer);
Writer.WriteUInt32(Target.Body, 4, Buffer);
Writer.WriteUInt32(Target.UID, 8, Buffer);
Writer.WriteUInt32(Target.GuildID, 12, Buffer);
Writer.WriteUInt32(Target.GuildRank, 16, Buffer);
Writer.WriteUInt32(Target.Hitpoints, 84, Buffer);
Target.Owner.Equipment.SendAllEquips(client.Owner);
client.Owner.Send(Buffer);
}
Indeed, although do null checks on Owner, because you don't want to send packets to ex. a monster xDQuote:
you mean using smthing like that :D
PHP Code:public static void NewEntity(Entity Target, Entity client)
{
byte[] Buffer;
byte Length = w.e;
Buffer = new byte[8 + Length];
Writer.WriteUInt16(Length, 0, Buffer);
Writer.WriteUInt16(10014, 2, Buffer);
Writer.WriteUInt32(Target.Body, 4, Buffer);
Writer.WriteUInt32(Target.UID, 8, Buffer);
Writer.WriteUInt32(Target.GuildID, 12, Buffer);
Writer.WriteUInt32(Target.GuildRank, 16, Buffer);
Writer.WriteUInt32(Target.Hitpoints, 84, Buffer);
Target.Owner.Equipment.SendAllEquips(client.Owner);
client.Owner.Send(Buffer);
}
#region SpawnPacket [10014]
case 10014:
{
foreach (Client.GameState player in Kernel.GamePool.Values)
{
if (player.Entity.UID != client.Entity.UID)
{
// if there are players in Clients Screen send each player status to client
}
}
break;
}
#endregion
1. Loop through the collection for your screen. 2. Check if distance is valid between the entity and the one checking. 3. If the distance is valid then send spawnpaclet (there is 3 different, entity, ground and npc). 4. If the distance is invalid then send packets to remove (there is 2 different, subtype of generaldata and subtype of grounditem) + remove from screen collection 5. Loop through the collection in your map 6. Check if distance is valid between the entity and the one checking. 7. If the distance is valid then send spawnpaclet (there is 3 different, entity, ground and npc). + add to screen collection 8. If the distance is invalid then send packets to remove (there is 2 different, subtype of generaldata and subtype of grounditem) + remove from screen collection
public enum objpos : byte
{
Uint32_Mesh = 4,
Uint32_UID = 8,
Uint32_GuildId = 12,
Uint32_GuildRank = 16,
Uint16_unknown1 = 20,
BitVector32 = 22,
BitVector16 = 39,
Uint32_Head = 44,
Uint32_Garment = 48,
Uint32_Armor = 52,
Utin32_LeftWeapon = 56,
Uint32_RightWeapon = 60,
Uint32_LeftWeaponAccessory = 64,
Uint32_RightWeaponAccessory = 68,
Uint32_Steed = 72,
Uint16_X = 94,
Uint16_Y = 96,
Byte_Fascing = 100,
Byte_Action = 101,
Byte_Reborn = 108,
Byte_Level = 109,
Byte_Nobility = 133,
Str_Count = 234,
Str_NameLenght = 235,
Uint16_PLenght = 237
}
public CMD.ConquerAngle Facing { get { return (CMD.ConquerAngle)ReadByte((byte)objpos.Byte_Fascing); } set { WriteByte((byte)value, (byte)objpos.Byte_Fascing); } }
public CMD.ConquerAction Action { get { return (CMD.ConquerAction)ReadByte((byte)objpos.Byte_Action); } set { WriteByte((byte)value, (byte)objpos.Byte_Action); } }
public byte Level { get { return _lvl; } set { WriteByte(value, (byte)objpos.Byte_Level); _lvl = value; } }