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

Fixing select agent in drawing protocol where the second byte of the … #42

Merged
merged 2 commits into from
Jun 1, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion src/rv/comm/drawing/commands/Control.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package rv.comm.drawing.commands;

import java.nio.ByteBuffer;
import js.io.ByteUtil;
import rv.Viewer;
import rv.world.objects.Agent;

Expand All @@ -13,7 +14,17 @@ public class Control extends Command {
public Control(ByteBuffer buf, Viewer viewer) {
super();
this.viewer = viewer;
agent = Command.readAgent(buf, viewer.getWorldModel());

int type = ByteUtil.uValue(buf.get());

switch (type) {
case AGENT_SELECT:
agent = Command.readAgent(buf, viewer.getWorldModel());
break;
default:
System.err.println("Unknown control : " + type);
agent = null;
}
}

@Override
Expand Down