⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pcmanager.cpp

📁 天之炼狱1服务器端源文件游戏服务端不完整
💻 CPP
📖 第 1 页 / 共 4 页
字号:
				ZoneID         = ResurrectCoord.id; 				ZoneX          = ResurrectCoord.x;				ZoneY          = ResurrectCoord.y;			}			catch (NoSuchElementException&)			{				// 酒, 厚惑捞村...				throw Error("Critical Error : ResurrectInfo is not established!");			}		}		o/		// NoSuch力芭. by sigi. 2002.5.9		if (g_pResurrectLocationManager->getSlayerPosition(pSlayer->getResurrectZoneID(), ResurrectCoord))		{			ZoneID         = ResurrectCoord.id;			ZoneX          = ResurrectCoord.x;			ZoneY          = ResurrectCoord.y;		}		else		{			// 父老 酒流 何劝 困摹甫 瘤沥秦 初瘤 臼疽促搁, 			// 泅犁 粮俊辑 叼弃飘肺 汲沥登绢 乐绰 何劝粮栏肺 埃促.			if (g_pResurrectLocationManager->getSlayerPosition(pSlayer->getZone()->getZoneID(), ResurrectCoord))			{				ZoneID         = ResurrectCoord.id; 				ZoneX          = ResurrectCoord.x;				ZoneY          = ResurrectCoord.y;			}			else			{				// 酒, 厚惑捞村...				throw Error("Critical Error : ResurrectInfo is not established!");			}		}		try 		{			pZoneInfo = g_pZoneInfoManager->getZoneInfo(ZoneID);#ifdef __PAY_SYSTEM_ZONE__			GamePlayer* pGamePlayer = dynamic_cast<GamePlayer*>(pSlayer->getPlayer());			Assert(pGamePlayer!=NULL);			// 蜡丰拳 粮捞绊 蜡丰荤侩吝捞 酒聪搁..			if (pZoneInfo!=NULL				&& (pZoneInfo->isPayPlay() || pZoneInfo->isPremiumZone())				&& !pGamePlayer->isPayPlaying())			{			   	string connectIP = pGamePlayer->getSocket()->getHost();				// 蜡丰 辑厚胶 荤侩捞 啊瓷茄啊?				if (pGamePlayer->loginPayPlay(connectIP, pGamePlayer->getID()))				{					sendPayInfo(pGamePlayer);				}				else if (pZoneInfo->isPayPlay())				{					// 蜡丰 辑厚胶 荤侩 阂啊牢 版快					// 俊浇巢悼俊辑 何劝窍绰 镑栏肺 埃促.					if (g_pResurrectLocationManager->getSlayerPosition(13, ResurrectCoord))					{						ZoneID         = ResurrectCoord.id; 						ZoneX          = ResurrectCoord.x;						ZoneY          = ResurrectCoord.y;						pZoneInfo = g_pZoneInfoManager->getZoneInfo(ZoneID);					}					else					{						// 酒, 厚惑捞村...						throw Error("Critical Error : ResurrectInfo is not established!1");					}				}			}#endif		} 		catch (NoSuchElementException&) 		{			throw Error("Critical Error : 器呕俊 瘤沥等 粮 酒捞叼啊 撇府芭唱, ZoneInfoManager俊 秦寸 粮捞 粮犁窍瘤 臼嚼聪促.");		}				try 		{			pZoneGroup = g_pZoneGroupManager->getZoneGroup(pZoneInfo->getZoneGroupID());		} 		catch (NoSuchElementException&) 		{			// 老窜篮 辑滚啊 1措捞骨肺.. 弊措肺 唱埃促...			throw Error("Critical Error : 泅犁肺绰 霸烙 辑滚绰 1措挥捞寸..");		}		//pResurrectZone = pZoneGroup->getZone(ZoneID);		//Assert(pResurrectZone != NULL);		// EventResurrect俊辑 zone汲沥阑 官槽促.		//pDeadCreature->setZone(pResurrectZone);	 // 林籍贸府 by sigi. 2002.5.11		//pDeadCreature->setXY(ZoneX, ZoneY);		//pDeadCreature->save();	} 	else if (pDeadCreature->isVampire())	{		Vampire* pVampire = dynamic_cast<Vampire*>(pDeadCreature);		Assert(pVampire != NULL);		pVampire->setStashStatus(false);		pVampire->setHP(pVampire->getHP(ATTR_MAX), ATTR_CURRENT);		/o		try		{			ResurrectCoord = g_pResurrectLocationManager->getVampirePosition(pVampire->getResurrectZoneID());			ZoneID         = ResurrectCoord.id;			ZoneX          = ResurrectCoord.x;			ZoneY          = ResurrectCoord.y;		}		catch (NoSuchElementException&)		{			try			{				// 父老 酒流 何劝 困摹甫 瘤沥秦 初瘤 臼疽促搁, 				// 泅犁 粮俊辑 叼弃飘肺 汲沥登绢 乐绰 何劝粮栏肺 埃促.				ResurrectCoord = g_pResurrectLocationManager->getVampirePosition(pVampire->getZone()->getZoneID());				ZoneID         = ResurrectCoord.id; 				ZoneX          = ResurrectCoord.x;				ZoneY          = ResurrectCoord.y;			}			catch (NoSuchElementException&)			{				// 酒, 厚惑捞村...				throw Error("Critical Error : ResurrectInfo is not established!");			}		}		o/		// NoSuch力芭. by sigi. 2002.5.9		if (g_pResurrectLocationManager->getVampirePosition(pVampire->getResurrectZoneID(), ResurrectCoord))		{			ZoneID         = ResurrectCoord.id;			ZoneX          = ResurrectCoord.x;			ZoneY          = ResurrectCoord.y;		}		else		{			// 父老 酒流 何劝 困摹甫 瘤沥秦 初瘤 臼疽促搁, 			// 泅犁 粮俊辑 叼弃飘肺 汲沥登绢 乐绰 何劝粮栏肺 埃促.			if (g_pResurrectLocationManager->getVampirePosition(pVampire->getZone()->getZoneID(), ResurrectCoord))			{				ZoneID         = ResurrectCoord.id; 				ZoneX          = ResurrectCoord.x;				ZoneY          = ResurrectCoord.y;			}			else			{				// 酒, 厚惑捞村...				throw Error("Critical Error : ResurrectInfo is not established!");			}		}		try 		{			pZoneInfo = g_pZoneInfoManager->getZoneInfo(ZoneID);#ifdef __PAY_SYSTEM_ZONE__			GamePlayer* pGamePlayer = dynamic_cast<GamePlayer*>(pVampire->getPlayer());			Assert(pGamePlayer!=NULL);			// 蜡丰拳 粮捞绊 蜡丰荤侩磊啊 酒聪搁..			if (pZoneInfo!=NULL				&& (pZoneInfo->isPayPlay() || pZoneInfo->isPremiumZone())				&& !pGamePlayer->isPayPlaying())			{                string connectIP = pGamePlayer->getSocket()->getHost();                // 蜡丰 辑厚胶 荤侩捞 啊瓷茄啊?                if (pGamePlayer->loginPayPlay(connectIP, pGamePlayer->getID()))				{					sendPayInfo(pGamePlayer);				}				else if (pZoneInfo->isPayPlay())				{					// 蜡丰 辑厚胶 荤侩 阂啊牢 版快					// 覆焊巢悼俊辑 何劝窍绰 镑栏肺 埃促.					if (g_pResurrectLocationManager->getVampirePosition(23, ResurrectCoord))					{						ZoneID         = ResurrectCoord.id; 						ZoneX          = ResurrectCoord.x;						ZoneY          = ResurrectCoord.y;						pZoneInfo = g_pZoneInfoManager->getZoneInfo(ZoneID);					}					else					{						// 酒, 厚惑捞村...						throw Error("Critical Error : ResurrectInfo is not established!2");					}				}			}#endif		} 		catch (NoSuchElementException&) 		{			throw Error("Critical Error : 器呕俊 瘤沥等 粮 酒捞叼啊 撇府芭唱, ZoneInfoManager俊 秦寸 粮捞 粮犁窍瘤 臼嚼聪促.");		}				try 		{			pZoneGroup = g_pZoneGroupManager->getZoneGroup(pZoneInfo->getZoneGroupID());		} 		catch (NoSuchElementException&) 		{			// 老窜篮 辑滚啊 1措捞骨肺.. 弊措肺 唱埃促...			throw Error("Critical Error : 泅犁肺绰 霸烙 辑滚绰 1措挥捞寸..");		}		//pResurrectZone = pZoneGroup->getZone(ZoneID);		//Assert(pResurrectZone != NULL);		// EventResurrect俊辑 zone汲沥阑 官槽促.		//pDeadCreature->setZone(pResurrectZone);	 // 林籍贸府 by sigi. 2002.5.11		//pDeadCreature->setXY(ZoneX, ZoneY);		//pDeadCreature->save();	}	else Assert(false);*/	PlayerCreature* pPC = dynamic_cast<PlayerCreature*>(pDeadCreature);	Assert( pPC != NULL );	// 捞亥飘 粮俊辑 磷菌栏搁 捞亥飘 粮 何劝困摹肺..	EventZoneInfo* pEventZoneInfo = EventZoneInfoManager::Instance().getEventZoneInfo( pPC->getZoneID() );	if ( pEventZoneInfo != NULL )	{		ResurrectCoord.id = pPC->getZoneID();		ResurrectCoord.x = pEventZoneInfo->getResurrectX();		ResurrectCoord.y = pEventZoneInfo->getResurrectY();	}	// PK粮俊辑 磷菌阑 版快	// PK粮狼 何劝 困摹肺 啊具 茄促.	else if ( g_pPKZoneInfoManager->isPKZone( pPC->getZoneID() ) )	{		if ( !g_pPKZoneInfoManager->getResurrectPosition( pPC->getZoneID(), ResurrectCoord ) )			g_pResurrectLocationManager->getPosition( pPC, ResurrectCoord );	}	else	{		g_pResurrectLocationManager->getPosition( pPC, ResurrectCoord );	}	ZoneID	= ResurrectCoord.id; 	ZoneX	= ResurrectCoord.x;	ZoneY	= ResurrectCoord.y;	pZoneInfo = g_pZoneInfoManager->getZoneInfo(ZoneID);	pZoneGroup = g_pZoneGroupManager->getZoneGroup(pZoneInfo->getZoneGroupID());	// Resurrect 捞亥飘甫 敲饭捞绢 按眉俊 楷包矫挪促.	GamePlayer* pGamePlayer = dynamic_cast<GamePlayer*>(pDeadCreature->getPlayer());	EventResurrect* pEventResurrect = new EventResurrect(pGamePlayer);	pEventResurrect->setDeadline(0);	// 何劝且 厘家甫 悸泼茄促.	 by sigi. 2002.5.11	pResurrectZone = pZoneGroup->getZone(ZoneID);	Assert(pResurrectZone != NULL);	if ( pZone->isHolyLand() != pResurrectZone->isHolyLand() )	{		// 酒淬狼 己瘤俊辑 观栏肺 唱啊搁辑 何劝登绰 版快		// 己瘤 焊呈胶甫 促矫 技泼窍扁 困秦 initAllStat 阑 阂矾拎具 茄促.		pDeadCreature->setFlag( Effect::EFFECT_CLASS_INIT_ALL_STAT );	}	if ( g_pLevelWarZoneInfoManager->isCreatureBonusZone( pDeadCreature, pZone->getZoneID() )		!= g_pLevelWarZoneInfoManager->isCreatureBonusZone( pDeadCreature, pResurrectZone->getZoneID() ) )	{		pDeadCreature->setFlag( Effect::EFFECT_CLASS_INIT_ALL_STAT );	}	if ( pZone->isLevelWarZone() != pResurrectZone->isLevelWarZone() )	{		pDeadCreature->setFlag( Effect::EFFECT_CLASS_INIT_ALL_STAT );	}	pDeadCreature->setNewZone( pResurrectZone );	pDeadCreature->setNewXY( ZoneX, ZoneY );	// Player俊 Event甫 嘿牢促.	pGamePlayer->addEvent(pEventResurrect);	// DB 历厘阑 困秦辑.. EventResurrect俊辑 zone汲沥阑 官槽促.	ZoneCoord_t  oldZoneX = pDeadCreature->getX();	ZoneCoord_t  oldZoneY = pDeadCreature->getY();	// 货 粮狼 沥焊甫 历厘秦敌促.	pDeadCreature->setZone(pResurrectZone);		pDeadCreature->setXY(ZoneX, ZoneY);	pDeadCreature->save();	// 促矫 盔贰狼 Zone 沥焊肺 汲沥秦霖促.	pDeadCreature->setZone(pZone);	pDeadCreature->setXY(oldZoneX, oldZoneY);	pGamePlayer->setPlayerStatus(GPS_IGNORE_ALL);	__END_DEBUG	__END_CATCH}//////////////////////////////////////////////////////////////////////////////// transport All Creatures//////////////////////////////////////////////////////////////////////////////void PCManager::transportAllCreatures (ZoneID_t ZoneID, ZoneCoord_t ZoneX, ZoneCoord_t ZoneY, Race_t race)        throw (Error){	__BEGIN_TRY	vector< ObjectID_t > creatureIDs;	Zone* pZone = NULL;	// transportCreature - Zone::deleteCreature俊辑 促矫 PCManager肺 立辟秦辑	// SELF_DEAD_LOCK捞 惯积茄促. -_--.. 弊贰辑..	// 老窜 粮俊 乐绰 葛电 Creature狼 ID甫 扁撅秦滴绊...	__ENTER_CRITICAL_SECTION(m_Mutex)	hash_map< ObjectID_t , Creature* >::iterator iCreature  = m_Creatures.begin();	while (iCreature != m_Creatures.end()) 	{		Creature* pCreature = iCreature->second;		Assert(pCreature->isPC());		PlayerCreature* pPC = dynamic_cast<PlayerCreature*>(pCreature);		// race==0xFF绰 default肺 葛电 辆练捞扼绰 狼固捞绊 -_-;		// 漂沥 辆练父 捞悼矫挪促.		if (race==defaultRaceValue 			|| race==pPC->getRace())		{			creatureIDs.push_back( iCreature->first );			pZone = pCreature->getZone();		}		iCreature++;	}	__LEAVE_CRITICAL_SECTION(m_Mutex)	// 弊 Creature甸阑 促弗 镑栏肺 捞悼矫挪促.	try	{		vector< ObjectID_t >::const_iterator itr = creatureIDs.begin();				while (itr != creatureIDs.end()) 		{			Creature* pCreature = pZone->getCreature( *itr );			if (pCreature!=NULL)			{			//	transportCreature(pCreature, ZoneID, ZoneX, ZoneY, false);				GamePlayer* pGamePlayer = dynamic_cast<GamePlayer*>(pCreature->getPlayer());				Event* pEvent = pGamePlayer->getEvent(Event::EVENT_CLASS_TRANSPORT);				if (pEvent==NULL)				{					EventTransport* pEventTransport = new EventTransport(pGamePlayer);					ZoneInfo* pZoneInfo = g_pZoneInfoManager->getZoneInfo( ZoneID );					Assert(pZoneInfo!=NULL);					pEventTransport->setDeadline( 10*10 );					pEventTransport->setTargetZone( ZoneID, ZoneX, ZoneY );					pEventTransport->setZoneName( pZoneInfo->getFullName() );					// 割 檬饶俊 绢叼肺 捞悼茄促.绊 焊郴霖促.					pEventTransport->sendMessage();					pGamePlayer->addEvent(pEventTransport);				}				else				{					EventTransport* pEventTransport = dynamic_cast<EventTransport*>(pEvent);					pEventTransport->sendMessage();				}			}			itr ++;		}	}	catch (Throwable & t)	{		filelog("PCManagerBug.log", "transportAllCreaturesBUG : %s", t.toString().c_str());	}		__END_CATCH}//////////////////////////////////////////////////////////////////////////////// get debug string//////////////////////////////////////////////////////////////////////////////string PCManager::toString () const       throw (){	__BEGIN_TRY	StringStream msg;	msg << "PCManager("		<< CreatureManager::toString()		<< ")" ;	return msg.toString();	__END_CATCH}

⌨️ 快捷键说明

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