From: bdemsky Date: Wed, 11 Mar 2009 00:40:33 +0000 (+0000) Subject: change X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=d3c8804a94dca8bf8803826b3049e0c5e0ce7da3;p=IRC.git change --- diff --git a/Robust/src/Benchmarks/Distributed/RainForest/java/RainForestServerThread.java b/Robust/src/Benchmarks/Distributed/RainForest/java/RainForestServerThread.java index e7dd2380..82e36761 100644 --- a/Robust/src/Benchmarks/Distributed/RainForest/java/RainForestServerThread.java +++ b/Robust/src/Benchmarks/Distributed/RainForest/java/RainForestServerThread.java @@ -38,7 +38,7 @@ public class RainForestServerThread extends Thread { byte[] buf = new byte[5]; //1 byte to decide if terminate or continue + 4 bytes for getting the round index byte[] buffer = new byte[9]; //1 byte presence of tree/rocks + 8 bytes for their x and y coordinates - + byte[] buffer2 = new byte[900]; //1 byte presence of tree/rocks + 8 bytes for their x and y coordinates while(true) { /* Check for termination character */ String readStr = readFromSock(5); @@ -58,9 +58,7 @@ public class RainForestServerThread extends Thread { /* Send data representing presence/absence of trees */ for(int i=0 ; i> offset) & 0xFF); - } - for(int i = 5; i<9; i++) { - int offset = (3-(i-5)) * 8; - b[i] = (byte) ((y >> offset) & 0xFF); + byte[] fillBytes(GameMap[][] land, int x, int cols, byte[] b) { + for (int y=0;y> offset) & 0xFF); + } + for(int i = 5; i<9; i++) { + int offset = (3-(i-5)) * 8; + b[i+yoffset] = (byte) ((y >> offset) & 0xFF); + } } return b; }