亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? rfbproto.java

?? 一個遠程登陸器的原代碼
?? JAVA
?? 第 1 頁 / 共 4 頁
字號:
//  Copyright (C) 2002-2004 Ultr@VNC Team.  All Rights Reserved.
//  Copyright (C) 2004 Kenn Min Chong, John Witchel.  All Rights Reserved.
//  Copyright (C) 2001,2002 HorizonLive.com, Inc.  All Rights Reserved.
//  Copyright (C) 2001,2002 Constantin Kaplinsky.  All Rights Reserved.
//  Copyright (C) 2000 Tridia Corporation.  All Rights Reserved.
//  Copyright (C) 1999 AT&T Laboratories Cambridge.  All Rights Reserved.
//
//  This is free software; you can redistribute it and/or modify
//  it under the terms of the GNU General Public License as published by
//  the Free Software Foundation; either version 2 of the License, or
//  (at your option) any later version.
//
//  This software is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU General Public License for more details.
//
//  You should have received a copy of the GNU General Public License
//  along with this software; if not, write to the Free Software
//  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
//  USA.
//

//
// RfbProto.java
//4/19/04

import java.io.*;
import java.awt.*;
import java.awt.event.*;
import java.net.Socket;
import java.util.*;
import java.util.zip.*;


class RfbProto {

	final String versionMsg = "RFB 003.003\n";
	final static int ConnFailed = 0, NoAuth = 1, VncAuth = 2, MsLogon = 0xfffffffa;
	final static int VncAuthOK = 0, VncAuthFailed = 1, VncAuthTooMany = 2;

	final static int FramebufferUpdate = 0,
		SetColourMapEntries = 1,
		Bell = 2,
		ServerCutText = 3,
		rfbFileTransfer = 7;

	final int SetPixelFormat = 0,
		FixColourMapEntries = 1,
		SetEncodings = 2,
		FramebufferUpdateRequest = 3,
		KeyboardEvent = 4,
		PointerEvent = 5,
		ClientCutText = 6;

	final static int EncodingRaw = 0,
		EncodingCopyRect = 1,
		EncodingRRE = 2,
		EncodingCoRRE = 4,
		EncodingHextile = 5,
		EncodingZlib = 6,
		EncodingTight = 7,
		EncodingCompressLevel0 = 0xFFFFFF00,
		EncodingQualityLevel0 = 0xFFFFFFE0,
		EncodingXCursor = 0xFFFFFF10,
		EncodingRichCursor = 0xFFFFFF11,
		EncodingPointerPos = 0xFFFFFF18, // marscha - PointerPos
		EncodingLastRect = 0xFFFFFF20,
		EncodingNewFBSize = 0xFFFFFF21;

	final int HextileRaw = (1 << 0);
	final int HextileBackgroundSpecified = (1 << 1);
	final int HextileForegroundSpecified = (1 << 2);
	final int HextileAnySubrects = (1 << 3);
	final int HextileSubrectsColoured = (1 << 4);

	final static int TightExplicitFilter = 0x04;
	final static int TightFill = 0x08;
	final static int TightJpeg = 0x09;
	final static int TightMaxSubencoding = 0x09;
	final static int TightFilterCopy = 0x00;
	final static int TightFilterPalette = 0x01;
	final static int TightFilterGradient = 0x02;

	final static int TightMinToCompress = 12;

	// sf@2004 - FileTransfer part
	ArrayList remoteDirsList;
	ArrayList remoteFilesList;
	ArrayList a;
	boolean fFTInit = true; // sf@2004
	boolean fFTAllowed = true;
	boolean fAbort = false;
	boolean fFileReceptionError = false;
	boolean fFileReceptionRunning = false;
	boolean inDirectory2;
	FileOutputStream fos;
	FileInputStream fis;
	String sendFileSource;
	String receivePath;
	long fileSize;
	long receiveFileSize;
	long fileChunkCounter;

