object PacketHelpers
- Source
- PSPacket.scala
- Alphabetic
- By Inheritance
- PacketHelpers
- 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
- 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 createEnumCodec[E <: EnumEntry](e: Enum[E], storageCodec: Codec[Int]): Codec[E]
Create a Codec for enumeratum's Enum type
- 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
- def createIntEnumCodec[E <: IntEnumEntry](e: IntEnum[E], storageCodec: Codec[Int]): Codec[E]
Create a Codec for enumeratum's IntEnum type
- 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)
- def createLongIntEnumCodec[E <: IntEnumEntry](e: IntEnum[E], storageCodec: Codec[Long]): Codec[E]
- def emptyCodec[T](instance: T): Codec[T]
Used in certain instances where Codec defintions are stubbed out
- def encodedString: Codec[String]
Codec for how PlanetSide represents strings on the wire
- 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
- 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)
- 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
- def encodedWideStringAligned(adjustment: Int): Codec[String]
Same as encodedWideString but with a bit alignment after the decoded size
- 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 hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- 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 normalListCodec
for a newAlignedListCodec
.Encode and decode a byte-aligned
List
.
This function is copied almost verbatim from its source, with exception of swapping the normalListCodec
for a newAlignedListCodec
.- 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 theList
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
- def listOfNSized[A](size: Long, codec: Codec[A]): Codec[List[A]]
Codec that encodes/decodes a list of
n
elements, wheren
is known at compile time.
This function is copied almost verbatim from its source, with exception of swapping the parameter that is normally aNat
literal
.Codec that encodes/decodes a list of
n
elements, wheren
is known at compile time.
This function is copied almost verbatim from its source, with exception of swapping the parameter that is normally aNat
literal
. The modified function takes a normal unsignedInteger
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
- 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()
- 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. DecodingCodec[A]
from the input vector emits a value but reverts to the prior read position. EncodingCodec[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 astarget
but resets the contents of the vector as ifCodec
were never applied
- See also
scodec.codecs.peek
orcodecs/package.scala:peek
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- val utf16: Codec[String]
Variable for the charset that PlanetSide uses for unicode (2 byte unicode)
- 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()