sorbet/rbi/gems/steam-condenser@1.3.11-2d1a1acc2e76631e91cb25a263b3d00373371695.rbi
# typed: true
# DO NOT EDIT MANUALLY
# This is an autogenerated file for types exported from the `steam-condenser` gem.
# Please instead update this file by running `bin/tapioca gem steam-condenser`.
# This module is used as a wrapper around Steam Condenser's classes
#
# It does not provide any own functionality, but this file is used as an entry
# point when using the gem (i.e. +require 'steam-condenser').
#
# @author Sebastian Staudt
#
# source://steam-condenser//lib/steam-condenser.rb#12
module SteamCondenser; end
# This module is used as a wrapper around Steam Condenser's Steam Community
# classes
#
# It does not provide any own functionality, but this file is used to easily
# require classes to interact with the Steam Community
#
# @author Sebastian Staudt
#
# source://steam-condenser//lib/steam-condenser/community.rb#15
module SteamCondenser::Community; end
# This class represents Steam news and can be used to load a list of current
# news about specific games
#
# @author Sebastian Staudt
#
# source://steam-condenser//lib/steam-condenser/community/app_news.rb#16
class SteamCondenser::Community::AppNews
# Creates a new instance of an AppNews news item with the given data
#
# @param app_id [Fixnum] The unique Steam Application ID of the game (e.g.
# `440` for Team Fortress 2). See
# http://developer.valvesoftware.com/wiki/Steam_Application_IDs for
# all application IDs.
# @param news_data [Hash<Symbol, Object>] The news data extracted from JSON
# @return [AppNews] a new instance of AppNews
#
# source://steam-condenser//lib/steam-condenser/community/app_news.rb#122
def initialize(app_id, news_data); end
# Returns the Steam Application ID of the game this news belongs to
#
# @return [Fixnum] The application ID of the game this news belongs to
#
# source://steam-condenser//lib/steam-condenser/community/app_news.rb#21
def app_id; end
# Returns the name of the author of this news
#
# @return [String] The author of this news
#
# source://steam-condenser//lib/steam-condenser/community/app_news.rb#26
def author; end
# Returns the contents of this news
#
# This might contain HTML code.
#
# @note Depending on the setting for the maximum length of a news (see
# {.news_for_app}), the contents might be truncated.
# @return [String] The contents of this news
#
# source://steam-condenser//lib/steam-condenser/community/app_news.rb#35
def contents; end
# Returns the date this news item has been published
#
# @return [Time] The date this news has been published
#
# source://steam-condenser//lib/steam-condenser/community/app_news.rb#40
def date; end
# Returns whether this news item originates from a source other than Steam
# itself (e.g. an external blog)
#
# @return [Boolean] `true` if this news item is from an external source
#
# source://steam-condenser//lib/steam-condenser/community/app_news.rb#99
def external?; end
# Returns the name of the feed this news item belongs to
#
# @return [String] The name of the feed this news belongs to
#
# source://steam-condenser//lib/steam-condenser/community/app_news.rb#45
def feed_label; end
# Returns the symbolic name of the feed this news item belongs to
#
# @return [String] The symbolic name of the feed this news belongs to
#
# source://steam-condenser//lib/steam-condenser/community/app_news.rb#50
def feed_name; end
# Returns a unique identifier for this news
#
# @return [Fixnum] A unique identifier for this news
#
# source://steam-condenser//lib/steam-condenser/community/app_news.rb#55
def gid; end
# Returns the title of this news
#
# @return [String] The title of this news
#
# source://steam-condenser//lib/steam-condenser/community/app_news.rb#60
def title; end
# Returns a simple textual representation of this news item
#
# Will consist of the name of the feed this news belongs to and the title
# of the news.
#
# @return [String] A simple text representing this news
#
# source://steam-condenser//lib/steam-condenser/community/app_news.rb#109
def to_s; end
# Returns the URL of the original news
#
# This is a direct link to the news on the Steam website or a redirecting
# link to the external post.
#
# @return [String] The URL of the original news
#
# source://steam-condenser//lib/steam-condenser/community/app_news.rb#68
def url; end
class << self
# Loads the news for the given game with the given restrictions
#
# @param app_id [Fixnum] The unique Steam Application ID of the game (e.g.
# `440` for Team Fortress 2). See
# http://developer.valvesoftware.com/wiki/Steam_Application_IDs for
# all application IDs.
# @param count [Fixnum] The maximum number of news to load. There's no
# reliable way to load all news. Use a really great number instead.
# @param max_length [Fixnum] The maximum content length of the news. If a
# maximum length is defined, the content of the news will only be at
# most `max_length` characters long plus an ellipsis.
# @return [Array<AppNews>] An array of news items for the specified game
# with the given options
#
# source://steam-condenser//lib/steam-condenser/community/app_news.rb#83
def news_for_app(app_id, count = T.unsafe(nil), max_length = T.unsafe(nil)); end
end
end
# This module implements caching functionality to be used in any object class
# having one or more unique object identifier (i.e. ID) and using a `fetch`
# method to fetch data, e.g. using a HTTP download.
#
# @author Sebastian Staudt
#
# source://steam-condenser//lib/steam-condenser/community/cacheable.rb#20
module SteamCondenser::Community::Cacheable
mixes_in_class_methods ::SteamCondenser::Community::Cacheable::ClassMethods
# Saves this object in the cache
#
# This will use the ID attributes selected for caching
#
# source://steam-condenser//lib/steam-condenser/community/cacheable.rb#138
def cache; end
# Fetches the object from some data source
#
# @note This method should be overridden in cacheable object classes and
# should implement the logic to retrieve the object's data. Updating
# the time is handled dynamically and does not need to be implemented
# separately.
#
# source://steam-condenser//lib/steam-condenser/community/cacheable.rb#153
def fetch; end
# Returns the time the object's data has been fetched the last time
#
# @return [Time] The time the object has been updated the last time
#
# source://steam-condenser//lib/steam-condenser/community/cacheable.rb#133
def fetch_time; end
# Returns whether the data for this object has already been fetched
#
# @return [Boolean] `true` if this object's data is available
#
# source://steam-condenser//lib/steam-condenser/community/cacheable.rb#159
def fetched?; end
private
# Returns the value for the ID
#
# @param id [Symbol] The name of an instance variable
# @return [Object] The value of the given instance variable
#
# source://steam-condenser//lib/steam-condenser/community/cacheable.rb#195
def cache_id_value(id); end
# Returns a complete list of all values for the cache IDs of the cacheable
# object
#
# @return [Array<Object, Array<Object>>] The values for the cache IDs
# @see #cache_id_value
#
# source://steam-condenser//lib/steam-condenser/community/cacheable.rb#183
def cache_ids; end
# If available, returns the cached instance for the object it is called on
#
# This may be used to either replace an initial object with a completely
# cached instance of the same ID or to compare a modified object with the
# copy that was cached before.
#
# @see #cache_ids
#
# source://steam-condenser//lib/steam-condenser/community/cacheable.rb#172
def cached_instance; end
class << self
# When this module is included in another class it is initialized to make
# use of caching
#
# The original `initialize` method of the including class will be wrapped,
# relaying all instantiations to the `new` method defined in {ClassMethods}.
# Additionally the class variable to save the attributes to cache (i.e. cache
# IDs) and the cache class variable itself are initialized.
#
# @param base [Class] The class to extend with caching functionality
# @see ClassMethods
#
# source://steam-condenser//lib/steam-condenser/community/cacheable.rb#32
def included(base); end
end
end
# This module implements functionality to access the cache of a class that
# includes the {Cacheable} module as class methods
#
# @author Sebastian Staudt
#
# source://steam-condenser//lib/steam-condenser/community/cacheable.rb#57
module SteamCondenser::Community::Cacheable::ClassMethods
# Defines wich instance variables which should be used to index the
# cached objects
#
# @note A call to this method is needed if you want a class including
# this module to really use the cache.
# @param ids [Array<Symbol>] The symbolic names of the instance variables
# representing a unique identifier for this object class
#
# source://steam-condenser//lib/steam-condenser/community/cacheable.rb#66
def cacheable_with_ids(*ids); end
# Returns whether an object with the given ID is already cached
#
# @param id [Object] The ID of the desired object
# @return [Boolean] `true` if the object with the given ID is already
# cached
#
# source://steam-condenser//lib/steam-condenser/community/cacheable.rb#75
def cached?(id); end
# Clears the object cache for the class this method is called on
#
# source://steam-condenser//lib/steam-condenser/community/cacheable.rb#81
def clear_cache; end
# This checks the cache for an existing object. If it exists it is
# returned, otherwise a new object is created.
# Overrides the default `new` method of the cacheable object class.
#
# @param args [Array<Object>] The parameters of the object that should be
# created and if possible loaded from cache
# @see #cached?
# @see #fetch
#
# source://steam-condenser//lib/steam-condenser/community/cacheable.rb#93
def new(*args); end
private
# Returns the current cache for the cacheable class
#
# @return [Hash<Object, Cacheable>] The cache for cacheable class
#
# source://steam-condenser//lib/steam-condenser/community/cacheable.rb#117
def cache; end
# Returns the list of IDs used for caching objects
#
# @return [Array<Symbol, Array<Symbol>>] The IDs used for caching objects
#
# source://steam-condenser//lib/steam-condenser/community/cacheable.rb#124
def cache_ids; end
end
# Represents the inventory of a DotA 2 player
#
# @author Sebastian Staudt
#
# source://steam-condenser//lib/steam-condenser/community/dota2/dota2_inventory.rb#14
class SteamCondenser::Community::Dota2Inventory < ::SteamCondenser::Community::GameInventory
# Creates a new inventory object for the given SteamID64 in DotA 2
# (App ID 570)
#
# @overload initialize
# @param steam_id64 [Fixnum] The 64bit SteamID of the player to get the
# inventory for
# @param fetch [Boolean] if `true` the object's data is fetched after
# creation
# @param bypass_cache [Boolean] if `true` the object's data is fetched again
# even if it has been cached already
# @return [Dota2Inventory] a new instance of Dota2Inventory
#
# source://steam-condenser//lib/steam-condenser/community/dota2/dota2_inventory.rb#25
def initialize(steam_id64); end
end
# The Steam application ID of DotA 2
#
# source://steam-condenser//lib/steam-condenser/community/dota2/dota2_inventory.rb#17
SteamCondenser::Community::Dota2Inventory::APP_ID = T.let(T.unsafe(nil), Integer)
# Represents a DotA 2 item
#
# @author Sebastian Staudt
#
# source://steam-condenser//lib/steam-condenser/community/dota2/dota2_item.rb#13
class SteamCondenser::Community::Dota2Item < ::SteamCondenser::Community::GameItem
# Creates a new instance of a DotA 2 item with the given data
#
# @param inventory [Dota2Inventory] The inventory this item is contained in
# @param item_data [Hash<Symbol, Object>] The data specifying this item
# @raise [Error::WebApi] on Web API errors
# @return [Dota2Item] a new instance of Dota2Item
#
# source://steam-condenser//lib/steam-condenser/community/dota2/dota2_item.rb#20
def initialize(inventory, item_data); end
# Returns whether this item is equipped by this player at all
#
# @return [Boolean] Whether this item is equipped by this player at all
#
# source://steam-condenser//lib/steam-condenser/community/dota2/dota2_item.rb#29
def equipped?; end
end
# Represents the inventory of a player of the DotA 2 beta
#
# @author Sebastian Staudt
#
# source://steam-condenser//lib/steam-condenser/community/dota2/dota2_test_inventory.rb#14
class SteamCondenser::Community::Dota2TestInventory < ::SteamCondenser::Community::GameInventory
# Creates a new inventory object for the given SteamID64 in the DotA 2 beta
# (App ID 205790)
#
# @overload initialize
# @param steam_id64 [Fixnum] The 64bit SteamID of the player to get the
# inventory for
# @param fetch [Boolean] if `true` the object's data is fetched after
# creation
# @param bypass_cache [Boolean] if `true` the object's data is fetched again
# even if it has been cached already
# @return [Dota2TestInventory] a new instance of Dota2TestInventory
#
# source://steam-condenser//lib/steam-condenser/community/dota2/dota2_test_inventory.rb#25
def initialize(steam_id64); end
end
# The Steam application ID of the DotA 2 beta
#
# source://steam-condenser//lib/steam-condenser/community/dota2/dota2_test_inventory.rb#17
SteamCondenser::Community::Dota2TestInventory::APP_ID = T.let(T.unsafe(nil), Integer)
# The GameAchievement class represents a specific achievement for a single
# game and for a single user
#
# It also provides the ability to load the global unlock percentages of all
# achievements of a specific game.
#
# @author Sebastian Staudt
#
# source://steam-condenser//lib/steam-condenser/community/game_achievement.rb#19
class SteamCondenser::Community::GameAchievement
# Creates the achievement with the given name for the given user and game
# and achievement data
#
# @param schema [GameStatsSchema] The game this achievement belongs to
# @param data [Hash<String, Object>] The achievement data extracted from
# the game schema
# @return [GameAchievement] a new instance of GameAchievement
#
# source://steam-condenser//lib/steam-condenser/community/game_achievement.rb#74
def initialize(schema, data); end
# Returns the symbolic API name of this achievement
#
# @return [String] The API name of this achievement
#
# source://steam-condenser//lib/steam-condenser/community/game_achievement.rb#24
def api_name; end
# Returns the description of this achievement
#
# @param language [Symbol]
# @return [String] The description of this achievement
#
# source://steam-condenser//lib/steam-condenser/community/game_achievement.rb#86
def description(language = T.unsafe(nil)); end
# Returns whether this achievement is hidden
#
# @return [Boolean] `true` if this achievement is hidden
#
# source://steam-condenser//lib/steam-condenser/community/game_achievement.rb#29
def hidden; end
# Returns the url for the closed icon of this achievement
#
# @return [String] The url of the closed achievement icon
#
# source://steam-condenser//lib/steam-condenser/community/game_achievement.rb#34
def icon_closed_url; end
# Returns the url for the open icon of this achievement
#
# @return [String] The url of the open achievement icon
#
# source://steam-condenser//lib/steam-condenser/community/game_achievement.rb#39
def icon_open_url; end
# source://steam-condenser//lib/steam-condenser/community/game_achievement.rb#90
def inspect; end
# Returns an instance of this achievement for the given user and the given
# unlock state
#
# @param user [SteamId] The user the instance should be returned for
# @param unlocked [Boolean] The state of the achievement for this user
# @return [Instance] The achievement instance for this user
#
# source://steam-condenser//lib/steam-condenser/community/game_achievement.rb#100
def instance(user, unlocked); end
# Returns the name of this achievement
#
# @param language [Symbol]
# @return [String] The name of this achievement
#
# source://steam-condenser//lib/steam-condenser/community/game_achievement.rb#108
def name(language = T.unsafe(nil)); end
# Return the stats schema of the game this achievement belongs to
#
# @return [GameStatsSchema] The stats schema of game this achievement
# belongs to
#
# source://steam-condenser//lib/steam-condenser/community/game_achievement.rb#45
def schema; end
class << self
# Loads the global unlock percentages of all achievements for the game with
# the given Steam Application ID
#
# @param app_id [Fixnum] The unique Steam Application ID of the game (e.g.
# `440` for Team Fortress 2). See
# http://developer.valvesoftware.com/wiki/Steam_Application_IDs for
# all application IDs
# @raise [Error::WebApi] if the request to Steam's Web API fails
# @return [Hash<Symbol, Float>] The symbolic achievement names with their
# corresponding unlock percentages
#
# source://steam-condenser//lib/steam-condenser/community/game_achievement.rb#57
def global_percentages(app_id); end
end
end
# source://steam-condenser//lib/steam-condenser/community/game_achievement.rb#112
class SteamCondenser::Community::GameAchievement::Instance
# @return [Instance] a new instance of Instance
#
# source://steam-condenser//lib/steam-condenser/community/game_achievement.rb#118
def initialize(achievement, user, unlocked); end
# Returns the value of attribute achievement.
#
# source://steam-condenser//lib/steam-condenser/community/game_achievement.rb#114
def achievement; end
# source://steam-condenser//lib/steam-condenser/community/game_achievement.rb#124
def inspect; end
# Returns whether this achievement has been unlocked by its owner
#
# @return [Boolean] `true` if the achievement has been unlocked by the
# user
#
# source://steam-condenser//lib/steam-condenser/community/game_achievement.rb#132
def unlocked?; end
# Returns the value of attribute user.
#
# source://steam-condenser//lib/steam-condenser/community/game_achievement.rb#116
def user; end
end
# Provides basic functionality to represent an inventory of player in a game
#
# @author Sebastian Staudt
#
# source://steam-condenser//lib/steam-condenser/community/game_inventory.rb#13
class SteamCondenser::Community::GameInventory
include ::SteamCondenser::Community::Cacheable
extend ::SteamCondenser::Community::Cacheable::ClassMethods
# Creates a new inventory object for the given AppID and SteamID64. This
# calls update to fetch the data and create the item instances contained in
# this players backpack
#
# @overload initialize
# @param app_id [Fixnum] The application ID of the game
# @param steam_id64 [Fixnum] The 64bit SteamID of the player to get the
# inventory for
# @param fetch [Boolean] if `true` the object's data is fetched after
# creation
# @param bypass_cache [Boolean] if `true` the object's data is fetched again
# even if it has been cached already
# @return [GameInventory] a new instance of GameInventory
#
# source://steam-condenser//lib/steam-condenser/community/game_inventory.rb#112
def initialize(app_id, steam_id64); end
# Returns the item at the given position in the inventory. The positions
# range from 1 to 100 instead of the usual array indices (0 to 99).
#
# @return [GameItem] The item at the given position in the inventory
#
# source://steam-condenser//lib/steam-condenser/community/game_inventory.rb#128
def [](index); end
# Returns the application ID of the game this inventory class belongs to
#
# @return [Fixnum] The application ID of the game
#
# source://steam-condenser//lib/steam-condenser/community/game_inventory.rb#36
def app_id; end
# Updates the contents of the inventory using the Steam Web API
#
# source://steam-condenser//lib/steam-condenser/community/cacheable.rb#43
def fetch; end
# Returns a short, human-readable string representation of this inventory
#
# @return [String] A string representation of this inventory
#
# source://steam-condenser//lib/steam-condenser/community/game_inventory.rb#154
def inspect; end
# Returns the item schema for this inventory
#
# @return [GameItemSchema] The item schema for the game this inventory
# belongs to
#
# source://steam-condenser//lib/steam-condenser/community/game_inventory.rb#163
def item_schema; end
# Returns an array of all items in this players inventory.
#
# @return [Array<GameItem>] All items in the backpack
#
# source://steam-condenser//lib/steam-condenser/community/game_inventory.rb#41
def items; end
# source://steam-condenser//lib/steam-condenser/community/game_inventory.rb#133
def original_fetch; end
# Returns an array of all items that this player just found or traded
#
# @return [Array<GameItem>] All preliminary items of the inventory
#
# source://steam-condenser//lib/steam-condenser/community/game_inventory.rb#46
def preliminary_items; end
# Returns the number of items in the user's inventory
#
# @return [Fixnum] The number of items in the inventory
#
# source://steam-condenser//lib/steam-condenser/community/game_inventory.rb#170
def size; end
# Returns the Steam ID of the player owning this inventory
#
# @return [SteamId] The Steam ID of the owner of this inventory
#
# source://steam-condenser//lib/steam-condenser/community/game_inventory.rb#51
def user; end
class << self
# source://steam-condenser//lib/steam-condenser/community/cacheable.rb#38
def method_added(name); end
# This is a wrapper around all subclasses of `GameInventory` so that an
# instance of correct subclass is returned for a given application ID. If
# there's no specific subclass for an application ID exists, a generic
# instance of `GameInventory` is created.
#
# @overload new
# @param app_id [Fixnum] The application ID of the game
# @param steam_id [Fixnum] The 64bit Steam ID or vanity URL of the user
# @param fetch [Boolean] if `true` the object's data is fetched after
# creation
# @param bypass_cache [Boolean] if `true` the object's data is fetched again
# even if it has been cached already
# @raise [SteamCondenserException] if creating the inventory fails
# @return [GameInventory] The inventory for the given user and game
#
# source://steam-condenser//lib/steam-condenser/community/game_inventory.rb#67
def new(app_id, steam_id = T.unsafe(nil), *args); end
# Sets the language the schema should be fetched in (default is: `'en'`)
#
# @param language [String] The ISO 639-1 code of the schema language
#
# source://steam-condenser//lib/steam-condenser/community/game_inventory.rb#100
def schema_language=(language); end
end
end
# A module implementing basic functionality for classes representing an item
# in a game
#
# @author Sebastian Staudt
#
# source://steam-condenser//lib/steam-condenser/community/game_item.rb#14
class SteamCondenser::Community::GameItem
# Creates a new instance of a GameItem with the given data
#
# @param inventory [GameInventory] The inventory this item is contained in
# @param item_data [Hash<Symbol, Object>] The data representing this item
# @return [GameItem] a new instance of GameItem
#
# source://steam-condenser//lib/steam-condenser/community/game_item.rb#90
def initialize(inventory, item_data); end
# Return the attributes of this item
#
# @return [Hash<Symbol, Object>, nil] The attributes of this item
#
# source://steam-condenser//lib/steam-condenser/community/game_item.rb#19
def attributes; end
# Returns the position of this item in the player's inventory
#
# @return [Fixnum] The position of this item in the player's inventory
#
# source://steam-condenser//lib/steam-condenser/community/game_item.rb#24
def backpack_position; end
# Returns the number of items the player owns of this item
#
# @return [Fixnum] The quantity of this item
#
# source://steam-condenser//lib/steam-condenser/community/game_item.rb#29
def count; end
# Returns whether this item is craftable
#
# @return [Boolean] `true` if this item is craftable
#
# source://steam-condenser//lib/steam-condenser/community/game_item.rb#129
def craftable?; end
# Returns the index where the item is defined in the schema
#
# @return [Fixnum] The schema index of this item
#
# source://steam-condenser//lib/steam-condenser/community/game_item.rb#34
def defindex; end
# Returns the ID of this item
#
# @return [Fixnum] The ID of this item
#
# source://steam-condenser//lib/steam-condenser/community/game_item.rb#39
def id; end
# Returns the inventory this items belongs to
#
# @return [GameInventory] The inventory this item belongs to
#
# source://steam-condenser//lib/steam-condenser/community/game_item.rb#44
def inventory; end
# Returns the class of this item
#
# @return [String] The class of this item
#
# source://steam-condenser//lib/steam-condenser/community/game_item.rb#49
def item_class; end
# Returns the item set this item belongs to
#
# @return [Hash<Symbol, Object>, nil] The set this item belongs to
#
# source://steam-condenser//lib/steam-condenser/community/game_item.rb#54
def item_set; end
# Returns the level of this item
#
# @return [Fixnum] The level of this item
#
# source://steam-condenser//lib/steam-condenser/community/game_item.rb#59
def level; end
# Returns the level of this item
#
# @return [String] The level of this item
#
# source://steam-condenser//lib/steam-condenser/community/game_item.rb#64
def name; end
# Returns the origin of this item
#
# @return [String] The origin of this item
#
# source://steam-condenser//lib/steam-condenser/community/game_item.rb#69
def origin; end
# Returns the original ID of this item
#
# @return [Fixnum] The original ID of this item
#
# source://steam-condenser//lib/steam-condenser/community/game_item.rb#74
def original_id; end
# Returns whether this item is preliminary
#
# Preliminary means that this item was just found or traded and has not yet
# been added to the inventory
#
# @return [Boolean] `true` if this item is preliminary
#
# source://steam-condenser//lib/steam-condenser/community/game_item.rb#139
def preliminary?; end
# Returns the quality of this item
#
# @return [String] The quality of this item
#
# source://steam-condenser//lib/steam-condenser/community/game_item.rb#79
def quality; end
# Returns the data for this item that's defined in the item schema
#
# @return [Hash<Symbol, Object>] The schema data for this item
#
# source://steam-condenser//lib/steam-condenser/community/game_item.rb#146
def schema_data; end
# Returns whether this item is tradeable
#
# @return [Boolean] `true` if this item is tradeable
#
# source://steam-condenser//lib/steam-condenser/community/game_item.rb#153
def tradeable?; end
# Returns the type of this item
#
# @return [String] The type of this item
#
# source://steam-condenser//lib/steam-condenser/community/game_item.rb#84
def type; end
end
# Provides item definitions and related data that specify the items of a game
#
# @author Sebastian Staudt
#
# source://steam-condenser//lib/steam-condenser/community/game_item_schema.rb#13
class SteamCondenser::Community::GameItemSchema
include ::SteamCondenser::Community::Cacheable
extend ::SteamCondenser::Community::Cacheable::ClassMethods
# Creates a new item schema for the game with the given application ID and
# with descriptions in the given language
#
# @overload initialize
# @param app_id [Fixnum] The application ID of the game
# @param language [Symbol] The language of description strings
# @param fetch [Boolean] if `true` the object's data is fetched after
# creation
# @param bypass_cache [Boolean] if `true` the object's data is fetched again
# even if it has been cached already
# @return [GameItemSchema] a new instance of GameItemSchema
#
# source://steam-condenser//lib/steam-condenser/community/game_item_schema.rb#74
def initialize(app_id, language = T.unsafe(nil)); end
# Returns the application ID of the game this item schema belongs to
#
# @return [Fixnum] The application ID of the game
#
# source://steam-condenser//lib/steam-condenser/community/game_item_schema.rb#21
def app_id; end
# The attributes defined for this game's items
#
# @return [Hash<Symbol, Object>] This item schema's attributes
#
# source://steam-condenser//lib/steam-condenser/community/game_item_schema.rb#26
def attributes; end
# The effects defined for this game's items
#
# @return [Hash<Symbol, Object>] This item schema's effects
#
# source://steam-condenser//lib/steam-condenser/community/game_item_schema.rb#31
def effects; end
# Updates the item definitions of this schema using the Steam Web API
#
# source://steam-condenser//lib/steam-condenser/community/cacheable.rb#43
def fetch; end
# Returns a short, human-readable string representation of this item schema
#
# @return [String] A string representation of this item schema
#
# source://steam-condenser//lib/steam-condenser/community/game_item_schema.rb#128
def inspect; end
# The levels defined for this game's items
#
# @return [Hash<Symbol, Object>] This item schema's item levels
#
# source://steam-condenser//lib/steam-condenser/community/game_item_schema.rb#36
def item_levels; end
# A mapping from the item name to the item's defindex
#
# @return [Hash<Symbol, Object>] The item name mapping
#
# source://steam-condenser//lib/steam-condenser/community/game_item_schema.rb#41
def item_names; end
# The item sets defined for this game's items
#
# @return [Hash<Symbol, Object>] This item schema's item sets
#
# source://steam-condenser//lib/steam-condenser/community/game_item_schema.rb#46
def item_sets; end
# The items defined for this game
#
# @return [Hash<Symbol, Object>] The items in this schema
#
# source://steam-condenser//lib/steam-condenser/community/game_item_schema.rb#51
def items; end
# The language of this item schema
#
# @return [Symbol] The language of this item schema
#
# source://steam-condenser//lib/steam-condenser/community/game_item_schema.rb#56
def language; end
# source://steam-condenser//lib/steam-condenser/community/game_item_schema.rb#80
def original_fetch; end
# The item origins defined for this game's items
#
# @return [Array<String>] This item schema's origins
#
# source://steam-condenser//lib/steam-condenser/community/game_item_schema.rb#61
def origins; end
# The item qualities defined for this game's items
#
# @return [Array<String>] This item schema's qualities
#
# source://steam-condenser//lib/steam-condenser/community/game_item_schema.rb#66
def qualities; end
class << self
# source://steam-condenser//lib/steam-condenser/community/cacheable.rb#38
def method_added(name); end
end
end
# The GameLeaderboard class represents a single leaderboard for a specific
# game
#
# @author Sebastian Staudt
#
# source://steam-condenser//lib/steam-condenser/community/game_leaderboard.rb#19
class SteamCondenser::Community::GameLeaderboard
include ::SteamCondenser::Community::XMLData
# Creates a new leaderboard instance with the given XML data
#
# @param board_data [Hash<String, Object>] The XML data of the leaderboard
# @return [GameLeaderboard] a new instance of GameLeaderboard
#
# source://steam-condenser//lib/steam-condenser/community/game_leaderboard.rb#171
def initialize(board_data); end
# Returns the display type of the scores on this leaderboard
#
# @return [Fixnum] The display type of the scores
#
# source://steam-condenser//lib/steam-condenser/community/game_leaderboard.rb#37
def display_type; end
# Returns the number of entries on this leaderboard
#
# @return [Fixnum] The number of entries on this leaderboard
#
# source://steam-condenser//lib/steam-condenser/community/game_leaderboard.rb#42
def entry_count; end
# Returns the entry on this leaderboard for the user with the given SteamID
#
# raise [SteamCondenserException] if an error occurs while fetching the
# leaderboard
#
# @param steam_id [Fixnum, SteamId] The 64bit SteamID or the `SteamId`
# object of the user
# @raise [SteamCondenser::Error]
# @return [GameLeaderboardEntry] The entry of the user if available
#
# source://steam-condenser//lib/steam-condenser/community/game_leaderboard.rb#93
def entry_for_steam_id(steam_id); end
# Returns an array of entries on this leaderboard for the user with the
# given SteamID and his/her friends
#
# raise [SteamCondenserException] if an error occurs while fetching the
# leaderboard
#
# @param steam_id [Fixnum, SteamId] The 64bit SteamID or the `SteamId`
# object of the user
# @raise [SteamCondenser::Error]
# @return [Array<GameLeaderboardEntry>] The entries of the user and his/her
# friends
#
# source://steam-condenser//lib/steam-condenser/community/game_leaderboard.rb#119
def entry_for_steam_id_friends(steam_id); end
# Returns the entries on this leaderboard for a given rank range
#
# The range is inclusive and a maximum of 5001 entries can be returned in a
# single request.
#
# raise [SteamCondenserException] if an error occurs while fetching the
# leaderboard
#
# @param first [Fixnum] The first entry to return from the leaderboard
# @param last [Fixnum] The last entry to return from the leaderboard
# @raise [SteamCondenser::Error]
# @return [Array<GameLeaderboardEntry>] The entries that match the given
# rank range
#
# source://steam-condenser//lib/steam-condenser/community/game_leaderboard.rb#141
def entry_range(first, last); end
# Returns the ID of the leaderboard
#
# @return [Fixnum] The ID of the leaderboard
#
# source://steam-condenser//lib/steam-condenser/community/game_leaderboard.rb#47
def id; end
# Returns the name of the leaderboard
#
# @return [String] The name of the leaderboard
#
# source://steam-condenser//lib/steam-condenser/community/game_leaderboard.rb#52
def name; end
# Returns the method that is used to sort the entries on the leaderboard
#
# @return [Fixnum] The sort method
#
# source://steam-condenser//lib/steam-condenser/community/game_leaderboard.rb#57
def sort_method; end
private
# Parses all entries available in the XML data
#
# @return [Array<GameLeaderboardEntry>] All available entries
#
# source://steam-condenser//lib/steam-condenser/community/game_leaderboard.rb#183
def parse_entries; end
class << self
# Returns the leaderboard for the given game and leaderboard ID or name
#
# @param app_id [Fixnum] The application ID of the game
# @param id [Fixnum, String] The ID or name of the leaderboard to return
# @return [GameLeaderboard] The matching leaderboard if available
#
# source://steam-condenser//lib/steam-condenser/community/game_leaderboard.rb#64
def leaderboard(app_id, id); end
# Returns an array containing all of a game's leaderboards
#
# @param app_id [Fixnum] The application ID of the game
# @return [Array<GameLeaderboard>] The leaderboards for this game
#
# source://steam-condenser//lib/steam-condenser/community/game_leaderboard.rb#80
def leaderboards(app_id); end
# Loads the leaderboards of the specified games into the cache
#
# @param app_id [Fixnum] The application ID of the game
# @raise [SteamCondenserException] if an error occurs while fetching the
# leaderboards
#
# source://steam-condenser//lib/steam-condenser/community/game_leaderboard.rb#198
def load_leaderboards(app_id); end
end
end
# source://steam-condenser//lib/steam-condenser/community/game_leaderboard.rb#26
SteamCondenser::Community::GameLeaderboard::DISPLAY_TYPE_MILLISECONDS = T.let(T.unsafe(nil), Integer)
# source://steam-condenser//lib/steam-condenser/community/game_leaderboard.rb#23
SteamCondenser::Community::GameLeaderboard::DISPLAY_TYPE_NONE = T.let(T.unsafe(nil), Integer)
# source://steam-condenser//lib/steam-condenser/community/game_leaderboard.rb#24
SteamCondenser::Community::GameLeaderboard::DISPLAY_TYPE_NUMERIC = T.let(T.unsafe(nil), Integer)
# source://steam-condenser//lib/steam-condenser/community/game_leaderboard.rb#25
SteamCondenser::Community::GameLeaderboard::DISPLAY_TYPE_SECONDS = T.let(T.unsafe(nil), Integer)
# source://steam-condenser//lib/steam-condenser/community/game_leaderboard.rb#29
SteamCondenser::Community::GameLeaderboard::SORT_METHOD_ASC = T.let(T.unsafe(nil), Integer)
# source://steam-condenser//lib/steam-condenser/community/game_leaderboard.rb#30
SteamCondenser::Community::GameLeaderboard::SORT_METHOD_DESC = T.let(T.unsafe(nil), Integer)
# source://steam-condenser//lib/steam-condenser/community/game_leaderboard.rb#28
SteamCondenser::Community::GameLeaderboard::SORT_METHOD_NONE = T.let(T.unsafe(nil), Integer)
# The GameLeaderboard class represents a single entry in a leaderboard
#
# @author Sebastian Staudt
#
# source://steam-condenser//lib/steam-condenser/community/game_leaderboard_entry.rb#11
class SteamCondenser::Community::GameLeaderboardEntry
# Creates new entry instance for the given XML data and leaderboard
#
# @param entry_data [Hash<String, Object>] The XML data of the leaderboard
# of the leaderboard entry
# @param leaderboard [GameLeaderboard] The leaderboard this entry belongs
# to
# @return [GameLeaderboardEntry] a new instance of GameLeaderboardEntry
#
# source://steam-condenser//lib/steam-condenser/community/game_leaderboard_entry.rb#39
def initialize(entry_data, leaderboard); end
# Returns the leaderboard this entry belongs to
#
# @return [GameLeaderboard] The leaderboard of this entry
#
# source://steam-condenser//lib/steam-condenser/community/game_leaderboard_entry.rb#31
def leaderboard; end
# Returns the rank where this entry is listed in the leaderboard
#
# @return [Fixnum] The rank of this entry
#
# source://steam-condenser//lib/steam-condenser/community/game_leaderboard_entry.rb#26
def rank; end
# Returns the score of this entry
#
# @return [Fixnum] The score of this player
#
# source://steam-condenser//lib/steam-condenser/community/game_leaderboard_entry.rb#21
def score; end
# Returns the Steam ID of this entry's player
#
# @return [SteamId] The Steam ID of the player
#
# source://steam-condenser//lib/steam-condenser/community/game_leaderboard_entry.rb#16
def steam_id; end
end
# This class represents the game statistics for a single user and a specific
# game
#
# @author Sebastian Staudt
#
# source://steam-condenser//lib/steam-condenser/community/game_stats.rb#17
class SteamCondenser::Community::GameStats
include ::SteamCondenser::Community::Cacheable
extend ::SteamCondenser::Community::Cacheable::ClassMethods
# Creates a `GameStats` object and fetches data from the Steam Community
# for the given user and game
#
# @param user_id [String, Fixnum] The custom URL or the 64bit Steam ID of
# the user
# @param game_id [String] The application ID or friendly name of the game
# @raise [Error] if the stats cannot be fetched
# @return [GameStats] a new instance of GameStats
#
# source://steam-condenser//lib/steam-condenser/community/game_stats.rb#50
def initialize(user_id, game_id); end
# Returns the achievements for this stats' user and game
#
# If the achievements' data hasn't been parsed yet, parsing is done now.
#
# @return [Array<GameAchievement::Instance>] All achievements belonging to
# this game
#
# source://steam-condenser//lib/steam-condenser/community/game_stats.rb#28
def achievements; end
# Returns the number of achievements done by this player
#
# @return [Fixnum] The number of achievements completed
# @see #achievements
#
# source://steam-condenser//lib/steam-condenser/community/game_stats.rb#81
def achievements_done; end
# Returns the percentage of achievements done by this player
#
# @return [Float] The percentage of achievements completed
# @see #achievements_done
#
# source://steam-condenser//lib/steam-condenser/community/game_stats.rb#89
def achievements_percentage; end
# source://steam-condenser//lib/steam-condenser/community/game_stats.rb#93
def inspect; end
# Returns the schema of the game these stats belong to
#
# @return [GameStatsSchema] The stats schema
#
# source://steam-condenser//lib/steam-condenser/community/game_stats.rb#38
def schema; end
# Returns the Steam ID of the player these stats belong to
#
# @return [SteamId] The Steam ID instance of the player
#
# source://steam-condenser//lib/steam-condenser/community/game_stats.rb#33
def user; end
# @return [Array<GameStatsValue::Instance>]
#
# source://steam-condenser//lib/steam-condenser/community/game_stats.rb#41
def values; end
class << self
# source://steam-condenser//lib/steam-condenser/community/cacheable.rb#38
def method_added(name); end
end
end
# source://steam-condenser//lib/steam-condenser/community/game_stats_datum.rb#10
class SteamCondenser::Community::GameStatsDatum
# @param schema [GameStatsSchema]
# @param data [Hash<Symbol, Object>]
# @return [GameStatsDatum] a new instance of GameStatsDatum
#
# source://steam-condenser//lib/steam-condenser/community/game_stats_datum.rb#20
def initialize(schema, data); end
# Returns the value of attribute api_name.
#
# source://steam-condenser//lib/steam-condenser/community/game_stats_datum.rb#12
def api_name; end
# Returns the value of attribute default_value.
#
# source://steam-condenser//lib/steam-condenser/community/game_stats_datum.rb#14
def default_value; end
# source://steam-condenser//lib/steam-condenser/community/game_stats_datum.rb#27
def inspect; end
# source://steam-condenser//lib/steam-condenser/community/game_stats_datum.rb#31
def instance(user, value); end
# source://steam-condenser//lib/steam-condenser/community/game_stats_datum.rb#35
def name(language = T.unsafe(nil)); end
# Returns the value of attribute schema.
#
# source://steam-condenser//lib/steam-condenser/community/game_stats_datum.rb#16
def schema; end
end
# source://steam-condenser//lib/steam-condenser/community/game_stats_datum.rb#39
class SteamCondenser::Community::GameStatsDatum::Instance
# @return [Instance] a new instance of Instance
#
# source://steam-condenser//lib/steam-condenser/community/game_stats_datum.rb#47
def initialize(user, datum, value); end
# Returns the value of attribute datum.
#
# source://steam-condenser//lib/steam-condenser/community/game_stats_datum.rb#41
def datum; end
# source://steam-condenser//lib/steam-condenser/community/game_stats_datum.rb#53
def inspect; end
# Returns the value of attribute user.
#
# source://steam-condenser//lib/steam-condenser/community/game_stats_datum.rb#43
def user; end
# Returns the value of attribute value.
#
# source://steam-condenser//lib/steam-condenser/community/game_stats_datum.rb#45
def value; end
end
# source://steam-condenser//lib/steam-condenser/community/game_stats_schema.rb#13
class SteamCondenser::Community::GameStatsSchema
include ::SteamCondenser::Community::Cacheable
extend ::SteamCondenser::Community::Cacheable::ClassMethods
# @overload initialize
# @param fetch [Boolean] if `true` the object's data is fetched after
# creation
# @param bypass_cache [Boolean] if `true` the object's data is fetched again
# even if it has been cached already
# @return [GameStatsSchema] a new instance of GameStatsSchema
#
# source://steam-condenser//lib/steam-condenser/community/game_stats_schema.rb#40
def initialize(app_id); end
# source://steam-condenser//lib/steam-condenser/community/game_stats_schema.rb#44
def achievement(api_name); end
# source://steam-condenser//lib/steam-condenser/community/game_stats_schema.rb#52
def achievement_translations(language); end
# @return [Hash<String, GameAchievement>]
#
# source://steam-condenser//lib/steam-condenser/community/game_stats_schema.rb#21
def achievements; end
# Returns the value of attribute app_id.
#
# source://steam-condenser//lib/steam-condenser/community/game_stats_schema.rb#23
def app_id; end
# Returns the value of attribute app_name.
#
# source://steam-condenser//lib/steam-condenser/community/game_stats_schema.rb#25
def app_name; end
# Returns the value of attribute app_version.
#
# source://steam-condenser//lib/steam-condenser/community/game_stats_schema.rb#27
def app_version; end
# Returns the value of attribute data.
#
# source://steam-condenser//lib/steam-condenser/community/game_stats_schema.rb#29
def data; end
# source://steam-condenser//lib/steam-condenser/community/game_stats_schema.rb#57
def datum(api_name); end
# source://steam-condenser//lib/steam-condenser/community/game_stats_schema.rb#61
def datum_names(language); end
# source://steam-condenser//lib/steam-condenser/community/cacheable.rb#43
def fetch; end
# source://steam-condenser//lib/steam-condenser/community/game_stats_schema.rb#66
def inspect; end
# source://steam-condenser//lib/steam-condenser/community/game_stats_schema.rb#48
def original_fetch; end
protected
# source://steam-condenser//lib/steam-condenser/community/game_stats_schema.rb#72
def add_language(language); end
# source://steam-condenser//lib/steam-condenser/community/game_stats_schema.rb#100
def fetch_language(language); end
class << self
# source://steam-condenser//lib/steam-condenser/community/game_stats_schema.rb#31
def default_language; end
# source://steam-condenser//lib/steam-condenser/community/game_stats_schema.rb#35
def default_language=(language); end
# source://steam-condenser//lib/steam-condenser/community/cacheable.rb#38
def method_added(name); end
end
end
# Represents the inventory (a.k.a. Robot Enrichment) of a Portal 2 player
#
# @author Sebastian Staudt
#
# source://steam-condenser//lib/steam-condenser/community/portal2/portal2_inventory.rb#14
class SteamCondenser::Community::Portal2Inventory < ::SteamCondenser::Community::GameInventory
# Creates a new inventory object for the given SteamID64 in Portal 2 (App ID
# 620)
#
# @overload initialize
# @param steam_id64 [Fixnum] The 64bit SteamID of the player to get the
# inventory for
# @param fetch [Boolean] if `true` the object's data is fetched after
# creation
# @param bypass_cache [Boolean] if `true` the object's data is fetched again
# even if it has been cached already
# @return [Portal2Inventory] a new instance of Portal2Inventory
#
# source://steam-condenser//lib/steam-condenser/community/portal2/portal2_inventory.rb#25
def initialize(steam_id64); end
end
# The Steam application ID of Portal 2
#
# source://steam-condenser//lib/steam-condenser/community/portal2/portal2_inventory.rb#17
SteamCondenser::Community::Portal2Inventory::APP_ID = T.let(T.unsafe(nil), Integer)
# Represents a Portal 2 item
#
# @author Sebastian Staudt
#
# source://steam-condenser//lib/steam-condenser/community/portal2/portal2_item.rb#13
class SteamCondenser::Community::Portal2Item < ::SteamCondenser::Community::GameItem
# Creates a new instance of a Portal 2 item with the given data
#
# @param inventory [Portal2Inventory] The inventory this item is contained
# in
# @param item_data [Hash<Symbol, Object>] The data specifying this item
# @raise [Error::WebApi] on Web API errors
# @return [Portal2Item] a new instance of Portal2Item
#
# source://steam-condenser//lib/steam-condenser/community/portal2/portal2_item.rb#30
def initialize(inventory, item_data); end
# Returns the symbols for each bot this player has equipped this item
#
# @return [Array<String>] The names of the bots this player has equipped
# this item
#
# source://steam-condenser//lib/steam-condenser/community/portal2/portal2_item.rb#45
def bots_equipped?; end
# Returns whether this item is equipped by this player at all
#
# @return [Boolean] `true` if the player has equipped this item at all
#
# source://steam-condenser//lib/steam-condenser/community/portal2/portal2_item.rb#52
def equipped?; end
# Returns the slot where this item can be equipped in or `nil` if this item
# cannot be equipped
#
# @return [String, nil] The slot where this item can be equipped in
#
# source://steam-condenser//lib/steam-condenser/community/portal2/portal2_item.rb#22
def slot; end
end
# The names of the bots available in Portal 2
#
# source://steam-condenser//lib/steam-condenser/community/portal2/portal2_item.rb#16
SteamCondenser::Community::Portal2Item::BOTS = T.let(T.unsafe(nil), Array)
# This class represents a game available on Steam
#
# @author Sebastian Staudt
#
# source://steam-condenser//lib/steam-condenser/community/steam_game.rb#16
class SteamCondenser::Community::SteamGame
include ::SteamCondenser::Community::Cacheable
extend ::SteamCondenser::Community::Cacheable::ClassMethods
# Creates a new instance of a game with the given data and caches it
#
# @note The real constructor of `SteamGame` is {.new}
# @param app_id [Fixnum] The application ID of the game
# @param game_data [Hash<Symbol, Object>, Hash<String, Object>] The JSON
# data of the game
# @return [SteamGame] a new instance of SteamGame
#
# source://steam-condenser//lib/steam-condenser/community/steam_game.rb#153
def initialize(app_id, game_data); end
# Returns the Steam application ID of this game
#
# @return [Fixnum] The Steam application ID of this game
#
# source://steam-condenser//lib/steam-condenser/community/steam_game.rb#24
def app_id; end
# Returns the URL for the icon image of this game
#
# @return [String] The URL for the game icon
#
# source://steam-condenser//lib/steam-condenser/community/steam_game.rb#79
def icon_url; end
# Returns the Steam application ID of this game
#
# @return [Fixnum] The Steam application ID of this game
#
# source://steam-condenser//lib/steam-condenser/community/steam_game.rb#24
def id; end
# Returns the leaderboard for this game and the given leaderboard ID or
# name
#
# @param id [Fixnum, String] The ID or name of the leaderboard to return
# @return [GameLeaderboard] The matching leaderboard if available
#
# source://steam-condenser//lib/steam-condenser/community/steam_game.rb#88
def leaderboard(id); end
# Returns an array containing all of this game's leaderboards
#
# @return [Array<GameLeaderboard>] The leaderboards for this game
#
# source://steam-condenser//lib/steam-condenser/community/steam_game.rb#95
def leaderboards; end
# Returns the URL for the logo thumbnail image of this game
#
# @return [String] The URL for the game logo thumbnail
#
# source://steam-condenser//lib/steam-condenser/community/steam_game.rb#109
def logo_thumbnail_url; end
# Returns the URL for the logo image of this game
#
# @return [String] The URL for the game logo
#
# source://steam-condenser//lib/steam-condenser/community/steam_game.rb#102
def logo_url; end
# Returns the full name of this game
#
# @return [String] The full name of this game
#
# source://steam-condenser//lib/steam-condenser/community/steam_game.rb#30
def name; end
# Returns the overall number of players currently playing this game
#
# @return [Fixnum] The number of players playing this game
#
# source://steam-condenser//lib/steam-condenser/community/steam_game.rb#116
def player_count; end
# Returns the URL of this game's page in the Steam Store
#
# @return [String] This game's store page
#
# source://steam-condenser//lib/steam-condenser/community/steam_game.rb#124
def store_url; end
# Returns whether the given version of this game is up-to-date
#
# @param version [Fixnum] The version to check against the Web API
# @return [Boolean] `true` if the given version is up-to-date
#
# source://steam-condenser//lib/steam-condenser/community/steam_game.rb#132
def uptodate?(version); end
# Creates a stats object for the given user and this game
#
# @param steam_id [String, Fixnum] The custom URL or the 64bit Steam ID of
# the user
# @return [GameStats] The stats of this game for the given user
#
# source://steam-condenser//lib/steam-condenser/community/steam_game.rb#141
def user_stats(steam_id); end
class << self
# Checks if a game is up-to-date by reading information from a `steam.inf`
# file and comparing it using the Web API
#
# @param path [String] The file system path of the `steam.inf` file
# @return [Boolean] `true` if the game is up-to-date
#
# source://steam-condenser//lib/steam-condenser/community/steam_game.rb#37
def check_steam_inf(path); end
# source://steam-condenser//lib/steam-condenser/community/cacheable.rb#38
def method_added(name); end
# Creates a new instance of a game with the given data and caches it
#
# @param app_id [Fixnum] The application ID of the game
# @param game_data [Hash<String, Object>] The XML data of the game
#
# source://steam-condenser//lib/steam-condenser/community/steam_game.rb#52
def new(app_id, game_data = T.unsafe(nil)); end
# Returns whether the given version of the game with the given application
# ID is up-to-date
#
# @param app_id [Fixnum] The application ID of the game to check
# @param version [Fixnum] The version to check against the Web API
# @raise [SteamCondenser::Error]
# @return [Boolean] `true` if the given version is up-to-date
#
# source://steam-condenser//lib/steam-condenser/community/steam_game.rb#68
def uptodate?(app_id, version); end
end
end
# The SteamGroup class represents a group in the Steam Community
#
# @author Sebastian Staudt
#
# source://steam-condenser//lib/steam-condenser/community/steam_group.rb#16
class SteamCondenser::Community::SteamGroup
include ::SteamCondenser::Community::Cacheable
include ::SteamCondenser::Community::XMLData
extend ::SteamCondenser::Community::Cacheable::ClassMethods
# Creates a new `SteamGroup` instance for the group with the given ID
#
# @overload initialize
# @param id [String, Fixnum] The custom URL of the group specified by the
# group admin or the 64bit group ID
# @param fetch [Boolean] if `true` the object's data is fetched after
# creation
# @param bypass_cache [Boolean] if `true` the object's data is fetched again
# even if it has been cached already
# @return [SteamGroup] a new instance of SteamGroup
#
# source://steam-condenser//lib/steam-condenser/community/steam_group.rb#58
def initialize(id); end
# Returns the URL to this group's full avatar
#
# @return [String] The URL to this group's full avatar
#
# source://steam-condenser//lib/steam-condenser/community/steam_group.rb#70
def avatar_full_url; end
# Returns the URL to this group's icon avatar
#
# @return [String] The URL to this group's icon avatar
#
# source://steam-condenser//lib/steam-condenser/community/steam_group.rb#79
def avatar_icon_url; end
# Returns the URL to this group's medium avatar
#
# @return [String] The URL to this group's medium avatar
#
# source://steam-condenser//lib/steam-condenser/community/steam_group.rb#88
def avatar_medium_url; end
# Returns the base URL for this group's page
#
# This URL is different for groups having a custom URL.
#
# @return [String] The base URL for this group
#
# source://steam-condenser//lib/steam-condenser/community/steam_group.rb#99
def base_url; end
# Returns the custom URL of this group
#
# The custom URL is a admin specified unique string that can be used
# instead of the 64bit SteamID as an identifier for a group.
#
# @return [String] The custom URL of this group
#
# source://steam-condenser//lib/steam-condenser/community/steam_group.rb#31
def custom_url; end
# Loads information about and members of this group
#
# This includes the ID, name, headline, summary of the group as well as
# avatar and custom URLs.
#
# This might take several HTTP requests as the Steam Community splits this
# data over several XML documents if the group has lots of members.
#
# @see Cacheable#fetch
#
# source://steam-condenser//lib/steam-condenser/community/cacheable.rb#43
def fetch; end
# Returns this group's 64bit SteamID
#
# @return [Fixnum] This group's 64bit SteamID
#
# source://steam-condenser//lib/steam-condenser/community/steam_group.rb#36
def group_id64; end
# Returns this group's headline text
#
# @return [String] This group's headline text
#
# source://steam-condenser//lib/steam-condenser/community/steam_group.rb#41
def headline; end
# Returns the number of members this group has
#
# If the members have already been fetched the size of the member array is
# returned. Otherwise the the first page of the member listing is fetched
# and the member count and the first batch of members is stored.
#
# @return [Fixnum] The number of this group's members
#
# source://steam-condenser//lib/steam-condenser/community/steam_group.rb#135
def member_count; end
# Returns the members of this group
#
# If the members haven't been fetched yet, this is done now.
#
# @return [Array<SteamId>] The Steam ID's of the members of this group
# @see #fetch
#
# source://steam-condenser//lib/steam-condenser/community/steam_group.rb#150
def members; end
# Returns this group's name
#
# @return [String] This group's name
#
# source://steam-condenser//lib/steam-condenser/community/steam_group.rb#46
def name; end
# source://steam-condenser//lib/steam-condenser/community/steam_group.rb#116
def original_fetch; end
# Returns this group's summary text
#
# @return [String] This group's summary text
#
# source://steam-condenser//lib/steam-condenser/community/steam_group.rb#51
def summary; end
private
# Fetches a specific page of the member listing of this group
#
# @param page [Fixnum] The member page to fetch
# @return [Fixnum] The total number of pages of this group's member listing
#
# source://steam-condenser//lib/steam-condenser/community/steam_group.rb#161
def fetch_page(page); end
class << self
# source://steam-condenser//lib/steam-condenser/community/cacheable.rb#38
def method_added(name); end
end
end
# source://steam-condenser//lib/steam-condenser/community/steam_group.rb#23
SteamCondenser::Community::SteamGroup::AVATAR_URL = T.let(T.unsafe(nil), String)
# The SteamId class represents a Steam Community profile (also called Steam
# ID)
#
# @author Sebastian Staudt
#
# source://steam-condenser//lib/steam-condenser/community/steam_id.rb#23
class SteamCondenser::Community::SteamId
include ::SteamCondenser::Community::Cacheable
include ::SteamCondenser::Community::XMLData
extend ::SteamCondenser::Community::Cacheable::ClassMethods
# Creates a new `SteamId` instance for the given Steam ID
#
# @overload initialize
# @param id [String, Fixnum] The custom URL of the Steam ID specified by the
# user or the 64bit SteamID
# @param fetch [Boolean] if `true` the object's data is fetched after
# creation
# @param bypass_cache [Boolean] if `true` the object's data is fetched again
# even if it has been cached already
# @return [SteamId] a new instance of SteamId
#
# source://steam-condenser//lib/steam-condenser/community/steam_id.rb#186
def initialize(id); end
# Returns whether the owner of this SteamID is VAC banned
#
# @return [Boolean] `true` if the user has been banned by VAC
#
# source://steam-condenser//lib/steam-condenser/community/steam_id.rb#201
def banned?; end
# Returns the base URL for this Steam ID
#
# This URL is different for Steam IDs having a custom URL.
#
# @return [String] The base URL for this SteamID
#
# source://steam-condenser//lib/steam-condenser/community/steam_id.rb#211
def base_url; end
# Returns the custom URL of this Steam ID
#
# The custom URL is a user specified unique string that can be used instead
# of the 64bit SteamID as an identifier for a Steam ID.
#
# @note The custom URL is not necessarily the same as the user's nickname.
# @return [String] The custom URL of this Steam ID
#
# source://steam-condenser//lib/steam-condenser/community/steam_id.rb#37
def custom_url; end
# Fetches data from the Steam Community by querying the XML version of the
# profile specified by the ID of this Steam ID
#
# @raise [Error] if the Steam ID data is not available, e.g. when it is
# private
# @see Cacheable#fetch
#
# source://steam-condenser//lib/steam-condenser/community/cacheable.rb#43
def fetch; end
# Fetches the friends of this user
#
# This creates a new `SteamId` instance for each of the friends without
# fetching their data.
#
# @see #friends
# @see #initialize
#
# source://steam-condenser//lib/steam-condenser/community/steam_id.rb#267
def fetch_friends; end
# Fetches information about the game the user is playing currently
#
# @return The user’s current game information
# @see #game_info
#
# source://steam-condenser//lib/steam-condenser/community/steam_id.rb#325
def fetch_game_info; end
# Fetches the games this user owns
#
# This fills the game hash with the names of the games as keys. The values
# will either be `false` if the game does not have stats or the game's
# "friendly name".
#
# @see #games
#
# source://steam-condenser//lib/steam-condenser/community/steam_id.rb#283
def fetch_games; end
# Fetches the groups this user is member of
#
# Uses the ISteamUser/GetUserGroupList interface.
#
# @return [Array<SteamGroup>] The groups of this user
# @see #groups
#
# source://steam-condenser//lib/steam-condenser/community/steam_id.rb#310
def fetch_groups; end
# Returns the Steam Community friends of this user
#
# If the friends haven't been fetched yet, this is done now.
#
# @return [Array<SteamId>] The friends of this user
# @see #fetch_friends
#
# source://steam-condenser//lib/steam-condenser/community/steam_id.rb#362
def friends; end
# Returns the URL of the full-sized version of this user's avatar
#
# @return [String] The URL of the full-sized avatar
#
# source://steam-condenser//lib/steam-condenser/community/steam_id.rb#341
def full_avatar_url; end
# Returns information about the game the user is playing currently
#
# If the information hasn't been fetched yet, this is done now.
#
# @return [Hash<Symbol, Object>] The user’s current game information
# @see #fetch_game_info
#
# source://steam-condenser//lib/steam-condenser/community/steam_id.rb#393
def game_info; end
# Returns the stats for the given game for the owner of this SteamID
#
# @param app_id [Fixnum] The application ID of the game stats should be
# fetched for
# @raise [Error] if the user does not own this game or it does not have any
# stats
# @return [GameStats] The statistics for the game with the given name
#
# source://steam-condenser//lib/steam-condenser/community/steam_id.rb#352
def game_stats(app_id); end
# Returns the games this user owns
#
# The keys of the hash are the games' application IDs and the values are
# the corresponding game instances.
#
# If the friends haven't been fetched yet, this is done now.
#
# @return [Hash<Fixnum, SteamGame>] The games this user owns
# @see #fetch_games
#
# source://steam-condenser//lib/steam-condenser/community/steam_id.rb#375
def games; end
# Returns all groups where this user is a member
#
# @return [] The groups of this user
# @see #fetch_groups
#
# source://steam-condenser//lib/steam-condenser/community/steam_id.rb#383
def groups; end
# Returns the URL of the icon version of this user's avatar
#
# @return [String] The URL of the icon-sized avatar
#
# source://steam-condenser//lib/steam-condenser/community/steam_id.rb#400
def icon_url; end
# Returns a unique identifier for this Steam ID
#
# This is either the 64bit numeric SteamID or custom URL
#
# @return [Fixnum, String] The 64bit numeric SteamID or the custom URL
#
# source://steam-condenser//lib/steam-condenser/community/steam_id.rb#409
def id; end
# Returns whether the owner of this SteamId is playing a game
#
# @return [Boolean] `true` if the user is in-game
#
# source://steam-condenser//lib/steam-condenser/community/steam_id.rb#416
def in_game?; end
# Returns whether the owner of this SteamID is VAC banned
#
# @return [Boolean] `true` if the user has been banned by VAC
#
# source://steam-condenser//lib/steam-condenser/community/steam_id.rb#201
def is_banned?; end
# Returns whether this Steam account is limited
#
# @return [Boolean] `true` if this account is limited
#
# source://steam-condenser//lib/steam-condenser/community/steam_id.rb#423
def limited?; end
# Returns the location of the user
#
# @return [String] The location of the user
#
# source://steam-condenser//lib/steam-condenser/community/steam_id.rb#47
def location; end
# Returns the URL of the medium-sized version of this user's avatar
#
# @return [String] The URL of the medium-sized avatar
#
# source://steam-condenser//lib/steam-condenser/community/steam_id.rb#430
def medium_avatar_url; end
# Returns the date of registration for the Steam account belonging to this
# SteamID
#
# @return [Time] The date of the Steam account registration
#
# source://steam-condenser//lib/steam-condenser/community/steam_id.rb#53
def member_since; end
# Returns the Steam nickname of the user
#
# @return [String] The Steam nickname of the user
#
# source://steam-condenser//lib/steam-condenser/community/steam_id.rb#58
def nickname; end
# Returns whether the owner of this SteamID is currently logged into Steam
#
# @return [Boolean] `true` if the user is online
#
# source://steam-condenser//lib/steam-condenser/community/steam_id.rb#437
def online?; end
# source://steam-condenser//lib/steam-condenser/community/steam_id.rb#225
def original_fetch; end
# Returns the privacy state of this Steam ID
#
# @return [String] The privacy state of this Steam ID
#
# source://steam-condenser//lib/steam-condenser/community/steam_id.rb#63
def privacy_state; end
# Returns whether this Steam ID is publicly accessible
#
# @return [Boolean] `true` if this Steam ID is public
#
# source://steam-condenser//lib/steam-condenser/community/steam_id.rb#444
def public?; end
# Returns the real name of this user
#
# @return [String] The real name of this user
#
# source://steam-condenser//lib/steam-condenser/community/steam_id.rb#68
def real_name; end
# Returns the time in minutes this user has played this game in the last
# two weeks
#
# @param app_id [Fixnum] The application ID of the game
# @return [Fixnum] The number of minutes this user played the given game in
# the last two weeks
#
# source://steam-condenser//lib/steam-condenser/community/steam_id.rb#454
def recent_playtime(app_id); end
# Returns the message corresponding to this user's online state
#
# @return [String] The message corresponding to this user's online state
# @see #ingame?
# @see #online?
#
# source://steam-condenser//lib/steam-condenser/community/steam_id.rb#75
def state_message; end
# Returns this user's 64bit SteamID
#
# If the SteamID is not known yet it is resolved from the vanity URL.
#
# @return [Fixnum] This user's 64bit SteamID
# @see .resolve_vanity_url
#
# source://steam-condenser//lib/steam-condenser/community/steam_id.rb#464
def steam_id64; end
# Returns the current Steam level of this user
#
# If the Steam level hasn't been updated yet, this is done now.
#
# @return [Fixnum] The current Steam level of this user
# @see #update_steam_level
#
# source://steam-condenser//lib/steam-condenser/community/steam_id.rb#474
def steam_level; end
# Returns the summary this user has provided
#
# @return [String] This user's summary
#
# source://steam-condenser//lib/steam-condenser/community/steam_id.rb#80
def summary; end
# Returns the total time in minutes this user has played this game
#
# @param app_id [Fixnum] The application ID of the game
# @return [Fixnum] The total number of minutes this user played the given
# game
#
# source://steam-condenser//lib/steam-condenser/community/steam_id.rb#483
def total_playtime(app_id); end
# Returns this user's ban state in Steam's trading system
#
# @return [String] This user's trading ban state
#
# source://steam-condenser//lib/steam-condenser/community/steam_id.rb#85
def trade_ban_state; end
# Updates the Steam level of this user using the Web API
#
# @return [Fixnum] The current Steam level of this user
# @see #steam_level
#
# source://steam-condenser//lib/steam-condenser/community/steam_id.rb#491
def update_steam_level; end
# Returns the visibility state of this Steam ID
#
# @return [Fixnum] This Steam ID's visibility State
#
# source://steam-condenser//lib/steam-condenser/community/steam_id.rb#90
def visibility_state; end
class << self
# Converts a 64bit numeric SteamID as used by the Steam Community to the
# legacy SteamID format
#
# @param community_id [Fixnum] The SteamID string as used by the Steam
# Community
# @raise [Error] if the community ID is to small
# @return [String] The converted SteamID, like `STEAM_0:0:12345`
#
# source://steam-condenser//lib/steam-condenser/community/steam_id.rb#99
def community_id_to_steam_id(community_id); end
# Converts a 64bit numeric SteamID as used by the Steam Community to the
# modern SteamID format (also known as SteamID 3)
#
# @param community_id [Fixnum] The SteamID string as used by the Steam
# Community
# @raise [Error] if the community ID is to small
# @return [String] The converted SteamID, like `[U:1:12345]`
#
# source://steam-condenser//lib/steam-condenser/community/steam_id.rb#119
def community_id_to_steam_id3(community_id); end
# Creates a new `SteamId` instance using a SteamID as used on servers
#
# The SteamID from the server is converted into a 64bit numeric SteamID
# first before this is used to retrieve the corresponding Steam Community
# profile.
#
# @param steam_id [String] The SteamID string as used on servers, like
# `STEAM_0:0:12345`
# @return [SteamId] The `SteamId` belonging to the given SteamID
# @see .convert_steam_id_to_community_id
# @see #initialize
#
# source://steam-condenser//lib/steam-condenser/community/steam_id.rb#177
def from_steam_id(steam_id); end
# source://steam-condenser//lib/steam-condenser/community/cacheable.rb#38
def method_added(name); end
# Resolves a vanity URL of a Steam Community profile to a 64bit numeric
# SteamID
#
# @param vanity_url [String] The vanity URL of a Steam Community profile
# @return [Fixnum] The 64bit numeric SteamID
#
# source://steam-condenser//lib/steam-condenser/community/steam_id.rb#136
def resolve_vanity_url(vanity_url); end
# Converts a SteamID as reported by game servers to a 64bit numeric SteamID
# as used by the Steam Community
#
# @param steam_id [String] The SteamID string as used on servers, like
# `STEAM_0:0:12345`
# @raise [Error] if the SteamID doesn't have the correct format
# @return [Fixnum] The converted 64bit numeric SteamID
#
# source://steam-condenser//lib/steam-condenser/community/steam_id.rb#152
def steam_id_to_community_id(steam_id); end
end
end
# Represents the inventory (aka. Backpack) of a player of the public Team
# Fortress 2 beta
#
# @author Sebastian Staudt
#
# source://steam-condenser//lib/steam-condenser/community/tf2/tf2_beta_inventory.rb#15
class SteamCondenser::Community::TF2BetaInventory < ::SteamCondenser::Community::GameInventory
# Creates a new inventory object for the given SteamID64 in the Team Fortress
# 2 beta (App ID 520)
#
# @overload initialize
# @param steam_id64 [Fixnum] The 64bit SteamID of the player to get the
# inventory for
# @param fetch [Boolean] if `true` the object's data is fetched after
# creation
# @param bypass_cache [Boolean] if `true` the object's data is fetched again
# even if it has been cached already
# @return [TF2BetaInventory] a new instance of TF2BetaInventory
#
# source://steam-condenser//lib/steam-condenser/community/tf2/tf2_beta_inventory.rb#26
def initialize(steam_id64); end
end
# The Steam application ID of the Team Fortress 2 beta
#
# source://steam-condenser//lib/steam-condenser/community/tf2/tf2_beta_inventory.rb#18
SteamCondenser::Community::TF2BetaInventory::APP_ID = T.let(T.unsafe(nil), Integer)
# Represents the special Team Fortress 2 item Golden Wrench. It includes the
# ID of the item, the serial number of the wrench, a reference to the SteamID
# of the owner and the date this player crafted the wrench
#
# @author Sebastian Staudt
#
# source://steam-condenser//lib/steam-condenser/community/tf2/tf2_golden_wrench.rb#18
class SteamCondenser::Community::TF2GoldenWrench
# Creates a new instance of a Golden Wrench with the given data
#
# @param wrench_data [Hash<Symbol, Object>] The JSON data for this wrench
# @return [TF2GoldenWrench] a new instance of TF2GoldenWrench
#
# source://steam-condenser//lib/steam-condenser/community/tf2/tf2_golden_wrench.rb#65
def initialize(wrench_data); end
# Returns the date this Golden Wrench has been crafted
#
# @return [Time] The crafting date of this wrench
#
# source://steam-condenser//lib/steam-condenser/community/tf2/tf2_golden_wrench.rb#23
def date; end
# Returns the unique item ID of this Golden Wrench
#
# @return [Fixnum] The ID of this wrench
#
# source://steam-condenser//lib/steam-condenser/community/tf2/tf2_golden_wrench.rb#28
def id; end
# Returns the serial number of this Golden Wrench
#
# @return [Fixnum] The serial of this wrench
#
# source://steam-condenser//lib/steam-condenser/community/tf2/tf2_golden_wrench.rb#33
def number; end
# Returns the SteamID of the owner of this Golden Wrench
#
# @return [SteamId] The owner of this wrench
#
# source://steam-condenser//lib/steam-condenser/community/tf2/tf2_golden_wrench.rb#38
def owner; end
class << self
# Returns all Golden Wrenches
#
# @raise [Error] if an error occurs querying the Web API or the Steam
# Community
# @return [Array<GoldenWrench>] All Golden Wrenches
#
# source://steam-condenser//lib/steam-condenser/community/tf2/tf2_golden_wrench.rb#47
def golden_wrenches; end
end
end
# Represents the inventory (aka. Backpack) of a Team Fortress 2 player
#
# @author Sebastian Staudt
#
# source://steam-condenser//lib/steam-condenser/community/tf2/tf2_inventory.rb#14
class SteamCondenser::Community::TF2Inventory < ::SteamCondenser::Community::GameInventory
# Creates a new inventory object for the given SteamID64 in Team Fortress 2
# (App ID 440)
#
# @overload initialize
# @param steam_id64 [Fixnum] The 64bit SteamID of the player to get the
# inventory for
# @param fetch [Boolean] if `true` the object's data is fetched after
# creation
# @param bypass_cache [Boolean] if `true` the object's data is fetched again
# even if it has been cached already
# @return [TF2Inventory] a new instance of TF2Inventory
#
# source://steam-condenser//lib/steam-condenser/community/tf2/tf2_inventory.rb#25
def initialize(steam_id64); end
end
# The Steam application ID of Team Fortress 2
#
# source://steam-condenser//lib/steam-condenser/community/tf2/tf2_inventory.rb#17
SteamCondenser::Community::TF2Inventory::APP_ID = T.let(T.unsafe(nil), Integer)
# Represents a Team Fortress 2 item
#
# @author Sebastian Staudt
#
# source://steam-condenser//lib/steam-condenser/community/tf2/tf2_item.rb#13
class SteamCondenser::Community::TF2Item < ::SteamCondenser::Community::GameItem
# Creates a new instance of a TF2 item with the given data
#
# @param inventory [TF2Inventory] The inventory this item is contained in
# @param item_data [Hash<Symbol, Object>] The data specifying this item
# @raise [Error::WebApi] on Web API errors
# @return [TF2Item] a new instance of TF2Item
#
# source://steam-condenser//lib/steam-condenser/community/tf2/tf2_item.rb#29
def initialize(inventory, item_data); end
# Returns the class symbols for each class this player has equipped this item
#
# @return [Array<String>] The names of the classes this player has equipped
# this item
#
# source://steam-condenser//lib/steam-condenser/community/tf2/tf2_item.rb#44
def classes_equipped?; end
# Returns whether this item is equipped by this player at all
#
# @return [Boolean] `true` if the player has equipped this item at all
#
# source://steam-condenser//lib/steam-condenser/community/tf2/tf2_item.rb#51
def equipped?; end
# Returns the slot where this item can be equipped in or `nil` if this item
# cannot be equipped
#
# @return [String, nil] The slot where this item can be equipped in
#
# source://steam-condenser//lib/steam-condenser/community/tf2/tf2_item.rb#22
def slot; end
end
# The names of the classes available in Team Fortress 2
#
# source://steam-condenser//lib/steam-condenser/community/tf2/tf2_item.rb#16
SteamCondenser::Community::TF2Item::CLASSES = T.let(T.unsafe(nil), Array)
# source://steam-condenser//lib/steam-condenser/community/uri.rb#4
module SteamCondenser::Community::URI
class << self
# source://steam-condenser//lib/steam-condenser/community/uri.rb#6
def open(*args); end
end
end
# This module provides functionality for accessing Steam's Web API
#
# The Web API requires you to register a domain with your Steam account to
# acquire an API key. See http://steamcommunity.com/dev for further details.
#
# @author Sebastian Staudt
#
# source://steam-condenser//lib/steam-condenser/community/web_api.rb#19
module SteamCondenser::Community::WebApi
include ::SteamCondenser::Logging
class << self
# Returns the Steam Web API key currently used by Steam Condenser
#
# @return [String] The currently active Steam Web API key
#
# source://steam-condenser//lib/steam-condenser/community/web_api.rb#30
def api_key; end
# Sets the Steam Web API key
#
# @param api_key [String] The 128bit API key as a hexadecimal string that
# has to be requested from http://steamcommunity.com/dev
# @raise [Error::WebApi] if the given API key is not a valid 128bit
# hexadecimal string
#
# source://steam-condenser//lib/steam-condenser/community/web_api.rb#40
def api_key=(api_key); end
# Fetches data from Steam Web API using the specified interface, method and
# version. Additional parameters are supplied via HTTP GET. Data is
# returned as a string in the given format.
#
# @param format [Symbol] The format to load from the API (`:json`, `:vdf`,
# or `:xml`)
# @param interface [String] The Web API interface to call, e.g.
# `ISteamUser`
# @param method [String] The Web API method to call, e.g.
# `GetPlayerSummaries`
# @param version [Fixnum] The API method version to use
# @param params [Hash<Symbol, Object>] Additional parameters to supply via
# HTTP GET
# @raise [Error::WebApi] if the request to Steam's Web API fails
# @return [String] The data as replied by the Web API in the desired format
#
# source://steam-condenser//lib/steam-condenser/community/web_api.rb#123
def get(format, interface, method, version = T.unsafe(nil), params = T.unsafe(nil)); end
# Returns a raw list of interfaces and their methods that are available in
# Steam's Web API
#
# This can be used for reference when accessing interfaces and methods that
# have not yet been implemented by Steam Condenser.
#
# @return [Array<Hash>] The list of interfaces and methods
#
# source://steam-condenser//lib/steam-condenser/community/web_api.rb#62
def interfaces; end
# Fetches JSON data from Steam Web API using the specified interface,
# method and version. Additional parameters are supplied via HTTP GET.
# Data is returned as a Hash containing the JSON data.
#
# @param interface [String] The Web API interface to call, e.g.
# `ISteamUser`
# @param method [String] The Web API method to call, e.g.
# `GetPlayerSummaries`
# @param version [Fixnum] The API method version to use
# @param params [Hash<Symbol, Object>] Additional parameters to supply via
# HTTP GET
# @raise [Error::WebApi] if the request to Steam's Web API fails
# @return [Hash<Symbol, Object>] The JSON data replied to the request
#
# source://steam-condenser//lib/steam-condenser/community/web_api.rb#79
def json(interface, method, version = T.unsafe(nil), params = T.unsafe(nil)); end
# Fetches JSON data from Steam Web API using the specified interface,
# method and version. Additional parameters are supplied via HTTP GET.
# Data is returned as a Hash containing the JSON data.
#
# @param interface [String] The Web API interface to call, e.g.
# `ISteamUser`
# @param method [String] The Web API method to call, e.g.
# `GetPlayerSummaries`
# @param version [Fixnum] The API method version to use
# @param params [Hash<Symbol, Object>] Additional parameters to supply via
# HTTP GET
# @raise [Error::WebApi] if the request to Steam's Web API fails
# @return [Hash<Symbol, Object>] The JSON data replied to the request
#
# source://steam-condenser//lib/steam-condenser/community/web_api.rb#97
def json!(interface, method, version = T.unsafe(nil), params = T.unsafe(nil)); end
# source://steam-condenser//lib/steam-condenser/logging.rb#28
def log; end
# Sets whether HTTPS should be used for the communication with the Web API
#
# @param secure [Boolean] Whether to use HTTPS
#
# source://steam-condenser//lib/steam-condenser/community/web_api.rb#51
def secure=(secure); end
end
end
# This class provides basic functionality to parse XML data
#
# @author Sebastian Staudt
#
# source://steam-condenser//lib/steam-condenser/community/xml_data.rb#14
module SteamCondenser::Community::XMLData
# Parse the given URL as XML data using `multi_xml`
#
# @param url [String] The URL to parse
# @raise [Error] if an error occurs while parsing the XML data
# @return [Hash<String, Object>] The data parsed from the XML document
#
# source://steam-condenser//lib/steam-condenser/community/xml_data.rb#20
def parse(url); end
end
# This error class is used as a base class for all errors related to Steam
# Condenser's operation
#
# @author Sebastian Staudt
#
# source://steam-condenser//lib/steam-condenser/error.rb#12
class SteamCondenser::Error < ::StandardError
# Creates a new `Error` instance
#
# @param message [String] The message to attach to the error
# @param cause [Exception] The exception that caused this error
# @return [Error] a new instance of Error
#
# source://steam-condenser//lib/steam-condenser/error.rb#23
def initialize(message, cause = T.unsafe(nil)); end
# Returns the exception that caused this error
#
# @return [Exception] The exception that caused this error
#
# source://steam-condenser//lib/steam-condenser/error.rb#17
def cause; end
end
# source://steam-condenser//lib/steam-condenser/error/packet_format.rb#14
class SteamCondenser::Error::PacketFormat < ::SteamCondenser::Error; end
# source://steam-condenser//lib/steam-condenser/error/rcon_ban.rb#18
class SteamCondenser::Error::RCONBan < ::SteamCondenser::Error
# source://steam-condenser//lib/steam-condenser/error/rcon_ban.rb#21
def initialize; end
end
# source://steam-condenser//lib/steam-condenser/error/rcon_no_auth.rb#16
class SteamCondenser::Error::RCONNoAuth < ::SteamCondenser::Error
# source://steam-condenser//lib/steam-condenser/error/rcon_no_auth.rb#19
def initialize; end
end
# source://steam-condenser//lib/steam-condenser/error/timeout.rb#19
class SteamCondenser::Error::Timeout < ::SteamCondenser::Error
# source://steam-condenser//lib/steam-condenser/error/timeout.rb#22
def initialize; end
end
# source://steam-condenser//lib/steam-condenser/error/web_api.rb#16
class SteamCondenser::Error::WebApi < ::SteamCondenser::Error
# source://steam-condenser//lib/steam-condenser/error/web_api.rb#45
def initialize(cause, status_code = T.unsafe(nil), status_message = T.unsafe(nil)); end
end
# This module is included by all classes of Steam Condenser that log events
#
# It is a lightweight wrapper around Ruby's `Logger` class from the standard
# library.
#
# source://steam-condenser//lib/steam-condenser/logging.rb#12
module SteamCondenser::Logging
# Returns the logger for the current class
#
# @return [Logger] The logger for the current class
#
# source://steam-condenser//lib/steam-condenser/logging.rb#69
def log; end
class << self
# Sets the default formatter to use for all logging events in Steam
# Condenser
#
# @param formatter [#call] The formatter to use when logging
#
# source://steam-condenser//lib/steam-condenser/logging.rb#46
def formatter=(formatter); end
# Creates a logger for the class that includes this module
#
# Additionally it defines a `.log` singleton method for the class that
# includes this module
#
# @param klass [Class] The class that includes this module
#
# source://steam-condenser//lib/steam-condenser/logging.rb#26
def included(klass); end
# Sets the default log level to use for filtering all logging events in
# Steam Condenser
#
# @param level [Fixnum] The log level to use when logging
#
# source://steam-condenser//lib/steam-condenser/logging.rb#62
def level=(level); end
# Sets the default logging device to use for all logging events in Steam
# Condenser
#
# @param logdev [IO] For example an output stream or file to log to
#
# source://steam-condenser//lib/steam-condenser/logging.rb#54
def logdev=(logdev); end
end
end
# This module is used as a wrapper around Steam Condenser's server classes
#
# It does not provide any own functionality, but this file is used to easily
# require classes to interact with servers
#
# @author Sebastian Staudt
#
# source://steam-condenser//lib/steam-condenser/servers.rb#14
module SteamCondenser::Servers; end
# This module is included by all classes implementing server functionality
#
# It provides basic name resolution features and the ability to rotate between
# different IP addresses belonging to a single DNS name.
#
# @author Sebastian Staudt
#
# source://steam-condenser//lib/steam-condenser/servers/base_server.rb#18
module SteamCondenser::Servers::BaseServer
# Creates a new server instance with the given address and port
#
# @param address [String] Either an IP address, a DNS name or one of them
# combined with the port number. If a port number is given, e.g.
# 'server.example.com:27016' it will override the second argument.
# @param port [Fixnum] The port the server is listening on
# @raise [Error] if an host name cannot be resolved
# @see init_socket
#
# source://steam-condenser//lib/steam-condenser/servers/base_server.rb#38
def initialize(address, port = T.unsafe(nil)); end
# Disconnect the connections to this server
#
# @note In the base implementation this does nothing, only connection-based
# communication channels have to be disconnected.
#
# source://steam-condenser//lib/steam-condenser/servers/base_server.rb#62
def disconnect; end
# Returns a list of host names associated with this server
#
# @return [Array<String>] The host names of this server
#
# source://steam-condenser//lib/steam-condenser/servers/base_server.rb#23
def host_names; end
# Returns a list of IP addresses associated with this server
#
# @return [Array<String>] The IP addresses of this server
#
# source://steam-condenser//lib/steam-condenser/servers/base_server.rb#28
def ip_addresses; end
# Rotate this server's IP address to the next one in the IP list
#
# If this method returns `true`, it indicates that all IP addresses have been
# used, hinting at the server(s) being unreachable. An appropriate action
# should be taken to inform the user.
#
# Servers with only one IP address will always cause this method to return
# `true` and the sockets will not be reinitialized.
#
# @return [Boolean] `true`, if the IP list reached its end. If the list
# contains only one IP address, this method will instantly return
# `true`
# @see #init_socket
#
# source://steam-condenser//lib/steam-condenser/servers/base_server.rb#78
def rotate_ip; end
protected
# Execute an action in the context of this server's current IP address
#
# Any failure will cause the IP to rotate to the next IP in the server's IP
# list and the execution will be repeated for the next IP address. If the IP
# rotation reaches the end of the list, the error will be reraised.
#
# @param proc [Proc] The action to be executed in a failsafe way
# @see #rotate_ip
#
# source://steam-condenser//lib/steam-condenser/servers/base_server.rb#99
def failsafe(&proc); end
# Initializes the socket(s) to communicate with the server
#
# @abstract Must be implemented in including classes to prepare sockets for
# server communication
#
# source://steam-condenser//lib/steam-condenser/servers/base_server.rb#113
def init_socket; end
end
# This module is included by classes representing different game server
# implementations and provides the basic functionality to communicate with
# them using the common query protocol
#
# @author Sebastian Staudt
#
# source://steam-condenser//lib/steam-condenser/servers/game_server.rb#28
module SteamCondenser::Servers::GameServer
include ::SteamCondenser::Servers::BaseServer
# Creates a new instance of a game server object
#
# @param address [String] Either an IP address, a DNS name or one of them
# combined with the port number. If a port number is given, e.g.
# 'server.example.com:27016' it will override the second argument.
# @param port [Fixnum] The port the server is listening on
# @raise [Error] if an host name cannot be resolved
#
# source://steam-condenser//lib/steam-condenser/servers/game_server.rb#91
def initialize(address, port = T.unsafe(nil)); end
# Sends the specified request to the server and handles the returned response
#
# Depending on the given request type this will fill the various data
# attributes of the server object.
#
# @param request_type [Symbol] The type of request to send to the server
# @param repeat_on_failure [Boolean] Whether the request should be repeated,
# if the replied packet isn't expected. This is useful to handle
# missing challenge numbers, which will be automatically filled in,
# although not requested explicitly.
# @raise [Error] if either the request type or the response
# packet is not known
#
# source://steam-condenser//lib/steam-condenser/servers/game_server.rb#207
def handle_response_for_request(request_type, repeat_on_failure = T.unsafe(nil)); end
# Initializes this server object with basic information
#
# @see #update_challenge_number
# @see #update_ping
# @see #update_server_info
#
# source://steam-condenser//lib/steam-condenser/servers/game_server.rb#255
def init; end
# Returns the last measured response time of this server
#
# If the latency hasn't been measured yet, it is done when calling this
# method for the first time.
#
# If this information is vital to you, be sure to call {#update_ping}
# regularly to stay up-to-date.
#
# @return [Fixnum] The latency of this server in milliseconds
# @see #update_ping
#
# source://steam-condenser//lib/steam-condenser/servers/game_server.rb#107
def ping; end
# Returns a list of players currently playing on this server
#
# If the players haven't been fetched yet, it is done when calling this
# method for the first time.
#
# As the players and their scores change quite often be sure to update this
# list regularly by calling {#update_players} if you rely on this
# information.
#
# @param rcon_password [String] The RCON password of this server may be
# provided to gather more detailed information on the players, like
# STEAM_IDs.
# @return [Hash] The players on this server
# @see update_players
#
# source://steam-condenser//lib/steam-condenser/servers/game_server.rb#126
def players(rcon_password = T.unsafe(nil)); end
# Authenticates the connection for RCON communication with the server
#
# @abstract Must be be implemented by including classes to handle the
# authentication
# @param password [String] The RCON password of the server
# @raise [NotImplementedError]
# @return [Boolean] whether the authentication was successful
# @see #rcon_exec
#
# source://steam-condenser//lib/steam-condenser/servers/game_server.rb#138
def rcon_auth(password); end
# Returns whether the RCON connection to this server is already authenticated
#
# @return [Boolean] `true` if the RCON connection is authenticated
# @see #rcon_auth
#
# source://steam-condenser//lib/steam-condenser/servers/game_server.rb#146
def rcon_authenticated?; end
# Remotely executes a command on the server via RCON
#
# @abstract Must be be implemented by including classes to handle the command
# execution
# @param command [String] The command to execute on the server
# @raise [NotImplementedError]
# @return [String] The output of the executed command
# @see #rcon_auth
#
# source://steam-condenser//lib/steam-condenser/servers/game_server.rb#157
def rcon_exec(command); end
# Returns the settings applied on the server. These settings are also called
# rules.
#
# If the rules haven't been fetched yet, it is done when calling this method
# for the first time.
#
# As the rules usually don't change often, there's almost no need to update
# this hash. But if you need to, you can achieve this by calling
# {#update_rules}.
#
# @return [Hash<String, String>] The currently active server rules
# @see #update_rules
#
# source://steam-condenser//lib/steam-condenser/servers/game_server.rb#173
def rules; end
# Returns a hash with basic information on the server.
#
# If the server information haven't been fetched yet, it is done when
# calling this method for the first time.
#
# The server information usually only changes on map change and when players
# join or leave. As the latter changes can be monitored by calling
# {#update_players}, there's no need to call {#update_server_info} very
# often.
#
# @return [Hash] Server attributes with their values
# @see #update_server_info
#
# source://steam-condenser//lib/steam-condenser/servers/game_server.rb#190
def server_info; end
# Returns a human-readable text representation of the server
#
# @return [String] Available information about the server in a human-readable
# format
#
# source://steam-condenser//lib/steam-condenser/servers/game_server.rb#355
def to_s; end
# Sends a A2S_SERVERQUERY_GETCHALLENGE request to the server and updates the
# challenge number used to communicate with this server
#
# There's usually no need to call this method explicitly, because
# {#handle_response_for_request} will automatically get the challenge number
# when the server assigns a new one.
#
# @see #handle_response_for_request
# @see #init
#
# source://steam-condenser//lib/steam-condenser/servers/game_server.rb#331
def update_challenge_number; end
# Sends a A2S_INFO request to the server and measures the time needed for the
# reply
#
# If this information is vital to you, be sure to call this method regularly
# to stay up-to-date.
#
# @return [Fixnum] The latency of this server in milliseconds
# @see #ping
#
# source://steam-condenser//lib/steam-condenser/servers/game_server.rb#343
def update_ping; end
# Sends a A2S_PLAYERS request to the server and updates the players' data for
# this server
#
# As the players and their scores change quite often be sure to update this
# list regularly by calling this method if you rely on this
# information.
#
# @param rcon_password [String] The RCON password of this server may be
# provided to gather more detailed information on the players, like
# STEAM_IDs.
# @see #handle_response_for_request
# @see #players
#
# source://steam-condenser//lib/steam-condenser/servers/game_server.rb#273
def update_players(rcon_password = T.unsafe(nil)); end
# Sends a A2S_RULES request to the server and updates the rules of this
# server
#
# As the rules usually don't change often, there's almost no need to update
# this hash. But if you need to, you can achieve this by calling this method.
#
# @see #handle_response_for_request
# @see #rules
#
# source://steam-condenser//lib/steam-condenser/servers/game_server.rb#305
def update_rules; end
# Sends a A2S_INFO request to the server and updates this server's basic
# information
#
# The server information usually only changes on map change and when players
# join or leave. As the latter changes can be monitored by calling
# {#update_players}, there's no need to call this method very often.
#
# @see #handle_response_for_request
# @see #server_info
#
# source://steam-condenser//lib/steam-condenser/servers/game_server.rb#318
def update_server_info; end
class << self
# Parses the player attribute names supplied by `rcon status`
#
# @param status_header [String] The header line provided by `rcon status`
# @return [Array<Symbol>] Split player attribute names
# @see .split_player_status
#
# source://steam-condenser//lib/steam-condenser/servers/game_server.rb#37
def player_status_attributes(status_header); end
# Splits the player status obtained with `rcon status`
#
# @param attributes [Array<Symbol>] The attribute names
# @param player_status [String] The status line of a single player
# @return [Hash<Symbol, String>] The attributes with the corresponding values
# for this player
# @see .player_status_attributes
#
# source://steam-condenser//lib/steam-condenser/servers/game_server.rb#57
def split_player_status(attributes, player_status); end
end
end
# This class represents a GoldSrc game server and can be used to query
# information about and remotely execute commands via RCON on the server
#
# A GoldSrc game server is an instance of the Half-Life Dedicated Server
# (HLDS) running games using Valve's GoldSrc engine, like Half-Life
# Deathmatch, Counter-Strike 1.6 or Team Fortress Classic.
#
# @author Sebastian Staudt
# @see SourceServer
#
# source://steam-condenser//lib/steam-condenser/servers/goldsrc_server.rb#23
class SteamCondenser::Servers::GoldSrcServer
include ::SteamCondenser::Servers::BaseServer
include ::SteamCondenser::Servers::GameServer
include ::SteamCondenser::Logging
# Creates a new instance of a GoldSrc server object
#
# @param address [String] Either an IP address, a DNS name or one of them
# combined with the port number. If a port number is given, e.g.
# 'server.example.com:27016' it will override the second argument.
# @param port [Fixnum] The port the server is listening on
# @param is_hltv [Boolean] HLTV servers need special treatment, so this
# is used to determine if the server is a HLTV server
# @raise [Error] if an host name cannot be resolved
# @return [GoldSrcServer] a new instance of GoldSrcServer
#
# source://steam-condenser//lib/steam-condenser/servers/goldsrc_server.rb#45
def initialize(address, port = T.unsafe(nil), is_hltv = T.unsafe(nil)); end
# Initializes the socket to communicate with the GoldSrc server
#
# @see GoldSrcSocket
#
# source://steam-condenser//lib/steam-condenser/servers/goldsrc_server.rb#54
def init_socket; end
# Tries to establish RCON authentication with the server with the given
# password
#
# This will send an empty command that will ensure the given password was
# correct. If successful, the password is stored for future use.
#
# @param password [String] The RCON password of the server
# @return [Boolean] `true` if authentication was successful
# @see #rcon_exec
#
# source://steam-condenser//lib/steam-condenser/servers/goldsrc_server.rb#67
def rcon_auth(password); end
# Remotely executes a command on the server via RCON
#
# @param command [String] The command to execute on the server via RCON
# @raise [Error::RCONNoAuth]
# @return [String] The output of the executed command
# @see #rcon_auth
#
# source://steam-condenser//lib/steam-condenser/servers/goldsrc_server.rb#85
def rcon_exec(command); end
class << self
# source://steam-condenser//lib/steam-condenser/logging.rb#28
def log; end
# Returns a master server instance for the default master server for
# GoldSrc games
#
# @return [MasterServer] The GoldSrc master server
#
# source://steam-condenser//lib/steam-condenser/servers/goldsrc_server.rb#32
def master; end
end
end
# This class represents a Steam master server and can be used to get game
# servers which are publicly available
#
# An intance of this class can be used much like Steam's server browser to get
# a list of available game servers, including filters to narrow down the search
# results.
#
# @author Sebastian Staudt
#
# source://steam-condenser//lib/steam-condenser/servers/master_server.rb#23
class SteamCondenser::Servers::MasterServer
include ::SteamCondenser::Servers::BaseServer
include ::SteamCondenser::Logging
# Initializes the socket to communicate with the master server
#
# @see MasterServerSocket
#
# source://steam-condenser//lib/steam-condenser/servers/master_server.rb#75
def init_socket; end
# Returns a list of game server matching the given region and filters
#
# Filtering:
# Instead of filtering the results sent by the master server locally, you
# should at least use the following filters to narrow down the results sent
# by the master server.
#
# Available filters:
#
# * `\type\d`: Request only dedicated servers
# * `\secure\1`: Request only secure servers
# * `\gamedir\[mod]`: Request only servers of a specific mod
# * `\map\[mapname]`: Request only servers running a specific map
# * `\linux\1`: Request only linux servers
# * `\empty\1`: Request only **non**-empty servers
# * `\full\1`: Request only servers **not** full
# * `\proxy\1`: Request only spectator proxy servers
#
# @note Receiving all servers from the master server is taking quite some
# time.
# @param region_code [Fixnum] The region code to specify a location of the
# game servers
# @param filters [String] The filters that game servers should match
# @param force [Boolean] Return a list of servers even if an error occured
# while fetching them from the master server
# @raise [Error::Timeout] if too many timeouts occur while querying the
# master server
# @return [Array<Array<String>>] A list of game servers matching the given
# region and filters
# @see A2M_GET_SERVERS_BATCH2_Packet
# @see MasterServer.retries=
#
# source://steam-condenser//lib/steam-condenser/servers/master_server.rb#110
def servers(region_code = T.unsafe(nil), filters = T.unsafe(nil), force = T.unsafe(nil)); end
class << self
# source://steam-condenser//lib/steam-condenser/logging.rb#28
def log; end
# Sets the number of consecutive requests that may fail, before getting
# the server list is cancelled (default: 3)
#
# @param retries [Fixnum] The number of allowed retries
#
# source://steam-condenser//lib/steam-condenser/servers/master_server.rb#68
def retries=(retries); end
end
end
# The master server address to query for GoldSrc game servers
#
# source://steam-condenser//lib/steam-condenser/servers/master_server.rb#32
SteamCondenser::Servers::MasterServer::GOLDSRC_MASTER_SERVER = T.let(T.unsafe(nil), Array)
# The region code for Africa
#
# source://steam-condenser//lib/steam-condenser/servers/master_server.rb#59
SteamCondenser::Servers::MasterServer::REGION_AFRICA = T.let(T.unsafe(nil), Integer)
# The region code for the whole world
#
# source://steam-condenser//lib/steam-condenser/servers/master_server.rb#62
SteamCondenser::Servers::MasterServer::REGION_ALL = T.let(T.unsafe(nil), Integer)
# The region code for Asia
#
# source://steam-condenser//lib/steam-condenser/servers/master_server.rb#50
SteamCondenser::Servers::MasterServer::REGION_ASIA = T.let(T.unsafe(nil), Integer)
# The region code for Australia
#
# source://steam-condenser//lib/steam-condenser/servers/master_server.rb#53
SteamCondenser::Servers::MasterServer::REGION_AUSTRALIA = T.let(T.unsafe(nil), Integer)
# The region code for Europe
#
# source://steam-condenser//lib/steam-condenser/servers/master_server.rb#47
SteamCondenser::Servers::MasterServer::REGION_EUROPE = T.let(T.unsafe(nil), Integer)
# The region code for the Middle East
#
# source://steam-condenser//lib/steam-condenser/servers/master_server.rb#56
SteamCondenser::Servers::MasterServer::REGION_MIDDLE_EAST = T.let(T.unsafe(nil), Integer)
# The region code for South America
#
# source://steam-condenser//lib/steam-condenser/servers/master_server.rb#44
SteamCondenser::Servers::MasterServer::REGION_SOUTH_AMERICA = T.let(T.unsafe(nil), Integer)
# The region code for the US east coast
#
# source://steam-condenser//lib/steam-condenser/servers/master_server.rb#38
SteamCondenser::Servers::MasterServer::REGION_US_EAST_COAST = T.let(T.unsafe(nil), Integer)
# The region code for the US west coast
#
# source://steam-condenser//lib/steam-condenser/servers/master_server.rb#41
SteamCondenser::Servers::MasterServer::REGION_US_WEST_COAST = T.let(T.unsafe(nil), Integer)
# The master server address to query for Source game servers
#
# source://steam-condenser//lib/steam-condenser/servers/master_server.rb#35
SteamCondenser::Servers::MasterServer::SOURCE_MASTER_SERVER = T.let(T.unsafe(nil), Array)
# source://steam-condenser//lib/steam-condenser/servers/packets/base_packet.rb#10
module SteamCondenser::Servers::Packets; end
# This packet class represents a A2M_GET_SERVERS_BATCH2 request sent to a
# master server
#
# It is used to receive a list of game servers matching the specified
# filters.
#
# Filtering:
# Instead of filtering the results sent by the master server locally, you
# should at least use the following filters to narrow down the results sent
# by the master server. Receiving all servers from the master server is
# taking quite some time.
#
# Available filters:
#
# * `\type\d`: Request only dedicated servers
# * `\secure\1`: Request only secure servers
# * `\gamedir\[mod]`: Request only servers of a specific mod
# * `\map\[mapname]`: Request only servers running a specific map
# * `\linux\1`: Request only linux servers
# * `\emtpy\1`: Request only **non**-empty servers
# * `\full\`: Request only servers **not** full
# * `\proxy\1`: Request only spectator proxy servers
#
# @author Sebastian Staudt
# @see MasterServer#servers
#
# source://steam-condenser//lib/steam-condenser/servers/packets/a2m_get_servers_batch2_packet.rb#36
class SteamCondenser::Servers::Packets::A2M_GET_SERVERS_BATCH2_Packet
include ::SteamCondenser::Servers::Packets::BasePacket
# Creates a master server request, filtering by the given paramters
#
# @param region_code [Numeric] The region code to filter servers by region
# @param start_ip [String] This should be the last IP received from the
# master server or 0.0.0.0
# @param filter [String] The filters to apply in the form
# "\filtername\value..."
# @return [A2M_GET_SERVERS_BATCH2_Packet] a new instance of A2M_GET_SERVERS_BATCH2_Packet
#
# source://steam-condenser//lib/steam-condenser/servers/packets/a2m_get_servers_batch2_packet.rb#47
def initialize(region_code = T.unsafe(nil), start_ip = T.unsafe(nil), filter = T.unsafe(nil)); end
# Returns the raw data representing this packet
#
# @return [String] A string containing the raw data of this request packet
#
# source://steam-condenser//lib/steam-condenser/servers/packets/a2m_get_servers_batch2_packet.rb#58
def to_s; end
end
# This packet class class represents a A2S_INFO request send to a game server
#
# It will cause the server to send some basic information about itself, e.g.
# the running game, map and the number of players.
#
# @author Sebastian Staudt
# @see GameServer#update_server_info
#
# source://steam-condenser//lib/steam-condenser/servers/packets/a2s_info_packet.rb#17
class SteamCondenser::Servers::Packets::A2S_INFO_Packet
include ::SteamCondenser::Servers::Packets::BasePacket
# Creates a new A2S_INFO request object
#
# @return [A2S_INFO_Packet] a new instance of A2S_INFO_Packet
#
# source://steam-condenser//lib/steam-condenser/servers/packets/a2s_info_packet.rb#22
def initialize; end
end
# This packet class represents a A2S_PLAYER request send to a game server
#
# It is used to request the list of players currently playing on the server.
#
# This packet type requires the client to challenge the server in advance,
# which is done automatically if required.
#
# @author Sebastian Staudt
# @see GameServer#update_player_info
#
# source://steam-condenser//lib/steam-condenser/servers/packets/a2s_player_packet.rb#20
class SteamCondenser::Servers::Packets::A2S_PLAYER_Packet
include ::SteamCondenser::Servers::Packets::BasePacket
include ::SteamCondenser::Servers::Packets::RequestWithChallenge
# Creates a new A2S_PLAYER request object including the challenge number
#
# @param challenge_number [Numeric] The challenge number received from the
# server
# @return [A2S_PLAYER_Packet] a new instance of A2S_PLAYER_Packet
#
# source://steam-condenser//lib/steam-condenser/servers/packets/a2s_player_packet.rb#29
def initialize(challenge_number = T.unsafe(nil)); end
end
# This packet class represents a A2S_RULES request send to a game server
#
# The game server will return a list of currently active game rules, e.g.
# `mp_friendlyfire = 1`.
#
# This packet type requires the client to challenge the server in advance,
# which is done automatically if required.
#
# @author Sebastian Staudt
# @see GameServer#update_rules_info
#
# source://steam-condenser//lib/steam-condenser/servers/packets/a2s_rules_packet.rb#21
class SteamCondenser::Servers::Packets::A2S_RULES_Packet
include ::SteamCondenser::Servers::Packets::BasePacket
include ::SteamCondenser::Servers::Packets::RequestWithChallenge
# Creates a new A2S_RULES request object including the challenge number
#
# @param challenge_number [Numeric] The challenge number received from the
# server
# @return [A2S_RULES_Packet] a new instance of A2S_RULES_Packet
#
# source://steam-condenser//lib/steam-condenser/servers/packets/a2s_rules_packet.rb#30
def initialize(challenge_number = T.unsafe(nil)); end
end
# This packet class represents a A2S_SERVERQUERY_GETCHALLENGE request send to
# a game server
#
# It is used to retrieve a challenge number from the game server, which helps
# to identify the requesting client.
#
# @author Sebastian Staudt
# @see GameServer#update_challenge_number
#
# source://steam-condenser//lib/steam-condenser/servers/packets/a2s_serverquery_getchallenge_packet.rb#18
class SteamCondenser::Servers::Packets::A2S_SERVERQUERY_GETCHALLENGE_Packet
include ::SteamCondenser::Servers::Packets::BasePacket
# Creates a new A2S_SERVERQUERY_GETCHALLENGE request object
#
# @return [A2S_SERVERQUERY_GETCHALLENGE_Packet] a new instance of A2S_SERVERQUERY_GETCHALLENGE_Packet
#
# source://steam-condenser//lib/steam-condenser/servers/packets/a2s_serverquery_getchallenge_packet.rb#23
def initialize; end
end
# This module implements the basic functionality used by most of the packets
# used in communication with master, Source or GoldSrc servers.
#
# @author Sebastian Staudt
# @see SteamPacketFactory
#
# source://steam-condenser//lib/steam-condenser/servers/packets/base_packet.rb#17
module SteamCondenser::Servers::Packets::BasePacket
# Creates a new packet object based on the given data
#
# @param header_data [Fixnum] The packet header
# @param content_data [String] The raw data of the packet
#
# source://steam-condenser//lib/steam-condenser/servers/packets/base_packet.rb#40
def initialize(header_data, content_data = T.unsafe(nil)); end
# Returns the raw data representing this packet
#
# @return [String] A string containing the raw data of this request packet
#
# source://steam-condenser//lib/steam-condenser/servers/packets/base_packet.rb#48
def to_s; end
end
# source://steam-condenser//lib/steam-condenser/servers/packets/base_packet.rb#19
SteamCondenser::Servers::Packets::BasePacket::A2M_GET_SERVERS_BATCH2_HEADER = T.let(T.unsafe(nil), Integer)
# source://steam-condenser//lib/steam-condenser/servers/packets/base_packet.rb#20
SteamCondenser::Servers::Packets::BasePacket::A2S_INFO_HEADER = T.let(T.unsafe(nil), Integer)
# source://steam-condenser//lib/steam-condenser/servers/packets/base_packet.rb#21
SteamCondenser::Servers::Packets::BasePacket::A2S_PLAYER_HEADER = T.let(T.unsafe(nil), Integer)
# source://steam-condenser//lib/steam-condenser/servers/packets/base_packet.rb#22
SteamCondenser::Servers::Packets::BasePacket::A2S_RULES_HEADER = T.let(T.unsafe(nil), Integer)
# source://steam-condenser//lib/steam-condenser/servers/packets/base_packet.rb#23
SteamCondenser::Servers::Packets::BasePacket::A2S_SERVERQUERY_GETCHALLENGE_HEADER = T.let(T.unsafe(nil), Integer)
# source://steam-condenser//lib/steam-condenser/servers/packets/base_packet.rb#24
SteamCondenser::Servers::Packets::BasePacket::C2M_CHECKMD5_HEADER = T.let(T.unsafe(nil), Integer)
# source://steam-condenser//lib/steam-condenser/servers/packets/base_packet.rb#25
SteamCondenser::Servers::Packets::BasePacket::M2A_SERVER_BATCH_HEADER = T.let(T.unsafe(nil), Integer)
# source://steam-condenser//lib/steam-condenser/servers/packets/base_packet.rb#26
SteamCondenser::Servers::Packets::BasePacket::RCON_GOLDSRC_CHALLENGE_HEADER = T.let(T.unsafe(nil), Integer)
# source://steam-condenser//lib/steam-condenser/servers/packets/base_packet.rb#27
SteamCondenser::Servers::Packets::BasePacket::RCON_GOLDSRC_NO_CHALLENGE_HEADER = T.let(T.unsafe(nil), Integer)
# source://steam-condenser//lib/steam-condenser/servers/packets/base_packet.rb#28
SteamCondenser::Servers::Packets::BasePacket::RCON_GOLDSRC_RESPONSE_HEADER = T.let(T.unsafe(nil), Integer)
# source://steam-condenser//lib/steam-condenser/servers/packets/base_packet.rb#30
SteamCondenser::Servers::Packets::BasePacket::S2A_INFO2_HEADER = T.let(T.unsafe(nil), Integer)
# source://steam-condenser//lib/steam-condenser/servers/packets/base_packet.rb#29
SteamCondenser::Servers::Packets::BasePacket::S2A_INFO_DETAILED_HEADER = T.let(T.unsafe(nil), Integer)
# source://steam-condenser//lib/steam-condenser/servers/packets/base_packet.rb#31
SteamCondenser::Servers::Packets::BasePacket::S2A_PLAYER_HEADER = T.let(T.unsafe(nil), Integer)
# source://steam-condenser//lib/steam-condenser/servers/packets/base_packet.rb#32
SteamCondenser::Servers::Packets::BasePacket::S2A_RULES_HEADER = T.let(T.unsafe(nil), Integer)
# source://steam-condenser//lib/steam-condenser/servers/packets/base_packet.rb#34
SteamCondenser::Servers::Packets::BasePacket::S2C_CHALLENGE_HEADER = T.let(T.unsafe(nil), Integer)
# source://steam-condenser//lib/steam-condenser/servers/packets/base_packet.rb#33
SteamCondenser::Servers::Packets::BasePacket::S2C_CONNREJECT_HEADER = T.let(T.unsafe(nil), Integer)
# This packet class represents a M2A_SERVER_BATCH response replied by a master
# server
#
# It contains a list of IP addresses and ports of game servers matching the
# requested criteria.
#
# @author Sebastian Staudt
# @see MasterServer#servers
#
# source://steam-condenser//lib/steam-condenser/servers/packets/m2a_server_batch_packet.rb#19
class SteamCondenser::Servers::Packets::M2A_SERVER_BATCH_Packet
include ::SteamCondenser::Servers::Packets::BasePacket
# Creates a new M2A_SERVER_BATCH response object based on the given data
#
# @param data [String] The raw packet data replied from the server
# @raise [Error::PacketFormat] if the packet data is not well formatted
# @return [M2A_SERVER_BATCH_Packet] a new instance of M2A_SERVER_BATCH_Packet
#
# source://steam-condenser//lib/steam-condenser/servers/packets/m2a_server_batch_packet.rb#33
def initialize(data); end
# Returns the list of servers returned from the server in this packet
#
# @return [Array<String>] An array of server addresses (i.e. IP addresses +
# port numbers)
#
# source://steam-condenser//lib/steam-condenser/servers/packets/m2a_server_batch_packet.rb#27
def servers; end
end
# source://steam-condenser//lib/steam-condenser/servers/packets/rcon/rcon_goldsrc_request.rb#8
module SteamCondenser::Servers::Packets::RCON; end
# This module is included by all classes representing a packet used by
# Source's RCON protocol
#
# It provides a basic implementation for initializing and serializing such a
# packet.
#
# @author Sebastian Staudt
# @see RCONPacketFactory
#
# source://steam-condenser//lib/steam-condenser/servers/packets/rcon/base_packet.rb#20
module SteamCondenser::Servers::Packets::RCON::BasePacket
include ::SteamCondenser::Servers::Packets::BasePacket
# Creates a new RCON packet object with the given request ID, type and
# content data
#
# @param request_id [Fixnum] The request ID for the current RCON
# communication
# @param rcon_header [Fixnum] The header for the packet type
# @param rcon_data [String] The raw packet data
#
# source://steam-condenser//lib/steam-condenser/servers/packets/rcon/base_packet.rb#48
def initialize(request_id, rcon_header, rcon_data); end
# Returns the request ID used to identify the RCON communication
#
# @return [Fixnum] The request ID used to identify the RCON communication
#
# source://steam-condenser//lib/steam-condenser/servers/packets/rcon/base_packet.rb#39
def request_id; end
# Returns the raw data representing this packet
#
# @return [String] A string containing the raw data of this RCON packet
#
# source://steam-condenser//lib/steam-condenser/servers/packets/rcon/base_packet.rb#57
def to_s; end
end
# Header for authentication requests
#
# source://steam-condenser//lib/steam-condenser/servers/packets/rcon/base_packet.rb#25
SteamCondenser::Servers::Packets::RCON::BasePacket::SERVERDATA_AUTH = T.let(T.unsafe(nil), Integer)
# Header for replies to authentication attempts
#
# source://steam-condenser//lib/steam-condenser/servers/packets/rcon/base_packet.rb#28
SteamCondenser::Servers::Packets::RCON::BasePacket::SERVERDATA_AUTH_RESPONSE = T.let(T.unsafe(nil), Integer)
# Header for command execution requests
#
# source://steam-condenser//lib/steam-condenser/servers/packets/rcon/base_packet.rb#31
SteamCondenser::Servers::Packets::RCON::BasePacket::SERVERDATA_EXECCOMMAND = T.let(T.unsafe(nil), Integer)
# Header for packets with the output of a command execution
#
# source://steam-condenser//lib/steam-condenser/servers/packets/rcon/base_packet.rb#34
SteamCondenser::Servers::Packets::RCON::BasePacket::SERVERDATA_RESPONSE_VALUE = T.let(T.unsafe(nil), Integer)
# This packet class represents a SERVERDATA_AUTH request sent to a Source
# server
#
# It is used to authenticate the client for RCON communication.
#
# @author Sebastian Staudt
# @see SourceServer#rcon_auth
#
# source://steam-condenser//lib/steam-condenser/servers/packets/rcon/rcon_auth_request.rb#17
class SteamCondenser::Servers::Packets::RCON::RCONAuthRequest
include ::SteamCondenser::Servers::Packets::BasePacket
include ::SteamCondenser::Servers::Packets::RCON::BasePacket
# Creates a RCON authentication request for the given request ID and RCON
# password
#
# @param request_id [Fixnum] The request ID of the RCON connection
# @param rcon_password [String] The RCON password of the server
# @return [RCONAuthRequest] a new instance of RCONAuthRequest
#
# source://steam-condenser//lib/steam-condenser/servers/packets/rcon/rcon_auth_request.rb#26
def initialize(request_id, rcon_password); end
end
# This packet class represents a SERVERDATA_AUTH_RESPONSE packet sent by a
# Source server
#
# It is used to indicate the success or failure of an authentication attempt
# of a client for RCON communication.
#
# @author Sebastian Staudt
# @see SourceServer#rcon_auth
#
# source://steam-condenser//lib/steam-condenser/servers/packets/rcon/rcon_auth_response.rb#18
class SteamCondenser::Servers::Packets::RCON::RCONAuthResponse
include ::SteamCondenser::Servers::Packets::BasePacket
include ::SteamCondenser::Servers::Packets::RCON::BasePacket
# Creates a RCON authentication response for the given request ID
#
# The request ID of the packet will match the client's request if
# authentication was successful
#
# @param request_id [Fixnum] The request ID of the RCON connection
# @return [RCONAuthResponse] a new instance of RCONAuthResponse
#
# source://steam-condenser//lib/steam-condenser/servers/packets/rcon/rcon_auth_response.rb#28
def initialize(request_id); end
end
# This packet class represents a SERVERDATA_EXECCOMMAND packet sent to a
# Source server
#
# It is used to request a command execution on the server.
#
# @author Sebastian Staudt
# @see SourceServer#rcon_exec
#
# source://steam-condenser//lib/steam-condenser/servers/packets/rcon/rcon_exec_request.rb#17
class SteamCondenser::Servers::Packets::RCON::RCONExecRequest
include ::SteamCondenser::Servers::Packets::BasePacket
include ::SteamCondenser::Servers::Packets::RCON::BasePacket
# Creates a RCON command execution request for the given request ID and
# command
#
# @param request_id [Fixnum] The request ID of the RCON connection
# @param rcon_command [String] The command to execute on the server
# @return [RCONExecRequest] a new instance of RCONExecRequest
#
# source://steam-condenser//lib/steam-condenser/servers/packets/rcon/rcon_exec_request.rb#26
def initialize(request_id, rcon_command); end
end
# This packet class represents a SERVERDATA_RESPONSE_VALUE packet sent by a
# Source server
#
# It is used to transport the output of a command from the server to the
# client which requested the command execution.
#
# @author Sebastian Staudt
# @see SourceServer#rcon_exec
#
# source://steam-condenser//lib/steam-condenser/servers/packets/rcon/rcon_exec_response.rb#18
class SteamCondenser::Servers::Packets::RCON::RCONExecResponse
include ::SteamCondenser::Servers::Packets::BasePacket
include ::SteamCondenser::Servers::Packets::RCON::BasePacket
# Creates a RCON command response for the given request ID and command
# output
#
# @param request_id [Fixnum] The request ID of the RCON connection
# @param command_response [String] The output of the command executed on
# the server
# @return [RCONExecResponse] a new instance of RCONExecResponse
#
# source://steam-condenser//lib/steam-condenser/servers/packets/rcon/rcon_exec_response.rb#28
def initialize(request_id, command_response); end
# Returns the output of the command execution
#
# @return [String] The output of the command
#
# source://steam-condenser//lib/steam-condenser/servers/packets/rcon/rcon_exec_response.rb#35
def response; end
end
# This packet class represents a RCON request packet sent to a GoldSrc server
#
# It is used to request a command execution on the server.
#
# @author Sebastian Staudt
# @see GoldSrcServer#rcon_exec
#
# source://steam-condenser//lib/steam-condenser/servers/packets/rcon/rcon_goldsrc_request.rb#16
class SteamCondenser::Servers::Packets::RCON::RCONGoldSrcRequest
include ::SteamCondenser::Servers::Packets::BasePacket
# Creates a request for the given request string
#
# The request string has the form `rcon {challenge number} {RCON password}
# {command}`.
#
# @param request [String] The request string to send to the server
# @return [RCONGoldSrcRequest] a new instance of RCONGoldSrcRequest
#
# source://steam-condenser//lib/steam-condenser/servers/packets/rcon/rcon_goldsrc_request.rb#26
def initialize(request); end
# Returns the raw data representing this packet
#
# @return [String] A string containing the raw data of this request packet
#
# source://steam-condenser//lib/steam-condenser/servers/packets/rcon/rcon_goldsrc_request.rb#33
def to_s; end
end
# This packet class represents a RCON response packet sent by a GoldSrc
# server
#
# It is used to transport the output of a command from the server to the
# client which requested the command execution.
#
# @author Sebastian Staudt
# @see GoldSrcServer#rcon_exec
#
# source://steam-condenser//lib/steam-condenser/servers/packets/rcon/rcon_goldsrc_response.rb#18
class SteamCondenser::Servers::Packets::RCON::RCONGoldSrcResponse
include ::SteamCondenser::Servers::Packets::BasePacket
# Creates a RCON command response for the given command output
#
# @param command_response [String] The output of the command executed on
# the server
# @return [RCONGoldSrcResponse] a new instance of RCONGoldSrcResponse
#
# source://steam-condenser//lib/steam-condenser/servers/packets/rcon/rcon_goldsrc_response.rb#26
def initialize(command_response); end
# Returns the output of the command execution
#
# @return [String] The output of the command
#
# source://steam-condenser//lib/steam-condenser/servers/packets/rcon/rcon_goldsrc_response.rb#33
def response; end
end
# This module provides functionality to handle raw packet data for Source
# RCON
#
# It's is used to transform data bytes into packet objects for RCON
# communication with Source servers.
#
# @author Sebastian Staudt
# @see BasePacket
#
# source://steam-condenser//lib/steam-condenser/servers/packets/rcon/rcon_packet_factory.rb#22
module SteamCondenser::Servers::Packets::RCON::RCONPacketFactory
class << self
# Creates a new packet object based on the header byte of the given raw
# data
#
# @param raw_data [String] The raw data of the packet
# @raise [Error::PacketFormat] if the packet header is not recognized
# @return [BasePacket] The packet object generated from the packet data
#
# source://steam-condenser//lib/steam-condenser/servers/packets/rcon/rcon_packet_factory.rb#30
def packet_from_data(raw_data); end
end
end
# This packet class represents a special SERVERDATA_RESPONSE_VALUE packet
# which is sent to the server
#
# It is used to determine the end of a RCON response from Source servers.
# Packets of this type are sent after the actual RCON command and the empty
# response packet from the server will indicate the end of the response.
#
# @author Sebastian Staudt
# @see SourceServer#rcon_exec
#
# source://steam-condenser//lib/steam-condenser/servers/packets/rcon/rcon_terminator.rb#19
class SteamCondenser::Servers::Packets::RCON::RCONTerminator
include ::SteamCondenser::Servers::Packets::BasePacket
include ::SteamCondenser::Servers::Packets::RCON::BasePacket
# Creates a new RCON terminator packet instance for the given request ID
#
# @param request_id [Fixnum] The request ID for the current RCON
# communication
# @return [RCONTerminator] a new instance of RCONTerminator
#
# source://steam-condenser//lib/steam-condenser/servers/packets/rcon/rcon_terminator.rb#27
def initialize(request_id); end
end
# This module implements a method to generate raw packet data used by request
# packets which send a challenge number
#
# @author Sebastian Staudt
#
# source://steam-condenser//lib/steam-condenser/servers/packets/request_with_challenge.rb#12
module SteamCondenser::Servers::Packets::RequestWithChallenge
# Returns the raw data representing this packet
#
# @return [String] A string containing the raw data of this request packet
#
# source://steam-condenser//lib/steam-condenser/servers/packets/request_with_challenge.rb#17
def to_s; end
end
# This class represents a S2A_INFO_DETAILED response packet sent by a Source
# or GoldSrc server
#
# Out-of-date (before 10/24/2008) GoldSrc servers use an older format (see
# {S2A_INFO_DETAILED_Packet}).
#
# @author Sebastian Staudt
# @see GameServer#update_server_info
#
# source://steam-condenser//lib/steam-condenser/servers/packets/s2a_info2_packet.rb#18
class SteamCondenser::Servers::Packets::S2A_INFO2_Packet
include ::SteamCondenser::Servers::Packets::BasePacket
include ::SteamCondenser::Servers::Packets::S2A_INFO_BasePacket
# Creates a new S2A_INFO2 response object based on the given data
#
# @param data [String] The raw packet data replied from the server
# @return [S2A_INFO2_Packet] a new instance of S2A_INFO2_Packet
# @see S2A_INFO_BasePacket#generate_info_hash
#
# source://steam-condenser//lib/steam-condenser/servers/packets/s2a_info2_packet.rb#32
def initialize(data); end
end
# source://steam-condenser//lib/steam-condenser/servers/packets/s2a_info2_packet.rb#22
SteamCondenser::Servers::Packets::S2A_INFO2_Packet::EDF_GAME_ID = T.let(T.unsafe(nil), Integer)
# source://steam-condenser//lib/steam-condenser/servers/packets/s2a_info2_packet.rb#23
SteamCondenser::Servers::Packets::S2A_INFO2_Packet::EDF_GAME_PORT = T.let(T.unsafe(nil), Integer)
# source://steam-condenser//lib/steam-condenser/servers/packets/s2a_info2_packet.rb#24
SteamCondenser::Servers::Packets::S2A_INFO2_Packet::EDF_SERVER_ID = T.let(T.unsafe(nil), Integer)
# source://steam-condenser//lib/steam-condenser/servers/packets/s2a_info2_packet.rb#25
SteamCondenser::Servers::Packets::S2A_INFO2_Packet::EDF_SERVER_TAGS = T.let(T.unsafe(nil), Integer)
# source://steam-condenser//lib/steam-condenser/servers/packets/s2a_info2_packet.rb#26
SteamCondenser::Servers::Packets::S2A_INFO2_Packet::EDF_SOURCE_TV = T.let(T.unsafe(nil), Integer)
# This module implements methods to generate and access server information
# from S2A_INFO_DETAILED and S2A_INFO2 response packets
#
# @author Sebastian Staudt
# @see S2A_INFO_DETAILED_Packet
# @see S2A_INFO2_Packet
#
# source://steam-condenser//lib/steam-condenser/servers/packets/s2a_info_base_packet.rb#16
module SteamCondenser::Servers::Packets::S2A_INFO_BasePacket
include ::SteamCondenser::Servers::Packets::BasePacket
# Returns the information provided by the server
#
# @return [Hash<String, Object>] The information provided by the server
#
# source://steam-condenser//lib/steam-condenser/servers/packets/s2a_info_base_packet.rb#23
def info; end
end
# This class represents a S2A_INFO_DETAILED response packet sent by a GoldSrc
# server
#
# @author Sebastian Staudt
# @deprecated Only outdated GoldSrc servers (before 10/24/2008) use this
# format. Newer ones use the same format as Source servers now
# (see {S2A_INFO2_Packet}).
# @see GameServer#update_server_info
#
# source://steam-condenser//lib/steam-condenser/servers/packets/s2a_info_detailed_packet.rb#18
class SteamCondenser::Servers::Packets::S2A_INFO_DETAILED_Packet
include ::SteamCondenser::Servers::Packets::BasePacket
include ::SteamCondenser::Servers::Packets::S2A_INFO_BasePacket
# Creates a new S2A_INFO_DETAILED response object based on the given data
#
# @param data [String] The raw packet data replied from the server
# @return [S2A_INFO_DETAILED_Packet] a new instance of S2A_INFO_DETAILED_Packet
# @see S2A_INFO_BasePacket#generate_info_hash
#
# source://steam-condenser//lib/steam-condenser/servers/packets/s2a_info_detailed_packet.rb#26
def initialize(data); end
end
# This class represents a S2A_LOGSTRING packet used to transfer log messages
#
# @author Sebastian Staudt
#
# source://steam-condenser//lib/steam-condenser/servers/packets/s2a_logstring_packet.rb#13
class SteamCondenser::Servers::Packets::S2A_LOGSTRING_Packet
include ::SteamCondenser::Servers::Packets::BasePacket
# Creates a new S2A_LOGSTRING object based on the given data
#
# @param data [String] The raw packet data sent by the server
# @return [S2A_LOGSTRING_Packet] a new instance of S2A_LOGSTRING_Packet
#
# source://steam-condenser//lib/steam-condenser/servers/packets/s2a_logstring_packet.rb#25
def initialize(data); end
# Returns the log message contained in this packet
#
# @return [String] The log message
#
# source://steam-condenser//lib/steam-condenser/servers/packets/s2a_logstring_packet.rb#20
def message; end
end
# This class represents a S2A_PLAYER response sent by a game server
#
# It is used to transfer a list of players currently playing on the server.
#
# @author Sebastian Staudt
# @see GameServer#update_player_info
#
# source://steam-condenser//lib/steam-condenser/servers/packets/s2a_player_packet.rb#17
class SteamCondenser::Servers::Packets::S2A_PLAYER_Packet
include ::SteamCondenser::Servers::Packets::BasePacket
# Creates a new S2A_PLAYER response object based on the given data
#
# @param content_data [String] The raw packet data sent by the server
# @raise [Error::PacketFormat] if the packet data is not well formatted
# @return [S2A_PLAYER_Packet] a new instance of S2A_PLAYER_Packet
#
# source://steam-condenser//lib/steam-condenser/servers/packets/s2a_player_packet.rb#30
def initialize(content_data); end
# Returns the list of active players provided by the server
#
# @return [Hash<String, SteamPlayer>] All active players on the server
#
# source://steam-condenser//lib/steam-condenser/servers/packets/s2a_player_packet.rb#24
def player_hash; end
end
# This class represents a S2A_RULES response sent by a game server
#
# It is used to transfer a list of server rules (a.k.a. CVARs) with their
# active values.
#
# @author Sebastian Staudt
# @see GameServer#update_rules_info
#
# source://steam-condenser//lib/steam-condenser/servers/packets/s2a_rules_packet.rb#17
class SteamCondenser::Servers::Packets::S2A_RULES_Packet
include ::SteamCondenser::Servers::Packets::BasePacket
# Creates a new S2A_RULES response object based on the given data
#
# @param content_data [String] The raw packet data sent by the server
# @return [S2A_RULES_Packet] a new instance of S2A_RULES_Packet
#
# source://steam-condenser//lib/steam-condenser/servers/packets/s2a_rules_packet.rb#29
def initialize(content_data); end
# Returns the list of server rules (a.k.a. CVars) with the current values
#
# @return [Hash<String, String>] A list of server rules
#
# source://steam-condenser//lib/steam-condenser/servers/packets/s2a_rules_packet.rb#24
def rules_hash; end
end
# This packet class represents a S2C_CHALLENGE response replied by a game
# server
#
# It is used to provide a challenge number to a client requesting information
# from the game server.
#
# @author Sebastian Staudt
# @see GameServer#update_challenge_number
#
# source://steam-condenser//lib/steam-condenser/servers/packets/s2c_challenge_packet.rb#18
class SteamCondenser::Servers::Packets::S2C_CHALLENGE_Packet
include ::SteamCondenser::Servers::Packets::BasePacket
# Creates a new S2C_CHALLENGE response object based on the given data
#
# @param challenge_number [String] The raw packet data replied from the
# server
# @return [S2C_CHALLENGE_Packet] a new instance of S2C_CHALLENGE_Packet
#
# source://steam-condenser//lib/steam-condenser/servers/packets/s2c_challenge_packet.rb#26
def initialize(challenge_number); end
# Returns the challenge number received from the game server
#
# @return [Fixnum] The challenge number provided by the game server
#
# source://steam-condenser//lib/steam-condenser/servers/packets/s2c_challenge_packet.rb#33
def challenge_number; end
end
# This module provides functionality to handle raw packet data, including
# data split into several UDP / TCP packets and BZIP2 compressed data. It's
# the main utility to transform data bytes into packet objects.
#
# @author Sebastian Staudt
# @see BasePacket
#
# source://steam-condenser//lib/steam-condenser/servers/packets/steam_packet_factory.rb#31
module SteamCondenser::Servers::Packets::SteamPacketFactory
class << self
# Creates a new packet object based on the header byte of the given raw
# data
#
# @param raw_data [String] The raw data of the packet
# @raise [Error::PacketFormat] if the packet header is not recognized
# @return [BasePacket] The packet object generated from the packet data
#
# source://steam-condenser//lib/steam-condenser/servers/packets/steam_packet_factory.rb#39
def packet_from_data(raw_data); end
# Reassembles the data of a split and/or compressed packet into a single
# packet object
#
# @param split_packets [Array<String>] An array of packet data
# @param is_compressed [Boolean] whether the data of this packet is
# compressed
# @param packet_checksum [Fixnum] The CRC32 checksum of the decompressed
# packet data
# @raise [Error::PacketFormat] if the calculated CRC32 checksum does not
# match the expected value
# @return [BasePacket] The reassembled packet
# @see packet_from_data
#
# source://steam-condenser//lib/steam-condenser/servers/packets/steam_packet_factory.rb#87
def reassemble_packet(split_packets, is_compressed = T.unsafe(nil), packet_checksum = T.unsafe(nil)); end
end
end
# source://steam-condenser//lib/steam-condenser/servers/sockets/base_socket.rb#14
module SteamCondenser::Servers::Sockets; end
# This module implements common functionality for sockets used to connect to
# game and master servers
#
# @author Sebastian Staudt
#
# source://steam-condenser//lib/steam-condenser/servers/sockets/base_socket.rb#20
module SteamCondenser::Servers::Sockets::BaseSocket
# Creates a new UDP socket to communicate with the server on the given IP
# address and port
#
# @param ip_address [String] Either the IP address or the DNS name of the
# server
# @param port [Fixnum] The port the server is listening on
#
# source://steam-condenser//lib/steam-condenser/servers/sockets/base_socket.rb#42
def initialize(ip_address, port = T.unsafe(nil)); end
# Closes the underlying socket
#
# source://steam-condenser//lib/steam-condenser/servers/sockets/base_socket.rb#48
def close; end
# Reads the given amount of data from the socket and wraps it into the
# buffer
#
# @param buffer_length [Fixnum] The data length to read from the socket
# @raise [Error::Timeout] if no packet is received on time
# @return [Fixnum] The number of bytes that have been read from the socket
# @see StringIO
#
# source://steam-condenser//lib/steam-condenser/servers/sockets/base_socket.rb#59
def receive_packet(buffer_length = T.unsafe(nil)); end
# Sends the given packet to the server
#
# This converts the packet into a byte stream first before writing it to
# the socket.
#
# @param data_packet [Packets::BasePacket] The packet to send to the
# server
# @see Packets::BasePacket#to_s
#
# source://steam-condenser//lib/steam-condenser/servers/sockets/base_socket.rb#91
def send_packet(data_packet); end
class << self
# Sets the timeout for socket operations
#
# Any request that takes longer than this time will cause a
# {Error::Timeout}.
#
# @param timeout [Fixnum] The amount of milliseconds before a request times
# out
#
# source://steam-condenser//lib/steam-condenser/servers/sockets/base_socket.rb#32
def timeout=(timeout); end
end
end
# This class represents a socket used to communicate with game servers based
# on the GoldSrc engine (e.g. Half-Life, Counter-Strike)
#
# @author Sebastian Staudt
#
# source://steam-condenser//lib/steam-condenser/servers/sockets/goldsrc_socket.rb#20
class SteamCondenser::Servers::Sockets::GoldSrcSocket
include ::SteamCondenser::Servers::Sockets::BaseSocket
include ::SteamCondenser::Logging
# Creates a new socket to communicate with the server on the given IP
# address and port
#
# @param ipaddress [String] Either the IP address or the DNS name of the
# server
# @param port_number [Fixnum] The port the server is listening on
# @param is_hltv [Boolean] `true` if the target server is a HTLV instance.
# HLTV behaves slightly different for RCON commands, this flag
# increases compatibility.
# @return [GoldSrcSocket] a new instance of GoldSrcSocket
#
# source://steam-condenser//lib/steam-condenser/servers/sockets/goldsrc_socket.rb#35
def initialize(ipaddress, port_number = T.unsafe(nil), is_hltv = T.unsafe(nil)); end
# Requests a challenge number from the server to be used for further
# requests
#
# @raise [Error::RCONBan] if the IP of the local machine has been banned on
# the game server
# @see #rcon_send
#
# source://steam-condenser//lib/steam-condenser/servers/sockets/goldsrc_socket.rb#130
def rcon_challenge; end
# Executes the given command on the server via RCON
#
# @param password [String] The password to authenticate with the server
# @param command [String] The command to execute on the server
# @raise [Error::RCONBan] if the IP of the local machine has been banned on
# the game server
# @raise [Error::RCONNoAuth] if the password is incorrect
# @return [RCONGoldSrcResponse] The response replied by the server
# @see #rcon_challenge
# @see #rcon_send
#
# source://steam-condenser//lib/steam-condenser/servers/sockets/goldsrc_socket.rb#94
def rcon_exec(password, command); end
# Wraps the given command in a RCON request packet and send it to the
# server
#
# @param command [String] The RCON command to send to the server
#
# source://steam-condenser//lib/steam-condenser/servers/sockets/goldsrc_socket.rb#145
def rcon_send(command); end
# Reads a packet from the socket
#
# The Source query protocol specifies a maximum packet size of 1,400 bytes.
# Bigger packets will be split over several UDP packets. This method
# reassembles split packets into single packet objects.
#
# @return [BasePacket] The packet replied from the server
#
# source://steam-condenser//lib/steam-condenser/servers/sockets/goldsrc_socket.rb#48
def reply; end
class << self
# source://steam-condenser//lib/steam-condenser/logging.rb#28
def log; end
end
end
# This class represents a socket used to communicate with master servers
#
# @author Sebastian Staudt
#
# source://steam-condenser//lib/steam-condenser/servers/sockets/master_server_socket.rb#14
class SteamCondenser::Servers::Sockets::MasterServerSocket
include ::SteamCondenser::Servers::Sockets::BaseSocket
include ::SteamCondenser::Logging
# Reads a single packet from the socket
#
# @raise [Error::PacketFormat] if the packet has the wrong format
# @return [BasePacket] The packet replied from the server
#
# source://steam-condenser//lib/steam-condenser/servers/sockets/master_server_socket.rb#23
def reply; end
class << self
# source://steam-condenser//lib/steam-condenser/logging.rb#28
def log; end
end
end
# This class represents a socket used for RCON communication with game
# servers based on the Source engine (e.g. Team Fortress 2, Counter-Strike:
# Source)
#
# The Source engine uses a stateful TCP connection for RCON communication and
# uses an additional socket of this type to handle RCON requests.
#
# @author Sebastian Staudt
#
# source://steam-condenser//lib/steam-condenser/servers/sockets/rcon_socket.rb#26
class SteamCondenser::Servers::Sockets::RCONSocket
include ::SteamCondenser::Servers::Sockets::BaseSocket
include ::SteamCondenser::Logging
# Creates a new TCP socket to communicate with the server on the given IP
# address and port
#
# @param ip [String, IPAddr] Either the IP address or the DNS name of the
# server
# @param port [Fixnum] The port the server is listening on
# @return [RCONSocket] a new instance of RCONSocket
#
# source://steam-condenser//lib/steam-condenser/servers/sockets/rcon_socket.rb#37
def initialize(ip, port); end
# Closes the underlying TCP socket if it exists
#
# SteamSocket#close
#
# source://steam-condenser//lib/steam-condenser/servers/sockets/rcon_socket.rb#47
def close; end
# Connects a new TCP socket to the server
#
# @raise [Error::Timeout] if the connection could not be
# established
#
# source://steam-condenser//lib/steam-condenser/servers/sockets/rcon_socket.rb#55
def connect; end
# Reads a packet from the socket
#
# The Source RCON protocol allows packets of an arbitrary sice transmitted
# using multiple TCP packets. The data is received in chunks and
# concatenated into a single response packet.
#
# @raise [Error::RCONBan] if the IP of the local machine has been banned on
# the game server
# @raise [Error::RCONNoAuth] if an authenticated connection has been
# dropped by the server
# @return [Packets::RCON::BasePacket] The packet replied from the server
#
# source://steam-condenser//lib/steam-condenser/servers/sockets/rcon_socket.rb#85
def reply; end
# Sends the given RCON packet to the server
#
# @param data_packet [Packets::RCON::BasePacket] The RCON packet to send to
# the server
# @see #connect
#
# source://steam-condenser//lib/steam-condenser/servers/sockets/rcon_socket.rb#68
def send_packet(data_packet); end
class << self
# source://steam-condenser//lib/steam-condenser/logging.rb#28
def log; end
end
end
# This class represents a socket used to communicate with game servers based
# on the Source engine (e.g. Team Fortress 2, Counter-Strike: Source)
#
# @author Sebastian Staudt
#
# source://steam-condenser//lib/steam-condenser/servers/sockets/source_socket.rb#16
class SteamCondenser::Servers::Sockets::SourceSocket
include ::SteamCondenser::Servers::Sockets::BaseSocket
include ::SteamCondenser::Logging
# Reads a packet from the socket
#
# The Source query protocol specifies a maximum packet size of 1,400 bytes.
# Bigger packets will be split over several UDP packets. This method
# reassembles split packets into single packet objects. Additionally Source
# may compress big packets using bzip2. Those packets will be compressed.
#
# @return [BasePacket] The packet replied from the server
#
# source://steam-condenser//lib/steam-condenser/servers/sockets/source_socket.rb#29
def reply; end
class << self
# source://steam-condenser//lib/steam-condenser/logging.rb#28
def log; end
end
end
# This class represents a Source game server and can be used to query
# information about and remotely execute commands via RCON on the server
#
# A Source game server is an instance of the Source Dedicated Server (SrcDS)
# running games using Valve's Source engine, like Counter-Strike: Source,
# Team Fortress 2 or Left4Dead.
#
# @author Sebastian Staudt
# @see GoldSrcServer
#
# source://steam-condenser//lib/steam-condenser/servers/source_server.rb#32
class SteamCondenser::Servers::SourceServer
include ::SteamCondenser::Servers::BaseServer
include ::SteamCondenser::Servers::GameServer
include ::SteamCondenser::Logging
# Creates a new instance of a server object representing a Source server,
# i.e. SrcDS instance
#
# @param address [String] Either an IP address, a DNS name or one of them
# combined with the port number. If a port number is given, e.g.
# 'server.example.com:27016' it will override the second argument.
# @param port [Fixnum] The port the server is listening on
# @raise [Error] if an host name cannot be resolved
# @return [SourceServer] a new instance of SourceServer
#
# source://steam-condenser//lib/steam-condenser/servers/source_server.rb#53
def initialize(address, port = T.unsafe(nil)); end
# Disconnects the TCP-based channel used for RCON commands
#
# @see RCONSocket#close
#
# source://steam-condenser//lib/steam-condenser/servers/source_server.rb#60
def disconnect; end
# Initializes the sockets to communicate with the Source server
#
# @see RCONSocket
# @see SourceSocket
#
# source://steam-condenser//lib/steam-condenser/servers/source_server.rb#68
def init_socket; end
# Authenticates the connection for RCON communication with the server
#
# @param password [String] The RCON password of the server
# @raise [Error::RCONBan]
# @return [Boolean] whether authentication was successful
# @see #rcon_authenticated?
# @see #rcon_exec
#
# source://steam-condenser//lib/steam-condenser/servers/source_server.rb#79
def rcon_auth(password); end
# Remotely executes a command on the server via RCON
#
# @param command [String] The command to execute on the server via RCON
# @raise [RCONBanException] if the IP of the local machine has been banned on
# the game server
# @raise [RCONNoAuthException] if not authenticated with the server
# @return [String] The output of the executed command
# @see #rcon_auth
#
# source://steam-condenser//lib/steam-condenser/servers/source_server.rb#98
def rcon_exec(command); end
class << self
# source://steam-condenser//lib/steam-condenser/logging.rb#28
def log; end
# Returns a master server instance for the default master server for Source
# games
#
# @return [MasterServer] The Source master server
#
# source://steam-condenser//lib/steam-condenser/servers/source_server.rb#41
def master; end
end
end
# The SteamPlayer class represents a player connected to a server
#
# @author Sebastian Staudt
#
# source://steam-condenser//lib/steam-condenser/servers/steam_player.rb#13
class SteamCondenser::Servers::SteamPlayer
# Creates a new player instance with the given information
#
# @param id [Fixnum] The ID of the player on the server
# @param name [String] The name of the player
# @param score [Fixnum] The score of the player
# @param connect_time [Float] The time the player is connected to the
# server
# @return [SteamPlayer] a new instance of SteamPlayer
#
# source://steam-condenser//lib/steam-condenser/servers/steam_player.rb#82
def initialize(id, name, score, connect_time); end
# Extends a player object with information retrieved from a RCON call to
# the status command
#
# @param player_data [String] The player data retrieved from `rcon status`
# @raise [Error] if the information belongs to another player
#
# source://steam-condenser//lib/steam-condenser/servers/steam_player.rb#95
def add_info(player_data); end
# Returns whether this player is a bot
#
# @return [Boolean] bool `true` if this player is a bot
#
# source://steam-condenser//lib/steam-condenser/servers/steam_player.rb#122
def bot?; end
# Returns the client port of this player
#
# @return [Fixnum] The client port of the player
#
# source://steam-condenser//lib/steam-condenser/servers/steam_player.rb#18
def client_port; end
# Returns the time this player is connected to the server
#
# @return [Float] The connection time of the player
#
# source://steam-condenser//lib/steam-condenser/servers/steam_player.rb#28
def connect_time; end
# Returns the connection ID (as used on the server) of this player
#
# @return [Fixnum] The connection ID of this player
#
# source://steam-condenser//lib/steam-condenser/servers/steam_player.rb#23
def connection_id; end
# Returns whether this player object has extended information gathered
# using RCON
#
# @return [Boolean] bool `true` if extended information for this player is available
#
# source://steam-condenser//lib/steam-condenser/servers/steam_player.rb#130
def extended?; end
# Returns the ID of this player
#
# @return [Fixnum] The ID of this player
#
# source://steam-condenser//lib/steam-condenser/servers/steam_player.rb#33
def id; end
# Returns the IP address of this player
#
# @return [String] The IP address of this player
#
# source://steam-condenser//lib/steam-condenser/servers/steam_player.rb#38
def ip_address; end
# Returns the packet loss of this player's connection
#
# @return [String] The packet loss of this player's connection
#
# source://steam-condenser//lib/steam-condenser/servers/steam_player.rb#48
def loss; end
# Returns the nickname of this player
#
# @return [String] The name of this player
#
# source://steam-condenser//lib/steam-condenser/servers/steam_player.rb#43
def name; end
# Returns the ping of this player
#
# @return [Fixnum] The ping of this player
#
# source://steam-condenser//lib/steam-condenser/servers/steam_player.rb#53
def ping; end
# Returns the rate of this player
#
# @return [Fixnum] The rate of this player
#
# source://steam-condenser//lib/steam-condenser/servers/steam_player.rb#58
def rate; end
# Returns the score of this player
#
# @return [Fixnum] The score of this player
#
# source://steam-condenser//lib/steam-condenser/servers/steam_player.rb#63
def score; end
# Returns the connection state of this player
#
# @return [String] The connection state of this player
#
# source://steam-condenser//lib/steam-condenser/servers/steam_player.rb#68
def state; end
# Returns the SteamID of this player
#
# @return [String] The SteamID of this player
#
# source://steam-condenser//lib/steam-condenser/servers/steam_player.rb#73
def steam_id; end
# Returns a string representation of this player
#
# @return [String] A string representing this player
#
# source://steam-condenser//lib/steam-condenser/servers/steam_player.rb#137
def to_s; end
end
# The current version of Steam Condenser
#
# source://steam-condenser//lib/steam-condenser/version.rb#9
SteamCondenser::VERSION = T.let(T.unsafe(nil), String)
# This extends the `StringIO` class from Ruby's standard library. It adds some
# methods to handle byte-wise input from a `StringIO` object.
#
# @author Sebastian Staudt
#
# source://steam-condenser//lib/core_ext/stringio.rb#12
class StringIO
include ::Enumerable
# Reads a zero-byte terminated string from the current position of the byte
# stream
#
# This reads the stream up until the first occurrence of a zero-byte or the
# end of the stream. The zero-byte is not included in the returned string.
#
# @return [String] The zero-byte terminated string read from the byte stream
#
# source://steam-condenser//lib/core_ext/stringio.rb#80
def cstring; end
# Reads a floating-point integer (32 bit) from the current position of the
# byte stream
#
# @return [Float] The floating-point integer read from the byte stream
#
# source://steam-condenser//lib/core_ext/stringio.rb#28
def float; end
# Reads the whole remaining content of the byte stream from the current
# position to the end
#
# @return [String] The remainder of the byte stream starting from the current
# position of the byte stream
#
# source://steam-condenser//lib/core_ext/stringio.rb#37
def get; end
# Reads an unsigned long integer (32 bit) from the current position of the
# byte stream
#
# @return [Fixnum] The unsigned long integer read from the byte stream
#
# source://steam-condenser//lib/core_ext/stringio.rb#45
def long; end
# Returns the remaining number of bytes from the current position to the end
# of the byte stream
#
# @return [Fixnum] The number of bytes until the end of the stream
#
# source://steam-condenser//lib/core_ext/stringio.rb#53
def remaining; end
# Reads an unsigned short integer (16 bit) from the current position of the
# byte stream
#
# @return [Fixnum] The unsigned short integer read from the byte stream
#
# source://steam-condenser//lib/core_ext/stringio.rb#61
def short; end
# Reads a signed long integer (32 bit) from the current position of the byte
# stream
#
# @return [Fixnum] The signed long integer read from the byte stream
#
# source://steam-condenser//lib/core_ext/stringio.rb#69
def signed_long; end
class << self
# Creates a new instance of `StringIO` with the given size and fills it with
# zero-bytes.
#
# @param size [Fixnum] The size the new instance should have
# @return [StringIO] A new `StringIO` instance with the given size, filled
# with zero-bytes
#
# source://steam-condenser//lib/core_ext/stringio.rb#20
def alloc(size); end
end
end
StringIO::VERSION = T.let(T.unsafe(nil), String)