object PacketCoding
- Source
- PacketCoding.scala
- Alphabetic
- By Inheritance
- PacketCoding
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def CreateControlPacket(packet: PlanetSideControlPacket): ControlPacket
Access to the
ControlPacketconstructor.Access to the
ControlPacketconstructor.- packet
a
PlanetSideControlPacket- returns
a
ControlPacket
- def CreateCryptoPacket(sequence: Int, packet: PlanetSideCryptoPacket): CryptoPacket
Access to the
CryptoPacketconstructor.Access to the
CryptoPacketconstructor.- sequence
na
- packet
a
PlanetSideCryptoPacket- returns
a
CryptoPacket
- def CreateGamePacket(sequence: Int, packet: PlanetSideGamePacket): GamePacket
Access to the
GamePacketconstructor.Access to the
GamePacketconstructor.- sequence
na
- packet
a
PlanetSideGamePacket- returns
a
GamePacket
- def DecodeControlPacket(msg: ByteVector): Attempt[PlanetSideControlPacket]
Transform a
ByteVectorinto aControlPacket.Transform a
ByteVectorinto aControlPacket.- msg
the the raw data to decode
- returns
a
PlanetSideControlPacket
- def DecodeGamePacket(msg: ByteVector): Attempt[PlanetSideGamePacket]
Transform a
ByteVectorinto aGamePacket.Transform a
ByteVectorinto aGamePacket.- msg
the the raw data to decode
- returns
a
PlanetSideGamePacket
- def DecodePacket(msg: ByteVector): Attempt[PlanetSidePacket]
Transforms
ByteVectordata into a PlanetSide packet.Transforms
ByteVectordata into a PlanetSide packet. Similar to theUnmarshalPacketbut it does not process packet headers. It supportsGamePacketin exchange for not supportingCryptoPacket(likeUnMarshalPacket). Mostly used in tests.- msg
raw, unencrypted packet
- returns
PlanetSidePacket
- See also
UnMarshalPacket
- def EncodePacket(packet: PlanetSideGamePacket): Attempt[BitVector]
Overloaded method for transforming a
GamePacketinto itsBitVectorrepresentation.Overloaded method for transforming a
GamePacketinto itsBitVectorrepresentation.- packet
the game packet to encode
- returns
a
BitVectortranslated from the packet's data
- def EncodePacket(packet: PlanetSideCryptoPacket): Attempt[BitVector]
Overloaded method for transforming a
CryptoPacketinto itsBitVectorrepresentation.Overloaded method for transforming a
CryptoPacketinto itsBitVectorrepresentation.- packet
the crypto packet to encode
- returns
a
BitVectortranslated from the packet's data
- def EncodePacket(packet: PlanetSideControlPacket): Attempt[BitVector]
Overloaded method for transforming a
ControlPacketinto itsBitVectorrepresentation.Overloaded method for transforming a
ControlPacketinto itsBitVectorrepresentation.- packet
the control packet to encode
- returns
a
BitVectortranslated from the packet's data
- def MarshalPacket(packet: PlanetSidePacketContainer): Attempt[BitVector]
Transform a kind of packet into the sequence of data that represents it.
Transform a kind of packet into the sequence of data that represents it. Wraps around the encoding process for all valid packet container types.
- packet
the packet to encode
- returns
a
BitVectortranslated from the packet's data
- final val PLANETSIDE_MIN_PACKET_SIZE: Int(1)
A lower bound on the packet size
- def UnmarshalPacket(msg: ByteVector): Attempt[PlanetSidePacketContainer]
Helper function to decode a packet without specifying a crypto state.
Helper function to decode a packet without specifying a crypto state. Used when there is no crypto state available such as in tests.
- msg
packet data bytes
- returns
PlanetSidePacketContainer
- def UnmarshalPacket(msg: ByteVector, cryptoState: Type): Attempt[PlanetSidePacketContainer]
Transforms
ByteVectordata into a PlanetSide packet.Transforms
ByteVectordata into a PlanetSide packet. Attempt to decode with an optional header and required payload. Does not decode into aGamePacket.- msg
the raw packet
- cryptoState
the current state of the connection's crypto. This is only used when decoding crypto packets as they do not have opcodes
- returns
PlanetSidePacketContainer
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def decryptPacket(crypto: CryptoStateWithMAC, packet: EncryptedPacket): Attempt[PlanetSidePacketContainer]
Perform decryption on an
EncryptedPacket.Perform decryption on an
EncryptedPacket.- crypto
the current state of the connection's crypto
- packet
an encrypted packet
- returns
a general packet container type
- def decryptPacketData(crypto: CryptoStateWithMAC, packet: EncryptedPacket): Attempt[ByteVector]
Compose the decrypted payload data from a formerly encrypted packet.
Compose the decrypted payload data from a formerly encrypted packet.
- crypto
the current state of the connection's crypto
- packet
an encrypted packet
- returns
a sequence of decrypted data
- def encryptPacket(crypto: CryptoStateWithMAC, sequenceNumber: Int, rawPacket: ByteVector): Attempt[EncryptedPacket]
Perform encryption on the packet's raw data.
Perform encryption on the packet's raw data.
- crypto
the current cryptographic state
- sequenceNumber
na
- rawPacket
a
ByteVectorthat represents the packet data- returns
an
EncryptedPacket
- def encryptPacket(crypto: CryptoStateWithMAC, packet: PlanetSidePacketContainer): Attempt[EncryptedPacket]
Encrypt the provided packet using the provided cryptographic state.
Encrypt the provided packet using the provided cryptographic state. Translate the packet into data to send on to the actual encryption process.
- crypto
the current cryptographic state
- packet
the unencrypted packet
- returns
an
EncryptedPacket
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def getPacketDataForEncryption(packet: PlanetSidePacketContainer): Attempt[(Int, ByteVector)]
Transform the privileged
packetinto aRawPacketrepresentation to get: the sequence number, and the rawByteVectordata.Transform the privileged
packetinto aRawPacketrepresentation to get: the sequence number, and the rawByteVectordata.- packet
the unencrypted packet
- returns
paired data based on the packet
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def makeRawPacket(packet: PlanetSidePacketContainer): Attempt[BitVector]
Transform either a
GamePacketor aControlPacketinto aBitVector.Transform either a
GamePacketor aControlPacketinto aBitVector. This is not as thorough as the process of unmarshalling though the results are very similar.- packet
a packet
- returns
a
BitVectorthat represents the packet
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- def unmarshalPayload(sequenceNumber: Int, payload: ByteVector): Attempt[PlanetSidePacketContainer]
Transform decrypted packet data into the type of packet that it represents.
Transform decrypted packet data into the type of packet that it represents. Will not compose data into an
EncryptedPacketor into aCryptoPacket.- sequenceNumber
na
- payload
the decrypted packet data
- returns
a general packet container type
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()