-
Notifications
You must be signed in to change notification settings - Fork 141
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OSRS Integration #473
base: kotlin-experiments
Are you sure you want to change the base?
OSRS Integration #473
Conversation
Related to #472. |
…t.xml file has duplicates in it.
Renamed XteaDecoder.java to XteaParser.java Added XteaUtil which decrypts/encrypts a ByteBuf with Xtea rounds. Added UserStats which details the incoming connection's hardware specs.
Added user stats to the credentials to replace uid.
Resolved issue with Crc check being invalid due to index sixteen being manually zeroed over the wire by Jagex.
… someone decides how to move forward with a multi-world impl.
… someone decides how to move forward with a multi-world impl.
Added the following decode messages: Add/Remove Ignores&Friends, Private Chat Messages.
Report abuse decoder. Keepalive decoder. Walk decoder. Arrowkey decoder. Close interface decoder. Amount input decoder. Removed 317 rev and 377 to follow soon. Note: You may need to exclude the 377 directory manually.
Object options decoders.
… organized but if anyone has suggestions I will gladly listen.
… organized but if anyone has suggestions I will gladly listen.
…ws-1252 characters. More decoding messages, have these remaining so far: ButtonMessageDecoder DialogueContinueMessageDecoder FlaggedMouseEventMessageDecoder ItemOnItemMessageDecoder ItemOnNpcMessageDecoder ItemOnObjectMessageDecoder SwitchItemMessageDecoder TakeTileItemMessageDecoder MagicOnItemMessageDecoder MagicOnNpcMessageDecoder MagicOnPlayerMessageDecoder FirstItemOptionMessageDecoder SecondItemOptionMessageDecoder ThirdItemOptionMessageDecoder FourthItemOptionMessageDecoder FifthItemOptionMessageDecoder PlayerDesignMessageDecoder PublicChatMessageDecoder Doesn't exist anymore: FlashingTabClickedMessageDecoder FirstItemActionMessageDecoder SecondItemActionMessageDecoder ThirdItemActionMessageDecoder FourthItemActionMessageDecoder FifthItemActionMessageDecoder
NPCS are complete w/o masks.
EnumDefinition.java support for OSRS Enums. DisplayStatusMessage has been supported (The ability to switch the display mode).
Standard named for id << component should be packedInterface. Added IfSetEventMessage encoder.
Added KeepAliveMessageDecoder message.
Directions have client rotations now.
PublicChatDecoder updated. Public chat is now working.
Fixes issue where we send amount when item is being removed in UpdateContainerPartialMessageEncoder
Moved equipment handler to an IfActionMessage
Half of social stuff done, adding friends communication between them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a first pass to get rid of the code churn in this PR so I can review the actual code changes. We need to get rid of the commit that deletes the Ruby and the commits that optimize imports and I think this will be easier to review.
@@ -5,6 +5,10 @@ description = 'Apollo Cache' | |||
dependencies { | |||
implementation project(':util') | |||
implementation group: 'com.google.guava', name: 'guava', version: guavaVersion | |||
implementation group: 'org.tukaani', name: 'xz', version: '1.8' | |||
implementation group: 'it.unimi.dsi', name: 'fastutil', version: '8.3.1' | |||
implementation group: 'org.apache.ant', name: 'ant', version: '1.10.7' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we depending on ant?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I forget.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So... can it be removed?
cache/build.gradle
Outdated
implementation group: 'org.tukaani', name: 'xz', version: '1.8' | ||
implementation group: 'it.unimi.dsi', name: 'fastutil', version: '8.3.1' | ||
implementation group: 'org.apache.ant', name: 'ant', version: '1.10.7' | ||
implementation group: 'com.google.code.gson', name: 'gson', version: '2.8.6' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd recommend using Jackson instead of Gson.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, no difference to me.
|
||
import org.apollo.cache.IndexedFileSystem; | ||
import org.apollo.cache.archive.Archive; | ||
import it.unimi.dsi.fastutil.ints.Int2ObjectArrayMap; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use standard collections instead of these fastutil
collections. We optimize on a case by case basis, not generally like this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's fine. I'll get rid of it.
definition.setF2117(buffer.readUShort()); | ||
definition.setF2118(buffer.readUByte()); | ||
} else if (opcode == 79) { | ||
definition.setF2119(buffer.readUShort()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If a field is unknown we don't assign it to unused fields, instead we just skip the data.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be faaaaaaaiiiiiiir I c&p this out of my cache editor. But i'll get rid of them.
game/data/messages.xml
Outdated
@@ -1,26 +1,41 @@ | |||
<messages> | |||
<message> | |||
<type>org.apollo.game.message.impl.ButtonMessage</type> | |||
<type>org.apollo.game.message.impl.decode.IfActionMessage</type> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These class names aren't descriptive. They need to have meaningful names without abbreviations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's the actual name Jagex use., I prefer it but I can see how it's not descriptive. I'll change it back.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's the actual name Jagex use
This is a fairly tired argument. A lot of what Jagex done is garbage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not disagreeing, I'm just explaining the decision.
import java.util.concurrent.Executors; | ||
import java.util.concurrent.Future; | ||
import java.util.concurrent.TimeUnit; | ||
import java.util.concurrent.*; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You've ran IntelliJ's "optimize imports" function over the code, this isn't the place to be doing that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have it set to auto do it. Sorry.
if (player.getInterfaceSet().contains(BankConstants.BANK_WINDOW_ID)) { | ||
if (message.getInterfaceId() == BankConstants.SIDEBAR_INVENTORY_ID) { | ||
if (player.getInterfaceSet().contains(BankConstants.WINDOW_ID)) { | ||
//if (message.getInterfaceId() == BankConstants.SIDEBAR_INVENTORY_ID) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Odd code here. Why is this commented out?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Honestly I don't remember. All interfaces have to be redone regardless.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@garyttierney It's because the interface doesn't exist anymore. I've removed it entirely now.
world.writeByte(0); // country | ||
world.writeShort(2000);// number of players | ||
return world; | ||
private ByteBuffer createWorld() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we actually need this to get login working?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Client freezes without it when clicked on by mistake.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, then I'd be inclined to make it return real data. cc @Major-
/** | ||
* The type Op item message. | ||
*/ | ||
public class OpItemMessage extends Message { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Naming needs reverted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reverted to what exactly? Apollo never had ground items.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then pick something sensible that isn't nonsense like OpItem
.
game/src/main/java/org/apollo/game/model/area/update/UpdateOperation.java
Show resolved
Hide resolved
game/src/main/java/org/apollo/game/release/r181/decoders/EventKeyboardDecoder.java
Outdated
Show resolved
Hide resolved
* | ||
* @param buffer the buffer | ||
*/ | ||
public UserStats(ByteBuf buffer) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A constructor isn't the place to be reading from a byte buffer. Create a static constructor and make it clear that the buffer is consumed.
net/src/main/java/org/apollo/net/codec/update/OnDemandResponseEncoder.java
Outdated
Show resolved
Hide resolved
net/src/main/java/org/apollo/net/codec/update/OnDemandResponseEncoder.java
Outdated
Show resolved
Hide resolved
net/src/main/java/org/apollo/net/codec/update/OnDemandResponseEncoder.java
Outdated
Show resolved
Hide resolved
game/src/main/java/org/apollo/game/release/r181/decoders/EventKeyboardDecoder.java
Outdated
Show resolved
Hide resolved
@@ -724,7 +735,8 @@ public void send(Message message) { | |||
* Sends the initial messages. | |||
*/ | |||
public void sendInitialMessages(DisplayMode mode) { | |||
send(new RebuildNormalMessage(position, index, world.getRegionRepository().getXteaRepository(), false)); | |||
send(new RebuildNormalMessage(position, index, updateInfo, world.getPlayerRepository(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an odd way to pass data for initialization, cc @Major-, we need to look at setting up player "pre-init" code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wasn't sure how to pass it around. You could do everything with a single player reference but I tried to keep it consistent with how other things are done.
*/ | ||
private static final int MAXIMUM_LOCAL_PLAYERS = 255; | ||
private void prefetch() { | ||
limitedPlayers.clear(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like this is an approximation of:
for (Player updatingPlayer : playersToUpdate) {
for (Region region : regions) {
for (Player candidate: regions.getPlayers()) {
// test
}
}
}
is that right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's not exactly correct.
for (Region region : regions) {
for (Player candidate: regions.getPlayers()) {
// test
}
}
Is more what it is like in that function. If you're referring to what it does for every player combined,, then yes.
@@ -5,6 +5,10 @@ description = 'Apollo Cache' | |||
dependencies { | |||
implementation project(':util') | |||
implementation group: 'com.google.guava', name: 'guava', version: guavaVersion | |||
implementation group: 'org.tukaani', name: 'xz', version: '1.8' | |||
implementation group: 'it.unimi.dsi', name: 'fastutil', version: '8.3.1' | |||
implementation group: 'org.apache.ant', name: 'ant', version: '1.10.7' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So... can it be removed?
Softagram Impact Report for pull/473 (head commit: ba35a57)
|
Start of the potential move to OSRS.