当前位置: 首页>>代码示例>>C++>>正文


C++ SocketInputStream::read方法代码示例

本文整理汇总了C++中SocketInputStream::read方法的典型用法代码示例。如果您正苦于以下问题:C++ SocketInputStream::read方法的具体用法?C++ SocketInputStream::read怎么用?C++ SocketInputStream::read使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SocketInputStream的用法示例。


在下文中一共展示了SocketInputStream::read方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: read

//--------------------------------------------------------------------------------
// read from socket input stream
//--------------------------------------------------------------------------------
void Resource::read (SocketInputStream & iStream ) 
	throw(IOException , Error )
{
	__BEGIN_TRY

	//--------------------------------------------------------------------------------
	// read version
	//--------------------------------------------------------------------------------
	iStream.read(m_Version);

	//--------------------------------------------------------------------------------
	// read filename
	//--------------------------------------------------------------------------------
	BYTE szFilename;
	iStream.read(szFilename);

	if (szFilename == 0 )
		throw InvalidProtocolException("szFilename == 0");

	if (szFilename > maxFilename )
		throw InvalidProtocolException("too large filename length");

	iStream.read(m_Filename , szFilename);

	//--------------------------------------------------------------------------------
	// read filesize
	//--------------------------------------------------------------------------------
	iStream.read(m_FileSize);

	__END_CATCH
}
开发者ID:hillwah,项目名称:darkeden,代码行数:34,代码来源:Resource.cpp

示例2: read

//////////////////////////////////////////////////////////////////////
// 입력스트림(버퍼)으로부터 데이타를 읽어서 패킷을 초기화한다.
//////////////////////////////////////////////////////////////////////
void GCAddMonsterFromTransformation::read (SocketInputStream & iStream ) 
	 throw(ProtocolException , Error )
{
	__BEGIN_TRY

	BYTE name_length = 0;
		
	iStream.read(m_ObjectID);
	iStream.read(m_MonsterType);

	iStream.read(name_length);
	if (name_length != 0) iStream.read(m_MonsterName, name_length);

	iStream.read(m_MainColor);
	iStream.read(m_SubColor);
	iStream.read(m_X);
	iStream.read(m_Y);
	iStream.read(m_Dir);

	m_pEffectInfo = new EffectInfo();
	m_pEffectInfo->read(iStream);

	iStream.read(m_CurrentHP);
	iStream.read(m_MaxHP);

	__END_CATCH
}
开发者ID:hillwah,项目名称:darkeden,代码行数:30,代码来源:GCAddMonsterFromTransformation.cpp

示例3: read

void GCTimeLimitItemInfo::read(SocketInputStream& iStream)
	throw(ProtocolException, Error)
{
	__BEGIN_TRY

	BYTE	szInfo;

	iStream.read(szInfo);
	Assert(szInfo <= MAX_TIME_LIMIT_ITEM_INFO);

	m_TimeLimitItemInfos.clear();

	for (int count = 0; count < szInfo; ++count )
	{
		ObjectID_t objectID;
		DWORD time;
		iStream.read(objectID);
		iStream.read(time);

		if (m_TimeLimitItemInfos.find(objectID) == m_TimeLimitItemInfos.end() )
		{
			m_TimeLimitItemInfos[objectID] = time;
		}
	}

	__END_CATCH
}
开发者ID:hillwah,项目名称:darkeden,代码行数:27,代码来源:GCTimeLimitItemInfo.cpp

示例4: read

//--------------------------------------------------------------------------------
// 입력스트림(버퍼)으로부터 데이타를 읽어서 패킷을 초기화한다.
//--------------------------------------------------------------------------------
void CUBeginUpdate::read (SocketInputStream & iStream ) 
	 throw(ProtocolException , Error )
{
	__BEGIN_TRY

	static WORD GuildVersion = atoi(g_pConfig->getProperty("GuildVersion").c_str());
	static WORD KeyVersion = atoi(g_pConfig->getProperty("KeyVersion").c_str());
	static WORD InfoVersion = atoi(g_pConfig->getProperty("InfoVersion").c_str());

	iStream.read(m_Version);

	if (m_Version >= GuildVersion )
	{
		iStream.read(m_GuildVersion);
		m_Type = TWO_VERSION_KEY_FRONT;
	}
	else if (m_Version >= KeyVersion )
	{
		m_Type = ONE_VERSION_KEY_BACK;
	}
	else m_Type = OLD_UPDATE;

	if (m_Version >= InfoVersion )
	{
		iStream.read(m_InfoVersion);
	}

	__END_CATCH
}
开发者ID:hillwah,项目名称:darkeden,代码行数:32,代码来源:CUBeginUpdate.cpp

示例5: read

void StoreInfo::read(SocketInputStream& iStream, bool toOther) throw(ProtocolException, Error)
{
	__BEGIN_TRY

	iStream.read(m_Open);
	if (toOther && m_Open == 0 ) return;

	BYTE szSign;
	iStream.read(szSign);

	if (szSign != 0 ) iStream.read(m_Sign, szSign);

	BYTE ItemNum;
	iStream.read(ItemNum);

	for (int i=0; i<ItemNum; ++i )
	{
		m_Items[i].read(iStream);
//		StoreItemInfo info;
//		info.read(iStream);
//		m_Items.push_back(info);
	}

	__END_CATCH
}
开发者ID:hillwah,项目名称:darkeden,代码行数:25,代码来源:StoreInfo.cpp

示例6: read

void CGSkillToInventory::read (SocketInputStream & iStream) 
	 throw(ProtocolException , Error)
{
	__BEGIN_TRY
		
#ifdef __USE_ENCRYPTER__
	SocketEncryptInputStream* pEIStream = dynamic_cast<SocketEncryptInputStream*>(&iStream);
    Assert(pEIStream!=NULL);

	if (pEIStream->getEncryptCode()!=0)
	{
		SHUFFLE_STATEMENT_5(pEIStream->getEncryptCode(),
							pEIStream->readEncrypt(m_SkillType),
							pEIStream->readEncrypt(m_ObjectID),
							pEIStream->readEncrypt(m_X),
							pEIStream->readEncrypt(m_Y),
							pEIStream->readEncrypt(m_TargetX));
		pEIStream->readEncrypt(m_TargetY);
		pEIStream->readEncrypt(m_InventoryItemObjectID);
	}
	else
#endif
	{
		iStream.read(m_SkillType);
		iStream.read(m_ObjectID);
		iStream.read(m_X);
		iStream.read(m_Y);
		iStream.read(m_TargetX);
		iStream.read(m_TargetY);
		iStream.read(m_InventoryItemObjectID);
	}

	__END_CATCH
}
开发者ID:hillwah,项目名称:darkeden,代码行数:34,代码来源:CGSkillToInventory.cpp

示例7: read

void NicknameInfo::read(SocketInputStream& iStream)
	throw(ProtocolException, Error)
{
	__BEGIN_TRY

	iStream.read(m_NicknameID);
	iStream.read(m_NicknameType);

	switch (m_NicknameType )
	{
		case NICK_NONE:
			{
				break;
			}
		case NICK_BUILT_IN:
		case NICK_QUEST:
		case NICK_FORCED:
			{
				iStream.read(m_NicknameIndex);
				break;
			}
		case NICK_CUSTOM_FORCED:
		case NICK_CUSTOM:
			{
				BYTE szSTR;
				iStream.read(szSTR);
				iStream.read(m_Nickname, szSTR);
				break;
			}
		default:
			Assert(false);
	}

	__END_CATCH
}
开发者ID:hillwah,项目名称:darkeden,代码行数:35,代码来源:NicknameInfo.cpp

示例8: read

void CGDissectionCorpse::read (SocketInputStream & iStream) 
	 throw(ProtocolException , Error)
{
	__BEGIN_TRY
		
#ifdef __USE_ENCRYPTER__
	SocketEncryptInputStream* pEIStream = dynamic_cast<SocketEncryptInputStream*>(&iStream);
    Assert(pEIStream!=NULL);

	if (pEIStream->getEncryptCode()!=0)
	{
		SHUFFLE_STATEMENT_4(pEIStream->getEncryptCode(),
							pEIStream->readEncrypt(m_ObjectID),
							pEIStream->readEncrypt(m_X),
							pEIStream->readEncrypt(m_Y),
							pEIStream->readEncrypt(m_IsPet));
	}
	else
#endif
	{
		iStream.read(m_ObjectID);
		iStream.read(m_X);
		iStream.read(m_Y);
		iStream.read(m_IsPet);
	}

	__END_CATCH
}
开发者ID:hillwah,项目名称:darkeden,代码行数:28,代码来源:CGDissectionCorpse.cpp

示例9: read

//////////////////////////////////////////////////////////////////////
// 입력스트림(버퍼)으로부터 데이타를 읽어서 패킷을 초기화한다.
//////////////////////////////////////////////////////////////////////
void GCLearnSkillOK::read (SocketInputStream & iStream ) 
	 throw(ProtocolException , Error )
{
	__BEGIN_TRY
	iStream.read(m_SkillType);
	iStream.read(m_DomainType);
	__END_CATCH
}
开发者ID:hillwah,项目名称:darkeden,代码行数:11,代码来源:GCLearnSkillOK.cpp

示例10: read

//////////////////////////////////////////////////////////////////////
// 입력스트림(버퍼)으로부터 데이타를 읽어서 패킷을 초기화한다.
//////////////////////////////////////////////////////////////////////
void GCDownSkillFailed::read (SocketInputStream & iStream ) 
	 throw(ProtocolException , Error )
{
	__BEGIN_TRY

	iStream.read(m_SkillType);
	iStream.read(m_Desc);

	__END_CATCH
}
开发者ID:hillwah,项目名称:darkeden,代码行数:13,代码来源:GCDownSkillFailed.cpp

示例11: read

//////////////////////////////////////////////////////////////////////////////
// 입력스트림(버퍼)으로부터 데이타를 읽어서 패킷을 초기화한다.
//////////////////////////////////////////////////////////////////////////////
void GCRemoveStoreItem::read (SocketInputStream & iStream ) 
	 throw(ProtocolException , Error )
{
	__BEGIN_TRY

	iStream.read(m_OwnerObjectID);
	iStream.read(m_Index);

	__END_CATCH
}
开发者ID:hillwah,项目名称:darkeden,代码行数:13,代码来源:GCRemoveStoreItem.cpp

示例12: read

void CGMakeItem::read (SocketInputStream & iStream) 
	 throw(ProtocolException , Error)
{
	__BEGIN_TRY
		
	iStream.read(m_ItemClass);
	iStream.read(m_ItemType);

	__END_CATCH
}
开发者ID:hillwah,项目名称:darkeden,代码行数:10,代码来源:CGMakeItem.cpp

示例13: read

void CGRequestInfo::read (SocketInputStream & iStream) 
	 throw(ProtocolException , Error)
{
	__BEGIN_TRY
		
	iStream.read(m_Code);
	iStream.read(m_Value);

	__END_CATCH
}
开发者ID:hillwah,项目名称:darkeden,代码行数:10,代码来源:CGRequestInfo.cpp

示例14: read

void CGReloadFromQuickSlot::read (SocketInputStream & iStream) 
	 throw(ProtocolException , Error)
{
	__BEGIN_TRY
		
	iStream.read(m_ObjectID);
	iStream.read(m_SlotID);

	__END_CATCH
}
开发者ID:hillwah,项目名称:darkeden,代码行数:10,代码来源:CGReloadFromQuickSlot.cpp

示例15: read

void CGTryJoinGuild::read (SocketInputStream & iStream) 
	 throw(ProtocolException , Error)
{
	__BEGIN_TRY
		
	iStream.read(m_GuildID);
	iStream.read(m_GuildMemberRank);

	__END_CATCH
}
开发者ID:hillwah,项目名称:darkeden,代码行数:10,代码来源:CGTryJoinGuild.cpp


注:本文中的SocketInputStream::read方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。