class Conreality::Player
Represents a Conreality
player.
Constants
- KEY
- TABLE
Attributes
avatar[RW]
The player's avatar image.
@return [Binary]
ip_addr[RW]
The player's IPv4/IPv6 address.
@return [String]
language[RW]
The player's primary language.
@return [String]
name[RW]
The player's full name.
@return [String]
nick[RW]
The player's nickname.
@return [String]
Public Class Methods
new(session, uuid)
click to toggle source
@param session [Session] @param uuid [#to_s]
Calls superclass method
Conreality::Object::new
# File lib/conreality/player.rb, line 44 def initialize(session, uuid) super(session, uuid) end
Public Instance Methods
camera()
click to toggle source
Returns the bodycam, if any, of this player.
@return [Camera, nil]
# File lib/conreality/player.rb, line 62 def camera self.has_camera? ? self.as_camera : nil end
deregister!()
click to toggle source
Deregisters this player from the game.
@return [void]
# File lib/conreality/player.rb, line 70 def deregister! # TODO end
has_camera?()
click to toggle source
Checks whether this player has a bodycam.
@return [Boolean]
# File lib/conreality/player.rb, line 52 def has_camera? @session.client.exec_with_params("SELECT COUNT(*) FROM #{q(Database::SCHEMA)}.#{q(:camera)} WHERE #{q(:uuid)} = $1 LIMIT 1", self.key) do |result| !!result.num_tuples.nonzero? end end