public override void Read(IStarboundStream stream) { EntityId = stream.ReadSignedVLQ(); Death = stream.ReadBoolean(); Unknown = new byte[stream.Length - stream.Position]; stream.Read(Unknown, 0, (int)(stream.Length - stream.Position)); }
public override void Read(IStarboundStream stream) { CauseEntityId = stream.ReadSignedVLQ(); DamageN = DamageNotification.FromStream(stream); /* * TargetEntityId = stream.ReadSignedVLQ(); * PositionX = stream.ReadSignedVLQ() / 100; * PositionY = stream.ReadSignedVLQ() / 100; * Damage = stream.ReadSignedVLQ() / 100; * DamageKind = stream.ReadUInt8(); * DamageSourceKind = stream.ReadString(); * TargetMaterialKind = stream.ReadString(); * HitResultKind = stream.ReadUInt8(); */ }
public override void Read(IStarboundStream stream) { EntityId = stream.ReadSignedVLQ(); Unknown = stream.ReadToEnd(); }
public override void Read(IStarboundStream stream) { //Interaction = stream; EntityId = stream.ReadSignedVLQ(); }
public override void Read(IStarboundStream stream) { CausingEntityId = stream.ReadSignedVLQ(); TargetEntityId = stream.ReadSignedVLQ(); }
public static Entity FromStream(IStarboundStream stream) { EntityType et = (EntityType)stream.ReadUInt8(); byte[] storeData = stream.ReadUInt8Array(); Entity ent; if (et == EntityType.Projectile) { ProjectileEntity pent = new ProjectileEntity(); using (StarboundStream s = new StarboundStream(storeData)) { pent.Projectile = s.ReadString(); pent.Information = s.ReadVariant().Value as VariantDict; pent.Unknown1 = s.ReadUInt8Array(17); pent.ThrowerEntityId = s.ReadSignedVLQ(); pent.Unknown2 = s.ReadUInt8Array((int)(s.Length - s.Position)); } ent = pent; } else if (et == EntityType.Player) { PlayerEntity pent = new PlayerEntity(); using (StarboundStream s = new StarboundStream(storeData)) { /* * bool uuid = s.ReadBoolean(); * * if (uuid) * { */ byte[] uuidDat = s.ReadUInt8Array(16); pent.UUID = BitConverter.ToString(uuidDat, 0).Replace("-", "").ToLower(); //} } ent = pent; } else if (et == EntityType.Object) { ObjectEntity oent = new ObjectEntity(); using (StarboundStream s = new StarboundStream(storeData)) { oent.Object = s.ReadString(); oent.Information = s.ReadVariant(); oent.Unknown = s.ReadUInt8Array((int)(s.Length - s.Position)); } ent = oent; } else { ent = new Entity(); } ent.EntityType = et; ent.StoreData = storeData; ent.EntityId = stream.ReadSignedVLQ(); return(ent); }