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


C++ Item::GetExtraBagBeginTime方法代码示例

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


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

示例1: if


//.........这里部分代码省略.........
		if (pItem1->IsEmpty())
		{
			return PACKET_EXE_CONTINUE;
		}
		ItemContainer* pExtraContainer = pHuman->GetExtraContain();

		//将物品放入扩展包
		ItemContainer* pExtraBagContainer = HumanItemLogic::GetBagByExtraContainPos(pHuman, index2);
		if (pExtraBagContainer == NULL)
		{
			g_pLog->FastSaveLog( LOG_FILE_1, "CGPackage_SwapItem: index2=%d, is invalid", index2) ;
			return PACKET_EXE_ERROR;
		}

		INT index_container1 = pBagContainer->BagIndex2ConIndex(index1);
		INT index_container2 = pExtraContainer->BagIndex2ConIndex(index2);

		//扩展包不存在
		if (!pExtraBagContainer->IsValid())
		{
			if (pItem1->GetItemClass() == ICLASS_EXTRABAG)
			{
				INT ret = g_ItemOperator.MoveItem(pBagContainer, index_container1, 
					pExtraContainer, index_container2);
				if (ret>=0)
				{
					msg.SetResult(SWITCHITEM_SUCCESS);
					msg.SetPackageIndex1(index1);
					msg.SetPackageIndex2(index2);
					pGamePlayer->SendPacket(&msg);
					
					Item* pDestItem = pExtraContainer->GetItem(index_container2);
					Assert(pDestItem);
					if (pDestItem->GetExtraBagBeginTime() == INVALID_TIME)
					{
						pDestItem->SetExtraBagBeginTime();
					}
					pHuman->ReInitExtraBag();

					g_pLog->FastSaveLog( LOG_FILE_1, "CGPackage_SwapItem: use extrabagitem, index2=%d ", index2 ) ;
					return PACKET_EXE_CONTINUE;
				}
				msg.SetResult(SWITCHITEM_FAIL);
				pGamePlayer->SendPacket(&msg);
				return PACKET_EXE_CONTINUE;
			}
			g_pLog->FastSaveLog( LOG_FILE_1, "CGPackage_SwapItem: index2=%d, can't put", index2) ;
			return PACKET_EXE_CONTINUE;
		}
		if (pExtraBagContainer->IsInContainer(index1))
		{
			return PACKET_EXE_CONTINUE;
		}
		if (pExtraBagContainer->IsCanUse())
		{
			INT nBagIndex = -1;
			nBagIndex =g_ItemOperator.MoveItem(pBagContainer, index_container1, pExtraBagContainer, -1);
			if (nBagIndex>=0)
			{
				msg.SetResult(SWITCHITEM_SUCCESS);
				msg.SetPackageIndex1(index1);
				msg.SetPackageIndex2(pExtraBagContainer->ConIndex2BagIndex(nBagIndex));
				pGamePlayer->SendPacket(&msg);
				g_pLog->FastSaveLog( LOG_FILE_1, "CGPackage_SwapItem: index1=%d, index2=%d Success", 
					index1, index2 ) ;
				return PACKET_EXE_CONTINUE;
开发者ID:,项目名称:,代码行数:67,代码来源:


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