	final static int sz_rfbFileTransferMsg = 12,
	// FileTransfer Content types and Params defines
	rfbDirContentRequest = 1,
	// Client asks for the content of a given Server directory
	rfbDirPacket = 2, // Full directory name or full file name.
	// Null content means end of Directory
	rfbFileTransferRequest = 3,
	// Client asks the server for the tranfer of a given file
	rfbFileHeader = 4,
	// First packet of a file transfer, containing file's features
	rfbFilePacket = 5, // One slice of the file
	rfbEndOfFile = 6,
	// End of file transfer (the file has been received or error)
	rfbAbortFileTransfer = 7,
	// The file transfer must be aborted, whatever the state
	rfbFileTransferOffer = 8,
	// The client offers to send a file to the server
	rfbFileAcceptHeader = 9, // The server accepts or rejects the file
	rfbCommand = 10,
	// The Client sends a simple command (File Delete, Dir create etc...)
	rfbCommandReturn = 11,
	//	New FT Protocole (V2) The zipped checksums of the destination file (Delta Transfer)
	rfbFileChecksums = 12,
	// The Client receives the server's answer about a simple command
	// rfbDirContentRequest client Request - content params 
	rfbRDirContent = 1, // Request a Server Directory contents
	rfbRDrivesList = 2, // Request the server's drives list
	
	// rfbDirPacket & rfbCommandReturn  server Answer - content params
	rfbADirectory = 1, // Reception of a directory name
	rfbAFile = 2, // Reception of a file name 
	rfbADrivesList = 3, // Reception of a list of drives
	rfbADirCreate = 4, // Response to a create dir command 
	rfbADirDelete = 5, // Response to a delete dir command 
	rfbAFileCreate = 6, // Response to a create file command 
	rfbAFileDelete = 7, // Response to a delete file command
	
	// rfbCommand Command - content params
	rfbCDirCreate = 1, // Request the server to create the given directory
	rfbCDirDelete = 2, // Request the server to delete the given directory
	rfbCFileCreate = 3, // Request the server to create the given file
	rfbCFileDelete = 4, // Request the server to delete the given file
	
	// Errors - content params or "size" field
	rfbRErrorUnknownCmd = 1, // Unknown FileTransfer command.
	rfbRErrorCmd = 0xFFFFFFFF,
	
	// Error when a command fails on remote side (ret in "size" field)
	sz_rfbBlockSize = 8192, // new FT protocole (v2)
	
	// Size of a File Transfer packet (before compression)
	sz_rfbZipDirectoryPrefix = 9;

	String rfbZipDirectoryPrefix = "!UVNCDIR-\0";
	// Transfered directory are zipped in a file with this prefix. Must end with "-"
	
	// End of FileTransfer part 
	
	String host;
	int port;
	Socket sock;
	DataInputStream is;
	OutputStream os;
	OutputStreamWriter osw;

	SessionRecorder rec;
	boolean inNormalProtocol = false;
	VncViewer viewer;

	// Java on UNIX does not call keyPressed() on some keys, for example
	// swedish keys To prevent our workaround to produce duplicate
	// keypresses on JVMs that actually works, keep track of if
	// keyPressed() for a "broken" key was called or not. 
	boolean brokenKeyPressed = false;

	// This will be set to true on the first framebuffer update
	// containing Zlib- or Tight-encoded data.
	boolean wereZlibUpdates = false;

	// This will be set to false if the startSession() was called after
	// we have received at least one Zlib- or Tight-encoded framebuffer
	// update.
	boolean recordFromBeginning = true;

	// This fields are needed to show warnings about inefficiently saved
	// sessions only once per each saved session file.
	boolean zlibWarningShown;
	boolean tightWarningShown;

	// Before starting to record each saved session, we set this field
	// to 0, and increment on each framebuffer update. We don't flush
	// the SessionRecorder data into the file before the second update. 
	// This allows us to write initial framebuffer update with zero
	// timestamp, to let the player show initial desktop before
	// playback.
	int numUpdatesInSession;

	//
	// Constructor. Make TCP connection to RFB server.
	//

	RfbProto(String h, int p, VncViewer v) throws IOException {
		viewer = v;
		host = h;
		port = p;
		sock = new Socket(host, port);
		is =
			new DataInputStream(
				new BufferedInputStream(sock.getInputStream(), 16384));
		os = sock.getOutputStream();
		osw = new OutputStreamWriter(sock.getOutputStream());
		inDirectory2 = false;
		a = new ArrayList();
		// sf@2004
		remoteDirsList = new ArrayList();
		remoteFilesList = new ArrayList();
	
		sendFileSource = "";
	}

