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

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

?? chworld.cpp

?? Windows上的MUD客戶端程序
?? CPP
?? 第 1 頁 / 共 5 頁
字號:
/*----------------------------------------------------------------------------
                        _                              _ _       
        /\             | |                            | (_)      
       /  \   _ __   __| |_ __ ___  _ __ ___   ___  __| |_  __ _ 
      / /\ \ | '_ \ / _` | '__/ _ \| '_ ` _ \ / _ \/ _` | |/ _` |
     / ____ \| | | | (_| | | | (_) | | | | | |  __/ (_| | | (_| |
    /_/    \_\_| |_|\__,_|_|  \___/|_| |_| |_|\___|\__,_|_|\__,_|

    The contents of this file are subject to the Andromedia Public
	License Version 1.0 (the "License"); you may not use this file
	except in compliance with the License. You may obtain a copy of
	the License at http://www.andromedia.com/APL/

    Software distributed under the License is distributed on an
	"AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
	implied. See the License for the specific language governing
	rights and limitations under the License.

    The Original Code is Pueblo client code, released November 4, 1998.

    The Initial Developer of the Original Code is Andromedia Incorporated.
	Portions created by Andromedia are Copyright (C) 1998 Andromedia
	Incorporated.  All Rights Reserved.

	Andromedia Incorporated                         415.365.6700
	818 Mission Street - 2nd Floor                  415.365.6701 fax
	San Francisco, CA 94103

    Contributor(s):
	--------------------------------------------------------------------------
	   Chaco team:  Dan Greening, Glenn Crocker, Jim Doubek,
	                Coyote Lussier, Pritham Shetty.

					Wrote and designed original codebase.

------------------------------------------------------------------------------

	Defines the ChWorld module for the Pueblo system.  This module is
	used to connect to external worlds, either old-style MUDs or Pueblo-
	enhanced virtual worlds.

----------------------------------------------------------------------------*/

// $Header: /home/cvs/chaco/modules/client/msw/ChWorld/ChWorld.cpp,v 2.228 1996/10/09 22:14:21 pritham Exp $

#include "headers.h"
#if !defined(CH_PUEBLO_PLUGIN)
#include "resource.h"
#else
#include "vwrres.h"
#endif

#ifdef CH_UNIX
#include <ChDispat.h>
#include <ChMsgTyp.h>
#include <ChReg.h>
#include <ChDialogs.h>
#include <ChTypes.h>
#include <ChGraphx.h>
#include "../../unix/ChWorld/UnixRes.h"
#include "ChWList.h"
#endif // CH_UNIX

#include <fstream.h>
#include <ctype.h>
#include <time.h>

#include <ChCore.h>
#include <ChMsgTyp.h>
#include <ChExcept.h>

#if !defined( CH_PUEBLO_PLUGIN )
#include <ChMenu.h>
#else
#include <ChHttp.h>
#endif

#include <ChHtmWnd.h>
											/* Headers for modules referenced
												by this module */
#include <ChSound.h>

#if defined( CH_MSW )

	#include <ChGraphx.h>

#endif	// defined( CH_MSW )


#include <ChWorld.h>

#include "World.h"
#include "ChWConn.h"
#include "ChTextInput.h"
#include "ChWorldStream.h"
#include "ChConnectDlg.h"

#if defined( CH_MSW )

	#include "ChWListD.h"
#if !defined( CH_PUEBLO_PLUGIN )
	#include "ChAbout.h"
	#include "ChPrefsWorld.h"
	#include "ChPrefsNotify.h"
	#include "ChQuickConnect.h"
#endif

#endif	// defined( CH_MSW )


/*----------------------------------------------------------------------------
	Constants
----------------------------------------------------------------------------*/

#define PERSONAL_URL			"personal:"
#define WORLD_LIST_URL			"world-list:"
#define WORLD_LIST_EDIT_URL		"world-list-edit:"
#define PERSONAL_URL_OLD		"http://~"
#define MAILTO_URL_PREFIX		"mailto:"

