mirror of
https://github.com/2revoemag/PSF-BotServer.git
synced 2026-03-25 06:49:07 +00:00
clarifying field names; updating comments; adding match cases in WSA
This commit is contained in:
parent
0b0507617a
commit
08f9f6a75f
3 changed files with 39 additions and 18 deletions
|
|
@ -7,26 +7,44 @@ import scodec.Codec
|
|||
import scodec.codecs._
|
||||
|
||||
/**
|
||||
* Dispatched from the server to render the projectiles of one player's weapon on other players' clients.
|
||||
* Dispatched to deliberately render certain projectiles of a weapon on other players' clients.<br>
|
||||
* <br>
|
||||
* This packet is generated by firing specific weapons in specific fire modes.
|
||||
* For example, the Phoenix (`hunterseeker`) discharged in its primary fire mode generates this packet;
|
||||
* but, the Phoenix in secondary fire mode does not.
|
||||
* The Striker (`striker`) discharged in its primary fire mode generates this packet;
|
||||
* but, the Striker in secondary fire mode does not.
|
||||
* The chosen fire mode(s) are not a straight-fire projectile but one that has special control asserted over it.
|
||||
* For the Phoenix, it is user-operated.
|
||||
* For the Striker, it tracks towards a target while the weapon's reticle hovers over that target.<br>
|
||||
* <br>
|
||||
* This packet will continue to be dispatched by the client for as long as the projectile being tracked is in the air.
|
||||
* All projectiles have a maximum lifespan before they will lose control and either despawn and/or explode.
|
||||
* This number is tracked in the packet for simplicity.
|
||||
* If the projectile strikes a valid target, the count will jump to a significantly enormous value beyond its normal lifespan.
|
||||
* This ensures that the projectile - locally and the shared model - will despawn.
|
||||
* @param projectile_guid the projectile
|
||||
* @param shot_origin a spawning position for the projectile
|
||||
* @param shot_vector a directional heading for the projectile
|
||||
* @param shot_pos the position of the projectile
|
||||
* @param shot_vel the velocity of the projectile
|
||||
* @param unk1 na;
|
||||
* usually 0
|
||||
* @param unk2 na
|
||||
* @param unk3 na
|
||||
* @param unk2 na;
|
||||
* will remain consistent for the lifespan of a given projectile in most cases
|
||||
* @param unk3 na;
|
||||
* will remain consistent for the lifespan of a given projectile in most cases
|
||||
* @param unk4 na;
|
||||
* usually false
|
||||
* @param unk5 na
|
||||
* @param time_alive how long the projectile has been in the air;
|
||||
* often expressed in multiples of 2
|
||||
*/
|
||||
final case class ProjectileStateMessage(projectile_guid : PlanetSideGUID,
|
||||
shot_origin : Vector3,
|
||||
shot_vector : Vector3,
|
||||
shot_pos : Vector3,
|
||||
shot_vel : Vector3,
|
||||
unk1 : Int,
|
||||
unk2 : Int,
|
||||
unk3 : Int,
|
||||
unk4 : Boolean,
|
||||
unk5 : Int)
|
||||
time_alive : Int)
|
||||
extends PlanetSideGamePacket {
|
||||
type Packet = ProjectileStateMessage
|
||||
def opcode = GamePacketOpcode.ProjectileStateMessage
|
||||
|
|
@ -36,12 +54,12 @@ final case class ProjectileStateMessage(projectile_guid : PlanetSideGUID,
|
|||
object ProjectileStateMessage extends Marshallable[ProjectileStateMessage] {
|
||||
implicit val codec : Codec[ProjectileStateMessage] = (
|
||||
("projectile_guid" | PlanetSideGUID.codec) ::
|
||||
("shot_origin" | Vector3.codec_pos) ::
|
||||
("shot_vector" | Vector3.codec_float) ::
|
||||
("shot_pos" | Vector3.codec_pos) ::
|
||||
("shot_vel" | Vector3.codec_float) ::
|
||||
("unk1" | uint8L) ::
|
||||
("unk2" | uint8L) ::
|
||||
("unk3" | uint8L) ::
|
||||
("unk4" | bool) ::
|
||||
("unk5" | uint16L)
|
||||
("time_alive" | uint16L)
|
||||
).as[ProjectileStateMessage]
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue