we1982 26 #1 Oluşturuldu: Nisan 25, 2018 Merhaba npc lere bastığımda id leri örülmekte... aşağıdaki kodda kırmızı ile yazılan yerde görünmemesi için kodu kapatıyorum gameserver patlıyor.. yardımlarınızı rica ederim.. bool CLuaEngine::ExecuteScript(CUser * pUser, CNpc * pNpc, int32 nEventID, int8 bSelectedReward, const char * filename) { ScriptBytecodeMap::iterator itr; bool result = false; m_lock->AcquireReadLock(); itr = m_scriptMap.find(filename); if (itr == m_scriptMap.end()) { // Build full path to script std::string szPath = LUA_SCRIPT_DIRECTORY; szPath += filename; // Release the read lock (we're not reading anymore) m_lock->ReleaseReadLock(); // Attempt to compile BytecodeBuffer bytecode; bytecode.reserve(LUA_SCRIPT_BUFFER_SIZE); if (!SelectAvailableScript()->CompileScript(szPath.c_str(), bytecode)) { printf("ERROR: Could not compile Lua script."); printf("FILE: %s", szPath.c_str()); printf("USER: %s", pUser->GetName().c_str()); printf("ZONE: %d", pUser->GetZoneID()); printf("NPC ID: %d", pNpc->m_sSid); printf("-"); return false; } // Acquire the write lock (we're adding the compiled script) m_lock->AcquireWriteLock(); // Add the script to our map m_scriptMap[filename] = bytecode; // Now that we have the bytecode, we can use it. result = SelectAvailableScript()->ExecuteScript(pUser, pNpc, nEventID, bSelectedReward, filename, bytecode); // Done using the lock. m_lock->ReleaseWriteLock(); } else { // Already have the bytecode, so now we need to use it. result = SelectAvailableScript()->ExecuteScript(pUser, pNpc, nEventID, bSelectedReward, filename, itr->second); // Done using the lock. m_lock->ReleaseReadLock(); } //std::string EventMessage; //EventMessage = string_format("NpcID = %d - EventID = %d - Lua = %s", pNpc->m_sSid, nEventID, filename); //Packet EventNotice(WIZ_CHAT, uint8(PUBLIC_CHAT)); //EventNotice GetNation() GetSocketID() //pUser->Send(&EventNotice); return result; } Mesajı raporla İletiyi paylaş Link to post Sitelerde Paylaş
Kaanizm33 0 #2 Nisan 25, 2018 tarihinde gönderildi sadece şu kısımda //EventMessage = string_format("NpcID = %d - EventID = %d - Lua = %s", pNpc->m_sSid, nEventID, filename); // olsun denermisin Mesajı raporla İletiyi paylaş Link to post Sitelerde Paylaş
donz05 30 #3 Nisan 25, 2018 tarihinde gönderildi npc nin butun gorev ve yetkilerini kapatmissin galiba ne yapmak istiyorsun npc ile tam anlayamadik sadece isminin gorunmesini istemiyorsan tbl den sil ismini gitsinduzeltiyorum npc id yazmissin onu kacirmisim gozden pardon :)-- mesaja ek olarak --// Npc Events if (isGM()) { std::string EventMessage; EventMessage = string_format("NpcID = %d - EventID = %d - TriggerIndex = %d - DataIndex = %d - CompleteIndex = %d ", pNpc->m_sSid, nEventID, pQuestHelper->nEventTriggerIndex, pQuestHelper->sEventDataIndex , pQuestHelper->nEventCompleteIndex); Packet EventNotice(WIZ_CHAT, uint8(PUBLIC_CHAT)); EventNotice Send(&EventNotice); } bunu dene bi haci Mesajı raporla İletiyi paylaş Link to post Sitelerde Paylaş
we1982 26 #4 Konu Sahibi Nisan 25, 2018 tarihinde gönderildi halleltim teşekkrler-- mesaja ek olarak --kırmızı ile yazan kısmı tamamem sildim... Mesajı raporla İletiyi paylaş Link to post Sitelerde Paylaş
YNG 55 #5 Nisan 26, 2018 tarihinde gönderildi Alıntıbool CLuaEngine::ExecuteScript(CUser * pUser, CNpc * pNpc, int32 nEventID, int8 bSelectedReward, const char * filename){ ScriptBytecodeMap::iterator itr; bool result = false; m_lock->AcquireReadLock(); itr = m_scriptMap.find(filename); if (itr == m_scriptMap.end()) { // Build full path to script std::string szPath = LUA_SCRIPT_DIRECTORY; szPath += filename; // Release the read lock (we're not reading anymore) m_lock->ReleaseReadLock(); // Attempt to compile BytecodeBuffer bytecode; bytecode.reserve(LUA_SCRIPT_BUFFER_SIZE); if (!SelectAvailableScript()->CompileScript(szPath.c_str(), bytecode)) { TRACE("ERROR: Could not compile Lua script."); TRACE("FILE: %s", szPath.c_str()); TRACE("USER: %s", pUser != nullptr ? pUser->GetName().c_str() : ""); TRACE("ZONE: %d", pUser != nullptr ? pUser->GetZoneID() : -1); TRACE("NPC ID: %d", pNpc != nullptr ? pNpc->GetProtoID() : 0); TRACE("-"); return false; } std::string sNoticeMessage; sNoticeMessage = string_format("NpcID : %d - Event ID : %d - Lua : %s", pNpc != nullptr ? pNpc->GetProtoID() : 0,nEventID,szPath.c_str()); Packet sNotice(WIZ_CHAT, uint8(PUBLIC_CHAT)); sNotice GetNation() GetSocketID() if (!sNoticeMessage.empty()) { if (pUser->isGM()) pUser->Send(&sNotice); } // Acquire the write lock (we're adding the compiled script) m_lock->AcquireWriteLock();#if !defined(LUA_SCRIPT_CACHE_DISABLED) // Add the script to our map m_scriptMap[filename] = bytecode;#endif // Now that we have the bytecode, we can use it. result = SelectAvailableScript()->ExecuteScript(pUser, pNpc, nEventID, bSelectedReward, filename, bytecode); // Done using the lock. m_lock->ReleaseWriteLock(); } else { // Already have the bytecode, so now we need to use it. result = SelectAvailableScript()->ExecuteScript(pUser, pNpc, nEventID, bSelectedReward, filename, itr->second); // Done using the lock. m_lock->ReleaseReadLock(); } return result;}"Boş Geliyordur Bole Eklersen Düzelebilir.." Mesajı raporla İletiyi paylaş Link to post Sitelerde Paylaş
we1982 26 #6 Konu Sahibi Nisan 26, 2018 tarihinde gönderildi @ YNG halletim teşekkürler.... Mesajı raporla İletiyi paylaş Link to post Sitelerde Paylaş