diff --git a/CHANGELOG.md b/CHANGELOG.md index 374e99e4..e45d77f8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -80,7 +80,8 @@ * logfiles are now saved in a `logfiles/` subdirectory * more helpful "disconnected" overlay in live mode (displays server IP and port) * major improvements to the behavior of windows with multi-monitor setups (among other things, dialogs are now displayed relative the the main window as opposed to always being on the primiary monitor) - * added a way to select players with the drawing API + * added a select players command to the drawing API: `| 3 | 0 | Agent/Team |` + * the swap buffers command now prints an error when the second byte does not equal 0 instead of ignoring it, making the behavior consistent with the rest of the drawing API * added a black outline for the player numbers texts * moved `config.txt` out of `resources/` into the root directory for easier access * moved build scripts to the `scripts/` subdirectory diff --git a/src/rv/comm/drawing/commands/DrawOption.java b/src/rv/comm/drawing/commands/DrawOption.java index 2bd4a5b4..6fb03c34 100644 --- a/src/rv/comm/drawing/commands/DrawOption.java +++ b/src/rv/comm/drawing/commands/DrawOption.java @@ -35,9 +35,16 @@ public class DrawOption extends Command { public DrawOption(ByteBuffer buf, Viewer viewer) { this.drawings = viewer.getDrawings(); - // currently only one type of draw option (swap buffers) int type = ByteUtil.uValue(buf.get()); - setName = getString(buf); + + switch (type) { + case SWAP_BUFFERS: + setName = getString(buf); + break; + default: + System.err.println("Unknown draw option : " + type); + setName = null; + } } @Override