Class: AWSCDK::GameLift::CfnFleet::ResourceCreationLimitPolicyProperty
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::GameLift::CfnFleet::ResourceCreationLimitPolicyProperty
- Defined in:
- game_lift/cfn_fleet.rb
Overview
A policy that limits the number of game sessions a player can create on the same fleet.
This optional policy gives game owners control over how players can consume available game server resources. A resource creation policy makes the following statement: "An individual player can create a maximum number of new game sessions within a specified time period".
The policy is evaluated when a player tries to create a new game session. For example, assume you have a policy of 10 new game sessions and a time period of 60 minutes. On receiving a CreateGameSession request, Amazon GameLift checks that the player (identified by CreatorId ) has created fewer than 10 game sessions in the past 60 minutes.
Instance Attribute Summary collapse
-
#new_game_sessions_per_creator ⇒ Numeric?
readonly
A policy that puts limits on the number of game sessions that a player can create within a specified span of time.
-
#policy_period_in_minutes ⇒ Numeric?
readonly
The time span used in evaluating the resource creation limit policy.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(new_game_sessions_per_creator: nil, policy_period_in_minutes: nil) ⇒ ResourceCreationLimitPolicyProperty
constructor
A new instance of ResourceCreationLimitPolicyProperty.
- #to_jsii ⇒ Object
Constructor Details
#initialize(new_game_sessions_per_creator: nil, policy_period_in_minutes: nil) ⇒ ResourceCreationLimitPolicyProperty
Returns a new instance of ResourceCreationLimitPolicyProperty.
1308 1309 1310 1311 1312 1313 |
# File 'game_lift/cfn_fleet.rb', line 1308 def initialize(new_game_sessions_per_creator: nil, policy_period_in_minutes: nil) @new_game_sessions_per_creator = new_game_sessions_per_creator Jsii::Type.check_type(@new_game_sessions_per_creator, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "newGameSessionsPerCreator") unless @new_game_sessions_per_creator.nil? @policy_period_in_minutes = policy_period_in_minutes Jsii::Type.check_type(@policy_period_in_minutes, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "policyPeriodInMinutes") unless @policy_period_in_minutes.nil? end |
Instance Attribute Details
#new_game_sessions_per_creator ⇒ Numeric? (readonly)
A policy that puts limits on the number of game sessions that a player can create within a specified span of time.
With this policy, you can control players' ability to consume available resources.
The policy is evaluated when a player tries to create a new game session. On receiving a CreateGameSession request, Amazon GameLift Servers checks that the player (identified by CreatorId ) has created fewer than game session limit in the specified time period.
1323 1324 1325 |
# File 'game_lift/cfn_fleet.rb', line 1323 def new_game_sessions_per_creator @new_game_sessions_per_creator end |
#policy_period_in_minutes ⇒ Numeric? (readonly)
The time span used in evaluating the resource creation limit policy.
1328 1329 1330 |
# File 'game_lift/cfn_fleet.rb', line 1328 def policy_period_in_minutes @policy_period_in_minutes end |
Class Method Details
.jsii_properties ⇒ Object
1330 1331 1332 1333 1334 1335 |
# File 'game_lift/cfn_fleet.rb', line 1330 def self.jsii_properties { :new_game_sessions_per_creator => "newGameSessionsPerCreator", :policy_period_in_minutes => "policyPeriodInMinutes", } end |
Instance Method Details
#to_jsii ⇒ Object
1337 1338 1339 1340 1341 1342 1343 1344 |
# File 'game_lift/cfn_fleet.rb', line 1337 def to_jsii result = {} result.merge!({ "newGameSessionsPerCreator" => @new_game_sessions_per_creator, "policyPeriodInMinutes" => @policy_period_in_minutes, }) result.compact end |