-
Notifications
You must be signed in to change notification settings - Fork 9
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
Incorporate server by CMorgue #1
base: master
Are you sure you want to change the base?
Conversation
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.
Hey man - I know I've left a lot of comments, but I'm seriously impressed! This is looking great. I can't believe how much you've implemented already.
A lot of my comments are just minor formatting changes or me trying to understand the code, but overall it looks really good. We should be able to merge this real soon.
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"> | ||
<attributes> | ||
<attribute name="module" value="true"/> | ||
</attributes> |
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.
What's this new attribute?
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 no clue. I didn't edit the .classpath file at all. It had to be automated by some software.
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.
Can we revert this change?
/** | ||
* The maximum number of connections per address. | ||
*/ | ||
public static final int CONNECTION_LIMIT = 3; |
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.
Seems you've got a mix of tabs and spaces - can we stick with 4 spaces for indentation?
rsc-server/src/org/openrsc/Main.java
Outdated
/** | ||
* Saves the state of the world. | ||
*/ | ||
public void onShutdown() { |
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.
Is this ever called?
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.
Not yet, I've gotta tie a few things together still. I'll do it right now
buffer.writeInt(packet.getPacketLength()); | ||
|
||
// Write the packet opcode. | ||
buffer.writeInt(packet.getOpcode() & 0xff); |
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 do we need this bitwise operator?
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 prevent the opcode value overflowing 1 byte size
Example:
https://gist.github.com/acrois/e2291313c249837148adb477bd186b29
The question is, does this value need to be limited to 0-255 because it is being sent across the wire using 4 bytes? The PacketDecoder is working in the same fashion, to prevent the opcode value being larger than 255.
From PacketDecoder.java:
// Read the opcode.
final int opcode = buffer.readInt() & 0xff;
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.
Hey @acrois, thanks for your comment! I've rolled back this server for now while I focus on the client, as CMorgue has moved onto other projects.
|
||
/** | ||
* A task which executes a group of tasks in a guaranteed sequence. | ||
* @author Graham Edgecombe |
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.
Where did this come from? Can we link to the source? Same for the other tasks.
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.
The task engine was pulled from Hyperion, and adjusted to suit the project. Credits were left in each class
No description provided.