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


C++ SocketOutputStream::write方法代码示例

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


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

示例1: write

//////////////////////////////////////////////////////////////////////
// 출력스트림(버퍼)으로 패킷의 바이너리 이미지를 보낸다.
//////////////////////////////////////////////////////////////////////
void GCAddMonsterFromTransformation::write (SocketOutputStream & oStream ) const 
     throw(ProtocolException , Error )
{
	__BEGIN_TRY
		
	BYTE name_length = m_MonsterName.size();

	oStream.write(m_ObjectID);
	oStream.write(m_MonsterType);

	oStream.write(name_length);
	if (m_MonsterName.size() != 0) oStream.write(m_MonsterName);

	oStream.write(m_MainColor);
	oStream.write(m_SubColor);
	oStream.write(m_X);
	oStream.write(m_Y);
	oStream.write(m_Dir);

	m_pEffectInfo->write(oStream);

	oStream.write(m_CurrentHP);
	oStream.write(m_MaxHP);

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

示例2: write

void CGDissectionCorpse::write (SocketOutputStream & oStream) const 
     throw(ProtocolException , Error)
{
	__BEGIN_TRY
		
#ifdef __USE_ENCRYPTER__
	SocketEncryptOutputStream* pEOStream = dynamic_cast<SocketEncryptOutputStream*>(&oStream);
    Assert(pEOStream!=NULL);

	if (pEOStream->getEncryptCode()!=0)
	{
		SHUFFLE_STATEMENT_4(pEOStream->getEncryptCode(),
							pEOStream->writeEncrypt(m_ObjectID),
							pEOStream->writeEncrypt(m_X),
							pEOStream->writeEncrypt(m_Y),
							pEOStream->writeEncrypt(m_IsPet));
	}
	else
#endif
	{
		oStream.write(m_ObjectID);
		oStream.write(m_X);
		oStream.write(m_Y);
		oStream.write(m_IsPet);
	}

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

示例3: write

void NicknameInfo::write(SocketOutputStream& oStream) const
	throw(ProtocolException, Error)
{
	__BEGIN_TRY

	oStream.write(m_NicknameID);
	oStream.write(m_NicknameType);

	switch (m_NicknameType )
	{
		case NICK_NONE:
			{
				break;
			}
		case NICK_BUILT_IN:
		case NICK_QUEST:
		case NICK_FORCED:
			{
				oStream.write(m_NicknameIndex);
				break;
			}
		case NICK_CUSTOM_FORCED:
		case NICK_CUSTOM:
			{
				BYTE szSTR = m_Nickname.size();
				oStream.write(szSTR);
				oStream.write(m_Nickname);
				break;
			}
		default:
			Assert(false);
	}

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

示例4: write

//////////////////////////////////////////////////////////////////////
// Datagram 객체로 패킷의 바이너리 이미지를 보낸다.
//////////////////////////////////////////////////////////////////////
void SGModifyGuildMemberOK::write (SocketOutputStream& oStream ) const 
     throw(ProtocolException , Error )
{
	__BEGIN_TRY

	BYTE szName = m_Name.size();
	BYTE szSender = m_Sender.size();

	if (szName == 0 )
		throw InvalidProtocolException("szName == 0");
	if (szName > 20 )
		throw InvalidProtocolException("too long name length");

	if (szSender == 0 )
		throw InvalidProtocolException("szSender == 0");
	if (szSender > 20 )
		throw InvalidProtocolException("too long sender length");

	oStream.write(m_GuildID);
	oStream.write(szName);
	oStream.write(m_Name);
	oStream.write(m_GuildMemberRank);
	oStream.write(szSender);
	oStream.write(m_Sender);

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

示例5: write

//--------------------------------------------------------------------------------
// write to socket output stream
//--------------------------------------------------------------------------------
void Resource::write (SocketOutputStream & oStream ) const 
	throw(IOException , Error )
{
	__BEGIN_TRY

	//--------------------------------------------------------------------------------
	// write version
	//--------------------------------------------------------------------------------
	oStream.write(m_Version);
	
	//--------------------------------------------------------------------------------
	// write filename
	//--------------------------------------------------------------------------------
	BYTE szFilename = m_Filename.size();

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

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

	oStream.write(szFilename);

	oStream.write(m_Filename);

	//--------------------------------------------------------------------------------
	// write filesize
	//--------------------------------------------------------------------------------
	oStream.write(m_FileSize);

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

示例6: write

void StoreInfo::write(SocketOutputStream& oStream, bool toOther) const throw(ProtocolException, Error)
{
	__BEGIN_TRY

	oStream.write(m_Open);
//	cout << "m_Open = " << (int)m_Open << endl;
	if (toOther && m_Open == 0 ) return;

	BYTE szSign = m_Sign.size();
	oStream.write(szSign);

	if (szSign != 0 ) oStream.write(m_Sign);

	BYTE ItemNum = m_Items.size();
	oStream.write(ItemNum);

	vector<StoreItemInfo>::const_iterator itr = m_Items.begin();

	for (; itr != m_Items.end(); ++itr )
	{
		itr->write(oStream);
	}

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

示例7: write

void CGSkillToInventory::write (SocketOutputStream & oStream) const 
     throw(ProtocolException , Error)
{
	__BEGIN_TRY
		
#ifdef __USE_ENCRYPTER__
	SocketEncryptOutputStream* pEOStream = dynamic_cast<SocketEncryptOutputStream*>(&oStream);
    Assert(pEOStream!=NULL);

	if (pEOStream->getEncryptCode()!=0)
	{
		SHUFFLE_STATEMENT_5(pEOStream->getEncryptCode(),
							pEOStream->writeEncrypt(m_SkillType),
							pEOStream->writeEncrypt(m_ObjectID),
							pEOStream->writeEncrypt(m_X),
							pEOStream->writeEncrypt(m_Y),
							pEOStream->writeEncrypt(m_TargetX));
		pEOStream->writeEncrypt(m_TargetY);
		pEOStream->writeEncrypt(m_InventoryItemObjectID);
	}
	else
#endif
	{
		oStream.write(m_SkillType);
		oStream.write(m_ObjectID);
		oStream.write(m_X);
		oStream.write(m_Y);
		oStream.write(m_TargetX);
		oStream.write(m_TargetY);
		oStream.write(m_InventoryItemObjectID);
	}

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

示例8: write

//////////////////////////////////////////////////////////////////////
// 출력스트림(버퍼)으로 패킷의 바이너리 이미지를 보낸다.
//////////////////////////////////////////////////////////////////////
void GCLearnSkillOK::write (SocketOutputStream & oStream ) const 
     throw(ProtocolException , Error )
{
	__BEGIN_TRY
	oStream.write(m_SkillType);
	oStream.write(m_DomainType);
	__END_CATCH
}
开发者ID:hillwah,项目名称:darkeden,代码行数:11,代码来源:GCLearnSkillOK.cpp

示例9: write

//////////////////////////////////////////////////////////////////////
// Datagram 객체로 패킷의 바이너리 이미지를 보낸다.
//////////////////////////////////////////////////////////////////////
void SGModifyGuildOK::write (SocketOutputStream& oStream ) const 
     throw(ProtocolException , Error )
{
	__BEGIN_TRY

	oStream.write(m_GuildID);
	oStream.write(m_GuildState);

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

示例10: write

//////////////////////////////////////////////////////////////////////
// 출력스트림(버퍼)으로 패킷의 바이너리 이미지를 보낸다.
//////////////////////////////////////////////////////////////////////
void GCDownSkillFailed::write (SocketOutputStream & oStream ) const 
     throw(ProtocolException , Error )
{
	__BEGIN_TRY

	oStream.write(m_SkillType);
	oStream.write(m_Desc);

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

示例11: write

//////////////////////////////////////////////////////////////////////////////
// 출력스트림(버퍼)으로 패킷의 바이너리 이미지를 보낸다.
//////////////////////////////////////////////////////////////////////////////
void GCRemoveStoreItem::write (SocketOutputStream & oStream ) const 
     throw(ProtocolException , Error )
{
	__BEGIN_TRY

	oStream.write(m_OwnerObjectID);
	oStream.write(m_Index);

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

示例12: write

void CGMakeItem::write (SocketOutputStream & oStream) const 
     throw(ProtocolException , Error)
{
	__BEGIN_TRY

	oStream.write(m_ItemClass);
	oStream.write(m_ItemType);

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

示例13: write

void CGRequestInfo::write (SocketOutputStream & oStream) const 
     throw(ProtocolException , Error)
{
	__BEGIN_TRY

	oStream.write(m_Code);
	oStream.write(m_Value);

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

示例14: write

void CGReloadFromQuickSlot::write (SocketOutputStream & oStream) const 
     throw(ProtocolException , Error)
{
	__BEGIN_TRY

	oStream.write(m_ObjectID);
	oStream.write(m_SlotID);

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

示例15: write

//--------------------------------------------------------------------------------
// 출력스트림(버퍼)으로 패킷의 바이너리 이미지를 보낸다.
//--------------------------------------------------------------------------------
void GCChangeWeather::write (SocketOutputStream & oStream ) const 
     throw(ProtocolException , Error )
{
	__BEGIN_TRY

	oStream.write((BYTE)m_Weather);
	oStream.write(m_WeatherLevel);

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


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