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



3779
3780
3781
# File 'generated/google/apis/games_v1/classes.rb', line 3779

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)


3707
3708
3709
# File 'generated/google/apis/games_v1/classes.rb', line 3707

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



3713
3714
3715
# File 'generated/google/apis/games_v1/classes.rb', line 3713

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


3718
3719
3720
# File 'generated/google/apis/games_v1/classes.rb', line 3718

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



3723
3724
3725
# File 'generated/google/apis/games_v1/classes.rb', line 3723

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)


3728
3729
3730
# File 'generated/google/apis/games_v1/classes.rb', line 3728

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)


3735
3736
3737
# File 'generated/google/apis/games_v1/classes.rb', line 3735

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)


3741
3742
3743
# File 'generated/google/apis/games_v1/classes.rb', line 3741

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)


3759
3760
3761
# File 'generated/google/apis/games_v1/classes.rb', line 3759

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



3764
3765
3766
# File 'generated/google/apis/games_v1/classes.rb', line 3764

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)


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

def status
  @status
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



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

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