本文整理汇总了C++中KLThrow函数的典型用法代码示例。如果您正苦于以下问题:C++ KLThrow函数的具体用法?C++ KLThrow怎么用?C++ KLThrow使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了KLThrow函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: args
// 连接到login server
INT CGameProduce_Login::ConnectToLoginServer(LuaPlus::LuaState* state)
{
LuaStack args(state);
if (!(args[2].IsInteger()))
{
KLThrow("LUA:GetBuffIconNameByIndex param parameter error");
}
if (!(args[3].IsInteger()))
{
KLThrow("LUA:GetBuffIconNameByIndex param parameter error");
}
int nAreaIndex = args[2].GetInteger();
int nLoginServerIndex = args[3].GetInteger();
if(CGameProcedure::s_pProcLogIn)
{
CGameProcedure::s_pProcLogIn->ConnectToLoginServer(nAreaIndex, nLoginServerIndex);
}
return 0;
}
示例2: args
// 得到宠物的名字
INT Pet::GetName(LuaPlus::LuaState* state)
{
LuaStack args(state);
if (!(args[2].IsInteger()) )
{
KLThrow("LUA:Pet GetName parameter error");
return 0;
}
INT nPetNum = args[2].GetInteger();
SDATA_PET* My_Pet= CDataPool::GetMe()->Pet_GetPet(nPetNum);
if( (!My_Pet) || ( !My_Pet->m_pModelData ) )
{
KLThrow("LUA:Pet GetName parameter error");
return 0;
}
state->PushString( My_Pet->m_szName.c_str());
return 1;
//DBC_DEFINEHANDLE(s_pMonsterAttr, DBC_CREATURE_ATT);
//const _DBC_CREATURE_ATT* pPet = (const _DBC_CREATURE_ATT*)s_pMonsterAttr->Search_Index_EQU(My_Pet->m_nDataID);
//if(pPet)
//{
// state->PushString(pPet->pName);
//}
//else
//{
// state->PushString("未知宠");
//}
//return 2;
}
示例3: args
//关心与某逻辑Obj的距离(用于商人或者任务窗口,当距离超过一定距离后自动关闭)
INT CUIWindowItem::LUA_CareObject(LuaPlus::LuaState* pState)
{
LuaStack args(pState);
if(!(args[2].IsInteger()))
{
KLThrow("LUA: CUIWindowItem::LUA_CareObject[2] Wrong Param1");
}
if(!(args[3].IsInteger()))
{
KLThrow("LUA: CUIWindowItem::LUA_CareObject[3] Wrong Param1");
}
if(!(args[4].IsString()))
{
KLThrow("LUA: CUIWindowItem::LUA_CareObject[4] Wrong Param1");
}
// Object的ID
INT nObjID = args[2].GetInteger();
// 是否关心
INT bCare = args[3].GetInteger()==1;
// 谁在关心
std::string str = args[4].GetString();
g_pObjectSystem->CareObject(nObjID, bCare, str);
return 0;
}
示例4: args
INT CVariableSystem::Lua_SetGlobalVariable(LuaPlus::LuaState* state) //设置全局变量
{
LuaPlus::LuaStack args(state);
if(!args[2].IsString())
{
KLThrow("LUA:CVariableSystem::Lua_SetGlobalVariable[2] param parameter error");
return 0;
}
if(!args[3].IsString())
{
KLThrow("LUA:CVariableSystem::Lua_SetGlobalVariable[3] param parameter error");
return 0;
}
if(!args[4].IsInteger())
{
KLThrow("LUA:CVariableSystem::Lua_SetGlobalVariable[4] param parameter error");
return 0;
}
// 如果没有设置触发事件参数 20100714 BLL
if ( !args[5].IsInteger() )
{
CVariableSystem::GetMe()->SetVariable(args[2].GetString(), args[3].GetString(), args[4].GetInteger());
}
else
{
CVariableSystem::GetMe()->SetVariable(args[2].GetString(), args[3].GetString(), args[4].GetInteger(), args[5].GetInteger());
}
return 0;
}
示例5: args
/* ------------------------------------------------
// 放生
参数1 GUID m_uHighSection
参数2 GUID m_uLowSection
------------------------------------------------ */
INT Mount::FreeMount(LuaPlus::LuaState* state)
{
LuaStack args(state);
if (!(args[2].IsString()))
{
KLThrow("Mount::FreeMount[2] param parameter error");
}
STRING szHighSection = args[2].GetString();
if (!(args[3].IsString()))
{
KLThrow("Mount::FreeMount[3] param parameter error");
}
STRING szLowSection = args[3].GetString();
PET_GUID_t GUID;
GUID.m_uHighSection = atol(szHighSection.c_str());
GUID.m_uLowSection = atol(szLowSection.c_str());
const SDATA_PET* pPet = CDataPool::GetMe()->Pet_GetPet(GUID);
if (pPet && FALSE == pPet->m_GUID.IsNull())
{
//向服务器发送
CGManipulatePet Msg;
Msg.SetGUID(pPet->m_GUID);
Msg.SetManipulateType( MANIPULATE_FREEHORSE );
CNetManager::GetMe()->SendPacket(&Msg);
}
return 0;
}
示例6: KLU_Log
// 计算从开始点到结束点的路径 2006-4-17
BOOL CPath::CreateMovePath(const fVector2& fvCurrent, const fVector2& fvTarget)
{
KLU_Log("Begin CreateMovePath : %f,%f,%f,%f", fvCurrent.x, fvCurrent.y,
fvTarget.x, fvTarget.y);
m_vPosStack.clear();
CScene* pActiveScene = (CScene*)CWorldManager::GetMe()->GetActiveScene();
if( pActiveScene == NULL )
return FALSE;
if( FALSE == pActiveScene->IsValidPosition(fvCurrent) )
KLThrow("CPath::CreateMovePath() current position is invalid : %f,%f", fvCurrent.x, fvCurrent.y);
if( FALSE == pActiveScene->IsValidPosition(fvTarget) )
KLThrow("CPath::CreateMovePath() target position is invalid : %f,%f", fvTarget.x, fvTarget.y);
bool find = pActiveScene->mPathFinder->findPath(fvCurrent.x, fvCurrent.y, fvTarget.x, fvTarget.y);
int pathCount = 0;
if (find)
{
size_t count = pActiveScene->mPathFinder->getNumPathPoints();
pathCount = static_cast<int>(count);
KLU_Log("CreateMovePath : %f,%f,%f,%f,%d,%s", fvCurrent.x, fvCurrent.y,
fvTarget.x, fvTarget.y, pathCount, find ? "find" : "not find");
if (count > 16)
{
KLU_Log("CreateMovePath : %f,%f,%f,%f,%d,path unit > 16", fvCurrent.x, fvCurrent.y,
fvTarget.x, fvTarget.y, pathCount);
}
for (size_t i=0; i<count-1; ++i)
{
const PathLib::ResultPoint& point1 = pActiveScene->mPathFinder->getResultPoint(i);
const PathLib::ResultPoint& point2 = pActiveScene->mPathFinder->getResultPoint(i+1);
PathUnit pathUnit;
pathUnit.fvStart.x = point1.x;
pathUnit.fvStart.y = point1.y;
pathUnit.fvTarget.x = point2.x;
pathUnit.fvTarget.y = point2.y;
m_vPosStack.push_back(pathUnit);
}
}
return find;
}
示例7: Release
BOOL CSoundBufferFMod::ReadWavBuffer(const STRING &name)
{
Release();
char* lpAddress = NULL;
DWORD dwSize = CGameProcedure::s_pResourceProvider->loadResource(name.c_str(), lpAddress, "General");
if(dwSize > 0)
{
m_pFModSample = FSOUND_Sample_Load(FSOUND_FREE,
lpAddress,
FSOUND_HW3D | FSOUND_LOADMEMORY, 0, dwSize);
CGameProcedure::s_pResourceProvider->unloadResource( lpAddress, dwSize );
}
if(!m_pFModSample)
{
KLThrow("Invalid sound file:%s", name.c_str());
return FALSE;
}
//缺省所有声音都是不循环的
FSOUND_Sample_SetMode(m_pFModSample, FSOUND_LOOP_OFF);
return TRUE;
}
示例8: args
// 20100421 AddCodeBegin
// 得到技能名称
INT SkillStudy::GetSkillName(LuaPlus::LuaState* state)
{
LuaStack args(state);
if (!(args[2].IsInteger()))
{
KLThrow("PlayerShop::EnumItem[2] param parameter error");
}
INT nSkillID = args[2].GetInteger();
DBC_DEFINEHANDLE(s_pSkillDBC, DBC_SKILL_DATA);
const _DBC_SKILL_DATA* pSkillData = (const _DBC_SKILL_DATA*)s_pSkillDBC->Search_Index_EQU(nSkillID);
if (pSkillData)
{
if ( pSkillData->m_lpszName != NULL )
{
state->PushString( pSkillData->m_lpszName );
return 1;
}
}
state->PushString("");
return 1;
}
示例9: args
INT MissionReply::EnumItem(LuaPlus::LuaState* state)
{
LuaStack args(state);
//检查参数
if (!(args[2].IsInteger()))
{
KLThrow("LUA: MissionReply::EnumItem Wrong Param2");
}
INT nIndex = args[2].GetInteger();
if(nIndex>=0 && nIndex<=3)
{
tActionItem* pActionItem = CActionSystem::GetMe()->EnumAction(nIndex, NAMETYPE_MISSIONREFER);
if(pActionItem)
{
LuaObject objReturn = state->BoxPointer(pActionItem);
objReturn.SetMetaTable(*CActionItem::s_pMetaTable);
objReturn.PushStack();
return 1;
}
}
//非法ActionItem
LuaObject objReturn = state->BoxPointer(&(CActionItem::s_InvalidAction));
objReturn.SetMetaTable(*CActionItem::s_pMetaTable);
objReturn.PushStack();
return 1;
}
示例10: KLThrow
// 渲染OGRE场景
VOID CEngineInterface::RenderFrame(VOID)
{
if(!Ogre::Root::getSingletonPtr())
{
KLThrow("Ogre::Root = 0");
}
const UINT MAX_RENDER_INTER_TIME = 2000;
static UINT s_nLastRenderTime = 0;
UINT s_nTimeNow = g_pTimeSystem->GetTimeNow();
if(g_pTimeSystem->CalSubTime(s_nLastRenderTime, s_nTimeNow) > MAX_RENDER_INTER_TIME)
{
Ogre::Root::getSingleton().clearEventTimes();
s_nLastRenderTime = s_nTimeNow;
return;
}
s_nLastRenderTime = s_nTimeNow;
//重置小地图探灯
if(m_pMapLight)
{
m_pMapLight->Update();
}
Ogre::Root::getSingleton().renderOneFrame();
}