Class: Google::Apis::GamesV1::RoomParticipant

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
generated/google/apis/games_v1/classes.rb,
generated/google/apis/games_v1/representations.rb,
generated/google/apis/games_v1/representations.rb

Overview

This is a JSON template for a participant in a room.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Core::JsonObjectSupport

#to_json

Methods included from Core::Hashable

process_value, #to_h

Constructor Details

#initialize(**args) ⇒ RoomParticipant

Returns a new instance of RoomParticipant.



3499
3500
3501
# File 'generated/google/apis/games_v1/classes.rb', line 3499

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#auto_matchedBoolean Also known as: auto_matched?

True if this participant was auto-matched with the requesting player. Corresponds to the JSON property autoMatched

Returns:

  • (Boolean)


3427
3428
3429
# File 'generated/google/apis/games_v1/classes.rb', line 3427

def auto_matched
  @auto_matched
end

#auto_matched_playerGoogle::Apis::GamesV1::AnonymousPlayer

This is a JSON template for an anonymous player Corresponds to the JSON property autoMatchedPlayer



3433
3434
3435
# File 'generated/google/apis/games_v1/classes.rb', line 3433

def auto_matched_player
  @auto_matched_player
end

#capabilitiesArray<String>

The capabilities which can be used when communicating with this participant. Corresponds to the JSON property capabilities

Returns:

  • (Array<String>)


3438
3439
3440
# File 'generated/google/apis/games_v1/classes.rb', line 3438

def capabilities
  @capabilities
end

#client_addressGoogle::Apis::GamesV1::RoomClientAddress

This is a JSON template for the client address when setting up a room. Corresponds to the JSON property clientAddress



3443
3444
3445
# File 'generated/google/apis/games_v1/classes.rb', line 3443

def client_address
  @client_address
end

#connectedBoolean Also known as: connected?

True if this participant is in the fully connected set of peers in the room. Corresponds to the JSON property connected

Returns:

  • (Boolean)


3448
3449
3450
# File 'generated/google/apis/games_v1/classes.rb', line 3448

def connected
  @connected
end

#idString

An identifier for the participant in the scope of the room. Cannot be used to identify a player across rooms or in other contexts. Corresponds to the JSON property id

Returns:

  • (String)


3455
3456
3457
# File 'generated/google/apis/games_v1/classes.rb', line 3455

def id
  @id
end

#kindString

Uniquely identifies the type of this resource. Value is always the fixed string games#roomParticipant. Corresponds to the JSON property kind

Returns:

  • (String)


3461
3462
3463
# File 'generated/google/apis/games_v1/classes.rb', line 3461

def kind
  @kind
end

#leave_reasonString

The reason the participant left the room; populated if the participant status is PARTICIPANT_LEFT. Possible values are:

  • "PLAYER_LEFT" - The player explicitly chose to leave the room.
  • "GAME_LEFT" - The game chose to remove the player from the room.
  • "ABANDONED" - The player switched to another application and abandoned the room.
  • "PEER_CONNECTION_FAILURE" - The client was unable to establish or maintain a connection to other peer(s) in the room.
  • "SERVER_ERROR" - The client received an error response when it tried to communicate with the server.
  • "TIMEOUT" - The client timed out while waiting for players to join and connect.
  • "PRESENCE_FAILURE" - The client's XMPP connection ended abruptly. Corresponds to the JSON property leaveReason

Returns:

  • (String)


3479
3480
3481
# File 'generated/google/apis/games_v1/classes.rb', line 3479

def leave_reason
  @leave_reason
end

#playerGoogle::Apis::GamesV1::Player

This is a JSON template for a Player resource. Corresponds to the JSON property player



3484
3485
3486
# File 'generated/google/apis/games_v1/classes.rb', line 3484

def player
  @player
end

#statusString

The status of the participant with respect to the room. Possible values are:

  • "PARTICIPANT_INVITED" - The participant has been invited to join the room, but has not yet responded.
  • "PARTICIPANT_JOINED" - The participant has joined the room (either after creating it or accepting an invitation.)
  • "PARTICIPANT_DECLINED" - The participant declined an invitation to join the room.
  • "PARTICIPANT_LEFT" - The participant joined the room and then left it. Corresponds to the JSON property status

Returns:

  • (String)


3497
3498
3499
# File 'generated/google/apis/games_v1/classes.rb', line 3497

def status
  @status
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
# File 'generated/google/apis/games_v1/classes.rb', line 3504

def update!(**args)
  @auto_matched = args[:auto_matched] if args.key?(:auto_matched)
  @auto_matched_player = args[:auto_matched_player] if args.key?(:auto_matched_player)
  @capabilities = args[:capabilities] if args.key?(:capabilities)
  @client_address = args[:client_address] if args.key?(:client_address)
  @connected = args[:connected] if args.key?(:connected)
  @id = args[:id] if args.key?(:id)
  @kind = args[:kind] if args.key?(:kind)
  @leave_reason = args[:leave_reason] if args.key?(:leave_reason)
  @player = args[:player] if args.key?(:player)
  @status = args[:status] if args.key?(:status)
end