mirror of
https://github.com/2revoemag/PSF-BotServer.git
synced 2026-03-24 22:39:07 +00:00
Packet: QuantityUpdateMessage
This commit is contained in:
parent
93fe7d6be8
commit
0bed8ce5b8
3 changed files with 51 additions and 1 deletions
|
|
@ -392,7 +392,7 @@ object GamePacketOpcode extends Enumeration {
|
|||
|
||||
// OPCODE 60
|
||||
case GenericCollisionMsg => noDecoder(opcode)
|
||||
case QuantityUpdateMessage => noDecoder(opcode)
|
||||
case QuantityUpdateMessage => game.QuantityUpdateMessage.decode
|
||||
case ArmorChangedMessage => noDecoder(opcode)
|
||||
case ProjectileStateMessage => noDecoder(opcode)
|
||||
case MountVehicleCargoMsg => noDecoder(opcode)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,29 @@
|
|||
// Copyright (c) 2016 PSForever.net to present
|
||||
package net.psforever.packet.game
|
||||
|
||||
import net.psforever.packet.{GamePacketOpcode, Marshallable, PacketHelpers, PlanetSideGamePacket}
|
||||
import scodec.Codec
|
||||
import scodec.codecs._
|
||||
|
||||
/**
|
||||
* Instructs client to update the quantity of an item when sent server to client.
|
||||
*
|
||||
* See also [[QuantityDeltaUpdateMessage]]
|
||||
*
|
||||
* @param item_guid the item to update
|
||||
* @param quantity the quantity to update the item to
|
||||
*/
|
||||
final case class QuantityUpdateMessage(item_guid : PlanetSideGUID,
|
||||
quantity : Int)
|
||||
extends PlanetSideGamePacket {
|
||||
type Packet = QuantityUpdateMessage
|
||||
def opcode = GamePacketOpcode.QuantityUpdateMessage
|
||||
def encode = QuantityUpdateMessage.encode(this)
|
||||
}
|
||||
|
||||
object QuantityUpdateMessage extends Marshallable[QuantityUpdateMessage] {
|
||||
implicit val codec : Codec[QuantityUpdateMessage] = (
|
||||
("item_guid" | PlanetSideGUID.codec) ::
|
||||
("quantity" | int32L)
|
||||
).as[QuantityUpdateMessage]
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue