Exemple #1
0
rappleAction::rappleAction(IEntity * ee)
{
    if(gEnv->pInput)
        gEnv->pInput->AddEventListener(this);
    auto myCVar = gEnv->pConsole->GetCVar("cl_tpvMaxWeapDistDebug");
    myCVar->Set("1");
    player = ee;
	//cMovement = new CPlayerMovementController((CPlayer*)player);
    flowManager = gEnv->pFlowSystem->GetIModuleManager();
					CryLogAlways("rAction startup");
	ready = false;
}
void CEquipmentManager::DumpPack(const SEquipmentPack* pPack) const
{
	CryLogAlways("Pack: '%s' Primary='%s' ItemCount=%" PRISIZE_T " AmmoCount=%" PRISIZE_T "",
		pPack->m_name.c_str(), pPack->m_primaryItem.c_str(), pPack->m_items.size(), pPack->m_ammoCount.size());

	CryLogAlways("   Items:");
	for (std::vector<SEquipmentPack::SEquipmentItem>::const_iterator iter = pPack->m_items.begin();
		iter != pPack->m_items.end(); ++iter)
	{
		CryLogAlways("   '%s' : '%s'", iter->m_name.c_str(), iter->m_type.c_str());

		int numAccessories = iter->m_setup.size();

		for(int i = 0; i < numAccessories; i++)
		{
			CryLogAlways("			Accessory: '%s'", iter->m_setup[i]->GetName());
		}
	}

	CryLogAlways("   Ammo:");
	for (std::map<string, int>::const_iterator iter = pPack->m_ammoCount.begin();
		iter != pPack->m_ammoCount.end(); ++iter)
	{
		CryLogAlways("   '%s'=%d", iter->first.c_str(), iter->second);
	}
}
		ValueDumper(TSynchedKey key, const TSynchedValue &value)
		{
			switch(value.GetType())
			{
				case eSVT_Bool:
					CryLogAlways("  %.08d -     bool: %s", key, *value.GetPtr<bool>() ? "true" : "false");
					break;

				case eSVT_Float:
					CryLogAlways("  %.08d -    float: %f", key, *value.GetPtr<float>());
					break;

				case eSVT_Int:
					CryLogAlways("  %.08d -      int: %d", key, *value.GetPtr<int>());
					break;

				case eSVT_EntityId:
					CryLogAlways("  %.08d - entityId: %.08x", key, *value.GetPtr<EntityId>());
					break;

				case eSVT_String:
					CryLogAlways("  %.08d -  string: %s", key, value.GetPtr<string>()->c_str());
					break;

				default:
					CryLogAlways("  %.08d - unknown: %.08x", key, *value.GetPtr<uint32>());
					break;
			}
		}
