⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 gameproc.cpp

📁 网络游戏龙族 完整的登陆器 C++ 源代码
💻 CPP
📖 第 1 页 / 共 5 页
字号:
	if ( UpdateInputState( ) == DI_OK )
	{	
		KeyboardProc( );
		MouseProc( );
	}	
	
	ViewCheckRoutine( 40 );
	
JUMP_SKIP:
	
	CharacterProcCheck();
	
	ViewCheckRoutine( 50 );
	
	CircleMagic();
	EffectProc();
	DrawItemList();
	OutputNumberAni();
	OutputSkillGauge();
	
	CheckTime_SkillMsg();
	
	ViewCheckRoutine( 60 );
	
	DrawClock(); //付阑 甘牢 版快
	
	CalcOrder();

	if( !tool_ViewMenu )
	MenuChecking();     //皋春 备己夸家狼 面倒眉农MenuChecking();     
	
	g_nLButtonState		= 0;	g_nRButtonState		= 0;
	g_nLDButtonState	= 0;	g_nRDButtonState	= 0;
	
	RainAnimationSetting();
	SnowAnimationSetting();
	CurrentMsgMgr.CheckCurrentStatusMessage();
	
	ViewCheckRoutine( 70 );
	
	OutputSkillCursor();
	CheckEventAttrTile();
	
	// SoundUp 
	BackEffectSound2(MapNumber);

	ViewCheckRoutine( 80 );

	CheckHpUpDown();

	if ( ProtocolWritingProc( &connections ) < 0 )	{return FALSE;}

	gr.GuideGhost_PreSet();

	if(!g_FrameMgr.CanNextFrame())
	{
		goto SKIP__;
	}

	if(!g_bIsActive)
	{	//< CSD-030723
		goto SKIP__;
	}	//> CSD-030723
	
	g_DestBackBuf = GetSurfacePointer( g_DirectDrawInfo.lpDirectDrawSurfaceBack );
	if( SysInfo.notconectserver || tool_DrawMap )	EraseScreen( lpDirectDrawInfo, RGB( 0x00, 0x00, 0x00 ) );
	
	curr_direct_draw_info = lpDirectDrawInfo;		// 1027 YGI
	CursorStatus();
	ViewCheckRoutine( 100 );
	
	DisplaySpriteUnderTile();
	MapDisplay( 0 );
	ViewCheckRoutine( 110 );
	DrawSkilltile();

	DisplaySpriteBottom();
	PutDestPoint();
	DisplayShadowFirst();
	MapDisplay( 2 );

	ViewCheckRoutine( 120 );

	DisplaySprite();
	
	MapDisplay( 1 );
	
	
	ViewCheckRoutine( 130 );
	
	DisplaySpriteCeiling();
	
	DisplaySkillCursor();
	
	ViewCheckRoutine( 140 );
	
	DisplaySpriteTrans();
	
	ViewCheckRoutine( 150 );
	
	MapDisplay_Attr();

	DisplayFightStone();
	
	_DisplayMapObjectAfter();

	ViewCheckRoutine( 160 );

	ViewRoofData();
	RainAnimationOutput();
	SnowAnimationOutput();
		
	DisplaySpriteNo();
		
	ViewCheckRoutine( 170 );

	CheckParticleEffect();	// LTS DRAGON
	DrawParticleEffect();	// LTS DRAGON

	MapBright();

	ViewCheckRoutine( 180 );
	
	DisplayChatAndNumber();

	LocalWarInfoDisPlay();		// LTS LOCALWAR
  
	if( !tool_ViewMenu )
	MenuDisplay();     //皋春 备己夸家狼 面倒眉农MenuChecking();     //皋春 备己夸家狼 面倒眉农MenuDisplay();      //皋春狼 劝己咯何甫 魄窜秦 免仿窍绰 窃荐	
	
	gr.GuideGhost_OutPut();
	
	CurrentMsgMgr.ViewCurrentStatusMessage();
	
	ViewTips();
	
	Check_Beginer_BBS();

	Display_Beginer_BBS();
	
	ViewCheckRoutine( 210 );

	ViewLoadMask();
	
	DisplayDebug( );

	ViewCheckRoutine( 220 );
		
	_DisplayDebugCharInfo();

	CursorDisplayBack();

	ViewCheckRoutine( 230 );

