Polar posting about these recently in Discord jogged my memory that I'd
missed this flag off, previously I called this FLAG_HIGHLIGHT.
I've also added the official Jagex names to the documentation, thanks to
Polar.
I don't think 550 supports any of the flags after DEDICATEDACTIVITY.
Signed-off-by: Graham <gpe@openrs2.org>
It's now used for both XTEA and ISAAC keys, and there's nothing
XTEA-specific about it so there's no need to duplicate it.
Signed-off-by: Graham <gpe@openrs2.org>
I'm currently working on a CreateResponse class, which is even more
distinct from LoginResponse - so I've decided to separate it. For
consistency, separating the JS5 login responses seems sensible too.
Signed-off-by: Graham <gpe@openrs2.org>
The client's UI makes it easy to submit invalid dates not supported by
LocalDate. Rather than throwing an exception in a codec, it'd be good to
support representing these for:
* Allowing the development of a debugging proxy server that sits between
the client and game server.
* Making it easier to send the invalid date of birth response to the
creation request.
We'll still switch to LocalDate as early as possible in the packet
handler in the future.
Signed-off-by: Graham <gpe@openrs2.org>
There are now three additional abstract PacketCodec classes:
FixedPacketCodec, VariableBytePacketCodec and VariableShortPacketCodec.
The PacketLength class has been removed, as it is no longer required.
The main reason for this change is that the create suggested names
packet is a bit of an oddball: its length field measures the size of the
packet in longs, not bytes. The codec for this packet will be able to
inherit from PacketCodec directly to implement the custom length logic.
Signed-off-by: Graham <gpe@openrs2.org>
I've also removed the comment - I'm going to have to do something
similar for CREATE_DOWNSTREAM, and I think it's a bit more obvious with
the more distinctive name.
This allows us to deal with a single corner case of the same opcode
being used for two slightly different login response packets, depending
on the request.
In some cases the capacity would be one byte greater than necessary.
I've added a comment explaining why the calculation works and a unit
test that ensures it is calculated correctly for all lengths between 1
and 511*3+1 bytes.
Signed-off-by: Graham <gpe@openrs2.org>
It's more concise and I suspect Kotlin's implementation is better than
Java's, as it seems to take available() into account.
Signed-off-by: Graham <gpe@openrs2.org>
Excluding the 0xFF trailers, the first block is actually 512 bytes, and
the remaining blocks are all 511 bytes. I had mistakenly written the
code and tests on the basis of all blocks being 511 bytes.
The Js5ResponseDecoder now works with OSRS.
Signed-off-by: Graham <gpe@openrs2.org>