//------------------------------------------------------------------------
bool CGameRules::OnDemoteToClient(SHostMigrationInfo &hostMigrationInfo, uint32 &state)
{
	if (!g_pGame->GetIGameFramework()->ShouldMigrateNub(hostMigrationInfo.m_session))
	{
		return true;
	}

	CryLogAlways("[Host Migration]: CGameRules::OnDemoteToClient() started");

	if (m_hostMigrationCachedEntities.empty())
	{
		HostMigrationFindDynamicEntities(m_hostMigrationCachedEntities);
	}
	else
	{
		HostMigrationRemoveDuplicateDynamicEntities();
	}

	CryLogAlways("[Host Migration]: CGameRules::OnDemoteToClient() finished");
	CCCPOINT(HostMigration_OnDemoteToClient);
	return true;
}
void CTacticalPointLanguageExtender::Initialize()
{
	CryLogAlways("Registering TPS Extensions...");
	INDENT_LOG_DURING_SCOPE();

	if (gEnv->pAISystem->GetTacticalPointSystem())
	{
		RegisterWithTacticalPointSystem();
		RegisterQueries();

		Script::Call(gEnv->pScriptSystem, "ReloadTPSExtensions");
	}
}
void CryVR_WiimoteManagerPlugin::ProcessEvent( EFlowEvent event, SActivationInfo* pActInfo )
{


    if ( event == eFE_Activate  && GetPortBool( pActInfo, 0 ) )
    {
        CryLogAlways( "Evenement init wiimote" );
        Init( GetPortBool( pActInfo, 1 ), GetPortBool( pActInfo, 1 ), GetPortInt( pActInfo, 2 ), GetPortFloat( pActInfo, 3 ), GetPortInt( pActInfo, 4 ), GetPortInt( pActInfo, 5 ), GetPortBool( pActInfo, 6 ), GetPortInt( pActInfo, 7 ) );

        //Sleep(1000);
        while ( wiiuse_poll( wiimotes, CryVR_WiimoteManagerPlugin::found ) )
        {
            CryLogAlways( "Initial Event" );
            Status( wiimotes[0] );
        }

        ActivateOutput( pActInfo, 0, true );
    }



}
Exemple #7
0
void CInventory::Dump() const
{
	struct Dumper
	{
		Dumper(EntityId entityId, const char* desc)
		{
			IEntitySystem* pEntitySystem = gEnv->pEntitySystem;
			IEntity*       pEntity       = pEntitySystem->GetEntity(entityId);
			CryLogAlways(">> Id: %u [%s] $3%s $5%s", entityId, pEntity ? pEntity->GetName() : "<unknown>", pEntity ? pEntity->GetClass()->GetName() : "<unknown>", desc ? desc : "");
		}
	};

	int count = GetCount();
	CryLogAlways("-- $3%s$1's Inventory: %d Items --", GetEntity()->GetName(), count);

	if (count)
	{
		for (TInventoryCIt it = m_stats.slots.begin(); it != m_stats.slots.end(); ++it)
		{
			Dumper dump(*it, 0);
		}
	}

	CryLogAlways(">> --");

	Dumper current(m_stats.currentItemId, "Current");
	Dumper last(m_stats.lastItemId, "Last");
	Dumper holstered(m_stats.holsteredItemId, "Holstered");

	CryLogAlways("-- $3%s$1's Inventory: %" PRISIZE_T " Ammo Types --", GetEntity()->GetName(), m_stats.ammoInfo.size());

	if (!m_stats.ammoInfo.empty())
	{
		for (TAmmoInfoMap::const_iterator ait = m_stats.ammoInfo.begin(); ait != m_stats.ammoInfo.end(); ++ait)
		{
			CryLogAlways(">> [%s] $3%d$1/$3%d", ait->first->GetName(), ait->second.GetCount(), GetAmmoCapacity(ait->first));
		}
	}
}
void CGameTokenSystem::RenameToken( IGameToken *pToken,const char *sNewName )
{
	CRY_ASSERT(pToken);
	CGameToken *pCToken = (CGameToken*)pToken;
	GameTokensMap::iterator it = m_pGameTokensMap->find( pCToken->m_name.c_str() );
	if (it != m_pGameTokensMap->end())
		m_pGameTokensMap->erase(it);
#ifdef DEBUG_GAME_TOKENS
	CryLogAlways("GameTokenSystemNew::RenameToken: 0x%p '%s' -> '%s'", pCToken, pCToken->m_name, sNewName);
#endif
	pCToken->m_name = sNewName;
	(*m_pGameTokensMap)[pCToken->m_name.c_str()] = pCToken;
}
Exemple #9
0
void CScriptSystem::OnFileChange(const char *fileName)
{
	FUNCTION_PROFILER_FAST(GetISystem(), PROFILE_SCRIPT, gEnv->bProfilerEnabled);

	if(g_pMonoCVars->mono_realtimeScriptingDetectChanges == 0)
		return;

	const char *fileExt = PathUtil::GetExt(fileName);
	if(!strcmp(fileExt, "cs") || !strcmp(fileExt, "dll"))
	{
		CryLogAlways("[CryMono] Detected change in file %s, preparing for reload..", fileName);

		if(!GetFocus())
		{
			CryLogAlways("CryENGINE did not have focus, waiting..");
			m_bDetectedChanges = true;
			return;
		}

		Reload();
	}
}
/// Runs all registered tests (if they meet their dependencies)
void CFeatureTestMgr::RunAll()
{
	// Writing the list of the active registered tests. 
	// This can be useful to later check, when a crash occurs, 
	// which tests were executed and which are skipped 
	// (We will have no valid results for them)
	{
		if(m_pAutoTester && !m_testManifestWritten)
		{
			XmlNodeRef testManifest = GetISystem()->CreateXmlNode("testManifest");
			testManifest->setTag("testmanifest");		

			CryLogAlways("About to dump out the testmanifest xml...");

			for (TFeatureTestVec::iterator iter(m_featureTests.begin()); iter != m_featureTests.end(); ++iter)
			{
				FeatureTestState& fTest = *iter;
				XmlNodeRef testDescrNode = fTest.m_pTest->XmlDescription();
				if(testDescrNode)
				{
					testManifest->addChild(testDescrNode);
				}
				
			}

			m_pAutoTester->WriteTestManifest(testManifest);
			m_testManifestWritten = true;
		}
	}



	if (!IsRunning())
	{
		// Ensure all tests are cleaned up and scheduled to run
		ResetAllTests(eFTS_Scheduled);

		if (StartNextTest() || WaitingForScheduledTests())
		{
			CryLog("Running all map feature tests...");
		}
		else
		{
			CryWarning(VALIDATOR_MODULE_GAME, VALIDATOR_WARNING, "No tests available to run!");
		}
	}
	else
	{
		CryWarning(VALIDATOR_MODULE_GAME, VALIDATOR_WARNING, "Tests are already running, can't start more until tests are complete.");
	}
}
//---------------------------------------------------
/*static*/ void ScreenLayoutManager::SetSafeArea( IConsoleCmdArgs* pArgs )
{
	if( !s_inst )
	{
		CryLogAlways( "No ScreenLayoutInstance available!" );
		return;
	}

	if( pArgs->GetArgCount() != 2 && pArgs->GetArgCount() != 3 )
	{
		CryLogAlways( "Incorrect Number of params" );
		return;
	}

	if( pArgs->GetArgCount() == 2 )
	{
		int id = (int)atoi( pArgs->GetArg(1) );

		// amount > 1.0f / probably an ID
		if( id <= 0 || id > eHSAID_END )
		{
			CryLog( "unknown safe area id." );
			return;
		}

		s_inst->SetSafeArea( (EHUDSafeAreaID)id );

		return;
	}

	float xammount = (float)atof( pArgs->GetArg(1) );
	float yammount = (float)atof( pArgs->GetArg(2) );
	if( xammount > 0.0f && yammount > 0.0f )
	{
		s_inst->SetSafeArea( Vec2(xammount, yammount) );
		return;
	}
}
void CGameTokenSystem::DeleteToken( IGameToken* pToken )
{
	CRY_ASSERT(pToken);
	GameTokensMap::iterator it = m_pGameTokensMap->find( ((CGameToken*)pToken)->m_name.c_str() );
	if (it != m_pGameTokensMap->end())
	{
#ifdef DEBUG_GAME_TOKENS
		CryLogAlways("GameTokenSystemNew::DeleteToken: About to delete Token 0x%p '%s' val=%s", pToken, pToken->GetName(), pToken->GetValueAsString());
#endif

		m_pGameTokensMap->erase(it);
		delete (CGameToken*)pToken;
	}
}
Exemple #13
0
void CUIMultiPlayer::PlayerJoined(EntityId playerid, const string& name)
{
    CryLogAlways("[CUIMultiPlayer] PlayerJoined %i %s", playerid, name.c_str() );

    m_Players[playerid].name = name;

    if (gEnv->pGame->GetIGameFramework()->GetClientActorId() == playerid)
    {
        SubmitNewName();
        return;
    }

    m_eventSender.SendEvent<eUIE_PlayerJoined>(playerid, name);
}
Exemple #14
0
void CDialogSystem::DumpSessions()
{
	// all sessions
	CryLogAlways("[DIALOG] AllSessions: Count=%" PRISIZE_T "", m_allSessions.size());
	for (TDialogSessionMap::const_iterator iter = m_allSessions.begin();
		iter != m_allSessions.end(); ++iter)
	{
		const CDialogSession* pSession = iter->second;
		CryLogAlways("  Session %d 0x%p Script=%s", pSession->GetSessionID(), pSession, pSession->GetScript()->GetID().c_str());
	}

	if (m_activeSessions.empty() == false)
	{
		CryLogAlways("[DIALOG] ActiveSessions: Count=%" PRISIZE_T "", m_activeSessions.size());
		// active sessions
		for (TDialogSessionVec::const_iterator iter = m_activeSessions.begin();
			iter != m_activeSessions.end(); ++iter)
		{
			const CDialogSession* pSession = *iter;
			CryLogAlways("  Session %d 0x%p Script=%s", pSession->GetSessionID(), pSession, pSession->GetScript()->GetID().c_str());
		}
	}

	// pending delete sessions
	if (m_pendingDeleteSessions.empty() == false)
	{
		CryLogAlways("[DIALOG] PendingDelete: Count=%" PRISIZE_T "", m_pendingDeleteSessions.size());
		// active sessions
		for (TDialogSessionVec::const_iterator iter = m_pendingDeleteSessions.begin();
			iter != m_pendingDeleteSessions.end(); ++iter)
		{
			const CDialogSession* pSession = *iter;
			CryLogAlways("  Session %d 0x%p Script=%s", pSession->GetSessionID(), pSession, pSession->GetScript()->GetID().c_str());
		}
	}
	// restore sessions
	if (m_restoreSessions.empty() == false)
	{
		CryLogAlways("[DIALOG] RestoreSessions: Count=%" PRISIZE_T "", m_restoreSessions.size());
		for (std::vector<SessionID>::const_iterator iter = m_restoreSessions.begin();
			iter != m_restoreSessions.end(); ++iter)
		{
			SessionID id = *iter;
			CryLogAlways("  Session %d", id);
		}
	}
}
void CryVR_WiimoteManagerPlugin::Status( struct wiimote_t* wm )
{
    CryLogAlways( "\n\n--- CONTROLLER STATUS [wiimote id %i] ---\n", wm->unid );
    CryLogAlways( "attachment:      %i\n", wm->exp.type );
    CryLogAlways( "speaker:         %i\n", WIIUSE_USING_SPEAKER( wm ) );
    CryLogAlways( "ir:              %i\n", WIIUSE_USING_IR( wm ) );
    CryLogAlways( "leds:            %i %i %i %i\n", WIIUSE_IS_LED_SET( wm, 1 ), WIIUSE_IS_LED_SET( wm, 2 ), WIIUSE_IS_LED_SET( wm, 3 ), WIIUSE_IS_LED_SET( wm, 4 ) );
    CryLogAlways( "battery:         %f %%\n", wm->battery_level );
}
void CAutoTester::AddSimpleTestCase(const char * groupName, const char * testName, float duration, const char * failureReason, const char * owners)
{
	bool passed = true;
	XmlNodeRef testCase = GetISystem()->CreateXmlNode();
	testCase->setTag("testcase");
	testCase->setAttr("name", testName);
	
	if (owners)
	{
		testCase->setAttr("owners", owners);
	}

	if (duration >= 0.f)
	{
		testCase->setAttr("time", duration);
	}

	// Set whatever other attributes are useful here!

	if (failureReason == NULL || failureReason[0] == '\0')
	{
		CryLogAlways ("CAutoTester::AddSimpleTestCase() Group '%s' test '%s' passed!", groupName, testName);
		testCase->setAttr("status", "run");
	}
	else
	{
		CryLogAlways ("CAutoTester::AddSimpleTestCase() Group '%s' test '%s' failed: %s", groupName, testName, failureReason);
		XmlNodeRef failedCase = GetISystem()->CreateXmlNode();
		failedCase->setTag("failure");
		failedCase->setAttr("type", "TestCaseFailed");
		failedCase->setAttr("message", failureReason);
		testCase->addChild(failedCase);
		passed = false;
	}

	AddTestCaseResult(string().Format("%s: %s", m_includeThisInFileName, groupName ? groupName : "No group name specified"), testCase, passed);
}
void CToolboxApplication::CreateLevel(const char *levelName)
{
	LOADING_TIME_PROFILE_SECTION(gEnv->pSystem);

	CryLogAlways("Creating empty level %s", levelName);

	string levelPath = PathUtil::GetGameFolder().append("/Levels/").append(levelName).append("/");
	string editorFile = levelPath.append(levelName).append(".tbx");

	gEnv->pCryPak->MakeDir(levelPath, true);

	XmlNodeRef todRoot = GetISystem()->LoadXmlFromFile("Toolbox/default_time_of_day.tod");
	if(todRoot)
	{
		ITimeOfDay *pTimeOfDay = gEnv->p3DEngine->GetTimeOfDay();
		pTimeOfDay->Serialize(todRoot, true);
		pTimeOfDay->SetTime(12.0f, true);
	}

	// Reset systems
	{
		gEnv->pEntitySystem->Reset();
		gEnv->p3DEngine->UnloadLevel();
		gEnv->pPhysicalWorld->SetupEntityGrid(2, Vec3(ZERO), 128, 128, 4, 4, 1);
	}

	if(!gEnv->p3DEngine->InitLevelForEditor(levelPath, ""))
	{
		ToolboxWarning("Failed to initialize level");
		return;
	}

	STerrainInfo terrainInfo;

	terrainInfo.nHeightMapSize_InUnits = terrainInfo.nSectorSize_InMeters = 256;
	terrainInfo.nUnitSize_InMeters = 1;
	terrainInfo.nSectorsTableSize_InSectors = 1;
	terrainInfo.fHeightmapZRatio = 0.003f;
	terrainInfo.fOceanWaterLevel = 20;

	gEnv->p3DEngine->CreateTerrain(terrainInfo);

	XmlNodeRef environmentRoot = GetISystem()->LoadXmlFromFile("Toolbox/default_environment_settings.xml");
	gEnv->p3DEngine->LoadEnvironmentSettingsFromXML(environmentRoot);

	GetISystem()->GetISystemEventDispatcher()->OnSystemEvent(ESYSTEM_EVENT_LEVEL_LOAD_END, 0, 0);

	m_bLoadedLevel = true;
}
//------------------------------------------------------------------------
void CPlayerFeature::ActivateFeature(CActor *pActor, const char *feature)
{
	if (!stricmp("parachute", feature))
	{
		Parachute(pActor);
	}
	else if (!stricmp("dualSOCOM", feature))
	{
		DualSOCOM(pActor);
	}
	else
	{
		CryLogAlways("%s - Unknown Player Feature '%s'...", GetEntity()->GetName(), feature);
	}
}
SDeferredLinetestReceiver * CPlayerVisTable::GetAvailableDeferredLinetestReceiver(SDeferredLinetestBuffer& visBuffer)
{
	for(int i = 0; i < kMaxVisTableLinetestsPerFrame; i++)
	{
		if(visBuffer.m_deferredLinetestReceivers[i].IsFree())
		{
			return &visBuffer.m_deferredLinetestReceivers[i];
		}
	}

	assert(!"Failed to find free processing entry when one was present according to m_numLinetestsCurrentlyProcessing");
	CryLogAlways("[RS] GetAvailableEntryForProcessing: Failed to find a valid index, about to memory overwrite\n[RS]  Num Entries Processing: %d\n[RS]  Num Free: %d\n", visBuffer.m_numLinetestsCurrentlyProcessing, kMaxVisTableLinetestsPerFrame - visBuffer.m_numLinetestsCurrentlyProcessing);

	return NULL;
}
//---------------------------------------
void CAreaAnnouncer::LoadAnnouncementArea(const IEntity* pEntity, const char* areaName)
{
	TAudioSignalID signal[AREA_ANNOUNCERS];

	stack_string signalName;
	for(int i = 0; i < AREA_ANNOUNCERS; i++)
	{
		signalName.Format("%s_%d", areaName, i + 1);
		signal[i] = g_pGame->GetGameAudio()->GetSignalID(signalName.c_str(), false);
	}

#if !defined(_RELEASE)
	if(aa_debug)
	{
		CryLogAlways("[AA] Found area '%s' with Signals %d, %d", areaName, signal[0], signal[1]);
	}
#endif

	if(signal[0] != INVALID_AUDIOSIGNAL_ID && signal[1] != INVALID_AUDIOSIGNAL_ID)
	{
		SAnnouncementArea area;
		area.m_areaProxyId = pEntity->GetId();
		COMPILE_TIME_ASSERT(sizeof(area.m_signal) == sizeof(signal));
		memcpy(area.m_signal, signal, sizeof(area.m_signal));

#if !defined(_RELEASE)
		cry_strncpy(&area.m_name[0], areaName, SAnnouncementArea::k_maxNameLength);
#endif

		DesignerWarning(m_areaList.size() < k_maxAnnouncementAreas, "Too many AreaAnnouncer area boxes loaded");
		if(m_areaList.size() < k_maxAnnouncementAreas)
		{
			m_areaList.push_back(area);
		}
	}

#if !defined(_RELEASE)
	//Found one signal but not both
	if(signal[0] != signal[1] && (signal[0] == INVALID_AUDIOSIGNAL_ID || signal[1] == INVALID_AUDIOSIGNAL_ID))
	{
#if defined(USER_benp)
		CRY_ASSERT_MESSAGE(0, ("'%s' only has signal for 1 team!", areaName));
#endif
		CryWarning(VALIDATOR_MODULE_GAME, VALIDATOR_ERROR, "'%s' only has signal for 1 team!", areaName);
	}
#endif

}
Exemple #21
0
//-------------------------------------------------------------------------
void CGameBrowser::CancelSearching(bool feedback /*= true*/)
{
	CryLogAlways("CGameBrowser::CancelSearching");

	if (m_searchingTask != CryLobbyInvalidTaskID)
	{
		CryLog("  canceling search task %u", m_searchingTask);
		ICryLobby *pLobby = gEnv->pNetwork->GetLobby();
		pLobby->GetMatchMaking()->CancelTask(m_searchingTask);
		// Calling FinishedSearch will clear m_searchingTask
	}

	m_delayedSearchType = eDST_None;

	FinishedSearch(feedback, true);
}
	virtual void ProcessEvent( EFlowEvent event, SActivationInfo *pActInfo )
	{
		switch (event)
		{
		case eFE_Initialize:
			{
			}
			break;
		case eFE_Activate:
#if CRY_PLATFORM_DURANGO

			if(IsPortActive(pActInfo, EIP_Poll))
			{

				size_t memberCountParty = Live::State::Party::Instance().GetPartyMembers()->size();

				CryLogAlways("Partymembers: %d", memberCountParty);

				static MatchmakingUtils::INetworkingUser_impl s_networkingUser;

				ICryLobby *pLobby = gEnv->pNetwork->GetLobby();
				if (pLobby)
				{
					ICryMatchMaking *pMatchmaking = pLobby->GetMatchMaking();
					if (pMatchmaking)
					{
						pMatchmaking->SetINetworkingUser(&s_networkingUser);
					}
				}	

				HRESULT hr = MatchmakingUtils::InitiateSession( "PlayerSkillAutoEval", "", 0);
			}


			if(IsPortActive(pActInfo, EIP_Launch))
			{
				MatchmakingUtils::SetLaunching();
			}

			if(IsPortActive(pActInfo, EIP_Leave))
			{
				MatchmakingUtils::QuitMatchmaking();
			}
#endif
			break;
		}
	}
Exemple #23
0
IMonoMethod *CScriptClass::GetMethod(const char *name, int numParams, bool throwOnFail)
{
	MonoMethodSignature *pSignature = nullptr;

	void *pIterator = 0;

	MonoClass *pClass = (MonoClass *)m_pObject;
	MonoType *pClassType = mono_class_get_type(pClass);
	MonoMethod *pCurMethod = nullptr;

	while (pClass != nullptr)
	{
		pCurMethod = mono_class_get_methods(pClass, &pIterator);
		if(pCurMethod == nullptr)
		{
			pClass = mono_class_get_parent(pClass);
			if(pClass == mono_get_object_class())
				break;

			pIterator = 0;
			continue;
		}

		pSignature = mono_method_signature(pCurMethod);
		int signatureParamCount = mono_signature_get_param_count(pSignature);

		bool bCorrectName = !strcmp(mono_method_get_name(pCurMethod), name);
		if(bCorrectName && signatureParamCount == numParams)
			return new CScriptMethod(pCurMethod);
	}

	if(throwOnFail)
	{
		if(!GetMonoScriptSystem()->IsInitialized())
		{
			CryLogAlways("Failed to locate method %s in class %s", name, GetName());
		}
		else if(IMonoAssembly *pCorlibAssembly = GetMonoScriptSystem()->GetCorlibAssembly())
		{
			if(IMonoException *pException = GetMonoScriptSystem()->GetCorlibAssembly()->GetException("System", "MissingMethodException", "Failed to locate method %s in class %s", name, GetName()))
				pException->Throw();
		}
	}
	
	return nullptr;
}
Exemple #24
0
//Next lobby joins (and reserves slots for everyone)
void CGameLobbyManager::NewSessionResponse(CGameLobby* pLobby, CrySessionID sessionId)
{
	CryLogAlways("CGameLobbyManager::NewSessionResponse %d", sessionId != CrySessionInvalidID);

	CRY_ASSERT(pLobby == m_nextLobby);
	CRY_ASSERT(m_primaryLobby && m_nextLobby);

	if(sessionId != CrySessionInvalidID)
	{
		m_bMergingIsComplete = true;
		CompleteMerge(sessionId);
	}
	else
	{
		m_nextLobby->LeaveSession(true);
	}
}
Exemple #25
0
void CUILobbyMP::GetFriendsCB(CryLobbyTaskID taskID, ECryLobbyError error, SFriendInfo* pFriendInfo, uint32 numFriends, void* pArg)
{
	int breakhere = 0;
	if(error == eCLE_Success)
	{
		int continueHere = 10;
		breakhere += continueHere;

		ICryFriends* pFriends = gEnv->pNetwork->GetLobby()->GetFriends();
		unsigned int user = g_pGame->GetPlayerProfileManager()->GetExclusiveControllerDeviceIndex();
		if(pFriends)
		{
			error = pFriends->FriendsSendGameInvite(user, CrySessionInvalidHandle, &pFriendInfo->userID, 1, NULL, CUILobbyMP::InviteFriends, NULL);
			CryLogAlways("UILobbyMP: Sending friend invite to: %s, error: %d", pFriendInfo->name, error);
		}
	}
}
/* virtual */ void
CFlowInspectorDefault::NotifyFlow(IFlowGraph * pGraph, const SFlowAddress from, const SFlowAddress to)
{
	static char msg[256];

	if (!m_bProcessing) 
		return;
	if (m_bPaused) 
		return;

	if (RunFilters(pGraph, from, to) == false)
		return;

	string name;
	TFlowRecord rec;
	GetGraphNameAndType (pGraph, name, rec.m_type);
	rec.m_from = from;
	rec.m_to = to;
	rec.m_pGraph = pGraph;
	rec.m_tstamp = m_currentTime;

	const TFlowInputData *data = pGraph->GetInputValue(to.node, to.port);
	if (0 != data) 
	{
		rec.m_data = *data;
	}
	string val;
	rec.m_data.GetValueWithConversion(val);

	_snprintf(msg, sizeof(msg)-1, "0x%p %s [%s:%s] -> [%s:%s] Val=%s",
		(const IFlowGraph*) rec.m_pGraph,
		name.c_str(),
		GetNodeName(rec.m_pGraph, rec.m_from).c_str(),
		GetPortName(rec.m_pGraph, rec.m_from),
		GetNodeName(rec.m_pGraph, rec.m_to).c_str(),
		GetPortName(rec.m_pGraph, rec.m_to), val.c_str());
	msg[sizeof(msg)-1] = '\0'; // safe terminate
	rec.m_message = msg;

	if (CFlowSystemCVars::Get().m_inspectorLog != 0)
	{
		CryLogAlways("[fgi] %s", msg);
	}

	m_curRecords.push_back(rec);
}
//------------------------------------------------------------------------
void CItem::NetSetOwnerId(EntityId id)
{
	if (id==m_ownerId)
		return;

	CryLogAlways("%s::NetSetOwnerId(%s)", GetEntity()->GetName(), GetActor(id)?GetActor(id)->GetEntity()->GetName():"null");

	if (id)
		PickUp(id, true);
	else
	{
		Drop();

		CActor *pActor=GetOwnerActor();
		if (pActor)
			pActor->GetInventory()->SetCurrentItem(0);
	}
}
Exemple #28
0
bool CScriptSystem::CompleteInit()
{
	CryLogAlways("		Initializing CryMono ...");
	
	// Create root domain and determine the runtime version we'll be using.
	m_pRootDomain = new CScriptDomain(eRV_4_30319);
	m_domains.push_back(m_pRootDomain);

	CScriptArray::m_pDefaultElementClass = mono_get_object_class();

#ifndef _RELEASE
	m_pPdb2MdbAssembly = m_pRootDomain->LoadAssembly(PathUtils::GetMonoPath() + "bin\\pdb2mdb.dll");
#endif

	RegisterPriorityBindings();

	return Reload();
}
bool CToolboxApplication::SetGameMode(bool bGameMode)
{
	m_bGameMode = bGameMode;
	bool on = bGameMode;

	bool ok = StartGameContext(on);
	if (ok)
	{
		if(gEnv->IsEditor())
			gEnv->pGame->EditorResetGame(bGameMode);

		gEnv->pGameFramework->OnEditorSetGameMode(bGameMode);
	}
	else
	{
		CryLogAlways("Failed configuring net context");
	}
	return ok;
}
Exemple #30
0
bool CScriptClass::ImplementsClass(const char *className, const char *nameSpace)
{
	MonoClass *pClass = (MonoClass *)m_pObject;

	while (pClass != nullptr)
	{
		if(!strcmp(mono_class_get_name(pClass), className) 
			&& (nameSpace == nullptr || !strcmp(mono_class_get_namespace(pClass), nameSpace)))
			return true;
		else
			CryLogAlways("%s did not match pattern %s", mono_class_get_name(pClass), className);

		pClass = mono_class_get_parent(pClass);
		if(pClass == mono_get_object_class())
			break;
	}

	return false;
}