# PSF-LoginServer - master - net.psforever.packet.PacketCoding
PSF - LoginServer - master - net.psforever.packet.PacketCoding
Keywords: PSF LoginServer master net.psforever.packet.PacketCoding

PSF-LoginServer - master < Back


# Packages

-  package root
  Definition Classes
    root
-  package net
  Definition Classes
    root
-  package psforever
  Definition Classes
    net
-  package packet
  Definition Classes
    psforever
-  package control
  Definition Classes
    packet
-  package crypto
  Definition Classes
    packet
-  package game
  Definition Classes
    packet
-  package reset
  Definition Classes
    packet
- ControlPacketOpcode
- CryptoPacketOpcode
- GamePacketOpcode
- Marshallable
- PacketCoding
- PacketHelpers
- PacketType
- PlanetSideControlPacket
- PlanetSideCryptoPacket
- PlanetSideGamePacket
- PlanetSidePacket
- PlanetSidePacketFlags
- PlanetSideResetSequencePacket
- ResetSequenceOpcode

o

net.psforever.packet

# PacketCoding

###

#### object PacketCoding

Source
  PacketCoding.scala

Linear Supertypes
AnyRef, Any

Ordering

1. Alphabetic
2. By Inheritance

Inherited

1. PacketCoding
2. AnyRef
3. Any

1. Hide All
2. Show All

Visibility

1. Public
2. Protected

### Type Members

1.  case class CryptoCoding (rc5EncryptionKey: Key, rc5DecryptionKey: Key, macEncryptionKey: ByteVector, macDecryptionKey: ByteVector) extends Product with Serializable

### Value Members

1.  final def !=(arg0: Any): Boolean
   Definition Classes
     AnyRef → Any
2.  final def ##: Int
   Definition Classes
     AnyRef → Any
3.  final def ==(arg0: Any): Boolean
   Definition Classes
     AnyRef → Any
4.  final val PLANETSIDE_MIN_PACKET_SIZE: Int(1)

   A lower bound on the packet size

5.  val RC5_BLOCK_SIZE: Int
6.  final def asInstanceOf[T0]: T0
   Definition Classes
     Any
7.  def clone(): AnyRef
   Attributes
     protected[lang]
   Definition Classes
     AnyRef
   Annotations
     @throws(classOf[java.lang.CloneNotSupportedException]) @native()
8.  def decodePacket(msg: ByteVector): Attempt[PlanetSidePacket]

   Transforms `ByteVector` data into a PlanetSide packet.

   Transforms `ByteVector` data into a PlanetSide packet. Similar to the `UnmarshalPacket` but it does not process packet headers. It supports `GamePacket` in exchange for not supporting `CryptoPacket` (like `UnMarshalPacket`). Mostly used in tests.

   msg

     raw, unencrypted packet

   returns

     `PlanetSidePacket`

   See also

     `UnMarshalPacket`

9.  def encodePacket(packet: PlanetSidePacket): Attempt[BitVector]

   Transform a `PlanetSidePacket` into its `BitVector` representation.

   Transform a `PlanetSidePacket` into its `BitVector` representation.

   packet

     the packet to encode

   returns

     a `BitVector` translated from the packet's data

10.  final def eq(arg0: AnyRef): Boolean
    Definition Classes
      AnyRef
11.  def equals(arg0: AnyRef): Boolean
    Definition Classes
      AnyRef → Any
12.  def finalize(): Unit
    Attributes
      protected[lang]
    Definition Classes
      AnyRef
    Annotations
      @throws(classOf[java.lang.Throwable])
13.  final def getClass(): Class[_ <: AnyRef]
    Definition Classes
      AnyRef → Any
    Annotations
      @native()
14.  def hashCode(): Int
    Definition Classes
      AnyRef → Any
    Annotations
      @native()
15.  final def isInstanceOf[T0]: Boolean
    Definition Classes
      Any
16.  def marshalPacket(packet: PlanetSidePacket, sequence: Option[Int] = None, crypto: Option[CryptoCoding] = None): 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

    sequence

      the packet's sequence number. Must be set for all non ControlPacket packets (but always for encrypted packets).

    crypto

      if set, encrypt final payload

    returns

      a `BitVector` translated from the packet's data

17.  final def ne(arg0: AnyRef): Boolean
    Definition Classes
      AnyRef
18.  final def notify(): Unit
    Definition Classes
      AnyRef
    Annotations
      @native()
19.  final def notifyAll(): Unit
    Definition Classes
      AnyRef
    Annotations
      @native()
20.  final def synchronized[T0](arg0: => T0): T0
    Definition Classes
      AnyRef
21.  def toString(): String
    Definition Classes
      AnyRef → Any
22.  def unmarshalPacket(msg: ByteVector, crypto: Option[CryptoCoding] = None, cryptoState: Type = CryptoPacketOpcode.Ignore): Attempt[(PlanetSidePacket, Option[Int])]

    Transforms `ByteVector` data into a PlanetSide packet.

    Transforms `ByteVector` data into a PlanetSide packet. Attempt to decode with an optional header and required payload. Does not decode into a `GamePacket`.

    msg

      the raw packet

    crypto

      CryptoCoding instance for packet decryption, if this is a encrypted 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`

23.  final def wait(): Unit
    Definition Classes
      AnyRef
    Annotations
      @throws(classOf[java.lang.InterruptedException])
24.  final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
      AnyRef
    Annotations
      @throws(classOf[java.lang.InterruptedException])
25.  final def wait(arg0: Long): Unit
    Definition Classes
      AnyRef
    Annotations
      @throws(classOf[java.lang.InterruptedException]) @native()

### Inherited from AnyRef

### Inherited from Any

### Ungrouped