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.


3777
3778
3779
# File 'generated/google/apis/games_v1/classes.rb', line 3777

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)

3705
3706
3707
# File 'generated/google/apis/games_v1/classes.rb', line 3705

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


3711
3712
3713
# File 'generated/google/apis/games_v1/classes.rb', line 3711

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>)

3716
3717
3718
# File 'generated/google/apis/games_v1/classes.rb', line 3716

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


3721
3722
3723
# File 'generated/google/apis/games_v1/classes.rb', line 3721

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)

3726
3727
3728
# File 'generated/google/apis/games_v1/classes.rb', line 3726

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)

3733
3734
3735
# File 'generated/google/apis/games_v1/classes.rb', line 3733

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)

3739
3740
3741
# File 'generated/google/apis/games_v1/classes.rb', line 3739

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)

3757
3758
3759
# File 'generated/google/apis/games_v1/classes.rb', line 3757

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


3762
3763
3764
# File 'generated/google/apis/games_v1/classes.rb', line 3762

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)

3775
3776
3777
# File 'generated/google/apis/games_v1/classes.rb', line 3775

def status
  @status
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object


3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
# File 'generated/google/apis/games_v1/classes.rb', line 3782

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