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


C++ CKnights::InitializeValue方法代码示例

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


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

示例1: RecvCreateKnights

void CUdpSocket::RecvCreateKnights( char* pBuf )
{
	int index = 0, send_index = 0, namelen = 0, idlen = 0, knightsindex = 0, nation = 0, community = 0;
	char knightsname[MAX_ID_SIZE+1]; memset( knightsname, 0x00, MAX_ID_SIZE+1 );
	char chiefname[MAX_ID_SIZE+1]; memset( chiefname, 0x00, MAX_ID_SIZE+1 );
	CKnights* pKnights = NULL;

	community = GetByte( pBuf, index );
	knightsindex = GetShort( pBuf, index );
	nation = GetByte( pBuf, index );
	namelen = GetShort( pBuf, index );
	GetString( knightsname, pBuf, namelen, index );
	idlen = GetShort( pBuf, index );
	GetString( chiefname, pBuf, idlen, index );

	pKnights = new CKnights;
	pKnights->InitializeValue();

	pKnights->m_sIndex = knightsindex;
	pKnights->m_byFlag = community;
	pKnights->m_byNation = nation;
	strcpy( pKnights->m_strName, knightsname );
	strcpy( pKnights->m_strChief, chiefname );
	memset( pKnights->m_strViceChief_1, 0x00, MAX_ID_SIZE+1);
	memset( pKnights->m_strViceChief_2, 0x00, MAX_ID_SIZE+1);
	memset( pKnights->m_strViceChief_3, 0x00, MAX_ID_SIZE+1);
	pKnights->m_sMembers = 1;
	pKnights->m_nMoney = 0;
	pKnights->m_nPoints = 0;
	pKnights->m_byGrade = 5;
	pKnights->m_byRanking = 0;

	for(int i=0; i<MAX_CLAN; i++)	{
		pKnights->m_arKnightsUser[i].byUsed = 0;
		strcpy(pKnights->m_arKnightsUser[i].strUserName, "");
	}	

	m_pMain->m_KnightsArray.PutData( pKnights->m_sIndex, pKnights );

	// 클랜정보에 추가
	m_pMain->m_KnightsManager.AddKnightsUser( knightsindex, chiefname );

	//TRACE("UDP - RecvCreateKnights - knname=%s, name=%s, index=%d\n", knightsname, chiefname, knightsindex);
}
开发者ID:ImOriqinaL,项目名称:snoxd-koserver,代码行数:44,代码来源:UdpSocket.cpp


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