|
You last visited: Today at 00:27
Advertisement
SpawnPackets??
Discussion on SpawnPackets?? within the CO2 Private Server forum part of the Conquer Online 2 category.
02/19/2013, 14:11
|
#1
|
elite*gold: 0
Join Date: Jul 2008
Posts: 874
Received Thanks: 239
|
SpawnPackets??
Hey1 every1
Can any one Explain To me What spawnPackets is ??
Ty For ur Time
|
|
|
02/19/2013, 14:21
|
#2
|
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,376
|
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)
|
|
|
02/19/2013, 14:22
|
#3
|
elite*gold: 0
Join Date: Aug 2007
Posts: 1,525
Received Thanks: 230
|
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
|
|
|
02/19/2013, 14:23
|
#4
|
elite*gold: 0
Join Date: Jul 2012
Posts: 17
Received Thanks: 9
|
Quote:
Originally Posted by abdoumatrix
Hey1 every1
Can any one Explain To me What spawnPackets is ??
Ty For ur Time
|
version ?
|
|
|
02/19/2013, 14:27
|
#5
|
elite*gold: 0
Join Date: Aug 2007
Posts: 1,525
Received Thanks: 230
|
Quote:
Originally Posted by sweetloudpl
version ?
|
i guess u missunderstood him .. all he needs is Packet Describtion not Structure so Version doesnt do matter in this case
|
|
|
02/19/2013, 14:30
|
#6
|
elite*gold: 0
Join Date: Jul 2008
Posts: 874
Received Thanks: 239
|
Quote:
Originally Posted by pro4never
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:
Originally Posted by shadowman123
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
|
Quote:
Originally Posted by sweetloudpl
version ?
|
I'm asking to know what change in 5700+ patch
cuz i have seen this
Quote:
Originally Posted by sala7mostafa
U can use 5696 to make the new class
Just spawnPackets changed in this patch
|
Quote:
Originally Posted by sala7mostafa
u should +2 on name, clan name, X, Y and HitPoints
thats it
|
So Most changes is in Entity File
Is this Right?
PHP Code:
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); } } }
|
|
|
02/19/2013, 14:40
|
#7
|
elite*gold: 0
Join Date: Aug 2007
Posts: 1,525
Received Thanks: 230
|
X , Y , Actions , Angle , First Class , 2nd & 3rd Classes , ClanName , PlayerName ... btw Name spawn packet is coded Badly ... too useless Codes
|
|
|
02/19/2013, 15:26
|
#8
|
elite*gold: 0
Join Date: Jul 2008
Posts: 874
Received Thanks: 239
|
Quote:
Originally Posted by shadowman123
X , Y , Actions , Angle , First Class , 2nd & 3rd Classes , ClanName , PlayerName ... btw Name spawn packet is coded Badly ... too useless Codes
|
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
|
|
|
02/19/2013, 15:40
|
#9
|
elite*gold: 0
Join Date: Aug 2007
Posts: 1,525
Received Thanks: 230
|
Quote:
Originally Posted by abdoumatrix
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
|
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 Ones
|
|
|
02/19/2013, 16:07
|
#10
|
elite*gold: 0
Join Date: Dec 2012
Posts: 1,761
Received Thanks: 946
|
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.
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;
}
Note: ^Uncompleted.
|
|
|
02/19/2013, 16:13
|
#11
|
elite*gold: 0
Join Date: Aug 2007
Posts: 1,525
Received Thanks: 230
|
Quote:
Originally Posted by Super Aids
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.
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;
}
Note: ^Uncompleted.
|
you mean using smthing like that
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); }
|
|
|
02/19/2013, 16:16
|
#12
|
elite*gold: 0
Join Date: Dec 2012
Posts: 1,761
Received Thanks: 946
|
Quote:
Originally Posted by shadowman123
you mean using smthing like that
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); }
|
Indeed, although do null checks on Owner, because you don't want to send packets to ex. a monster xD
The only thing I dislike about that is you're not using a packethandler to handle the actual structure of the packet.
|
|
|
02/19/2013, 16:27
|
#13
|
elite*gold: 0
Join Date: Aug 2007
Posts: 1,525
Received Thanks: 230
|
well what came on my mind is adding case :-
PHP Code:
#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
|
|
|
02/19/2013, 17:13
|
#14
|
elite*gold: 0
Join Date: Dec 2012
Posts: 1,761
Received Thanks: 946
|
If you are referring to when a packet is received then the spawnpacket is never received. Although there is a subtype of GeneralData that requests specific entities in your screen if they have left the screen.
Also you really need some kind of screen class and map class to handle your spawns.
Instead of looping through ALL clients then do it like this.
Code:
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
|
|
|
02/19/2013, 22:01
|
#15
|
elite*gold: 0
Join Date: Feb 2009
Posts: 259
Received Thanks: 159
|
is easy to update in properties ... if you use your mind
Code:
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
}
Code:
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; } }
and others
|
|
|
Similar Threads
|
Probleme mit Spawnpackets
02/21/2012 - DarkOrbit - 12 Replies
Eig bin ich eher der Typ der viel search benutzt und dann auch alles findet, aber hierbei brauch ich mal bisschen hilfe :D (hab nichts passendes gefunden)
Zu meinem Problem: Ich habe in Delphi einen soweit funktionierenden sniffer bzw testbot geschrieben, der per idtcpclient sich aufm server einloggt. Das geht auch soweit, auch das laufsystem funktioniert, was aber nicht geht ist, dass er mir kein Spawnpacket für resourcen oder honeyboxen anzeigt genauso für die Streuner >_<
Hab mir das...
|
All times are GMT +2. The time now is 00:27.
|
|