#define SAVE_DLG_FLAGS			(OFN_OVERWRITEPROMPT | OFN_HIDEREADONLY)
#define SAVE_DLG_FILTER			"Text Files (*.txt)|*.txt|"\
								"HTML Files (*.htm)|*.htm|"\
								"All Files (*.*)|*.*||"
#define SAVE_DLG_FILTER_LONG	"Text Files (*.txt)|*.txt|"\
									"HTML Files (*.htm;*.html)|*.htm;*.html|"\
									"All Files (*.*)|*.*||"
#define SAVE_LOG_DIR			"Logs"


/*----------------------------------------------------------------------------
	Type definitions
----------------------------------------------------------------------------*/

typedef enum { invalid, xworld, href, xcmd, xmode } CommandType;


/*----------------------------------------------------------------------------
	Utility functions
----------------------------------------------------------------------------*/

CH_INTERN_FUNC( CommandType )
GetCommand( const string& strCommand, string& strValue, bool boolInline );

CH_INTERN_FUNC( bool )
FormatHint( string& strHint );

inline bool IsTargetSelfOutput( const string& strTarget )
	{
		bool	boolSelf = (strTarget.Compare( "_self" ) == 0);

		return boolSelf;
	}


/*----------------------------------------------------------------------------
	Socket handler declaration
----------------------------------------------------------------------------*/

CH_DECLARE_SOCKET_HANDLER( worldSocketHandler )
CH_DECLARE_SOCKET_ASYNC_HANDLER( worldSocketAsyncHandler )


/*----------------------------------------------------------------------------
	Handler declarations
----------------------------------------------------------------------------*/

CH_DECLARE_MESSAGE_HANDLER( defWorldHandler )
CH_DECLARE_MESSAGE_HANDLER( worldInitHandler )
CH_DECLARE_MESSAGE_HANDLER( worldShowModuleHandler )
CH_DECLARE_MESSAGE_HANDLER( worldLoadCompleteHandler )
CH_DECLARE_MESSAGE_HANDLER( worldLoadErrorHandler )

#if !defined( CH_PUEBLO_PLUGIN )
CH_DECLARE_MESSAGE_HANDLER( worldGetPageCountHandler )
CH_DECLARE_MESSAGE_HANDLER( worldGetPagesHandler )
CH_DECLARE_MESSAGE_HANDLER( worldGetPageDataHandler )
CH_DECLARE_MESSAGE_HANDLER( worldReleasePagesHandler )
#endif // #if !defined( CH_PUEBLO_PLUGIN )

CH_DECLARE_MESSAGE_HANDLER( worldCommandHandler )
CH_DECLARE_MESSAGE_HANDLER( worldInlineHandler )
CH_DECLARE_MESSAGE_HANDLER( worldHintHandler )
CH_DECLARE_MESSAGE_HANDLER( worldInvalidWorldHandler )
CH_DECLARE_MESSAGE_HANDLER( worldSendWorldCmdHandler )

static ChMsgHandlerDesc	worldHandlers[] =
					{	{CH_MSG_INIT, worldInitHandler},
						{CH_MSG_SHOW_MODULE, worldShowModuleHandler},
						{CH_MSG_LOAD_COMPLETE, worldLoadCompleteHandler},
						{CH_MSG_LOAD_ERROR, worldLoadErrorHandler},
#if !defined( CH_PUEBLO_PLUGIN )
						{CH_MSG_GET_PAGE_COUNT, worldGetPageCountHandler},
						{CH_MSG_GET_PAGES, worldGetPagesHandler},
						{CH_MSG_GET_PAGE_DATA, worldGetPageDataHandler},
						{CH_MSG_RELEASE_PAGES, worldReleasePagesHandler},
#endif
						{CH_MSG_CMD, worldCommandHandler},
						{CH_MSG_INLINE, worldInlineHandler},
						{CH_MSG_HINT, worldHintHandler},
						{CH_MSG_INVALID_WORLD, worldInvalidWorldHandler},
						{CH_MSG_SEND_WORLD_CMD, worldSendWorldCmdHandler} };


/*----------------------------------------------------------------------------
	Chaco menu handlers
----------------------------------------------------------------------------*/

#if !defined( CH_PUEBLO_PLUGIN )

CH_DECLARE_MESSAGE_HANDLER( fileMenuHandler )

CH_DECLARE_MESSAGE_HANDLER( editMenuHandler )
CH_DECLARE_MESSAGE_HANDLER( OnStdEditCopy )
CH_DECLARE_MESSAGE_HANDLER( OnStdEditCut )
CH_DECLARE_MESSAGE_HANDLER( OnStdEditPaste )

CH_DECLARE_MESSAGE_HANDLER( viewMenuHandler )
CH_DECLARE_MESSAGE_HANDLER( OnViewPrevCommand )

CH_DECLARE_MESSAGE_HANDLER( worldMenuHandler )
CH_DECLARE_MESSAGE_HANDLER( OnWorldListCommand )
CH_DECLARE_MESSAGE_HANDLER( OnWorldAddCommand )
CH_DECLARE_MESSAGE_HANDLER( OnWorldCreateShortcutCommand )
CH_DECLARE_MESSAGE_HANDLER( OnWorldQuickConnectCommand )
CH_DECLARE_MESSAGE_HANDLER( OnWorldDisconnectCommand )
CH_DECLARE_MESSAGE_HANDLER( OnWorldLoggingCommand )

CH_DECLARE_MESSAGE_HANDLER( windowMenuHandler )
CH_DECLARE_MESSAGE_HANDLER( OnWindowInputCommand )

#endif // !defined( CH_PUEBLO_PLUGIN )


/*----------------------------------------------------------------------------
	ChWorldTinTin class
----------------------------------------------------------------------------*/

ChWorldTinTin::ChWorldTinTin( ChWorldMainInfo* pMainInfo ) :
				TinTin( pMainInfo )
{
}


void ChWorldTinTin::SendToWorld( const string& strOutput )
{
	if (IsOnline())
	{										/* This function doesn't apply
												any tintin processing to the
												string that it is sending */
		GetMainInfo()->Send( strOutput );
	}
}


void ChWorldTinTin::Display( const string& strOutput,
								bool boolPreformatted ) const
{
	if (IsOnline())
	{										/* This function doesn't apply
												any tintin processing to the
												string that it is sending */

		GetMainInfo()->Display( strOutput, boolPreformatted );
	}
}


/*----------------------------------------------------------------------------
	ChWorldMainInfo class
----------------------------------------------------------------------------*/

ChWorldMainInfo::ChWorldMainInfo( const ChModuleID& idModule, ChCore* pCore,
										ChArgumentList* pList ) :
					ChMainInfo( idModule, pCore ),
					m_iConnectID( 0 ),
					m_pTextInput( 0 ),
					m_pTextOutput( 0 ),
					m_pWorldConn( 0 ),
					m_pTinTin( 0 ),
					m_pWorldStreamMgr( 0 ),
					m_worldDispatcher( pCore, idModule, defWorldHandler ),
					m_boolPuebloEnhancedFound( false ),
					m_focusTarget( focusNone ),
					m_idSoundModule( 0 ),
					m_idGraphicsModule( 0 ),
					m_pWorldInfo( 0 ),
					m_boolShown( false ),
					m_echoState( echoOn ),
	#if !defined( CH_PUEBLO_PLUGIN )
					m_boolMenus( false ),
					m_boolMenusInstalled( false ),
					m_pStdFileMenu( 0 ),
					m_pStdEditMenu( 0 ),
					m_pStdViewMenu( 0 ),
					m_pWorldMenu( 0 ),
					m_pStdWindowMenu( 0 ),
	#endif
					m_boolPersonalList( false ),
					m_boolDisplayChanged( true ),
					m_boolLoadPending( false ),
					m_pConnectingDlg( 0 ),
					m_boolWaitingForHostName( false ),
					m_worldCmdLine( pList )
{
											// Create the TinTin object
	m_pTinTin = new ChWorldTinTin( this );
											// Create the stream manager
	m_pWorldStreamMgr =
		new ChWorldStreamManager( this, GetModuleID() );
	ASSERT( m_pWorldStreamMgr );
											// Read the registry settings
	UpdatePreferences();

	RegisterDispatchers();
											// Create critical section object

	InitializeCriticalSection( &m_critsecDisconnect );
}


ChWorldMainInfo::~ChWorldMainInfo()
{
	#if !defined( CH_PUEBLO_PLUGIN )
		DestroyMenus();
	#endif
	
		ShutdownWorld( true, true );

	if (m_pWorldStreamMgr)
	{										// Delete the stream manager
		delete m_pWorldStreamMgr;
		m_pWorldStreamMgr = 0;
	}
											// Free the URL history items
	EmptyURLList();
											// Delete the Text output object
	if (m_pTextOutput)
	{
		delete m_pTextOutput;
		m_pTextOutput = 0;
	}
											// Delete the Text input object
	if (m_pTextInput)
	{
		delete m_pTextInput;
		m_pTextInput = 0;
	}
											// Delete the TinTin object
	if (m_pTinTin)
	{
		delete m_pTinTin;
		m_pTinTin = 0;
	}

	UnloadSoundModule();
	UnloadGraphicsModule();
											// Destroy critical section objects

	DeleteCriticalSection( &m_critsecDisconnect );
}


void ChWorldMainInfo::OnSecondTick( time_t timeCurr )
{
	if (IsConnected())
	{
		GetTinTin()->OnSecondTick( timeCurr );
	}
}


void ChWorldMainInfo::Initialize()
{											/* Create the text input and
												output objects */
	m_pTextInput = new ChTextInput( this );
	m_pTextOutput = new ChTextOutput( this );
											/* Load the sound module as
												'optional' */
	LoadSoundModule( true );
											// Create the menus
#if !defined( CH_PUEBLO_PLUGIN )
	CreateMenus();
#endif
											// Perform startup processing
	OnInitialStartup();
}


void ChWorldMainInfo::ShowModule( bool boolShow )
{
	ChShowModuleMsg	showMsg( boolShow );

	if (boolShow && !IsShown())
	{
		
		#if !defined( CH_PUEBLO_PLUGIN )
			InstallMenus();
		#endif

		SetShown( boolShow );
	}
	else if (!boolShow && IsShown())
	{
		#if !defined( CH_PUEBLO_PLUGIN )
				UninstallMenus();
		#endif

		m_boolShown = false;

		SetShown( boolShow );
	}
											// Hide or show the ChSound module
	if (GetSoundID())
	{
		NotifySound( showMsg );
	}
											// Hide or show the ChGraphx module
	if (GetGraphicsID())
	{
		NotifyGraphics( showMsg );
	}
}


void ChWorldMainInfo::DisplayWorldList()
{
	if (DisplayChanged())
	{
		SetDisplayChanged( false );
											// Clear the text output window
		GetTextOutput()->Clear();

		if (m_urlList.IsEmpty())
		{									// Display the personal list


			DoJump( PERSONAL_URL, "", true, true, true );
		}
		else
		{									// Display the last page viewed
			string*		pstrTail;

			pstrTail = (string*)m_urlList.GetTail();
			DoJump( *pstrTail, "", true, false );
		}
	}
}


void ChWorldMainInfo::Send( const string& strText, bool boolEcho )
{
	GetWorldConnection()->SendWorldCommand( strText, boolEcho );
}


void ChWorldMainInfo::Send( const string& strDefaultCmd,
							const string& strMD5,
							const string& strOverrideCmd,
							const string& strParams,
							bool boolEcho )
{
	string		strCmd;

	if (!strMD5.IsEmpty() && !strOverrideCmd.IsEmpty())
	{
		if (VerifyMD5( strMD5 ))
		{
			strCmd = strOverrideCmd;
		}
	}

	if (strCmd.IsEmpty())
	{
		strCmd = strDefaultCmd;
	}

	strCmd += ' ' + strParams;

	Send( strCmd, boolEcho );
}