//	TxtOut.RcTXTOut(100,100,100,1,"dwFrameSkipGab:[%d]",dwFrameSkipGab);
#ifdef USE_PROFILER	// 031013 kyo
	g_ProFileMgr.StopCounter("GameProc");
	g_ProFileMgr.DrawCounter(g_ProFileType); 
#endif 	
	FlipScreen( lpDirectDrawInfo );

//<soto-HK
	g_FrameMgr.DoFrameDelay(&pTemp);
	strcpy(pTemp,"c8");
	delete pTemp; pTemp = NULL;
//>soto-HK

SKIP__:	

	CharacterProcFrameCount();
	CheckTrap();

	///////////// SoundUp lkh 眠啊 /////////////
	ObjectSoundPlay();
	WeatherFXSound();
	//021030 YGI
	StartSound( 0 );
	//BGMFadeInOut();
	////////////////////////////////////////////

	CheckEffectSpriteFree(); //鞘夸绝绢柳 捞棋飘 胶橇扼捞飘 朝府扁
	
	CheckAutoWave();
	return	TRUE;
}	
	
//////////////////////////////////////////////////////////////////////////////
	
BOOL GameTestProc( LPDIRECTDRAWINFO lpDirectDrawInfo )
{
	static DWORD tick;
	static DWORD oldtick = ::timeGetTime();
	static DWORD deltatick;
	static int tickcount = 0;
	static int skip = 65;

	LPCHARACTER ch = NULL;

	if (SysInfo.notconectserver == 0) // normal 捞搁.
	{
		if (ProtocolProc(&connections) < 0)
		{
			return	FALSE;
		}
	}
	
	if (UpdateInputState( ) == DI_OK)
	{
		MouseProc();
	}
	
	g_OrderInfo.count = 0;
	LightCount = 0;

	CharacterProcCheck();
	EffectProc();
	DrawItemList();
	CalcOrder();
	MenuChecking();     //皋春 备己夸家狼 面倒眉农MenuChecking();     //皋春 备己夸家狼 面倒眉农MenuDisplay();      //皋春狼 劝己咯何甫 魄窜秦 免仿窍绰 窃荐
	
	g_nLButtonState = 0; 
	g_nRButtonState = 0;
	g_nLDButtonState = 0; 
	g_nRDButtonState = 0;

	RainAnimationSetting();
	SnowAnimationSetting();
	CurrentMsgMgr.CheckCurrentStatusMessage();
	CheckEventAttrTile();

	tick = ::timeGetTime();
	deltatick = tick - oldtick;
	tickcount += deltatick;
	
	if (tickcount > skip)
	{	//< CSD-031014	
		oldtick = ::timeGetTime();
		tickcount -= skip;
	}	//> CSD-031014
	else
	{	
		oldtick = ::timeGetTime();
		tickcount -= skip + 2;
	}	
//-------------------------------------------------

	if( g_DirectDrawInfo.lpDirectDraw == NULL)
	{
		if(!InitDirectDraw( g_hwndMain, &g_DirectDrawInfo )) return  FALSE;
	}
	
	g_DestBackBuf = GetSurfacePointer( g_DirectDrawInfo.lpDirectDrawSurfaceBack );
	
//	MDrawObject( lpDirectDrawInfo );
	DisplaySpriteUnderTile();
	MapDisplay( 0 );
	DisplaySpriteBottom();
	MapDisplay( 2 );
	DisplaySprite();
	MapDisplay( 1 );
	DisplaySpriteCeiling();
	DisplaySpriteTrans();

	DisplaySpriteNo();
	
	MapDisplay_Attr();
	_DisplayMapObjectAfter();
	ViewRoofData();
	
	RainAnimationOutput();
	SnowAnimationOutput();
	
	ch = Hero->lpNext;
	if( ch && tool_ViewAnimationFrame )
	{
		if( tool_AnimationEditCurFrame -1 >= 0 )
			PutCompressedImage( 300,150, &CharSpr[ch->sprno].sp[ (int)ch->direction][ tool_AnimationEditCurFrame-1] );
		Hprint2( 300, 30, g_DestBackBuf,"%d", tool_AnimationEditCurFrame-1 +1 );
			PutCompressedImage( 400,150, &CharSpr[ch->sprno].sp[ (int)ch->direction][ tool_AnimationEditCurFrame] );
		Hprint2( 400, 30, g_DestBackBuf,"%d", tool_AnimationEditCurFrame +1 );	
		if( tool_AnimationEditCurFrame +1 < tool_AnimationEditTotalSpriteNo/8 )
			PutCompressedImage( 500,150, &CharSpr[ch->sprno].sp[ (int)ch->direction][ tool_AnimationEditCurFrame+1] );
		Hprint2( 500, 30, g_DestBackBuf,"%d", tool_AnimationEditCurFrame+1+1 );
	}		
	
//	MapCurtain();
	MapBright();
	
	MenuDisplay();     //皋春 备己夸家狼 面倒眉农MenuChecking();     //皋春 备己夸家狼 面倒眉农MenuDisplay();      //皋春狼 劝己咯何甫 魄窜秦 免仿窍绰 窃荐	
	
	ViewVersion( g_GameInfo.version );
	
//	CursorDisplay( &MouseCursorFlag );	
	CurrentMsgMgr.ViewCurrentStatusMessage();
	DisplayDebug( );
	

	CursorDisplayBack();
	
	
	
	
	FlipScreen( lpDirectDrawInfo );
	while( ( (::timeGetTime()) - tick) < (DWORD)skip ) { }

SKIP__:
	
	CharacterProcFrameCount( );
	
//	if( SkipTime - STDTime < 60 )
//	{
//		while( 1 )	
//		{
//			SkipTime = ::timeGetTime();
//			if( SkipTime - STDTime > 60 ) 
//			{
//				STDTime = SkipTime;
//				break;
//			}		
//		}			
//	}
//	else
//	{
//		STDTime = SkipTime;
//	}	
	
	if( Hero->nCurrentAction < 0 || Hero->nCurrentAction > 23  )
	{
		_asm nop;
	}

	return	TRUE;
}	
	
	
	
	
	
	
static int	effect_Test=1;
///////////////// 0501 lkh 荐沥 /////////////////
void KeyboardProc( void )
{	
	if( SysInfo.viewcharacterframe ) return;

	if ( g_aCurrentKeys[ DIK_LEFT ] & 0x80 )
	{
		MoveScreen( DIRECTION_LEFT );
	}
	if ( g_aCurrentKeys[ DIK_RIGHT ] & 0x80 )
	{
		MoveScreen( DIRECTION_RIGHT );
	}
	if ( g_aCurrentKeys[ DIK_UP ] & 0x80 )
	{
		MoveScreen( DIRECTION_UP );
	}
	if ( g_aCurrentKeys[ DIK_DOWN ] & 0x80 )
	{
		MoveScreen( DIRECTION_DOWN );
	}
	if (!IsChatBoxActive())//盲泼 葛靛啊 酒聪搁
	{
		if (g_aCurrentKeys[ DIK_SPACE] & 0x80)
		{
			SetHeroPosition( 1 );		// 0110
		}		
	}

	static bool callskilltable0;
	static bool callskilltable1;
			
	if( (g_aCurrentKeys[DIK_LSHIFT ] & 0x80) || (g_aCurrentKeys[DIK_RSHIFT] & 0x80))
	{		
		DontMoveAttackFlag = true;
	}		
	else	
	{		
		DontMoveAttackFlag = false;
	}		

	if( (g_aCurrentKeys[ DIK_LCONTROL] & 0x80)	|| ( g_aCurrentKeys[ DIK_RCONTROL] & 0x80))
		CheckPC = true;
	else
		CheckPC = false;
}	
	
	
void MouseProc( void )
{	
//	if( StartMapFlag )
//	{
//		StartMapFlag = 0;
//		g_Map.tox = g_Map.x = StartMapx;
//		g_Map.toy = g_Map.y = StartMapy;
//	}


	if( tool_ID_INPUT_MAP_ATTR )
	{		
		if( tMapAttr_Offset_Modify == IDC_ATTR_OFFSET_YES2 )
		{	
			if( LButtonDownIng )
			{
				tMapAttrX = Mox/ TILE_SIZE;
				tMapAttrY = Moy/ TILE_SIZE;
				return;
			}
		}	
		else
		{	
			if( LButtonDownIng ){	tool_InputMapAttr( Mox/ TILE_SIZE, Moy/ TILE_SIZE, 1 );return; }
			if( RButtonDownIng ){	tool_InputMapAttr( Mox/ TILE_SIZE, Moy/ TILE_SIZE, 0 );return; }
		}	
	}		
	if( Hero )	SetView( Hero, Hero->sight );
	


	if( SysInfo.dx == 0 )
	{
	}
	else if( g_StartMenuOn == false  ) // 霸烙郴俊 甸绢吭阑锭, 
	{
		int mousechange = 0;

		if ( g_pointMouseX < 2 )					if( MoveScreen( DIRECTION_LEFT ) )	mousechange  = 1;	// 哭率..
		if ( g_pointMouseX > SCREEN_WIDTH - 2 )		if( MoveScreen( DIRECTION_RIGHT ) ) mousechange  = 1;   // 坷弗率..
		if ( g_pointMouseY < 2 )					if( MoveScreen( DIRECTION_UP ) )	mousechange  = 1;	// 困..
		if ( g_pointMouseY > SCREEN_HEIGHT - 2 )	if( MoveScreen( DIRECTION_DOWN ) )	mousechange  = 1;	// 酒贰..

		if( g_pointMouseX < 2 )
		{	
			if( g_pointMouseY < 2 )						{ PushMouseCursor();	CursorNo( 11 ); }
			else if( g_pointMouseY> SCREEN_HEIGHT - 2 ) { PushMouseCursor();	CursorNo( 9 );	}
			else										{ PushMouseCursor();	CursorNo( 10 ); }
		}	
		else if ( g_pointMouseX > SCREEN_WIDTH - 2 )	
		{	
			if( g_pointMouseY < 2 )						{ PushMouseCursor();	CursorNo( 13 ); }
			else if( g_pointMouseY> SCREEN_HEIGHT - 2 ) { PushMouseCursor();	CursorNo( 15 );	}
			else										{ PushMouseCursor();	CursorNo( 14 ); }
		}	
		else 
		{	
			if( g_pointMouseY < 2 )						{ PushMouseCursor();	CursorNo( 12 ); }
			else if( g_pointMouseY> SCREEN_HEIGHT - 2 ) { PushMouseCursor();	CursorNo( 8 );	}
			else										PopMouseCursor();
		}	
	}		

//----------------------

	Mapx = g_Map.x * TILE_SIZE - g_Map.oX;
	Mapy = g_Map.y * TILE_SIZE - g_Map.oY;

	Mox =  Mapx + g_pointMouseX;
	Moy =  Mapy + g_pointMouseY;
	
//	if( AutoAttackFlag )
////	{
	////	AutoAttackFlag = 0;
//		g_GameInfo.nSelectedSpriteType = AutoAttackSpriteType;
//		g_GameInfo.lpcharacter = AutoAttacklpcharacter;
//
//		DoHeroAttack( AutoAttackx, AutoAttacky );
//		return;
//	}
	
	

	switch ( g_nLButtonState )
	{
		case	STATE_BUTTON_PRESSED:		
											DoLButtonDown( );		break;
		case	STATE_BUTTON_RELEASED:		DoLButtonUp( );			break;
		case	STATE_BUTTON_STILL :	DoLbuttonStill(); break;
	}
	
	switch ( g_nRButtonState )
	{
		case	STATE_BUTTON_PRESSED:		DoRButtonDown( );		break;
		case	STATE_BUTTON_RELEASED:		DoRButtonUp( );			break;
	}		
	if( g_nLDButtonState == STATE_BUTTON_DOUBLECLICK )	DoLDButtonDown( );		
	if( g_nRDButtonState == STATE_BUTTON_DOUBLECLICK )	DoRDButtonDown( );
}	
	
	
//1206 zhh
#include "CReadArgument.h"

// LogIn Server俊 立辟...
int CheckAgentServer( t_connection *c, char *id, char *password )
{//021021 lsw
	int ret = 0;
	if( SysInfo.notconectserver == 1 ) 
	{
		goto __CheckSuccss;
	}
#ifndef JAPAN_LOCALIZING_
	if( !IsASCII( id ) ) 
	{
		ret = -9;
		goto __CheckFail;
	}
#endif
	//001215 zhh
	if( g_pBill->ReturnLineNum() < 0 )
	{
		ret  = GetAgentServerIPAddress( c );

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -