From: Hendrik B. <nh...@us...> - 2012-10-26 21:54:11
|
Update of /cvsroot/arianne/stendhal/src/games/stendhal/bot/postman In directory vz-cvs-4.sog:/tmp/cvs-serv29918/src/games/stendhal/bot/postman Modified Files: UdpHandler.java Log Message: fixed reading of the buffer to only read the part which was filled by the last packet Index: UdpHandler.java =================================================================== RCS file: /cvsroot/arianne/stendhal/src/games/stendhal/bot/postman/UdpHandler.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** UdpHandler.java 26 Oct 2012 21:25:04 -0000 1.1 --- UdpHandler.java 26 Oct 2012 21:54:08 -0000 1.2 *************** *** 41,45 **** DatagramPacket receivePacket = new DatagramPacket(data, data.length); serverSocket.receive(receivePacket); ! String line = new String(receivePacket.getData(), "UTF-8"); int pos = line.indexOf('/'); if (pos > -1) { --- 41,45 ---- DatagramPacket receivePacket = new DatagramPacket(data, data.length); serverSocket.receive(receivePacket); ! String line = new String(receivePacket.getData(), receivePacket.getOffset(), receivePacket.getLength(), "UTF-8"); int pos = line.indexOf('/'); if (pos > -1) { |