mirror of
https://github.com/2revoemag/PSF-BotServer.git
synced 2026-01-19 18:14:44 +00:00
activating case for extra parameter now that a method is available
This commit is contained in:
parent
38a4e128b6
commit
3cfa08b3cb
|
|
@ -31,11 +31,14 @@ import scodec.codecs._
|
|||
* @param player_guid the player GUID
|
||||
* @param item_guid the item GUID
|
||||
* @param dest a codified location within the player's inventory see above
|
||||
* //@param extra optional; a special kind of item manipulation; the common one is `FA`
|
||||
* @param extra optional; a special kind of item manipulation; the common one is `FA`
|
||||
* @see MoveItemMessage
|
||||
* @see ObjectAttachMessage
|
||||
*/
|
||||
final case class ObjectAttachMessage(player_guid : PlanetSideGUID,
|
||||
item_guid : PlanetSideGUID,
|
||||
dest : Int)
|
||||
dest : Int,
|
||||
extra : Option[Int])
|
||||
extends PlanetSideGamePacket {
|
||||
type Packet = ObjectAttachMessage
|
||||
def opcode = GamePacketOpcode.ObjectAttachMessage
|
||||
|
|
@ -43,18 +46,11 @@ final case class ObjectAttachMessage(player_guid : PlanetSideGUID,
|
|||
}
|
||||
|
||||
object ObjectAttachMessage extends Marshallable[ObjectAttachMessage] {
|
||||
// implicit val codec : Codec[ObjectAttachMessage] = (
|
||||
// ("player_guid" | PlanetSideGUID.codec) ::
|
||||
// ("item_guid" | PlanetSideGUID.codec) >>:~ { _ =>
|
||||
// ("dest" | uint8L) >>:~ ( loc =>
|
||||
// conditional(loc == 0, "extra" | uint8L)
|
||||
// )
|
||||
// }
|
||||
// ).as[ObjectAttachMessage]
|
||||
|
||||
implicit val codec : Codec[ObjectAttachMessage] = (
|
||||
("player_guid" | PlanetSideGUID.codec) ::
|
||||
("item_guid" | PlanetSideGUID.codec) ::
|
||||
("dest" | uint8L)
|
||||
(("dest" | uint8L) >>:~ { loc =>
|
||||
conditional(loc == 0, "extra" | uint8L).hlist
|
||||
})
|
||||
).as[ObjectAttachMessage]
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue