From: Adam Megacz Date: Sat, 2 Jan 2010 00:11:22 +0000 (-0800) Subject: create Makefile, remove source files that jad improperly decompiled X-Git-Url: http://git.megacz.com/?p=rsa2client.git;a=commitdiff_plain;h=3565e70a6cb86b5a90be38ce35b718918f3250de create Makefile, remove source files that jad improperly decompiled --- diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9f971d0 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +build +mcs.jar diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..1a77725 --- /dev/null +++ b/Makefile @@ -0,0 +1,7 @@ +mcs.jar: + rm -rf build + mkdir build + javac -cp class -d build `find src -name \*.java` + jar cvf $@- -C class . + jar uvf $@- -C build . + mv $@- $@ diff --git a/class/Acme/Crypto/DesCipher.class b/class/Acme/Crypto/DesCipher.class deleted file mode 100644 index 7fec970..0000000 Binary files a/class/Acme/Crypto/DesCipher.class and /dev/null differ diff --git a/class/mcsClient/BitMap.class b/class/mcsClient/BitMap.class deleted file mode 100644 index bcfec6a..0000000 Binary files a/class/mcsClient/BitMap.class and /dev/null differ diff --git a/class/mcsClient/ColorPalette.class b/class/mcsClient/ColorPalette.class deleted file mode 100644 index cac5e92..0000000 Binary files a/class/mcsClient/ColorPalette.class and /dev/null differ diff --git a/class/mcsClient/ComboKeyArray.class b/class/mcsClient/ComboKeyArray.class deleted file mode 100644 index ec5eeb1..0000000 Binary files a/class/mcsClient/ComboKeyArray.class and /dev/null differ diff --git a/class/mcsClient/Decompress$VideoCommands.class b/class/mcsClient/Decompress$VideoCommands.class deleted file mode 100644 index dbf772f..0000000 Binary files a/class/mcsClient/Decompress$VideoCommands.class and /dev/null differ diff --git a/class/mcsClient/Decompress.class b/class/mcsClient/Decompress.class deleted file mode 100644 index 4546592..0000000 Binary files a/class/mcsClient/Decompress.class and /dev/null differ diff --git a/class/mcsClient/DefaultKeyArray.class b/class/mcsClient/DefaultKeyArray.class deleted file mode 100644 index b7000f9..0000000 Binary files a/class/mcsClient/DefaultKeyArray.class and /dev/null differ diff --git a/class/mcsClient/Help.class b/class/mcsClient/Help.class deleted file mode 100644 index d8afc78..0000000 Binary files a/class/mcsClient/Help.class and /dev/null differ diff --git a/class/mcsClient/HexConversion.class b/class/mcsClient/HexConversion.class deleted file mode 100644 index c1a1826..0000000 Binary files a/class/mcsClient/HexConversion.class and /dev/null differ diff --git a/class/mcsClient/KeepAlive.class b/class/mcsClient/KeepAlive.class deleted file mode 100644 index 1005050..0000000 Binary files a/class/mcsClient/KeepAlive.class and /dev/null differ diff --git a/class/mcsClient/KeyButton.class b/class/mcsClient/KeyButton.class deleted file mode 100644 index 7202e81..0000000 Binary files a/class/mcsClient/KeyButton.class and /dev/null differ diff --git a/class/mcsClient/KeyButtonListener.class b/class/mcsClient/KeyButtonListener.class deleted file mode 100644 index 4563836..0000000 Binary files a/class/mcsClient/KeyButtonListener.class and /dev/null differ diff --git a/class/mcsClient/KeyData.class b/class/mcsClient/KeyData.class deleted file mode 100644 index 00c0864..0000000 Binary files a/class/mcsClient/KeyData.class and /dev/null differ diff --git a/class/mcsClient/KeyMap.class b/class/mcsClient/KeyMap.class deleted file mode 100644 index f81db31..0000000 Binary files a/class/mcsClient/KeyMap.class and /dev/null differ diff --git a/class/mcsClient/LockingKeyStateManager.class b/class/mcsClient/LockingKeyStateManager.class deleted file mode 100644 index 4aab631..0000000 Binary files a/class/mcsClient/LockingKeyStateManager.class and /dev/null differ diff --git a/class/mcsClient/McsClient.class b/class/mcsClient/McsClient.class deleted file mode 100644 index bbe6ce5..0000000 Binary files a/class/mcsClient/McsClient.class and /dev/null differ diff --git a/class/mcsClient/McsKeyAdapter.class b/class/mcsClient/McsKeyAdapter.class deleted file mode 100644 index 5392449..0000000 Binary files a/class/mcsClient/McsKeyAdapter.class and /dev/null differ diff --git a/class/mcsClient/McsMouseAdapter.class b/class/mcsClient/McsMouseAdapter.class deleted file mode 100644 index d5da475..0000000 Binary files a/class/mcsClient/McsMouseAdapter.class and /dev/null differ diff --git a/class/mcsClient/McsMouseMotionAdapter.class b/class/mcsClient/McsMouseMotionAdapter.class deleted file mode 100644 index 12f652c..0000000 Binary files a/class/mcsClient/McsMouseMotionAdapter.class and /dev/null differ diff --git a/class/mcsClient/McsTargetSize.class b/class/mcsClient/McsTargetSize.class deleted file mode 100644 index 053b10b..0000000 Binary files a/class/mcsClient/McsTargetSize.class and /dev/null differ diff --git a/class/mcsClient/McsTcpConnection.class b/class/mcsClient/McsTcpConnection.class deleted file mode 100644 index 977b7b1..0000000 Binary files a/class/mcsClient/McsTcpConnection.class and /dev/null differ diff --git a/class/mcsClient/McsToolBar$1.class b/class/mcsClient/McsToolBar$1.class deleted file mode 100644 index 7e85b06..0000000 Binary files a/class/mcsClient/McsToolBar$1.class and /dev/null differ diff --git a/class/mcsClient/McsToolBar$2.class b/class/mcsClient/McsToolBar$2.class deleted file mode 100644 index 02c064f..0000000 Binary files a/class/mcsClient/McsToolBar$2.class and /dev/null differ diff --git a/class/mcsClient/McsToolBar$3.class b/class/mcsClient/McsToolBar$3.class deleted file mode 100644 index 0eb03a9..0000000 Binary files a/class/mcsClient/McsToolBar$3.class and /dev/null differ diff --git a/class/mcsClient/McsToolBar.class b/class/mcsClient/McsToolBar.class deleted file mode 100644 index bfddaf8..0000000 Binary files a/class/mcsClient/McsToolBar.class and /dev/null differ diff --git a/class/mcsClient/McsVersion.class b/class/mcsClient/McsVersion.class deleted file mode 100644 index dfc7b11..0000000 Binary files a/class/mcsClient/McsVersion.class and /dev/null differ diff --git a/class/mcsClient/MessageCodes.class b/class/mcsClient/MessageCodes.class deleted file mode 100644 index 9186ab8..0000000 Binary files a/class/mcsClient/MessageCodes.class and /dev/null differ diff --git a/class/mcsClient/MessageReader.class b/class/mcsClient/MessageReader.class deleted file mode 100644 index fed56e9..0000000 Binary files a/class/mcsClient/MessageReader.class and /dev/null differ diff --git a/class/mcsClient/Options$1.class b/class/mcsClient/Options$1.class deleted file mode 100644 index 21d3713..0000000 Binary files a/class/mcsClient/Options$1.class and /dev/null differ diff --git a/class/mcsClient/Options$2.class b/class/mcsClient/Options$2.class deleted file mode 100644 index 3e67162..0000000 Binary files a/class/mcsClient/Options$2.class and /dev/null differ diff --git a/class/mcsClient/Options.class b/class/mcsClient/Options.class deleted file mode 100644 index 0d82267..0000000 Binary files a/class/mcsClient/Options.class and /dev/null differ diff --git a/class/mcsClient/Row.class b/class/mcsClient/Row.class deleted file mode 100644 index 17dda45..0000000 Binary files a/class/mcsClient/Row.class and /dev/null differ diff --git a/class/mcsClient/SavedSettings.class b/class/mcsClient/SavedSettings.class deleted file mode 100644 index b81f84a..0000000 Binary files a/class/mcsClient/SavedSettings.class and /dev/null differ diff --git a/class/mcsClient/SecureDatagramSocket.class b/class/mcsClient/SecureDatagramSocket.class deleted file mode 100644 index c589285..0000000 Binary files a/class/mcsClient/SecureDatagramSocket.class and /dev/null differ diff --git a/src/mcsClient/DatagramReader.java b/src/mcsClient/DatagramReader.java deleted file mode 100644 index 7a0c33c..0000000 --- a/src/mcsClient/DatagramReader.java +++ /dev/null @@ -1,385 +0,0 @@ -// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov. -// Jad home page: http://www.kpdus.com/jad.html -// Decompiler options: packimports(3) fieldsfirst nonlb space - -package mcsClient; - -import java.io.IOException; -import java.net.*; -import java.util.LinkedList; -import java.util.logging.Level; -import java.util.logging.Logger; -import javax.swing.JFrame; -import javax.swing.JOptionPane; - -// Referenced classes of package mcsClient: -// BitMap, SecureDatagramSocket, McsTcpConnection, LiveVideoPanel, -// McsToolBar - -public final class DatagramReader - implements Runnable { - - public boolean videoLostSync; - private DatagramSocket dgSocket; - private McsTcpConnection mcsTcpConnection; - private LiveVideoPanel liveVideoPanel; - private LinkedList datagramList; - private static final boolean USE_MULTICAST = false; - public static final int DEFAULT_DIALIN_BITRATE; - public static final int DEFAULT_NET_BITRATE; - private long serverTime; - private long serverBaseTime; - private long clientTime; - private long clientBaseTime; - private boolean gotBaseTime; - private long skew; - private long upperSkew; - private long lowerSkew; - private long initialBitRate; - private long skewTime; - private boolean gotBeginningOfFrame; - private boolean gotInitialBitRate; - private boolean detectedPPP; - private int frameNumber; - private int maxSequenceNumber; - private int lastFrameNumber; - private long totalFrameSize; - private BitMap bitmap; - private boolean initialized; - private static int nakMessage[] = new int[4]; - private McsToolBar sliderListener; - private int nakCount; - private static Logger logger = Logger.getAnonymousLogger(); - - public DatagramReader(McsTcpConnection mcstcpconnection, LiveVideoPanel livevideopanel, LinkedList linkedlist, String s, int i, boolean flag) { - videoLostSync = false; - serverBaseTime = 0L; - clientTime = 0L; - clientBaseTime = 0L; - gotBaseTime = false; - skew = 0L; - upperSkew = 150L; - lowerSkew = -10L; - initialBitRate = 0L; - skewTime = 225L; - gotBeginningOfFrame = false; - gotInitialBitRate = false; - detectedPPP = false; - maxSequenceNumber = 0; - lastFrameNumber = 0; - totalFrameSize = 0L; - bitmap = new BitMap(); - initialized = true; - sliderListener = null; - nakCount = 0; - mcsTcpConnection = mcstcpconnection; - liveVideoPanel = livevideopanel; - datagramList = linkedlist; - logger.setLevel(Level.WARNING); - String s1 = System.getProperty("mcs.debug"); - if (s1 != null && s1.equalsIgnoreCase("true")) - logger.setLevel(Level.ALL); - nakMessage[0] = nakMessage.length * 4; - nakMessage[1] = 5; - if (mcstcpconnection.getDetectedPPP() || flag) { - detectedPPP = true; - upperSkew = 150L; - lowerSkew = -30L; - skewTime = 2000L; - } - if (mcstcpconnection.videoEncrypted()) - dgSocket = new SecureDatagramSocket(mcstcpconnection.cipher1, mcstcpconnection.cipher2, mcstcpconnection.getLocalPort()); - else - dgSocket = new DatagramSocket(mcstcpconnection.getLocalPort()); - dgSocket.setReceiveBufferSize(0x1f400); - dgSocket.setSoTimeout(500); - if (flag) - return; - try { - byte abyte0[] = new byte[10]; - DatagramPacket datagrampacket = new DatagramPacket(abyte0, abyte0.length, InetAddress.getByName(s), i); - for (int j = 0; j < 6; j++) { - dgSocket.send(datagrampacket); - try { - Thread.currentThread(); - Thread.sleep(60L); - } - catch (InterruptedException interruptedexception) { } - } - - try { - Thread.currentThread(); - Thread.sleep(200L); - } - catch (InterruptedException interruptedexception1) { } - } - catch (Exception exception) { - logger.severe(exception.toString()); - initialized = false; - JOptionPane.showMessageDialog(new JFrame(), "Failed to connect. Try again.", "Remote Console Datagram Reader Initialization Error", 0); - } - return; - } - - private void cleanupThread() { - if (dgSocket != null) { - dgSocket.disconnect(); - dgSocket.close(); - } - dgSocket = null; - mcsTcpConnection = null; - liveVideoPanel = null; - datagramList = null; - initialized = false; - } - - private void process() { - int l; - Thread thread; - l = 0; - boolean flag = false; - boolean flag1 = false; - boolean flag2 = false; - if (!initialized) - return; - thread = Thread.currentThread(); - goto _L1 -_L22: - if (nakCount >= 25) { - logger.info("25 NAK messages sent"); - nakCount = 0; - } - DatagramPacket datagrampacket; - byte abyte1[] = new byte[1500]; - datagrampacket = new DatagramPacket(abyte1, abyte1.length); - dgSocket.receive(datagrampacket); - goto _L2 - SocketTimeoutException sockettimeoutexception; - sockettimeoutexception; - goto _L1 - IOException ioexception3; - ioexception3; - logger.warning("Datagram Reader - error reading datagram " + ioexception3); - return; -_L2: - byte abyte0[]; - int j; - abyte0 = datagrampacket.getData(); - j = datagrampacket.getOffset(); - if (datagrampacket.getLength() >= 24) goto _L3; else goto _L1 -_L3: - if (abyte0[j + 7] != 6) goto _L5; else goto _L4 -_L4: - videoLostSync = true; - gotBaseTime = false; - logger.info("DatagramReader: video lost sync"); - goto _L1 -_L5: - videoLostSync = false; - frameNumber = (abyte0[j + 8] & 0xff) << 8 | abyte0[j + 9] & 0xff; - if (gotBeginningOfFrame) goto _L7; else goto _L6 -_L6: - if ((abyte0[j + 7] & 0xbf) != 0) goto _L8; else goto _L1 -_L8: - gotBeginningOfFrame = true; - lastFrameNumber = frameNumber - 1; - l = 128; - bitmap.clear(); - bitmap.setBit(0); -_L7: - int i; - i = (abyte0[j + 10] & 0xff) << 8 | abyte0[j + 11] & 0xff; - int i1 = (abyte0[j + 2] & 0xff) << 8 | abyte0[j + 3] & 0xff; - totalFrameSize += i1; - serverTime = ((long)abyte0[j + 20] & 255L) << 24 | ((long)abyte0[j + 21] & 255L) << 16 | ((long)abyte0[j + 22] & 255L) << 8 | (long)abyte0[j + 23] & 255L; - clientTime = System.currentTimeMillis(); - if (gotBaseTime) goto _L10; else goto _L9 -_L9: - gotBaseTime = true; - serverBaseTime = serverTime; - clientBaseTime = clientTime; - totalFrameSize = 0L; - goto _L11 -_L10: - long l1; - skew = clientTime - clientBaseTime - (serverTime - serverBaseTime); - l1 = (totalFrameSize * 8L * 1000L) / ((clientTime - clientBaseTime) + 50L); - if (l1 > 0x13880L) - liveVideoPanel.doPartialScreenUpdates = false; - else - liveVideoPanel.doPartialScreenUpdates = true; - if (skew >= lowerSkew) goto _L13; else goto _L12 -_L12: - gotBaseTime = false; - goto _L11 -_L13: - if (skew <= upperSkew || clientTime - clientBaseTime <= skewTime) goto _L11; else goto _L14 -_L14: - int ai[]; - if (!gotInitialBitRate) { - initialBitRate = l1; - gotInitialBitRate = true; - if (detectedPPP) { - if (initialBitRate < (long)DEFAULT_DIALIN_BITRATE) - initialBitRate = DEFAULT_DIALIN_BITRATE; - } else - if (initialBitRate < (long)DEFAULT_NET_BITRATE) - initialBitRate = DEFAULT_NET_BITRATE; - if (sliderListener != null) - sliderListener.setSliderInitialBitRate(initialBitRate); - } else { - if (l1 < (initialBitRate * 60L) / 100L) - l1 = (initialBitRate * 60L) / 100L; - if (detectedPPP && l1 > initialBitRate) - l1 = initialBitRate; - } - gotBaseTime = false; - l1 *= 75L; - l1 /= 100L; - ai = new int[3]; - ai[0] = ai.length * 4; - ai[1] = 10; - ai[2] = (int)l1; - thread; - if (Thread.interrupted()) - return; - try { - mcsTcpConnection.sendMessage(ai, false); - } - catch (IOException ioexception4) { - logger.severe("Socket exception - DatagramReader exiting"); - return; - } -_L11: - if (frameNumber == lastFrameNumber) - break MISSING_BLOCK_LABEL_1033; - if (frameNumber == lastFrameNumber + 1) goto _L16; else goto _L15 -_L15: - nakMessage[2] = 0; - nakMessage[3] = frameNumber; - try { - mcsTcpConnection.sendMessage(nakMessage, false); - } - catch (IOException ioexception) { - logger.severe("Socket exception - DatagramReader exiting"); - return; - } - nakCount++; - goto _L17 -_L16: - if ((l & 0x80) != 0) goto _L19; else goto _L18 -_L18: - nakMessage[2] = 0; - nakMessage[3] = 0; - thread; - if (Thread.interrupted()) - return; - try { - mcsTcpConnection.sendMessage(nakMessage, false); - } - catch (IOException ioexception1) { - logger.severe("Socket exception - DatagramReader exiting"); - return; - } - nakCount++; - goto _L17 -_L20: - int k; - nakMessage[2] = k; - nakMessage[3] = frameNumber; - thread; - if (Thread.interrupted()) - return; - try { - mcsTcpConnection.sendMessage(nakMessage, false); - } - catch (IOException ioexception2) { - logger.severe("Socket exception - DatagramReader exiting"); - return; - } - nakCount++; - break; /* Loop/switch isn't completed */ -_L19: - if ((k = bitmap.findZeroBit()) <= maxSequenceNumber) goto _L20; else goto _L17 -_L17: - lastFrameNumber = frameNumber; - bitmap.clear(); - l = 0; - maxSequenceNumber = 0; - bitmap.setBit(i); - maxSequenceNumber = i <= maxSequenceNumber ? maxSequenceNumber : i; - l |= abyte0[j + 7]; - abyte0[j + 7] &= 0x3f; - int j1; - if ((j1 = datagramList.size()) < 10 || liveVideoPanel.imagesAutomaticallyPaused) - break MISSING_BLOCK_LABEL_1147; - thread; - if (Thread.interrupted()) - return; - if (liveVideoPanel.pauseVideo() != 1) { - logger.severe("Socket exception - DatagramReader exiting"); - return; - } - liveVideoPanel.imagesAutomaticallyPaused = true; - long l2 = ((long)abyte0[j] & 255L) << 24 | ((long)abyte0[j + 1] & 255L) << 16 | ((long)abyte0[j + 2] & 255L) << 8 | (long)abyte0[j + 3] & 255L; - long l3 = ((long)abyte0[j + 12] & 255L) << 24 | ((long)abyte0[j + 13] & 255L) << 16 | ((long)abyte0[j + 14] & 255L) << 8 | (long)abyte0[j + 15] & 255L; - long l4 = ((long)abyte0[j + 16] & 255L) << 24 | ((long)abyte0[j + 17] & 255L) << 16 | ((long)abyte0[j + 18] & 255L) << 8 | (long)abyte0[j + 19] & 255L; - if (i >= 0 && i <= 896 && l3 >= 0L && l3 <= 0xc0000L && l4 >= 0L && l3 <= 0xc0000L) { - if (l2 != 31L) - synchronized (datagramList) { - datagramList.addFirst(datagrampacket); - datagramList.notify(); - } - } else { - logger.warning("Bad packet discarded. seq num: " + i + " vid ram offset: " + l3 + " vid ram count: " + l4); - } - goto _L1 - ArrayIndexOutOfBoundsException arrayindexoutofboundsexception; - arrayindexoutofboundsexception; - logger.warning(arrayindexoutofboundsexception.toString()); -_L1: - thread; - if (Thread.interrupted()) - return; - if (true) goto _L22; else goto _L21 -_L21: - } - - public void run() { - process(); - cleanupThread(); - } - - protected void finalize() throws Throwable { - cleanupThread(); - } - - public boolean initialized() { - return initialized; - } - - public void addSliderListener(McsToolBar mcstoolbar) { - sliderListener = mcstoolbar; - } - - public void setInitialBitRate(long l) { - initialBitRate = l; - gotInitialBitRate = true; - int ai[] = new int[3]; - ai[0] = ai.length * 4; - ai[1] = 10; - ai[2] = (int)l; - try { - mcsTcpConnection.sendMessage(ai, true); - } - catch (IOException ioexception) { - logger.severe("Socket exception - setInitialBitRate"); - return; - } - } - - static { - DEFAULT_DIALIN_BITRATE = McsToolBar.BITRATES[2]; - DEFAULT_NET_BITRATE = McsToolBar.BITRATES[7]; - } -} diff --git a/src/mcsClient/LiveVideoPanel.java b/src/mcsClient/LiveVideoPanel.java deleted file mode 100644 index ec0f2b2..0000000 --- a/src/mcsClient/LiveVideoPanel.java +++ /dev/null @@ -1,464 +0,0 @@ -// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov. -// Jad home page: http://www.kpdus.com/jad.html -// Decompiler options: packimports(3) fieldsfirst nonlb space - -package mcsClient; - -import java.awt.*; -import java.awt.image.*; -import java.io.*; -import java.net.DatagramPacket; -import java.util.LinkedList; -import java.util.logging.Level; -import java.util.logging.Logger; -import javax.swing.JPanel; - -// Referenced classes of package mcsClient: -// ColorPalette, Decompress, McsTargetSize, McsTcpConnection, -// McsToolBar, LockingKeyStateManager - -public final class LiveVideoPanel extends JPanel - implements Runnable { - - private int targetWidth; - private int targetHeight; - private boolean initialized; - private McsTargetSize targetSize; - private ColorPalette colorPalette; - private IndexColorModel indexColorModel; - private LinkedList datagramList; - public static boolean PRINT_HEADER = false; - public static boolean MEASURE_PERFORMANCE = false; - public boolean SHOW_CURSOR; - public static final boolean DEBUG_MOUSE = false; - public static final int SUCCESS = 1; - public static final int FAILURE = 2; - boolean doPartialScreenUpdates; - boolean interpolation; - Graphics2D graphics2D; - RenderingHints renderingHints; - private final Toolkit defaultToolkit = Toolkit.getDefaultToolkit(); - private final Cursor invisibleCursor; - private Cursor visibleCursor; - private Cursor currentCursor; - private byte imageData[]; - private MemoryImageSource memoryImageSource; - private MemoryImageSource memoryImageSource_1024_768; - private MemoryImageSource memoryImageSource_800_600; - private MemoryImageSource memoryImageSource_640_480; - private MemoryImageSource memoryImageSource_640_400; - private MemoryImageSource memoryImageSource_656_496; - private Image image_1024_768; - private Image image_800_600; - private Image image_640_480; - private Image image_640_400; - private Image image_656_496; - private Image image; - private int blankImage[]; - private MemoryImageSource blankMemoryImageSource; - private Image blank; - private Dimension dimension_1024_768; - private Dimension dimension_800_600; - private Dimension dimension_640_480; - private Dimension dimension_640_400; - private Dimension dimension_656_496; - private McsTcpConnection mcsTcpConnection; - private int frameWidth; - private int frameHeight; - private int livePanelWait; - private boolean livePanelSchedule; - private McsToolBar sliderListener; - private static int resumeMessage[] = new int[2]; - private static int pauseMessage[] = new int[2]; - boolean imagesAutomaticallyPaused; - private LockingKeyStateManager lockingKeyStateManager; - private static Logger logger = Logger.getAnonymousLogger(); - - public LiveVideoPanel(McsTcpConnection mcstcpconnection, LinkedList linkedlist, McsTargetSize mcstargetsize, LockingKeyStateManager lockingkeystatemanager) { - targetWidth = 1024; - targetHeight = 768; - initialized = false; - colorPalette = new ColorPalette(); - indexColorModel = new IndexColorModel(8, colorPalette.hardwareColors.length, colorPalette.hardwareColors, 0, 0, null); - SHOW_CURSOR = true; - doPartialScreenUpdates = true; - interpolation = false; - graphics2D = null; - renderingHints = null; - invisibleCursor = defaultToolkit.createCustomCursor(new BufferedImage(1, 1, 2), new Point(0, 0), ""); - dimension_1024_768 = new Dimension(1024, 768); - dimension_800_600 = new Dimension(800, 600); - dimension_640_480 = new Dimension(640, 480); - dimension_640_400 = new Dimension(640, 400); - dimension_656_496 = new Dimension(656, 496); - sliderListener = null; - imagesAutomaticallyPaused = false; - mcsTcpConnection = mcstcpconnection; - datagramList = linkedlist; - targetSize = mcstargetsize; - lockingKeyStateManager = lockingkeystatemanager; - imageData = new byte[targetWidth * targetHeight * 2]; - memoryImageSource_1024_768 = new MemoryImageSource(1024, 768, indexColorModel, imageData, 0, 1024); - memoryImageSource_800_600 = new MemoryImageSource(800, 600, indexColorModel, imageData, 0, 800); - memoryImageSource_640_480 = new MemoryImageSource(640, 480, indexColorModel, imageData, 0, 640); - memoryImageSource_640_400 = new MemoryImageSource(640, 400, indexColorModel, imageData, 0, 640); - memoryImageSource_656_496 = new MemoryImageSource(656, 496, indexColorModel, imageData, 0, 656); - memoryImageSource_1024_768.setAnimated(true); - memoryImageSource_800_600.setAnimated(true); - memoryImageSource_640_480.setAnimated(true); - memoryImageSource_640_400.setAnimated(true); - memoryImageSource_656_496.setAnimated(true); - memoryImageSource = memoryImageSource_1024_768; - image_1024_768 = createImage(memoryImageSource_1024_768); - image_800_600 = createImage(memoryImageSource_800_600); - image_640_480 = createImage(memoryImageSource_640_480); - image_640_400 = createImage(memoryImageSource_640_400); - image_656_496 = createImage(memoryImageSource_656_496); - image = image_1024_768; - blankImage = new int[0xc0000]; - blankMemoryImageSource = new MemoryImageSource(1024, 768, indexColorModel, blankImage, 0, 1024); - blank = createImage(blankMemoryImageSource); - Cursor cursor = getCursor(); - Cursor cursor1 = cursor; - if (!SHOW_CURSOR) { - setCursor(invisibleCursor); - Cursor cursor2 = invisibleCursor; - } - resumeMessage[0] = resumeMessage.length * 4; - resumeMessage[1] = 8; - pauseMessage[0] = pauseMessage.length * 4; - pauseMessage[1] = 7; - livePanelWait = 0; - livePanelSchedule = true; - logger.setLevel(Level.WARNING); - String s = System.getProperty("mcs.debug"); - if (s != null && s.equalsIgnoreCase("true")) - logger.setLevel(Level.ALL); - initialized = true; - } - - public void toggleVisibleCursor() { - if (currentCursor.equals(visibleCursor)) { - setCursor(invisibleCursor); - currentCursor = invisibleCursor; - } else { - setCursor(visibleCursor); - currentCursor = visibleCursor; - } - } - - public boolean initialized() { - return initialized; - } - - public boolean isFocusable() { - return true; - } - - public void addNotify() { - super.addNotify(); - } - - public boolean isOpaque() { - return false; - } - - public void paintComponent(Graphics g) { - super.paintComponent(g); - Rectangle rectangle = g.getClipBounds(); - if (rectangle.x >= 0 && rectangle.x < targetWidth && rectangle.y >= 0 && rectangle.y < targetHeight) - g.drawImage(image, 0, 0, null); - livePanelWait = 0; - } - - public void update(Graphics g) { - super.update(g); - } - - public void setInterpolation(boolean flag) { - interpolation = flag; - } - - private void cleanupThread() { - mcsTcpConnection = null; - datagramList = null; - lockingKeyStateManager = null; - initialized = false; - } - - private void process() { - float f; - float f1; - float f2; - float f3; - long l; - int k; - boolean flag3; - int ai[]; - Decompress decompress; - Thread thread; - f = 0.0F; - f1 = 0.0F; - f2 = 0.0F; - f3 = 0.0F; - boolean flag = false; - k = 2; - boolean flag1 = false; - boolean flag2 = false; - Object obj = null; - flag3 = false; - Object obj1 = null; - ai = new int[2]; - ai[0] = ai.length * 4; - ai[1] = 16; - setBackground(Color.white); - setEnabled(true); - setVisible(true); - decompress = new Decompress(imageData); - long l1; - l = l1 = System.currentTimeMillis(); - graphics2D = (Graphics2D)getGraphics(); - renderingHints = graphics2D.getRenderingHints(); - logger.info("RenderingHints size = " + renderingHints.size()); - thread = Thread.currentThread(); - break MISSING_BLOCK_LABEL_1474; -_L2: - LinkedList linkedlist = datagramList; - JVM INSTR monitorenter ; - int i; - DatagramPacket datagrampacket; -label0: - { - thread; - if (Thread.interrupted()) { - logger.info("Terminating LiveVideoPanel"); - return; - } - try { - while ((i = datagramList.size()) == 0) - datagramList.wait(); - datagrampacket = (DatagramPacket)datagramList.removeLast(); - break label0; - } - catch (InterruptedException interruptedexception1) { } - return; - } - Exception exception; - exception; - throw exception; - if (i > 2 || !imagesAutomaticallyPaused) - break MISSING_BLOCK_LABEL_277; - if (resumeVideo() != 1) { - logger.severe("Socket exception - LiveVideoPanel exiting"); - return; - } - imagesAutomaticallyPaused = false; - break MISSING_BLOCK_LABEL_313; - if (i < 6 || imagesAutomaticallyPaused) - break MISSING_BLOCK_LABEL_313; - if (pauseVideo() != 1) { - logger.severe("Socket exception - LiveVideoPanel exiting"); - return; - } - imagesAutomaticallyPaused = true; - DataInputStream datainputstream; - try { - datainputstream = new DataInputStream(new ByteArrayInputStream(datagrampacket.getData(), datagrampacket.getOffset(), datagrampacket.getLength())); - } - catch (NullPointerException nullpointerexception) { - logger.severe("Data stream has been closed. LiveVideoPanel exiting."); - return; - } - int i1; - int i2; - int j2; - try { - int j = datagrampacket.getLength(); - i1 = datainputstream.readInt(); - int j1 = datainputstream.readInt(); - int k1 = datainputstream.readInt(); - i2 = datainputstream.readInt(); - j2 = datainputstream.readInt(); - int k2 = datainputstream.readInt(); - if (MEASURE_PERFORMANCE) { - f3++; - f1 += i1; - f += j2; - } - if (PRINT_HEADER) { - System.out.println(); - System.out.println("dg length: " + i1 + ", vro: " + i2 + ", vrc: " + j2); - } - flag3 = false; - if (i1 > 1458) { - flag3 = true; - logger.warning("Bad datagramLength = " + i1); - } - if (j1 != k) { - if (j1 == 2) { - memoryImageSource = memoryImageSource_1024_768; - image = image_1024_768; - logger.info("Setting to 1024 x 768"); - setPreferredSize(dimension_1024_768); - targetWidth = 1024; - targetHeight = 768; - targetSize.setWidth(1024); - targetSize.setHeight(768); - } else - if (j1 == 3) { - memoryImageSource = memoryImageSource_800_600; - image = image_800_600; - logger.info("Setting to 800 x 600"); - setPreferredSize(dimension_800_600); - targetWidth = 800; - targetHeight = 600; - targetSize.setWidth(800); - targetSize.setHeight(600); - } else - if (j1 == 4) { - memoryImageSource = memoryImageSource_640_480; - image = image_640_480; - logger.info("Setting to 640 x 480"); - setPreferredSize(dimension_640_480); - targetWidth = 640; - targetHeight = 480; - targetSize.setWidth(640); - targetSize.setHeight(480); - } else - if (j1 == 23) { - memoryImageSource = memoryImageSource_640_400; - image = image_640_400; - logger.info("Setting to 640 x 400"); - setPreferredSize(dimension_640_400); - targetWidth = 640; - targetHeight = 400; - targetSize.setWidth(640); - targetSize.setHeight(400); - } else - if (j1 == 25) { - memoryImageSource = memoryImageSource_656_496; - image = image_656_496; - logger.info("Setting to 656 x 496"); - setPreferredSize(dimension_656_496); - targetWidth = 656; - targetHeight = 496; - targetSize.setWidth(656); - targetSize.setHeight(496); - } else { - flag3 = true; - logger.warning("Bad messageType = " + j1); - } - java.awt.Container container = getParent(); - java.awt.Container container1 = container; - k = j1; - } - if (i2 < 0 || i2 > targetWidth * targetHeight) { - flag3 = true; - logger.warning("Bad videoRamOffset = " + i2); - } - if (j2 < 0 || j2 > targetWidth * targetHeight) { - flag3 = true; - logger.warning("Bad videoRamCount = " + j2); - } - } - catch (IOException ioexception) { - logger.warning("LiveVideoPanel: got I/O exception" + ioexception); - break; /* Loop/switch isn't completed */ - } - if (!flag3) - try { - decompress.doDecompress(datainputstream, i1 - 24, i2, j2, memoryImageSource, targetWidth, targetHeight); - } - catch (ArrayIndexOutOfBoundsException arrayindexoutofboundsexception) { - logger.warning("Decompress failed - " + arrayindexoutofboundsexception.toString()); - flag3 = true; - } - if (i2 + j2 >= targetWidth * targetHeight) - break; /* Loop/switch isn't completed */ - if (doPartialScreenUpdates) { - if (!decompress.pixelsInParts) - memoryImageSource.newPixels(0, 0, targetWidth, targetHeight, false); - if (!flag3) - repaint(); - } -_L3: - thread; - if (!Thread.interrupted()) goto _L2; else goto _L1 -_L1: - thread; - if (Thread.interrupted()) - return; - if (!decompress.pixelsInParts) - memoryImageSource.newPixels(0, 0, targetWidth, targetHeight, false); - if (!flag3) { - repaint(); - try { - livePanelWait += 2; - Thread.currentThread(); - Thread.sleep(livePanelWait); - } - catch (InterruptedException interruptedexception) { } - } - if (MEASURE_PERFORMANCE) { - f2++; - long l2 = System.currentTimeMillis(); - if (l2 - l > 10000L) { - System.out.println("Datagrams/sec = " + (f3 * 1000F) / (float)(l2 - l)); - System.out.println("Frames/sec = " + (f2 * 1000F) / (float)(l2 - l)); - System.out.println("Bit rate = " + (8F * f1) / 10F); - f2 = 0.0F; - f = 0.0F; - f1 = 0.0F; - f3 = 0.0F; - l = l2 = System.currentTimeMillis(); - try { - mcsTcpConnection.sendMessage(ai); - } - catch (IOException ioexception1) { - logger.warning("Socket exception - LiveVideoPanel exiting"); - return; - } - } - } - thread; - if (Thread.interrupted()) - return; - goto _L3 - } - - public void run() { - process(); - cleanupThread(); - } - - void setFrameSize(int i, int j) { - frameWidth = i; - frameHeight = j; - } - - public int resumeVideo() { - try { - mcsTcpConnection.sendMessage(resumeMessage); - } - catch (IOException ioexception) { - return 2; - } - return 1; - } - - public int pauseVideo() { - imagesAutomaticallyPaused = false; - try { - mcsTcpConnection.sendMessage(pauseMessage); - } - catch (IOException ioexception) { - return 2; - } - return 1; - } - - public void addSliderListener(McsToolBar mcstoolbar) { - sliderListener = mcstoolbar; - } - -}