ggcommand.cpp

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

CPP
95
字号
//////////////////////////////////////////////////////////////////////// // Filename    : GGCommand.cpp // Written By  : reiot@ewestsoft.com// Description : // //////////////////////////////////////////////////////////////////////// include files#include "GGCommand.h"//////////////////////////////////////////////////////////////////////// Datagram 按眉肺何磐 单捞鸥甫 佬绢辑 菩哦阑 檬扁拳茄促.//////////////////////////////////////////////////////////////////////void GGCommand::read ( Datagram & iDatagram ) 	 throw ( ProtocolException , Error ){	__BEGIN_TRY	//--------------------------------------------------	// read command	//--------------------------------------------------	BYTE szCommand;	iDatagram.read( szCommand );	if ( szCommand == 0 )		throw InvalidProtocolException("szCommand == 0");	if ( szCommand > 80 )		throw InvalidProtocolException("too long Command length");	iDatagram.read( m_Command , szCommand );	__END_CATCH}		    //////////////////////////////////////////////////////////////////////// Datagram 按眉肺 菩哦狼 官捞呈府 捞固瘤甫 焊辰促.//////////////////////////////////////////////////////////////////////void GGCommand::write ( Datagram & oDatagram ) const      throw ( ProtocolException , Error ){	__BEGIN_TRY	//--------------------------------------------------	// write client IP	//--------------------------------------------------	BYTE szCommand = m_Command.size();	if ( szCommand == 0 )		throw InvalidProtocolException("szCommand == 0");	if ( szCommand > 80 )		throw InvalidProtocolException("too long Command length");	oDatagram.write( szCommand );	oDatagram.write( m_Command );	__END_CATCH}//////////////////////////////////////////////////////////////////////// execute packet's handler//////////////////////////////////////////////////////////////////////void GGCommand::execute ( Player * pPlayer ) 	 throw ( ProtocolException , Error ){	__BEGIN_TRY			GGCommandHandler::execute( this );			__END_CATCH}////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////string GGCommand::toString () const    throw (){	StringStream msg;	msg << "GGCommand("		<< m_Command 		<< ")";	return msg.toString();}

⌨️ 快捷键说明

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