Skip to content
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

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
Open

Incorporate server by CMorgue #1

wants to merge 15 commits into from

Conversation

Danjb1
Copy link
Owner

@Danjb1 Danjb1 commented Nov 3, 2019

No description provided.

Copy link
Owner Author

@Danjb1 Danjb1 left a 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>
Copy link
Owner Author

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?

Copy link
Collaborator

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.

Copy link
Owner Author

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;
Copy link
Owner Author

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 Show resolved Hide resolved
/**
* Saves the state of the world.
*/
public void onShutdown() {
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this ever called?

Copy link
Collaborator

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

rsc-server/src/org/openrsc/model/CommandHandler.java Outdated Show resolved Hide resolved
rsc-server/src/org/openrsc/net/codec/PacketDecoder.java Outdated Show resolved Hide resolved
buffer.writeInt(packet.getPacketLength());

// Write the packet opcode.
buffer.writeInt(packet.getOpcode() & 0xff);
Copy link
Owner Author

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?

Copy link

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;

Copy link
Owner Author

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
Copy link
Owner Author

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.

Copy link
Collaborator

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

rsc-server/src/org/openrsc/util/GameUtils.java Outdated Show resolved Hide resolved
rsc-server/src/org/openrsc/util/GameUtils.java Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants