Packages

o

net.psforever.packet

PacketHelpers

object PacketHelpers

Source
PSPacket.scala
Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. PacketHelpers
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

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 def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  6. def createEnumCodec[E <: EnumEntry](e: Enum[E], storageCodec: Codec[Int]): Codec[E]

    Create a Codec for enumeratum's Enum type

  7. def createEnumerationCodec[E <: Enumeration](e: E, storageCodec: Codec[Int]): Codec[PacketHelpers.createEnumerationCodec.E.Value]

    Create a Codec for an enumeration type that can correctly represent its value

    Create a Codec for an enumeration type that can correctly represent its value

    E

    The inferred type

    e

    the enumeration type to create a codec for

    storageCodec

    the Codec used for actually representing the value

    returns

    Generated codec

  8. def createIntEnumCodec[E <: IntEnumEntry](e: IntEnum[E], storageCodec: Codec[Int]): Codec[E]

    Create a Codec for enumeratum's IntEnum type

  9. def createLongEnumerationCodec[E <: Enumeration](e: E, storageCodec: Codec[Long]): Codec[PacketHelpers.createLongEnumerationCodec.E.Value]

    Same as createEnumerationCodec but with a Codec type of Long

    Same as createEnumerationCodec but with a Codec type of Long

    NOTE: enumerations in scala can't be represented by more than an Int anyways, so this conversion shouldn't matter. This is only to overload createEnumerationCodec to work with uint32[L] codecs (which are Long)

  10. def createLongIntEnumCodec[E <: IntEnumEntry](e: IntEnum[E], storageCodec: Codec[Long]): Codec[E]
  11. def emptyCodec[T](instance: T): Codec[T]

    Used in certain instances where Codec defintions are stubbed out

  12. def encodedString: Codec[String]

    Codec for how PlanetSide represents strings on the wire

  13. def encodedStringAligned(adjustment: Int): Codec[String]

    Same as encodedString but with a bit adjustment

    Same as encodedString but with a bit adjustment

    This comes in handy when a PlanetSide string is decoded on a non-byte boundary. The PlanetSide client will byte align after decoding the string lenght, but BEFORE the string itself. Scodec doesn't like this variability and there doesn't appear to be a way to fix this issue.

    adjustment

    The adjustment amount in bits

    returns

    Generated string decoding codec with adjustment

  14. def encodedStringSize: Codec[Int]

    Common codec for how PlanetSide stores string sizes

    Common codec for how PlanetSide stores string sizes

    When the first bit of the byte is set, the size can be between [0, 127]. Otherwise, it is between [128, 32767] and two bytes are used for encoding. The magic in this is next level (read as: SCodec makes things hard to understand)

  15. def encodedWideString: Codec[String]

    Common codec for PlanetSide wchar_t strings (wide strings, UTF-16)

    Common codec for PlanetSide wchar_t strings (wide strings, UTF-16)

    An encoded *wide* string is twice the length of the given encoded size and half of the length of the input string. We use xmap to transform the encodedString codec as this change is just a division and multiply

  16. def encodedWideStringAligned(adjustment: Int): Codec[String]

    Same as encodedWideString but with a bit alignment after the decoded size

  17. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  18. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  19. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  20. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  21. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  22. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  23. def listOfNAligned[A](countCodec: Codec[Long], alignment: Int, valueCodec: Codec[A]): Codec[List[A]]

    Encode and decode a byte-aligned List.

    This function is copied almost verbatim from its source, with exception of swapping the normal ListCodec for a new AlignedListCodec.

    Encode and decode a byte-aligned List.

    This function is copied almost verbatim from its source, with exception of swapping the normal ListCodec for a new AlignedListCodec.

    A

    the type of the List contents

    countCodec

    the codec that represents the prefixed size of the List

    alignment

    the number of bits padded between the List size and the List contents

    valueCodec

    a codec that describes each of the contents of the List

    returns

    a codec that works on a List of A

    See also

    codec\package.scala, listOfN

  24. def listOfNSized[A](size: Long, codec: Codec[A]): Codec[List[A]]

    Codec that encodes/decodes a list of n elements, where n is known at compile time.

    This function is copied almost verbatim from its source, with exception of swapping the parameter that is normally a Nat literal.

    Codec that encodes/decodes a list of n elements, where n is known at compile time.

    This function is copied almost verbatim from its source, with exception of swapping the parameter that is normally a Nat literal. The modified function takes a normal unsigned Integer and assures that the parameter is non-negative before further processing.

    A

    the type of the List contents

    size

    the known size of the List

    codec

    a codec that describes each of the contents of the List

    returns

    a codec that works on a List of A but excludes the size from the encoding

    See also

    codec\package.scala, sizedList

    codec\package.scala, listOfN

    codec\package.scala, provides

  25. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  26. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  27. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  28. def peek[A](target: Codec[A]): Codec[A]

    A peek that decodes like the normal but encodes nothing.

    A peek that decodes like the normal but encodes nothing. Decoding Codec[A] from the input vector emits a value but reverts to the prior read position. Encoding Codec[A] to the input vector appends no new data to the input vector. In effect, peek is a harmless meta-Codec that processes a value and introduces no changes to the input/output vector.

    target

    codec that decodes the value

    returns

    Codec that behaves the same as target but resets the contents of the vector as if Codec were never applied

    See also

    scodec.codecs.peek or codecs/package.scala:peek

  29. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  30. def toString(): String
    Definition Classes
    AnyRef → Any
  31. val utf16: Codec[String]

    Variable for the charset that PlanetSide uses for unicode (2 byte unicode)

  32. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  33. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  34. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()

Inherited from AnyRef

Inherited from Any

Ungrouped