	void close() {
		try {
			sock.close();
			if (rec != null) {
				rec.close();
				rec = null;
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	//
	// Read server's protocol version message
	//

	int serverMajor, serverMinor;

	void readVersionMsg() throws Exception {

		byte[] b = new byte[12];

		is.readFully(b);

		if ((b[0] != 'R')
			|| (b[1] != 'F')
			|| (b[2] != 'B')
			|| (b[3] != ' ')
			|| (b[4] < '0')
			|| (b[4] > '9')
			|| (b[5] < '0')
			|| (b[5] > '9')
			|| (b[6] < '0')
			|| (b[6] > '9')
			|| (b[7] != '.')
			|| (b[8] < '0')
			|| (b[8] > '9')
			|| (b[9] < '0')
			|| (b[9] > '9')
			|| (b[10] < '0')
			|| (b[10] > '9')
			|| (b[11] != '\n')) {
			throw new Exception(
				"Host " + host + " port " + port + " is not an RFB server");
		}

		serverMajor = (b[4] - '0') * 100 + (b[5] - '0') * 10 + (b[6] - '0');
		serverMinor = (b[8] - '0') * 100 + (b[9] - '0') * 10 + (b[10] - '0');
	}

	//
	// Write our protocol version message
	//

	void writeVersionMsg() throws IOException {
		os.write(versionMsg.getBytes());
	}

	//
	// Find out the authentication scheme.
	//

	int readAuthScheme() throws Exception {
		int authScheme = is.readInt();

		switch (authScheme) {

			case ConnFailed :
				int reasonLen = is.readInt();
				byte[] reason = new byte[reasonLen];
				is.readFully(reason);
				throw new Exception(new String(reason));

			case NoAuth :
			case VncAuth :
			case MsLogon:
				return authScheme;

			default :
				throw new Exception(
					"Unknown authentication scheme from RFB server: "
						+ authScheme);

		}
	}

	//
	// Write the client initialisation message
	//

	void writeClientInit() throws IOException {
		if (viewer.options.shareDesktop) {
			os.write(1);
		} else {
			os.write(0);
		}
		viewer.options.disableShareDesktop();
	}

	//
	// Read the server initialisation message
	//

	String desktopName;
	int framebufferWidth, framebufferHeight;
	int bitsPerPixel, depth;
	boolean bigEndian, trueColour;
	int redMax, greenMax, blueMax, redShift, greenShift, blueShift;

	void readServerInit() throws IOException {
		framebufferWidth = is.readUnsignedShort();
		framebufferHeight = is.readUnsignedShort();
		bitsPerPixel = is.readUnsignedByte();
		depth = is.readUnsignedByte();
		bigEndian = (is.readUnsignedByte() != 0);
		trueColour = (is.readUnsignedByte() != 0);
		redMax = is.readUnsignedShort();
		greenMax = is.readUnsignedShort();
		blueMax = is.readUnsignedShort();
		redShift = is.readUnsignedByte();
		greenShift = is.readUnsignedByte();
		blueShift = is.readUnsignedByte();
		byte[] pad = new byte[3];
		is.readFully(pad);
		int nameLength = is.readInt();
		byte[] name = new byte[nameLength];
		is.readFully(name);
		desktopName = new String(name);

		inNormalProtocol = true;
	}

	//
	// Create session file and write initial protocol messages into it.
	//

	void startSession(String fname) throws IOException {
		rec = new SessionRecorder(fname);
		rec.writeHeader();
		rec.write(versionMsg.getBytes());
		rec.writeIntBE(NoAuth);
		rec.writeShortBE(framebufferWidth);
		rec.writeShortBE(framebufferHeight);
		byte[] fbsServerInitMsg =
			{
				32,
				24,
				0,
				1,
				0,
				(byte) 0xFF,
				0,
				(byte) 0xFF,
				0,
				(byte) 0xFF,
				16,
				8,
				0,
				0,
				0,
				0 };
		rec.write(fbsServerInitMsg);
		rec.writeIntBE(desktopName.length());
		rec.write(desktopName.getBytes());
		numUpdatesInSession = 0;

		if (wereZlibUpdates)
			recordFromBeginning = false;

		zlibWarningShown = false;
		tightWarningShown = false;
	}

	//
	// Close session file.
	//

	void closeSession() throws IOException {
		if (rec != null) {
			rec.close();
			rec = null;
		}
	}

	//
	// Set new framebuffer size
	//

	void setFramebufferSize(int width, int height) {
		framebufferWidth = width;
		framebufferHeight = height;
	}

	//
	// Read the server message type
	//

	int readServerMessageType() throws IOException {
		int msgType = is.readUnsignedByte();

		// If the session is being recorded:
		if (rec != null) {
			if (msgType == Bell) { // Save Bell messages in session files.
				rec.writeByte(msgType);
				if (numUpdatesInSession > 0)
					rec.flush();
			}
		}

		return msgType;
	}

	//
	// Read a FramebufferUpdate message
	//

	int updateNRects;

	void readFramebufferUpdate() throws IOException {
		is.readByte();
		updateNRects = is.readUnsignedShort();

		// If the session is being recorded:
		if (rec != null) {
			rec.writeByte(FramebufferUpdate);
			rec.writeByte(0);
			rec.writeShortBE(updateNRects);
		}

		numUpdatesInSession++;
	}

	// Read a FramebufferUpdate rectangle header

	int updateRectX, updateRectY, updateRectW, updateRectH, updateRectEncoding;

	void readFramebufferUpdateRectHdr() throws Exception {
		updateRectX = is.readUnsignedShort();
		updateRectY = is.readUnsignedShort();
		updateRectW = is.readUnsignedShort();

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
麻豆一区二区在线| 欧美日韩和欧美的一区二区| 国产日本一区二区| 97精品久久久午夜一区二区三区| 国内成人免费视频| 在线成人av网站| 久久精品免费观看| 亚洲欧美怡红院| 欧美日本视频在线| 大胆亚洲人体视频| 午夜精品视频在线观看| 久久婷婷成人综合色| 色婷婷av久久久久久久| 亚洲成人在线网站| 国产精品三级av在线播放| 欧日韩精品视频| 国产成人8x视频一区二区| 亚洲国产视频在线| 中文字幕日本乱码精品影院| 欧美一区二区视频在线观看2022 | 91丨九色丨尤物| 美女被吸乳得到大胸91| 亚洲人123区| 国产亚洲一区二区三区在线观看| 欧美日韩一区精品| 91免费看视频| 色综合天天性综合| 岛国av在线一区| 国产成人亚洲精品青草天美| 琪琪一区二区三区| 日韩国产欧美三级| 五月综合激情婷婷六月色窝| 亚洲欧洲精品成人久久奇米网| 日韩三级视频在线看| 91精品国产手机| 欧美夫妻性生活| 精品国产成人系列| 久久先锋影音av鲁色资源网| 久久尤物电影视频在线观看| 久久久蜜臀国产一区二区| 精品国一区二区三区| 欧美精品一区二区三区蜜桃| 精品久久人人做人人爽| 日韩免费性生活视频播放| 欧美一区二区三区视频免费播放| 欧美日韩在线精品一区二区三区激情| 欧美日韩国产中文| 精品久久人人做人人爰| 国产精品久久久久久久久免费丝袜| 国产日韩精品一区二区三区| 亚洲免费观看视频| 精品亚洲国内自在自线福利| 成人理论电影网| 欧美一区二区免费观在线| 久久先锋影音av鲁色资源网| 国产精品国产自产拍高清av| 亚洲国产精品一区二区www| 国产一区二区三区蝌蚪| 日本韩国视频一区二区| 久久久久久久一区| 日韩激情视频在线观看| 成人不卡免费av| 欧美成va人片在线观看| 亚洲欧美日韩电影| 国产精品18久久久久| 亚洲人成小说网站色在线| 中文字幕亚洲综合久久菠萝蜜| 天天综合天天综合色| 欧美日韩中文字幕一区二区| 日韩欧美自拍偷拍| 日韩精品1区2区3区| 日本韩国精品在线| 亚洲永久免费视频| 欧美综合一区二区三区| 亚洲国产视频a| 欧美日韩成人在线| 日本欧美一区二区在线观看| 欧美日韩国产综合一区二区| 亚洲精品国产视频| 91精品福利在线一区二区三区| 午夜不卡在线视频| 日韩美一区二区三区| 国产乱码字幕精品高清av | 国产精品乱码人人做人人爱| 国产一区二区精品久久99| 欧美国产视频在线| 91片在线免费观看| 日产国产欧美视频一区精品| 精品久久99ma| 欧美视频精品在线观看| 亚洲va欧美va国产va天堂影院| 在线不卡一区二区| 成人午夜精品一区二区三区| 欧美国产精品一区二区三区| 99视频精品在线| 麻豆精品久久久| 亚洲精品日产精品乱码不卡| 精品美女一区二区| 在线观看日韩av先锋影音电影院| 精品一区二区日韩| 亚洲欧美电影一区二区| 欧美成人video| 在线观看视频一区| 91丨porny丨中文| 国产激情视频一区二区三区欧美 | 91首页免费视频| 国产麻豆9l精品三级站| 亚洲在线观看免费| 1024国产精品| 亚洲欧美国产77777| 欧美经典一区二区三区| 日韩女优制服丝袜电影| 精品婷婷伊人一区三区三| 色域天天综合网| 99re这里只有精品视频首页| 国产不卡视频在线观看| 久久激情综合网| 国产一区二区三区在线观看精品| 日韩精品一级二级 | 日本伊人午夜精品| 午夜精品在线看| 蜜臀va亚洲va欧美va天堂 | 久久久不卡影院| 欧美国产一区二区| 亚洲蜜臀av乱码久久精品蜜桃| 国产视频一区二区在线观看| 一区二区三区精品在线观看| 日本一区二区三级电影在线观看| 久久久久久久久一| 亚洲摸摸操操av| 亚洲成人一区在线| 久久电影网站中文字幕| 成人国产亚洲欧美成人综合网| 色视频成人在线观看免| 日韩一区二区三区av| 国产三级精品三级在线专区| 亚洲嫩草精品久久| 久久国产综合精品| 在线中文字幕不卡| 久久―日本道色综合久久| 亚洲美女在线一区| 狠狠色丁香九九婷婷综合五月| 精东粉嫩av免费一区二区三区| eeuss影院一区二区三区| 91麻豆精品91久久久久久清纯| 久久久高清一区二区三区| 日韩精品免费视频人成| av中文一区二区三区| 久久嫩草精品久久久精品一| 亚洲精品第一国产综合野| 成人午夜激情视频| 国产日韩欧美制服另类| 麻豆国产精品官网| 日韩美女视频在线| 丝袜美腿亚洲色图| 欧美精品精品一区| 久久精品久久精品| 欧美午夜电影网| 亚洲成人1区2区| 欧美色涩在线第一页| 一个色在线综合| 欧美午夜精品一区二区三区 | 国产精品久久久久久久久晋中| 狠狠色2019综合网| 中文字幕永久在线不卡| 色狠狠色噜噜噜综合网| 亚洲一区二区三区美女| 宅男噜噜噜66一区二区66| 日韩专区欧美专区| 久久夜色精品国产欧美乱极品| 国产美女主播视频一区| 亚洲婷婷在线视频| 欧美美女激情18p| 精品一区二区三区免费| 国产精品久久国产精麻豆99网站| 成人av在线资源网站| 亚洲国产中文字幕| 精品久久国产字幕高潮| 91在线国产观看| 国产精品自拍毛片| 一区二区三区精密机械公司| 欧美一级国产精品| 成人久久视频在线观看| 秋霞国产午夜精品免费视频| 国产欧美日韩另类一区| 欧美一区二区三区视频免费播放 | 欧美视频你懂的| www.爱久久.com| 成人免费毛片高清视频| 久久草av在线| 美女爽到高潮91| 午夜精品久久久久| 亚洲国产精品久久人人爱蜜臀| 久久亚洲二区三区| 欧美一区二区三区免费视频| 91精彩视频在线观看| 99re这里只有精品视频首页| 成人美女在线观看| av动漫一区二区| 日本韩国精品一区二区在线观看|