SpawnPackets??

02/19/2013 14:11 abdoumatrix#1
Hey1 every1

Can any one Explain To me What spawnPackets is ??

Ty For ur Time

:handsdown::handsdown:;)
02/19/2013 14:21 pro4never#2
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 shadowman123#3
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 sweetloudpl#4
Quote:
Originally Posted by abdoumatrix View Post
Hey1 every1

Can any one Explain To me What spawnPackets is ??

Ty For ur Time

:handsdown::handsdown:;)
version ?
02/19/2013 14:27 shadowman123#5
Quote:
Originally Posted by sweetloudpl View Post
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 abdoumatrix#6
Quote:
Originally Posted by pro4never View Post
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 View Post
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 View Post
version ?
I'm asking to know what change in 5700+ patch

cuz i have seen this

Quote:
Originally Posted by sala7mostafa View Post
U can use 5696 to make the new class
Just spawnPackets changed in this patch
Quote:
Originally Posted by sala7mostafa View Post
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[((((index) + 3) + this.Name.Length) + this.ClanName.Length) + 2];
                    
Writer.WriteUInt16((ushort)((((index 3) + this.Name.Length) + this.ClanName.Length) + 2), 0this.SpawnPacket);
                    
Writer.WriteUInt16(0x271e2this.SpawnPacket);
                    
Writer.WriteUInt32(this.Flagindex 7this.SpawnPacket);
                    
this.SpawnPacket[index] = 4;
                    
this.SpawnPacket[index 1] = (byte)this._Name.Length;
                    
Writer.WriteString(this._Nameindex 2this.SpawnPacket);
                    
this.SpawnPacket[((index 1) + this.SpawnPacket[index 1]) + 2] = (byte)this.ClanName.Length;
                    
Writer.WriteString(this.ClanName, ((index 1) + this.SpawnPacket[index 1]) + 3this.SpawnPacket);
                }
                else
                {
                    
this.SpawnPacket = new byte[((index) + 3) + this.Name.Length];
                    
Writer.WriteUInt16((ushort)((index 3) + this.Name.Length), 0this.SpawnPacket);
                    
Writer.WriteUInt16(0x271e2this.SpawnPacket);
                    
Writer.WriteUInt32(this.Flagindex 7this.SpawnPacket);
                    
this.SpawnPacket[index] = 4;
                    
this.SpawnPacket[index 1] = (byte)this._Name.Length;
                    
Writer.WriteString(this._Nameindex 2this.SpawnPacket);
                }
            }
        }


______________________________________________________________________________________________________


 
public ushort X
        
{
            
get
            
{
                return 
this._x;
            }
            
set
            
{
                
this._x value;
                
Writer.WriteUInt16(value94this.SpawnPacket);
            }
        }


______________________________________________________________________________________________________

        
public ushort Y
        
{
            
get
            
{
                return 
this._y;
            }
            
set
            
{
                
this._y value;
                
Writer.WriteUInt16(value96this.SpawnPacket);
            }
        }

_______________________________________________________________________________________________________

public uint Hitpoints
        
{
            
get
            
{
                return 
this._hitpoints;
            }
            
set
            
{
                if (
this.EntityFlag == Conquer_Online_Server.Game.EntityFlag.Player)
                {
                    
this.Update(0valuefalse);
                }
                
this._hitpoints value;
                if (
this.Boss 0)
                {
                    
uint num this.MaxHitpoints 10000;
                    if (
num != 0)
                    {
                        
Writer.WriteUInt16((ushort)(value num), 86this.SpawnPacket);
                    }
                    else
                    {
                        
Writer.WriteUInt16((ushort)(((double)((value this.MaxHitpoints) / 1000)) / 1.09), 86this.SpawnPacket);
                    }
                }
                else
                {
                    
Writer.WriteUInt16((ushort)value86this.SpawnPacket);
                }
            }
        } 
02/19/2013 14:40 shadowman123#7
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 abdoumatrix#8
Quote:
Originally Posted by shadowman123 View Post
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:
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 shadowman123#9
Quote:
Originally Posted by abdoumatrix View Post
Is IT All >>>> Spawn Packets
PHP Code:
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 Super Aids#10
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 shadowman123#11
Quote:
Originally Posted by Super Aids View Post
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 :D

PHP Code:
public static void NewEntity(Entity TargetEntity client)
        {
            
byte[] Buffer;
            
byte Length w.e;
            
Buffer = new byte[Length];
            
Writer.WriteUInt16(Length0Buffer);
            
Writer.WriteUInt16(100142Buffer);
            
Writer.WriteUInt32(Target.Body4Buffer);
            
Writer.WriteUInt32(Target.UID8Buffer);
            
Writer.WriteUInt32(Target.GuildID12Buffer);
            
Writer.WriteUInt32(Target.GuildRank16Buffer);
            
Writer.WriteUInt32(Target.Hitpoints84Buffer);
            
Target.Owner.Equipment.SendAllEquips(client.Owner);
            
client.Owner.Send(Buffer);
        } 
02/19/2013 16:16 Super Aids#12
Quote:
Originally Posted by shadowman123 View Post
you mean using smthing like that :D

PHP Code:
public static void NewEntity(Entity TargetEntity client)
        {
            
byte[] Buffer;
            
byte Length w.e;
            
Buffer = new byte[Length];
            
Writer.WriteUInt16(Length0Buffer);
            
Writer.WriteUInt16(100142Buffer);
            
Writer.WriteUInt32(Target.Body4Buffer);
            
Writer.WriteUInt32(Target.UID8Buffer);
            
Writer.WriteUInt32(Target.GuildID12Buffer);
            
Writer.WriteUInt32(Target.GuildRank16Buffer);
            
Writer.WriteUInt32(Target.Hitpoints84Buffer);
            
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 shadowman123#13
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 Super Aids#14
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 teroareboss1#15
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