Exemple #1
0
CLuaRules::CLuaRules()
: CLuaHandleSynced("LuaRules", LUA_HANDLE_ORDER_RULES)
{
	if (!IsValid()) {
		return;
	}

	SetFullCtrl(true, true);
	SetFullRead(true, true);
	SetCtrlTeam(AllAccessTeam, true);
	SetReadTeam(AllAccessTeam, true);
	SetReadAllyTeam(AllAccessTeam, true);
	SetSelectTeam(AllAccessTeam, true);

	Init(LuaRulesSyncedFilename, LuaRulesUnsyncedFilename, SPRING_VFS_MOD);

	if (!IsValid()) {
		return;
	}

	BEGIN_ITERATE_LUA_STATES();

	if (SingleState() || L == L_Sim) {
		haveCommandFallback            = HasCallIn(L, "CommandFallback");
		haveAllowCommand               = HasCallIn(L, "AllowCommand");
		haveAllowUnitCreation          = HasCallIn(L, "AllowUnitCreation");
		haveAllowUnitTransfer          = HasCallIn(L, "AllowUnitTransfer");
		haveAllowUnitBuildStep         = HasCallIn(L, "AllowUnitBuildStep");
		haveAllowFeatureCreation       = HasCallIn(L, "AllowFeatureCreation");
		haveAllowFeatureBuildStep      = HasCallIn(L, "AllowFeatureBuildStep");
		haveAllowResourceLevel         = HasCallIn(L, "AllowResourceLevel");
		haveAllowResourceTransfer      = HasCallIn(L, "AllowResourceTransfer");
		haveAllowDirectUnitControl     = HasCallIn(L, "AllowDirectUnitControl");
		haveAllowStartPosition         = HasCallIn(L, "AllowStartPosition");

		haveMoveCtrlNotify             = HasCallIn(L, "MoveCtrlNotify");
		haveTerraformComplete          = HasCallIn(L, "TerraformComplete");
		haveAllowWeaponTargetCheck     = HasCallIn(L, "AllowWeaponTargetCheck");
		haveAllowWeaponTarget          = HasCallIn(L, "AllowWeaponTarget");
		haveAllowWeaponInterceptTarget = HasCallIn(L, "AllowWeaponInterceptTarget");
		haveUnitPreDamaged             = HasCallIn(L, "UnitPreDamaged");
		haveFeaturePreDamaged          = HasCallIn(L, "FeaturePreDamaged");
		haveShieldPreDamaged           = HasCallIn(L, "ShieldPreDamaged");
	}
	if (SingleState() || L == L_Draw) {
		haveDrawUnit       = HasCallIn(L, "DrawUnit"      );
		haveDrawFeature    = HasCallIn(L, "DrawFeature"   );
		haveDrawShield     = HasCallIn(L, "DrawShield"    );
		haveDrawProjectile = HasCallIn(L, "DrawProjectile");

		SetupUnsyncedFunction(L, "DrawUnit");
		SetupUnsyncedFunction(L, "DrawFeature");
		SetupUnsyncedFunction(L, "DrawShield");
		SetupUnsyncedFunction(L, "DrawProjectile");
		SetupUnsyncedFunction(L, "RecvSkirmishAIMessage");
	}

	END_ITERATE_LUA_STATES();
}
Exemple #2
0
CLuaGaia::CLuaGaia(): CLuaHandleSynced("LuaGaia", LUA_HANDLE_ORDER_GAIA)
{
	if (!IsValid())
		return;

	SetFullCtrl(true);
	SetFullRead(true);
	SetCtrlTeam(CEventClient::AllAccessTeam);
	SetReadTeam(CEventClient::AllAccessTeam);
	SetReadAllyTeam(CEventClient::AllAccessTeam);
	SetSelectTeam(teamHandler->GaiaTeamID());

	Init(LuaGaiaSyncedFilename, LuaGaiaUnsyncedFilename, SPRING_VFS_MAP_BASE);
}
Exemple #3
0
CLuaGaia::CLuaGaia()
: CLuaHandleSynced("LuaGaia", LUA_HANDLE_ORDER_GAIA)
{
	if (!IsValid()) {
		return;
	}

	teamsLocked = true;

	SetFullCtrl(true, true);
	SetFullRead(true, true);
	SetCtrlTeam(AllAccessTeam, true); //teamHandler->GaiaTeamID();
	SetReadTeam(AllAccessTeam, true);
	SetReadAllyTeam(AllAccessTeam, true);
	SetSelectTeam(teamHandler->GaiaTeamID(), true);

	Init(LuaGaiaSyncedFilename, LuaGaiaUnsyncedFilename, SPRING_VFS_MAP);
}