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

📄 masterlairinfomanager.cpp

📁 天之炼狱1服务器端源文件游戏服务端不完整
💻 CPP
📖 第 1 页 / 共 2 页
字号:
			pMasterLairInfo->setSummonY( pResult->getInt(++i) );			pMasterLairInfo->setFirstRegenDelay( pResult->getInt(++i) );			pMasterLairInfo->setRegenDelay( pResult->getInt(++i) );			pMasterLairInfo->setStartDelay( pResult->getInt(++i) );			pMasterLairInfo->setEndDelay( pResult->getInt(++i) );			pMasterLairInfo->setKickOutDelay( pResult->getInt(++i) );			pMasterLairInfo->setKickZoneID( pResult->getInt(++i) );			pMasterLairInfo->setKickZoneX( pResult->getInt(++i) );			pMasterLairInfo->setKickZoneY( pResult->getInt(++i) );			pMasterLairInfo->setLairAttackTick( pResult->getInt(++i) );			pMasterLairInfo->setLairAttackMinNumber( pResult->getInt(++i) );			pMasterLairInfo->setLairAttackMaxNumber( pResult->getInt(++i) );			pMasterLairInfo->setMasterSummonSay( pResult->getString(++i) );			pMasterLairInfo->setMasterDeadSlayerSay( pResult->getString(++i) );			pMasterLairInfo->setMasterDeadVampireSay( pResult->getString(++i) );			pMasterLairInfo->setMasterNotDeadSay( pResult->getString(++i) );			addMasterLairInfo(pMasterLairInfo);			//cout << pMasterLairInfo->toString().c_str() << endl;			// 眉农 内靛			// 付胶磐狼 阁胶磐 沥焊啊 乐绰瘤 眉农茄促.			try {				const MonsterInfo* pMonsterInfo = g_pMonsterInfoManager->getMonsterInfo( pMasterLairInfo->getMasterMonsterType() );				if (pMonsterInfo==NULL)	// 唱吝阑 困秦辑. -_-;				{					throw Error("付胶磐狼 阁胶磐 沥焊啊 绝寸.");				}				if (!pMonsterInfo->isMaster())				{					StringStream msg;					msg << "阁胶磐 鸥蕾[" 						<< (int)pMasterLairInfo->getMasterMonsterType() 						<< "]篮 付胶磐啊 酒聪促.";					throw Error(msg.toString());				}			} catch (Throwable& t) {				cout << t.toString().c_str() << endl;				throw Error("付胶磐狼 阁胶磐 沥焊啊 绝寸.");			}		}					SAFE_DELETE(pStmt);	} 	END_DB(pStmt)	__END_CATCH}//////////////////////////////////////////////////////////////////////////////// reload from database//////////////////////////////////////////////////////////////////////////////void MasterLairInfoManager::reload ()	throw (Error){	__BEGIN_TRY		//cout << "MasterLairInfoManager::reload()" << endl;	Statement* pStmt = NULL;	BEGIN_DB	{		// create statement		pStmt = g_pDatabaseManager->getConnection("DARKEDEN")->createStatement();		Result* pResult = pStmt->executeQuery(			"SELECT ZoneID, MasterNotReadyMonsterType, MasterMonsterType, MasterRemainNotReady, MasterX, MasterY, MasterDir, MaxPassPlayer, SummonX, SummonY, FirstRegenDelay, RegenDelay, StartDelay, EndDelay, KickOutDelay, KickZoneID, KickZoneX, KickZoneY, LairAttackTick, LairAttackMinNumber, LairAttackMaxNumber, MasterSummonSay, MasterDeadSlayerSay, MasterDeadVampireSay, MasterNotDeadSay FROM MasterLairInfo");		while (pResult->next()) 		{			uint i = 0;			ZoneID_t zoneID = pResult->getInt(++i);			MasterLairInfo* pMasterLairInfo = getMasterLairInfo( zoneID );			//cout << "new OK" << endl;			if (pMasterLairInfo!=NULL)			{				//cout << "Reload: " << zoneID << endl;				pMasterLairInfo->setZoneID( zoneID );				pMasterLairInfo->setMasterNotReadyMonsterType( pResult->getInt(++i) );				pMasterLairInfo->setMasterMonsterType( pResult->getInt(++i) );				pMasterLairInfo->setMasterRemainNotReady( pResult->getInt(++i)!=0 );				pMasterLairInfo->setMasterX( pResult->getInt(++i) );				pMasterLairInfo->setMasterY( pResult->getInt(++i) );				pMasterLairInfo->setMasterDir( pResult->getInt(++i) );				pMasterLairInfo->setMaxPassPlayer( pResult->getInt(++i) );				//pMasterLairInfo->setMaxSummonMonster( pResult->getInt(++i) );				pMasterLairInfo->setSummonX( pResult->getInt(++i) );				pMasterLairInfo->setSummonY( pResult->getInt(++i) );				pMasterLairInfo->setFirstRegenDelay( pResult->getInt(++i) );				pMasterLairInfo->setRegenDelay( pResult->getInt(++i) );				pMasterLairInfo->setStartDelay( pResult->getInt(++i) );				pMasterLairInfo->setEndDelay( pResult->getInt(++i) );				pMasterLairInfo->setKickOutDelay( pResult->getInt(++i) );				pMasterLairInfo->setKickZoneID( pResult->getInt(++i) );				pMasterLairInfo->setKickZoneX( pResult->getInt(++i) );				pMasterLairInfo->setKickZoneY( pResult->getInt(++i) );				pMasterLairInfo->setLairAttackTick( pResult->getInt(++i) );				pMasterLairInfo->setLairAttackMinNumber( pResult->getInt(++i) );				pMasterLairInfo->setLairAttackMaxNumber( pResult->getInt(++i) );				pMasterLairInfo->setMasterSummonSay( pResult->getString(++i) );				pMasterLairInfo->setMasterDeadSlayerSay( pResult->getString(++i) );				pMasterLairInfo->setMasterDeadVampireSay( pResult->getString(++i) );				pMasterLairInfo->setMasterNotDeadSay( pResult->getString(++i) );				// 眉农 内靛				// 付胶磐狼 阁胶磐 沥焊啊 乐绰瘤 眉农茄促.				try {					const MonsterInfo* pMonsterInfo = g_pMonsterInfoManager->getMonsterInfo( pMasterLairInfo->getMasterMonsterType() );					if (pMonsterInfo==NULL)	// 唱吝阑 困秦辑. -_-;					{						throw Error("付胶磐狼 阁胶磐 沥焊啊 绝寸.");					}					if (!pMonsterInfo->isMaster())					{						StringStream msg;						msg << "阁胶磐 鸥蕾[" 							<< (int)pMasterLairInfo->getMasterMonsterType() 							<< "]篮 付胶磐啊 酒聪促.";						throw Error(msg.toString());					}				} catch (Throwable& t) {					cout << t.toString().c_str() << endl;					throw Error("付胶磐狼 阁胶磐 沥焊啊 绝寸.");				}			}		}					SAFE_DELETE(pStmt);	} 	END_DB(pStmt)	__END_CATCH}//////////////////////////////////////////////////////////////////////////////// add zone info to zone info manager//////////////////////////////////////////////////////////////////////////////void MasterLairInfoManager::addMasterLairInfo (MasterLairInfo* pMasterLairInfo) 	throw (Error){	__BEGIN_TRY	// 老窜 鞍篮 酒捞叼狼 粮捞 乐绰瘤 眉农秦夯促.	hash_map< ZoneID_t , MasterLairInfo *>::iterator itr = m_MasterLairInfos.find(pMasterLairInfo->getZoneID());		if (itr != m_MasterLairInfos.end())		// 度鞍篮 酒捞叼啊 捞固 粮犁茄促绰 家府促. - -;		throw Error("duplicated zone id");	m_MasterLairInfos[ pMasterLairInfo->getZoneID() ] = pMasterLairInfo;	__END_CATCH}	//////////////////////////////////////////////////////////////////////////////// Delete zone info from zone info manager//////////////////////////////////////////////////////////////////////////////void MasterLairInfoManager::deleteMasterLairInfo (ZoneID_t zoneID) 	throw (NoSuchElementException){	__BEGIN_TRY			hash_map< ZoneID_t , MasterLairInfo *>::iterator itr = m_MasterLairInfos.find(zoneID);		if (itr != m_MasterLairInfos.end()) 	{		// 粮阑 昏力茄促.		SAFE_DELETE(itr->second);		// pair甫 昏力茄促.		m_MasterLairInfos.erase(itr);	} 	else 	{		// 弊繁 粮 酒捞叼甫 茫阑 荐 绝菌阑 锭		StringStream msg;		msg << "ZoneID : " << zoneID;		throw NoSuchElementException(msg.toString());	}	__END_CATCH}	//////////////////////////////////////////////////////////////////////////////// get zone from zone info manager//////////////////////////////////////////////////////////////////////////////MasterLairInfo* MasterLairInfoManager::getMasterLairInfo (ZoneID_t zoneID) 	throw (NoSuchElementException){	__BEGIN_TRY			MasterLairInfo* pMasterLairInfo = NULL;	hash_map< ZoneID_t , MasterLairInfo *>::iterator itr = m_MasterLairInfos.find(zoneID);		if (itr != m_MasterLairInfos.end()) {		pMasterLairInfo = itr->second;	} else {		// 弊繁 粮 酒捞叼甫 茫阑 荐 绝菌阑 锭		/*		StringStream msg;		msg << "ZoneID : " << zoneID; 		throw NoSuchElementException(msg.toString());		*/		return NULL;	}	return pMasterLairInfo;	__END_CATCH}//////////////////////////////////////////////////////////////////////////////// get debug string//////////////////////////////////////////////////////////////////////////////string MasterLairInfoManager::toString () const	throw (){	__BEGIN_TRY	StringStream msg;	msg << "MasterLairInfoManager(";	if (m_MasterLairInfos.empty()) msg << "EMPTY";	else 	{		for (hash_map< ZoneID_t , MasterLairInfo* >::const_iterator itr = m_MasterLairInfos.begin() ; itr != m_MasterLairInfos.end() ; itr ++) 		{			msg << itr->second->toString();		}	}	msg << ")";	return msg.toString();	__END_CATCH}// global variable definitionMasterLairInfoManager* g_pMasterLairInfoManager = NULL;

⌨️ 快捷键说明

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