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

📄 glincomingconnectionhandler.cpp

📁 dk1游戏的原代码文件,完整.编译系统redhat7.3,mysql 3.23 ,luascript v4.0 support
💻 CPP
字号:
//----------------------------------------------------------------------//// Filename    : GLIncomingConnectionHandler.cpp// Written By  : Reiot// Description :////----------------------------------------------------------------------// include files#include "GLIncomingConnection.h"#include "Properties.h"#ifdef __LOGIN_SERVER__	#include "ReconnectLoginInfo.h"	#include "ReconnectLoginInfoManager.h"	#include "GameServerManager.h"	#include "Lpackets/LGIncomingConnectionError.h"	#include "Lpackets/LGIncomingConnectionOK.h"#endif//----------------------------------------------------------------------// // GLIncomingConnectionHander::execute()// // 霸烙 辑滚啊 肺弊牢 辑滚肺何磐 GLIncomingConnection 菩哦阑 罐霸 登搁,// ReconnectLoginInfo甫 货肺 眠啊窍霸 等促.// //----------------------------------------------------------------------void GLIncomingConnectionHandler::execute ( GLIncomingConnection * pPacket )	 throw ( ProtocolException , Error ){	__BEGIN_TRY __BEGIN_DEBUG_EX	__BEGIN_DEBUG#ifdef __LOGIN_SERVER__	//--------------------------------------------------------------------------------	//	// 牢刘虐甫 积己茄促.	//	// *NOTE*	//	// 扁粮狼 规侥篮 肺弊牢 辑滚俊辑 牢刘虐甫 积己秦辑 霸烙辑滚俊 焊辰 饶, 努扼捞攫飘肺	// 傈价沁促. 捞犯霸 且 版快 CLSelectPCHandler::execute()俊辑 牢刘虐甫 积己窍绊 	// GLIncomingConnectionOKHandler::execute()俊辑 牢刘虐甫 努扼捞攫飘肺 焊郴霸 登绰单,	// 贸府 皋筋靛啊 促福骨肺 虐蔼捞 绢叼俊急啊 蜡瘤登绢具 茄促. 啊厘 窜鉴茄 规过篮 肺弊牢	// 敲饭捞绢 按眉俊 历厘窍搁 登绰单.. 购啊 操瘤窍促. 肚促弗 规过篮 霸烙 辑滚俊辑 促矫	// 肺弊牢 辑滚肺 虐蔼阑 登倒妨林绰 巴牢单, 捞绰 匙飘况农惑俊 虐蔼捞 2雀 空汗茄促绰	// 痢俊辑 阂鞘夸窍促. 	// 	// 蝶扼辑, 肺弊牢 辑滚俊辑 积己秦辑 霸烙辑滚俊 焊郴林绰 祈捞 任纠 彬阐秦瘤霸 等促.	//	// *TODO*	//	// 弥厩狼 版快, 肺拿匙飘况农啊 胶聪欺傅寸秦辑 虐蔼捞 蜡免瞪 荐 乐促. (窍变 构 风飘	// 菩胶况靛啊 蜡免瞪 啊瓷己档 乐绰单.. - -; 捞繁 芭具 SSL阑 结具 窍绰芭绊..)	// 捞甫 措厚秦辑 GLIncomingConnectionOK 菩哦篮 鞠龋拳登绢具 茄促.	//	// 肚茄 虐蔼篮 抗螟阂啊瓷秦具 茄促. (绢瞒乔 内靛甫 焊搁 抗螟啊瓷秦柳促.)	//	//--------------------------------------------------------------------------------	DWORD authKey = rand() << ( time(0) % 10 ) + rand() >> ( time(0)% 10 );	// CI 按眉甫 积己茄促.	ReconnectLoginInfo * pReconnectLoginInfo = new ReconnectLoginInfo();	pReconnectLoginInfo->setClientIP( pPacket->getClientIP() );	pReconnectLoginInfo->setPlayerID( pPacket->getPlayerID() );	pReconnectLoginInfo->setKey( authKey );	//--------------------------------------------------------------------------------	//	// 泅犁 矫埃 + 30 檬 饶甫 expire time 栏肺 汲沥茄促.	//	// *TODO*	//	// expire period 开矫 Config 颇老俊辑 瘤沥秦林搁 亮摆促.	//	//--------------------------------------------------------------------------------	Timeval currentTime;	getCurrentTime(currentTime);		currentTime.tv_sec += 30;	pReconnectLoginInfo->setExpireTime( currentTime );	// debug message	cout << "+--------------------------------+" << endl		 << "| Incoming Connection Infomation |" << endl		 << "+--------------------------------+" << endl		 << "ClientIP : " << pPacket->getClientIP() << endl		 << "Auth Key : " << authKey << endl;	try 	{		// RLIM 俊 眠啊茄促.		g_pReconnectLoginInfoManager->addReconnectLoginInfo( pReconnectLoginInfo );		// 肺弊牢 辑滚俊霸 促矫 舅妨霖促.		LGIncomingConnectionOK lgIncomingConnectionOK;		lgIncomingConnectionOK.setPlayerID( pPacket->getPlayerID() );		lgIncomingConnectionOK.setTCPPort( g_pConfig->getPropertyInt("LoginServerPort") );		lgIncomingConnectionOK.setKey( authKey );		g_pGameServerManager->sendPacket( pPacket->getHost() , pPacket->getPort() , &lgIncomingConnectionOK );		//cout << "GLIncomingConnectionHandler Send Packet to ServerIP : " << pPacket->getHost() << endl;	} 	catch ( DuplicatedException & de ) 	{		//cout << "Duplicated Exception Throwed Step 1" << endl;		// 角菩沁阑 版快 CI 甫 昏力窍绊, 肺弊牢 辑滚俊霸 GLIncomingConnectionError 菩哦阑 傈价茄促.		SAFE_DELETE(pReconnectLoginInfo);		//cout << "Duplicated Exception Throwed Step 2" << endl;		LGIncomingConnectionError lgIncomingConnectionError;		lgIncomingConnectionError.setMessage( de.toString() );		lgIncomingConnectionError.setPlayerID( pPacket->getPlayerID() );		//cout << "Duplicated Exception Throwed Step 3" << endl;		g_pGameServerManager->sendPacket( pPacket->getHost() , pPacket->getPort() , &lgIncomingConnectionError );		//cout << "Duplicated Exception Throwed Step 4" << endl;		//cout << "GLIncomingConnectionHandler Send Packet to ServerIP : " << pPacket->getHost() << endl;	}	#endif			__END_DEBUG	__END_DEBUG_EX __END_CATCH}

⌨️ 快捷键说明

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