1 [
EntityEditorProps(
category:
"GameScripted/Building", description:
"Handles client > server communication in Building. Should be attached to PlayerController.")]
14 RplComponent comp = RplComponent.Cast(compositionOutline.FindComponent(RplComponent));
27 RplComponent comp = RplComponent.Cast(provider.FindComponent(RplComponent));
42 RplComponent providerRplComp = RplComponent.Cast(provider.FindComponent(RplComponent));
54 RplComponent comp = RplComponent.Cast(composition.FindComponent(RplComponent));
68 RplComponent comp = RplComponent.Cast(composition.FindComponent(RplComponent));
78 RplComponent comp = RplComponent.Cast(provider.FindComponent(RplComponent));
87 [
RplRpc(RplChannel.Reliable, RplRcver.Owner)]
90 RplComponent rplComp = RplComponent.Cast(Replication.FindItem(compId));
94 IEntity provider = rplComp.GetEntity();
98 SCR_CampaignBuildingProviderComponent providerComponent = SCR_CampaignBuildingProviderComponent.Cast(provider.FindComponent(SCR_CampaignBuildingProviderComponent));
99 if (providerComponent)
100 providerComponent.SetCooldownClientLock(lock);
107 [
RplRpc(RplChannel.Reliable, RplRcver.Server)]
111 if (!compositionOutline)
114 SCR_CampaignBuildingLayoutComponent layoutComponent = SCR_CampaignBuildingLayoutComponent.Cast(compositionOutline.FindComponent(SCR_CampaignBuildingLayoutComponent));
115 if (!layoutComponent)
118 layoutComponent.AddBuildingValue(buildingValue);
125 [
RplRpc(RplChannel.Reliable, RplRcver.Server)]
132 BaseGameMode gameMode =
GetGame().GetGameMode();
134 SCR_CampaignBuildingManagerComponent buildingManagerComponent = SCR_CampaignBuildingManagerComponent.Cast(gameMode.FindComponent(SCR_CampaignBuildingManagerComponent));
135 if (!buildingManagerComponent)
138 SCR_CampaignBuildingProviderComponent providerComponent = SCR_CampaignBuildingProviderComponent.Cast(provider.FindComponent(SCR_CampaignBuildingProviderComponent));
139 if (!providerComponent)
142 bool isActiveUser = buildingManagerComponent.RemovePlayerIdFromProvider(playerID, providerComponent);
143 buildingManagerComponent.RemoveProvider(playerID, providerComponent, isActiveUser);
152 [
RplRpc(RplChannel.Reliable, RplRcver.Server)]
159 BaseGameMode gameMode =
GetGame().GetGameMode();
160 SCR_CampaignBuildingManagerComponent buildingManagerComponent = SCR_CampaignBuildingManagerComponent.Cast(gameMode.FindComponent(SCR_CampaignBuildingManagerComponent));
161 if (!buildingManagerComponent)
164 buildingManagerComponent.GetEditorMode(playerID, provider, UserActionActivationOnly, UserActionUsed);
170 [
RplRpc(RplChannel.Reliable, RplRcver.Server)]
179 editableEntity.Delete();
181 RplComponent.DeleteRplEntity(composition,
false);
189 [
RplRpc(RplChannel.Reliable, RplRcver.Server)]
200 SCR_NotificationsComponent.SendToFaction(faction,
true,
ENotification.EDITOR_SERVICE_DISASSEMBLED, playerId, rplCompositionId, callsign);
206 [
RplRpc(RplChannel.Reliable, RplRcver.Server)]
209 BaseGameMode gameMode =
GetGame().GetGameMode();
213 SCR_XPHandlerComponent compXP = SCR_XPHandlerComponent.Cast(gameMode.FindComponent(SCR_XPHandlerComponent));
217 compXP.AwardXP(playerId,
SCR_EXPRewards.FREE_ROAM_BUILDING_BUILT);
233 RplComponent rplComp = RplComponent.Cast(Replication.FindItem(rplProviderId));
237 return rplComp.GetEntity();