void ChWorldMainInfo::Display( const string& strText, bool boolPreformatted )
{
	string		strTextOut( strText );
	string		strOut;

	GetWorldConnection()->TurnHtmlOn( strOut );

	if (boolPreformatted)
	{
		strOut += "<pre>";
	}

	strOut += "<b><font text=\"#000080\">";

								/* Strip out HTML from the users'
									text and append it to the
									output buffer */

	ChHtmlWnd::EscapeForHTML( strTextOut );
	strOut += strTextOut;

	if (boolPreformatted)
	{
		strOut += "</pre>";
	}

	strOut += "</font></b><br>";

	GetWorldConnection()->TurnHtmlOff( strOut );
	GetTextOutput()->Add( strOut, false );
}


bool ChWorldMainInfo::DoCommand( const string& strCommand, chint32 lX,
									chint32 lY )
{
	bool		boolProcessed = true;
	ChCmdMsg	msg( strCommand, lX, lY );

	boolProcessed = DoHook( msg );

	if (!boolProcessed)
	{
		CommandType	command;
		string		strValue;
		string		strCoord;

		command = GetCommand( strCommand, strValue, false );

		if ((lX >= 0) && (lY >= 0))
		{										/* Append the coordinates to the
													command */
			char	buffer[80];

			sprintf( buffer, "?%ld,%ld", lX, lY );
			strCoord = buffer;
		}

		switch( command )
		{
			case xworld:
			{
				ChWorldInfo	info( strValue );

				if (info.IsValid())
				{
					Connect( info );
				}
				break;
			}

			case href:
			{

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品色婷婷| 亚洲黄一区二区三区| 91啦中文在线观看| 久久精品国产久精国产| 亚洲日本一区二区三区| 精品国产精品一区二区夜夜嗨| 91麻豆国产自产在线观看| 青青草成人在线观看| 亚洲精品中文在线| 国产性色一区二区| 欧美一区二区三区人| 一本色道亚洲精品aⅴ| 精品系列免费在线观看| 亚洲国产欧美在线人成| 日本一区二区电影| 日韩欧美亚洲一区二区| 欧美视频在线观看一区| 成av人片一区二区| 国产91精品在线观看| 欧美a级一区二区| 午夜伊人狠狠久久| 亚洲精品视频一区| 亚洲大片精品永久免费| 91精品国产欧美一区二区18| 色悠久久久久综合欧美99| 高清久久久久久| 国模套图日韩精品一区二区 | 国产一区二区视频在线| 亚洲一级在线观看| 一区二区三区在线免费| 国产精品传媒在线| **欧美大码日韩| 中文字幕乱码一区二区免费| 久久这里都是精品| 欧美成人a视频| 日韩欧美国产一区二区三区| 欧美一区二区观看视频| 9191久久久久久久久久久| 欧美三级电影在线看| 在线观看国产日韩| 欧美视频中文字幕| 精品视频在线看| 欧美色成人综合| 欧美日韩一区二区三区四区五区 | 一区二区三区四区亚洲| 伊人性伊人情综合网| 亚洲精品视频一区二区| 亚洲国产va精品久久久不卡综合| 亚洲精品高清在线| 亚洲 欧美综合在线网络| 亚洲一区二区av在线| 日韩精品一二三| 毛片av一区二区三区| 国产精品一区二区在线观看网站| 国产乱子伦视频一区二区三区| 国产福利91精品一区二区三区| 国产精品综合网| 成人app软件下载大全免费| 99久久免费国产| 欧美日韩中文一区| 欧美mv日韩mv| 国产农村妇女精品| 亚洲精品国产一区二区精华液 | 国产成人午夜高潮毛片| av亚洲精华国产精华精| 91麻豆国产自产在线观看| 精品视频在线视频| 久久嫩草精品久久久精品| 国产精品久久久久久久久久免费看| 自拍偷拍欧美精品| 日韩精品一卡二卡三卡四卡无卡| 国产在线精品不卡| 色视频欧美一区二区三区| 8v天堂国产在线一区二区| 久久综合一区二区| 中文字幕一区二区三区视频| 亚洲成人免费视| 国产一区二区免费视频| 日本二三区不卡| 欧美成人官网二区| 亚洲精品伦理在线| 激情图区综合网| 在线免费亚洲电影| 2021中文字幕一区亚洲| 亚洲免费av网站| 精品亚洲国内自在自线福利| 99视频在线精品| 日韩欧美中文字幕一区| 亚洲视频一二三| 国产美女视频一区| 精品1区2区3区| 亚洲欧美综合色| 国内一区二区视频| 欧美撒尿777hd撒尿| 中文av一区特黄| 久久精工是国产品牌吗| 欧美性xxxxx极品少妇| 日本一区二区三区国色天香 | 91香蕉视频在线| 日韩午夜精品视频| 艳妇臀荡乳欲伦亚洲一区| 国产精品888| 欧美一区二区性放荡片| 夜夜嗨av一区二区三区网页| 国产精品 欧美精品| 91精品免费观看| 亚洲一二三区视频在线观看| 成人小视频免费在线观看| 欧美一级淫片007| 亚洲一区av在线| 色婷婷综合久色| 国产精品美女久久久久久久久久久| 免费不卡在线观看| 69久久夜色精品国产69蝌蚪网| 亚洲美女屁股眼交3| 成人精品一区二区三区四区| 精品久久久网站| 美女看a上一区| 日韩欧美电影一区| 日韩国产精品久久久| 在线免费一区三区| 亚洲最大的成人av| 色婷婷亚洲婷婷| 亚洲三级久久久| av资源站一区| 国产精品国产三级国产有无不卡| 久久99蜜桃精品| 精品蜜桃在线看| 韩国精品久久久| 欧美大片拔萝卜| 极品少妇一区二区| 精品91自产拍在线观看一区| 精品无人码麻豆乱码1区2区| 日韩一区二区精品葵司在线| 天天射综合影视| 欧美一区二区在线视频| 麻豆91免费看| 久久综合色鬼综合色| 免费欧美高清视频| 日韩一区二区在线观看视频| 午夜精品爽啪视频| 欧美一级搡bbbb搡bbbb| 日本色综合中文字幕| 欧美xfplay| 国产成人综合精品三级| 国产女主播视频一区二区| 成人av片在线观看| 亚洲美女电影在线| 欧美色手机在线观看| 男人的j进女人的j一区| 精品噜噜噜噜久久久久久久久试看 | 欧美一区二区三区精品| 免费欧美日韩国产三级电影| 亚洲精品在线一区二区| 成人免费视频一区| 综合电影一区二区三区| 欧美三级日韩在线| 免费日韩伦理电影| 国产亚洲精品超碰| 色婷婷激情一区二区三区| 午夜精品福利在线| 26uuu精品一区二区| eeuss鲁片一区二区三区| 亚洲激情男女视频| 欧美成人a∨高清免费观看| 成人黄色片在线观看| 亚洲韩国精品一区| 精品国产sm最大网站| 91免费小视频| 青青草成人在线观看| 国产精品久久久久一区| 欧美日韩一二区| 国产一区二区三区在线观看免费视频| 亚洲国产高清在线观看视频| 在线观看国产日韩| 国产精品一二三四区| 亚洲精品日韩综合观看成人91| 91精品国产欧美一区二区成人 | 亚洲国产欧美一区二区三区丁香婷| 制服丝袜中文字幕一区| 国产成人精品三级麻豆| 亚洲国产一区二区在线播放| 亚洲精品在线电影| 在线观看视频一区二区欧美日韩| 久久精品国产秦先生| 亚洲综合另类小说| 26uuu国产一区二区三区| 欧美在线视频不卡| 国产精品一区二区久激情瑜伽| 一区二区三区**美女毛片| 久久久久88色偷偷免费 | 中文字幕一区视频| 日韩一区二区高清| 在线看一区二区| 国产不卡一区视频| 天堂精品中文字幕在线| 中文字幕在线视频一区| 欧美大片日本大片免费观看| 在线观看网站黄不卡| www.亚洲在线|