Mercurial > hg > Applications > TreeVNC
changeset 264:83d0256a8808
add fixing display filter.
author | oc |
---|---|
date | Mon, 08 Dec 2014 20:07:32 +0900 |
parents | 4075f68f1c91 |
children | 57d71d8f1616 |
files | src/main/java/com/glavsoft/rfb/encoding/decoder/ZRLEESender.java src/main/java/com/glavsoft/rfb/protocol/ReceiverTask.java src/main/java/jp/ac/u_ryukyu/treevnc/TreeRFBProto.java src/main/java/jp/ac/u_ryukyu/treevnc/TreeRootFinderListener.java |
diffstat | 4 files changed, 17 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/src/main/java/com/glavsoft/rfb/encoding/decoder/ZRLEESender.java Mon Dec 08 16:09:24 2014 +0900 +++ b/src/main/java/com/glavsoft/rfb/encoding/decoder/ZRLEESender.java Mon Dec 08 20:07:32 2014 +0900 @@ -30,18 +30,18 @@ if (rfb.hasViewer()) { ZRLEDecoder decoder = new ZRLEDecoder(); if (rfb.isTreeManager()) { - rfb.readSendData(dataLen, reader, bytes); + rfb.readSendData(dataLen, reader, bytes, rect); decoder.decode1(renderer, rect, bytes, 0); return; } else if (!rfb.getCuiVersion()) { - rfb.readSendData(dataLen, reader, null); + rfb.readSendData(dataLen, reader, null, rect); reader.reset(); reader.skip(16); decoder.decode(reader, renderer, rect); return; } } - rfb.readSendData(dataLen, reader, bytes); + rfb.readSendData(dataLen, reader, bytes, rect); } private int getZrleLength(FramebufferUpdateRectangle rect, Reader reader)
--- a/src/main/java/com/glavsoft/rfb/protocol/ReceiverTask.java Mon Dec 08 16:09:24 2014 +0900 +++ b/src/main/java/com/glavsoft/rfb/protocol/ReceiverTask.java Mon Dec 08 20:07:32 2014 +0900 @@ -243,6 +243,13 @@ FramebufferUpdateRectangle rect = new FramebufferUpdateRectangle(); rect.fill(reader); + /* + if(rect.x > 1920) { + reader.reset(); + return; + } + */ + long time = System.currentTimeMillis(); if(rfb.isTreeManager() && rfb.checkDelay) System.out.println(time + " : size : " + rect.width * rect.height); @@ -273,7 +280,7 @@ rfb.getContext().setInitData(initData); repaintController.updateRemoteDesktopName(rfb.getContext()); reader.reset(); - rfb.readSendData(length + 20, reader, null ); // size of UpdateRectangleMessage with initData. + rfb.readSendData(length + 20, reader, null, rect); // size of UpdateRectangleMessage with initData. short id = (short) rect.x; visible = (id != rfb.getId()); } @@ -289,7 +296,7 @@ } else if (rect.getEncodingType() == EncodingType.CHECK_DELAY) { int checkDelaySize = 24; reader.reset(); - rfb.readSendData(checkDelaySize, reader, null); + rfb.readSendData(checkDelaySize, reader, null, rect); int port = rfb.acceptPort; String address = rfb.getMyAddress(); sendCheckDelayReply(rect.time, port, address);
--- a/src/main/java/jp/ac/u_ryukyu/treevnc/TreeRFBProto.java Mon Dec 08 16:09:24 2014 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/treevnc/TreeRFBProto.java Mon Dec 08 20:07:32 2014 +0900 @@ -20,6 +20,7 @@ import com.glavsoft.exceptions.TransportException; import com.glavsoft.rfb.client.ClientToServerMessage; import com.glavsoft.rfb.encoding.EncodingType; +import com.glavsoft.rfb.encoding.decoder.FramebufferUpdateRectangle; import com.glavsoft.rfb.protocol.Protocol; import com.glavsoft.rfb.protocol.ProtocolContext; import com.glavsoft.transport.Reader; @@ -574,7 +575,7 @@ * @throws TransportException * @throws UnsupportedEncodingException */ - public void readSendData(int dataLen, Reader reader, byte[] bytes) + public void readSendData(int dataLen, Reader reader, byte[] bytes, FramebufferUpdateRectangle rect) throws TransportException, UnsupportedEncodingException { LinkedList<ByteBuffer> bufs = new LinkedList<ByteBuffer>(); ByteBuffer header = multicastqueue.allocate(16); @@ -619,7 +620,8 @@ bufs.addFirst(blen); bufs.addFirst(header); addSerialNumber(bufs); - multicastqueue.put(bufs); + if (rect.x < 1920) + multicastqueue.put(bufs); } catch (DataFormatException e) { throw new TransportException(e); } catch (IOException e) {
--- a/src/main/java/jp/ac/u_ryukyu/treevnc/TreeRootFinderListener.java Mon Dec 08 16:09:24 2014 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/treevnc/TreeRootFinderListener.java Mon Dec 08 20:07:32 2014 +0900 @@ -34,8 +34,8 @@ try { soc.joinGroup(InetAddress.getByName(McastAddr)); } catch (SocketException e) { + McastAddr = Ipv6McastAddr; soc.joinGroup(InetAddress.getByName(Ipv6McastAddr)); - McastAddr = Ipv6McastAddr; } DatagramPacket recvPacket = new DatagramPacket(buf, BufSize);