glincomingconnectionok.cpp

来自「天之炼狱1服务器端源文件游戏服务端不完整」· C++ 代码 · 共 119 行

CPP
119
字号
//////////////////////////////////////////////////////////////////////// // Filename    : GLIncomingConnectionOK.cpp // Written By  : reiot@ewestsoft.com// Description : // //////////////////////////////////////////////////////////////////////// include files#include "GLIncomingConnectionOK.h"//////////////////////////////////////////////////////////////////////// Datagram 按眉肺何磐 单捞鸥甫 佬绢辑 菩哦阑 檬扁拳茄促.//////////////////////////////////////////////////////////////////////void GLIncomingConnectionOK::read ( Datagram & iDatagram ) 	 throw ( ProtocolException , Error ){	__BEGIN_TRY	//--------------------------------------------------	// read Player ID	//--------------------------------------------------	BYTE szPlayerID;	iDatagram.read( szPlayerID );	if ( szPlayerID == 0 )		throw InvalidProtocolException("szPlayerID == 0");	if ( szPlayerID > 20 )		throw InvalidProtocolException("too long playerID size");	iDatagram.read( m_PlayerID , szPlayerID );	//--------------------------------------------------	// read TCP Port	//--------------------------------------------------	iDatagram.read( m_TCPPort );	//--------------------------------------------------	// read Auth Key	//--------------------------------------------------	iDatagram.read( m_Key );	__END_CATCH}		    //////////////////////////////////////////////////////////////////////// Datagram 按眉肺 菩哦狼 官捞呈府 捞固瘤甫 焊辰促.//////////////////////////////////////////////////////////////////////void GLIncomingConnectionOK::write ( Datagram & oDatagram ) const      throw ( ProtocolException , Error ){	__BEGIN_TRY	//--------------------------------------------------	// write Player ID	//--------------------------------------------------	BYTE szPlayerID = m_PlayerID.size();	if ( szPlayerID == 0 )		throw InvalidProtocolException("szPlayerID == 0");	if ( szPlayerID > 20 )		throw InvalidProtocolException("too long playerID size");	oDatagram.write( szPlayerID );	oDatagram.write( m_PlayerID );	//--------------------------------------------------	// write TCP Port	//--------------------------------------------------	oDatagram.write( m_TCPPort );	//--------------------------------------------------	// write auth Key	//--------------------------------------------------	oDatagram.write( m_Key );	__END_CATCH}//////////////////////////////////////////////////////////////////////// execute packet's handler//////////////////////////////////////////////////////////////////////void GLIncomingConnectionOK::execute ( Player * pPlayer ) 	 throw ( ProtocolException , Error ){	__BEGIN_TRY			GLIncomingConnectionOKHandler::execute( this );			__END_CATCH}////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////string GLIncomingConnectionOK::toString () const    throw (){	__BEGIN_TRY			StringStream msg;	msg << "GLIncomingConnectionOK("		<< "PlayerID:" << m_PlayerID		<< ",TCPPort:" << m_TCPPort		<< ",Key:" << m_Key		<< ")";	return msg.toString();	__END_CATCH}

⌨️ 快捷键说明

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