mirror of
https://github.com/2revoemag/PSF-BotServer.git
synced 2026-07-14 16:04:41 +00:00
activating case for extra parameter now that a method is available
This commit is contained in:
parent
38a4e128b6
commit
3cfa08b3cb
1 changed files with 8 additions and 12 deletions
|
|
@ -31,11 +31,14 @@ import scodec.codecs._
|
||||||
* @param player_guid the player GUID
|
* @param player_guid the player GUID
|
||||||
* @param item_guid the item GUID
|
* @param item_guid the item GUID
|
||||||
* @param dest a codified location within the player's inventory see above
|
* @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,
|
final case class ObjectAttachMessage(player_guid : PlanetSideGUID,
|
||||||
item_guid : PlanetSideGUID,
|
item_guid : PlanetSideGUID,
|
||||||
dest : Int)
|
dest : Int,
|
||||||
|
extra : Option[Int])
|
||||||
extends PlanetSideGamePacket {
|
extends PlanetSideGamePacket {
|
||||||
type Packet = ObjectAttachMessage
|
type Packet = ObjectAttachMessage
|
||||||
def opcode = GamePacketOpcode.ObjectAttachMessage
|
def opcode = GamePacketOpcode.ObjectAttachMessage
|
||||||
|
|
@ -43,18 +46,11 @@ final case class ObjectAttachMessage(player_guid : PlanetSideGUID,
|
||||||
}
|
}
|
||||||
|
|
||||||
object ObjectAttachMessage extends Marshallable[ObjectAttachMessage] {
|
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] = (
|
implicit val codec : Codec[ObjectAttachMessage] = (
|
||||||
("player_guid" | PlanetSideGUID.codec) ::
|
("player_guid" | PlanetSideGUID.codec) ::
|
||||||
("item_guid" | PlanetSideGUID.codec) ::
|
("item_guid" | PlanetSideGUID.codec) ::
|
||||||
("dest" | uint8L)
|
(("dest" | uint8L) >>:~ { loc =>
|
||||||
|
conditional(loc == 0, "extra" | uint8L).hlist
|
||||||
|
})
|
||||||
).as[ObjectAttachMessage]
|
).as[ObjectAttachMessage]
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue