static eEsifError CreateDomains( EsifAppPtr appPtr, EsifUpPtr upPtr, AppParticipantDataMapPtr participantDataMapPtr ) { eEsifError rc = ESIF_OK; UInt8 i = 0; ESIF_TRACE_DEBUG("Create Domains\n"); for (i = 0; i < upPtr->fDspPtr->get_domain_count(upPtr->fDspPtr); i++) { struct esif_fpc_domain *domain_ptr = upPtr->fDspPtr->get_domain(upPtr->fDspPtr, i + 1); if (NULL == domain_ptr) { continue; } rc = CreateDomain(i, appPtr, participantDataMapPtr, domain_ptr); if (ESIF_OK != rc) { goto exit; } ESIF_TRACE_DEBUG("Create Domain %s\n", domain_ptr->descriptor.name); } exit: return rc; }
void SSHTables::Make() { string domain = packagePath + "\\domain\\"; string dao = packagePath + "\\dao\\"; string daoImpl = packagePath + "\\dao\\impl\\"; string service = packagePath + "\\service\\"; string serviceImpl = packagePath + "\\service\\impl\\"; for (vector<Table>::const_iterator it = tables.begin(); it != tables.end(); it++) { CreateDomain(domain, *it); CreateDAO(dao, *it); CreateDAOImpl(daoImpl, *it); CreateService(service, *it); CreateServiceImpl(serviceImpl, *it); } }
bool CScriptSystem::Reload() { if((!m_bFirstReload && g_pMonoCVars->mono_realtimeScripting == 0) || m_bReloading) return false; m_bReloading = true; if(!m_bFirstReload) { for each(auto listener in m_listeners) listener->OnReloadStart(); m_pScriptManager->CallMethod("Serialize"); } IMonoDomain *pScriptDomain = CreateDomain("ScriptDomain", nullptr, true); IMonoAssembly *pCryBraryAssembly = pScriptDomain->LoadAssembly(PathUtils::GetBinaryPath() + "CryBrary.dll"); IMonoArray *pCtorParams = CreateMonoArray(2); pCtorParams->InsertAny(m_bFirstReload); pCtorParams->InsertMonoString(ToMonoString(PathUtils::GetConfigPath())); IMonoObject *pScriptManager = *pCryBraryAssembly->GetClass("ScriptManager", "CryEngine.Initialization")->CreateInstance(pCtorParams); SAFE_RELEASE(pCtorParams); auto result = pScriptManager->CallMethod("Initialize", m_bFirstReload); if(result == nullptr) return false; IMonoObject *pResult = *result; auto reloadResult = pResult->Unbox<EScriptReloadResult>(); SAFE_RELEASE(pResult); switch(reloadResult) { case EScriptReloadResult_Success: { // revert previous domain if(!m_bFirstReload) m_pScriptDomain->Release(); m_pScriptDomain = pScriptDomain; m_pScriptManager = pScriptManager; m_pCryBraryAssembly = pCryBraryAssembly; CacheManagedResources(); if(!m_bFirstReload) m_pScriptManager->CallMethod("Deserialize"); // Set Network.Editor etc. IMonoClass *pClass = m_pCryBraryAssembly->GetClass("Game"); IMonoArray *pArgs = CreateMonoArray(2); pArgs->Insert(gEnv->IsEditor()); pArgs->Insert(gEnv->IsDedicated()); pClass->GetMethod("InitializeGameStatics", 2)->InvokeArray(nullptr, pArgs); SAFE_RELEASE(pArgs); m_pScriptManager->CallMethod("ProcessWaitingScripts", m_bFirstReload); for each(auto listener in m_listeners) listener->OnReloadComplete(); if(!m_bFirstReload && gEnv->IsEditor()) gEnv->pFlowSystem->ReloadAllNodeTypes(); m_bReloading = false; m_bDetectedChanges = false; return true; } break; case EScriptReloadResult_Retry: { m_bReloading = false; return Reload(); } case EScriptReloadResult_Revert: { pScriptDomain->Release(); m_pScriptDomain->SetActive(); m_bReloading = false; m_bDetectedChanges = false; return false; } break; case EScriptReloadResult_Abort: { gEnv->pSystem->Quit(); m_bReloading = false; } break; } return false; }