steam-condenser 1.2.0 → 1.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +7 -7
- data/README.md +9 -2
- data/doc/A2M_GET_SERVERS_BATCH2_Packet.html +426 -0
- data/doc/A2S_INFO_Packet.html +260 -0
- data/doc/A2S_PLAYER_Packet.html +295 -0
- data/doc/A2S_RULES_Packet.html +296 -0
- data/doc/A2S_SERVERQUERY_GETCHALLENGE_Packet.html +261 -0
- data/doc/AbstractL4DStats.html +978 -0
- data/doc/AbstractL4DWeapon.html +734 -0
- data/doc/Achievement.html +660 -0
- data/doc/AlienSwarmMission.html +1557 -0
- data/doc/AlienSwarmStats.html +965 -0
- data/doc/AlienSwarmWeapon.html +640 -0
- data/doc/AppNews.html +1442 -0
- data/doc/C2M_CHECKMD5_Packet.html +341 -0
- data/doc/CSSMap.html +806 -0
- data/doc/CSSStats.html +825 -0
- data/doc/CSSWeapon.html +889 -0
- data/doc/Cacheable.html +913 -0
- data/doc/Cacheable/ClassMethods.html +696 -0
- data/doc/DefenseGridStats.html +2559 -0
- data/doc/DoDSClass.html +1264 -0
- data/doc/DoDSStats.html +486 -0
- data/doc/DoDSWeapon.html +806 -0
- data/doc/Dota2BetaInventory.html +339 -0
- data/doc/Dota2Inventory.html +339 -0
- data/doc/Dota2Item.html +388 -0
- data/doc/Dota2Stats.html +366 -0
- data/doc/GameAchievement.html +1257 -0
- data/doc/GameClass.html +321 -0
- data/doc/GameInventory.html +1363 -0
- data/doc/GameItem.html +1339 -0
- data/doc/GameLeaderboard.html +1609 -0
- data/doc/GameLeaderboardEntry.html +629 -0
- data/doc/GameSchema.html +568 -0
- data/doc/GameServer.html +2405 -0
- data/doc/GameStats.html +1461 -0
- data/doc/GameWeapon.html +590 -0
- data/doc/GoldSrcServer.html +740 -0
- data/doc/GoldSrcSocket.html +850 -0
- data/doc/ItemSchema.html +780 -0
- data/doc/L4D2Map.html +739 -0
- data/doc/L4D2Stats.html +930 -0
- data/doc/L4D2Weapon.html +486 -0
- data/doc/L4DExplosive.html +374 -0
- data/doc/L4DMap.html +776 -0
- data/doc/L4DStats.html +530 -0
- data/doc/L4DWeapon.html +296 -0
- data/doc/M2A_SERVER_BATCH_Packet.html +430 -0
- data/doc/M2C_ISVALIDMD5_Packet.html +383 -0
- data/doc/M2S_REQUESTRESTART_Packet.html +382 -0
- data/doc/MasterServer.html +1070 -0
- data/doc/MasterServerSocket.html +293 -0
- data/doc/Module.html +194 -0
- data/doc/PacketFormatError.html +257 -0
- data/doc/Portal2Inventory.html +339 -0
- data/doc/Portal2Item.html +499 -0
- data/doc/Portal2Stats.html +368 -0
- data/doc/RCONAuthRequest.html +318 -0
- data/doc/RCONAuthResponse.html +305 -0
- data/doc/RCONBanError.html +247 -0
- data/doc/RCONExecRequest.html +318 -0
- data/doc/RCONExecResponse.html +407 -0
- data/doc/RCONGoldSrcRequest.html +363 -0
- data/doc/RCONGoldSrcResponse.html +367 -0
- data/doc/RCONNoAuthError.html +247 -0
- data/doc/RCONPacket.html +548 -0
- data/doc/RCONPacketFactory.html +300 -0
- data/doc/RCONSocket.html +669 -0
- data/doc/RCONTerminator.html +304 -0
- data/doc/RequestWithChallenge.html +233 -0
- data/doc/S2A_INFO2_Packet.html +371 -0
- data/doc/S2A_INFO_BasePacket.html +357 -0
- data/doc/S2A_INFO_DETAILED_Packet.html +370 -0
- data/doc/S2A_LOGSTRING_Packet.html +373 -0
- data/doc/S2A_PLAYER_Packet.html +417 -0
- data/doc/S2A_RULES_Packet.html +411 -0
- data/doc/S2C_CHALLENGE_Packet.html +370 -0
- data/doc/S2M_HEARTBEAT2_Packet.html +444 -0
- data/doc/Server.html +781 -0
- data/doc/SourceServer.html +776 -0
- data/doc/SourceSocket.html +366 -0
- data/doc/StatsAttribute.html +514 -0
- data/doc/SteamCondenser.html +155 -0
- data/doc/SteamCondenser/A2M_GET_SERVERS_BATCH2_Packet.html +413 -0
- data/doc/SteamCondenser/A2S_INFO_Packet.html +249 -0
- data/doc/SteamCondenser/A2S_PLAYER_Packet.html +281 -0
- data/doc/SteamCondenser/A2S_RULES_Packet.html +282 -0
- data/doc/SteamCondenser/A2S_SERVERQUERY_GETCHALLENGE_Packet.html +250 -0
- data/doc/SteamCondenser/AbstractL4DStats.html +954 -0
- data/doc/SteamCondenser/AbstractL4DWeapon.html +703 -0
- data/doc/SteamCondenser/AlienSwarmMission.html +1494 -0
- data/doc/SteamCondenser/AlienSwarmStats.html +938 -0
- data/doc/SteamCondenser/AlienSwarmWeapon.html +614 -0
- data/doc/SteamCondenser/AppNews.html +1387 -0
- data/doc/SteamCondenser/C2M_CHECKMD5_Packet.html +327 -0
- data/doc/SteamCondenser/CSSMap.html +774 -0
- data/doc/SteamCondenser/CSSStats.html +799 -0
- data/doc/SteamCondenser/CSSWeapon.html +855 -0
- data/doc/SteamCondenser/Cacheable.html +698 -0
- data/doc/SteamCondenser/Cacheable/ClassMethods.html +531 -0
- data/doc/SteamCondenser/Community.html +134 -0
- data/doc/SteamCondenser/DefenseGridStats.html +2455 -0
- data/doc/SteamCondenser/DoDSClass.html +1209 -0
- data/doc/SteamCondenser/DoDSStats.html +470 -0
- data/doc/SteamCondenser/DoDSWeapon.html +774 -0
- data/doc/SteamCondenser/Error.html +156 -0
- data/doc/SteamCondenser/Error/PacketFormat.html +246 -0
- data/doc/SteamCondenser/Error/RCONBan.html +237 -0
- data/doc/SteamCondenser/Error/RCONNoAuth.html +236 -0
- data/doc/SteamCondenser/Error/Timeout.html +238 -0
- data/doc/SteamCondenser/Error/WebApi.html +339 -0
- data/doc/SteamCondenser/GameAchievement.html +1210 -0
- data/doc/SteamCondenser/GameClass.html +306 -0
- data/doc/SteamCondenser/GameInventory.html +1236 -0
- data/doc/SteamCondenser/GameItem.html +1282 -0
- data/doc/SteamCondenser/GameLeaderboard.html +1562 -0
- data/doc/SteamCondenser/GameLeaderboardEntry.html +604 -0
- data/doc/SteamCondenser/GameServer.html +2337 -0
- data/doc/SteamCondenser/GameStats.html +1416 -0
- data/doc/SteamCondenser/GameWeapon.html +566 -0
- data/doc/SteamCondenser/GoldSrcServer.html +716 -0
- data/doc/SteamCondenser/GoldSrcSocket.html +831 -0
- data/doc/SteamCondenser/L4D2Map.html +713 -0
- data/doc/SteamCondenser/L4D2Stats.html +906 -0
- data/doc/SteamCondenser/L4D2Weapon.html +466 -0
- data/doc/SteamCondenser/L4DExplosive.html +362 -0
- data/doc/SteamCondenser/L4DMap.html +746 -0
- data/doc/SteamCondenser/L4DStats.html +513 -0
- data/doc/SteamCondenser/L4DWeapon.html +284 -0
- data/doc/SteamCondenser/M2A_SERVER_BATCH_Packet.html +415 -0
- data/doc/SteamCondenser/M2C_ISVALIDMD5_Packet.html +368 -0
- data/doc/SteamCondenser/M2S_REQUESTRESTART_Packet.html +367 -0
- data/doc/SteamCondenser/MasterServer.html +1046 -0
- data/doc/SteamCondenser/MasterServerSocket.html +282 -0
- data/doc/SteamCondenser/Portal2Inventory.html +217 -0
- data/doc/SteamCondenser/Portal2Item.html +483 -0
- data/doc/SteamCondenser/Portal2Stats.html +353 -0
- data/doc/SteamCondenser/RCONAuthRequest.html +306 -0
- data/doc/SteamCondenser/RCONAuthResponse.html +293 -0
- data/doc/SteamCondenser/RCONExecRequest.html +306 -0
- data/doc/SteamCondenser/RCONExecResponse.html +392 -0
- data/doc/SteamCondenser/RCONGoldSrcRequest.html +349 -0
- data/doc/SteamCondenser/RCONGoldSrcResponse.html +354 -0
- data/doc/SteamCondenser/RCONPacket.html +530 -0
- data/doc/SteamCondenser/RCONPacketFactory.html +293 -0
- data/doc/SteamCondenser/RCONSocket.html +649 -0
- data/doc/SteamCondenser/RCONTerminator.html +292 -0
- data/doc/SteamCondenser/RequestWithChallenge.html +223 -0
- data/doc/SteamCondenser/S2A_INFO2_Packet.html +359 -0
- data/doc/SteamCondenser/S2A_INFO_BasePacket.html +342 -0
- data/doc/SteamCondenser/S2A_INFO_DETAILED_Packet.html +358 -0
- data/doc/SteamCondenser/S2A_LOGSTRING_Packet.html +358 -0
- data/doc/SteamCondenser/S2A_PLAYER_Packet.html +402 -0
- data/doc/SteamCondenser/S2A_RULES_Packet.html +396 -0
- data/doc/SteamCondenser/S2C_CHALLENGE_Packet.html +356 -0
- data/doc/SteamCondenser/S2M_HEARTBEAT2_Packet.html +430 -0
- data/doc/SteamCondenser/Server.html +754 -0
- data/doc/SteamCondenser/Servers.html +133 -0
- data/doc/SteamCondenser/SourceServer.html +752 -0
- data/doc/SteamCondenser/SourceSocket.html +355 -0
- data/doc/SteamCondenser/SteamGame.html +1802 -0
- data/doc/SteamCondenser/SteamGroup.html +969 -0
- data/doc/SteamCondenser/SteamId.html +4242 -0
- data/doc/SteamCondenser/SteamPacket.html +456 -0
- data/doc/SteamCondenser/SteamPacketFactory.html +521 -0
- data/doc/SteamCondenser/SteamPlayer.html +1696 -0
- data/doc/SteamCondenser/SteamSocket.html +679 -0
- data/doc/SteamCondenser/TF2BetaInventory.html +198 -0
- data/doc/SteamCondenser/TF2Class.html +1145 -0
- data/doc/SteamCondenser/TF2ClassFactory.html +263 -0
- data/doc/SteamCondenser/TF2Engineer.html +534 -0
- data/doc/SteamCondenser/TF2GoldenWrench.html +731 -0
- data/doc/SteamCondenser/TF2Inventory.html +217 -0
- data/doc/SteamCondenser/TF2Item.html +482 -0
- data/doc/SteamCondenser/TF2Medic.html +445 -0
- data/doc/SteamCondenser/TF2Sniper.html +357 -0
- data/doc/SteamCondenser/TF2Spy.html +531 -0
- data/doc/SteamCondenser/TF2Stats.html +670 -0
- data/doc/SteamCondenser/TimeoutError.html +249 -0
- data/doc/SteamCondenser/WebApi.html +999 -0
- data/doc/SteamCondenser/XMLData.html +171 -0
- data/doc/SteamCondenserError.html +153 -0
- data/doc/SteamGame.html +1859 -0
- data/doc/SteamGroup.html +1012 -0
- data/doc/SteamId.html +4369 -0
- data/doc/SteamPacket.html +469 -0
- data/doc/SteamPacketFactory.html +545 -0
- data/doc/SteamPlayer.html +1766 -0
- data/doc/SteamSocket.html +699 -0
- data/doc/StringIO.html +947 -0
- data/doc/TF2BetaInventory.html +315 -0
- data/doc/TF2Class.html +1194 -0
- data/doc/TF2ClassFactory.html +273 -0
- data/doc/TF2Engineer.html +558 -0
- data/doc/TF2GoldenWrench.html +760 -0
- data/doc/TF2Inventory.html +339 -0
- data/doc/TF2Item.html +499 -0
- data/doc/TF2Medic.html +465 -0
- data/doc/TF2Sniper.html +373 -0
- data/doc/TF2Spy.html +555 -0
- data/doc/TF2Stats.html +696 -0
- data/doc/WebApi.html +1021 -0
- data/doc/WebApiError.html +347 -0
- data/doc/XMLData.html +253 -0
- data/doc/_index.html +717 -0
- data/doc/class_list.html +53 -0
- data/doc/css/common.css +1 -0
- data/doc/css/full_list.css +57 -0
- data/doc/css/style.css +328 -0
- data/doc/file.LICENSE.html +100 -0
- data/doc/file.README.html +136 -0
- data/doc/file_list.html +58 -0
- data/doc/frames.html +28 -0
- data/doc/index.html +136 -0
- data/doc/js/app.js +214 -0
- data/doc/js/full_list.js +173 -0
- data/doc/js/jquery.js +4 -0
- data/doc/method_list.html +3988 -0
- data/doc/methods_list.html +3900 -0
- data/doc/top-level-namespace.html +114 -0
- data/lib/steam-condenser/version.rb +1 -1
- data/lib/steam/community/cacheable.rb +105 -44
- data/lib/steam/community/dota2/dota2_beta_inventory.rb +27 -0
- data/lib/steam/community/dota2/dota2_inventory.rb +27 -0
- data/lib/steam/community/dota2/dota2_item.rb +33 -0
- data/lib/steam/community/game_inventory.rb +18 -16
- data/lib/steam/community/game_leaderboard.rb +2 -2
- data/lib/steam/community/game_stats.rb +1 -1
- data/lib/steam/community/portal2/portal2_inventory.rb +11 -9
- data/lib/steam/community/steam_game.rb +0 -2
- data/lib/steam/community/steam_group.rb +2 -7
- data/lib/steam/community/steam_id.rb +2 -7
- data/lib/steam/community/tf2/tf2_beta_inventory.rb +11 -8
- data/lib/steam/community/tf2/tf2_inventory.rb +11 -9
- data/lib/steam/community/xml_data.rb +8 -1
- data/lib/steam/packets/a2s_player_packet.rb +1 -1
- data/lib/steam/packets/a2s_rules_packet.rb +1 -1
- data/lib/steam/servers/master_server.rb +3 -2
- data/lib/steam/sockets/rcon_socket.rb +1 -2
- data/pkg/steam-condenser-1.2.0.gem +0 -0
- data/pkg/steam-condenser-1.2.0/Gemfile +3 -0
- data/pkg/steam-condenser-1.2.0/Gemfile.lock +30 -0
- data/pkg/steam-condenser-1.2.0/LICENSE +25 -0
- data/pkg/steam-condenser-1.2.0/README.md +47 -0
- data/pkg/steam-condenser-1.2.0/Rakefile +46 -0
- data/pkg/steam-condenser-1.2.0/lib/core_ext/stringio.rb +91 -0
- data/pkg/steam-condenser-1.2.0/lib/errors/packet_format_error.rb +21 -0
- data/pkg/steam-condenser-1.2.0/lib/errors/rcon_ban_error.rb +22 -0
- data/pkg/steam-condenser-1.2.0/lib/errors/rcon_no_auth_error.rb +21 -0
- data/pkg/steam-condenser-1.2.0/lib/errors/steam_condenser_error.rb +11 -0
- data/pkg/steam-condenser-1.2.0/lib/errors/timeout_error.rb +28 -0
- data/pkg/steam-condenser-1.2.0/lib/errors/web_api_error.rb +57 -0
- data/pkg/steam-condenser-1.2.0/lib/steam-condenser.rb +18 -0
- data/pkg/steam-condenser-1.2.0/lib/steam-condenser/community.rb +24 -0
- data/pkg/steam-condenser-1.2.0/lib/steam-condenser/servers.rb +24 -0
- data/pkg/steam-condenser-1.2.0/lib/steam-condenser/version.rb +11 -0
- data/pkg/steam-condenser-1.2.0/lib/steam/community/alien_swarm/alien_swarm_mission.rb +119 -0
- data/pkg/steam-condenser-1.2.0/lib/steam/community/alien_swarm/alien_swarm_stats.rb +179 -0
- data/pkg/steam-condenser-1.2.0/lib/steam/community/alien_swarm/alien_swarm_weapon.rb +49 -0
- data/pkg/steam-condenser-1.2.0/lib/steam/community/app_news.rb +133 -0
- data/pkg/steam-condenser-1.2.0/lib/steam/community/cacheable.rb +137 -0
- data/pkg/steam-condenser-1.2.0/lib/steam/community/css/css_map.rb +61 -0
- data/pkg/steam-condenser-1.2.0/lib/steam/community/css/css_stats.rb +136 -0
- data/pkg/steam-condenser-1.2.0/lib/steam/community/css/css_weapon.rb +69 -0
- data/pkg/steam-condenser-1.2.0/lib/steam/community/defense_grid/defense_grid_stats.rb +237 -0
- data/pkg/steam-condenser-1.2.0/lib/steam/community/dods/dods_class.rb +90 -0
- data/pkg/steam-condenser-1.2.0/lib/steam/community/dods/dods_stats.rb +61 -0
- data/pkg/steam-condenser-1.2.0/lib/steam/community/dods/dods_weapon.rb +67 -0
- data/pkg/steam-condenser-1.2.0/lib/steam/community/game_achievement.rb +109 -0
- data/pkg/steam-condenser-1.2.0/lib/steam/community/game_class.rb +22 -0
- data/pkg/steam-condenser-1.2.0/lib/steam/community/game_inventory.rb +152 -0
- data/pkg/steam-condenser-1.2.0/lib/steam/community/game_item.rb +99 -0
- data/pkg/steam-condenser-1.2.0/lib/steam/community/game_leaderboard.rb +201 -0
- data/pkg/steam-condenser-1.2.0/lib/steam/community/game_leaderboard_entry.rb +43 -0
- data/pkg/steam-condenser-1.2.0/lib/steam/community/game_stats.rb +175 -0
- data/pkg/steam-condenser-1.2.0/lib/steam/community/game_weapon.rb +41 -0
- data/pkg/steam-condenser-1.2.0/lib/steam/community/l4d/abstract_l4d_stats.rb +173 -0
- data/pkg/steam-condenser-1.2.0/lib/steam/community/l4d/abstract_l4d_weapon.rb +56 -0
- data/pkg/steam-condenser-1.2.0/lib/steam/community/l4d/l4d2_map.rb +90 -0
- data/pkg/steam-condenser-1.2.0/lib/steam/community/l4d/l4d2_stats.rb +165 -0
- data/pkg/steam-condenser-1.2.0/lib/steam/community/l4d/l4d2_weapon.rb +38 -0
- data/pkg/steam-condenser-1.2.0/lib/steam/community/l4d/l4d_explosive.rb +34 -0
- data/pkg/steam-condenser-1.2.0/lib/steam/community/l4d/l4d_map.rb +65 -0
- data/pkg/steam-condenser-1.2.0/lib/steam/community/l4d/l4d_stats.rb +71 -0
- data/pkg/steam-condenser-1.2.0/lib/steam/community/l4d/l4d_weapon.rb +26 -0
- data/pkg/steam-condenser-1.2.0/lib/steam/community/portal2/portal2_inventory.rb +25 -0
- data/pkg/steam-condenser-1.2.0/lib/steam/community/portal2/portal2_item.rb +47 -0
- data/pkg/steam-condenser-1.2.0/lib/steam/community/portal2/portal2_stats.rb +32 -0
- data/pkg/steam-condenser-1.2.0/lib/steam/community/steam_game.rb +182 -0
- data/pkg/steam-condenser-1.2.0/lib/steam/community/steam_group.rb +135 -0
- data/pkg/steam-condenser-1.2.0/lib/steam/community/steam_id.rb +513 -0
- data/pkg/steam-condenser-1.2.0/lib/steam/community/tf2/tf2_beta_inventory.rb +22 -0
- data/pkg/steam-condenser-1.2.0/lib/steam/community/tf2/tf2_class.rb +92 -0
- data/pkg/steam-condenser-1.2.0/lib/steam/community/tf2/tf2_class_factory.rb +40 -0
- data/pkg/steam-condenser-1.2.0/lib/steam/community/tf2/tf2_engineer.rb +43 -0
- data/pkg/steam-condenser-1.2.0/lib/steam/community/tf2/tf2_golden_wrench.rb +70 -0
- data/pkg/steam-condenser-1.2.0/lib/steam/community/tf2/tf2_inventory.rb +25 -0
- data/pkg/steam-condenser-1.2.0/lib/steam/community/tf2/tf2_item.rb +47 -0
- data/pkg/steam-condenser-1.2.0/lib/steam/community/tf2/tf2_medic.rb +35 -0
- data/pkg/steam-condenser-1.2.0/lib/steam/community/tf2/tf2_sniper.rb +28 -0
- data/pkg/steam-condenser-1.2.0/lib/steam/community/tf2/tf2_spy.rb +41 -0
- data/pkg/steam-condenser-1.2.0/lib/steam/community/tf2/tf2_stats.rb +76 -0
- data/pkg/steam-condenser-1.2.0/lib/steam/community/web_api.rb +129 -0
- data/pkg/steam-condenser-1.2.0/lib/steam/community/xml_data.rb +17 -0
- data/pkg/steam-condenser-1.2.0/lib/steam/packets/a2m_get_servers_batch2_packet.rb +59 -0
- data/pkg/steam-condenser-1.2.0/lib/steam/packets/a2s_info_packet.rb +24 -0
- data/pkg/steam-condenser-1.2.0/lib/steam/packets/a2s_player_packet.rb +31 -0
- data/pkg/steam-condenser-1.2.0/lib/steam/packets/a2s_rules_packet.rb +32 -0
- data/pkg/steam-condenser-1.2.0/lib/steam/packets/a2s_serverquery_getchallenge_packet.rb +25 -0
- data/pkg/steam-condenser-1.2.0/lib/steam/packets/c2m_checkmd5_packet.rb +30 -0
- data/pkg/steam-condenser-1.2.0/lib/steam/packets/m2a_server_batch_packet.rb +52 -0
- data/pkg/steam-condenser-1.2.0/lib/steam/packets/m2c_isvalidmd5_packet.rb +34 -0
- data/pkg/steam-condenser-1.2.0/lib/steam/packets/m2s_requestrestart_packet.rb +34 -0
- data/pkg/steam-condenser-1.2.0/lib/steam/packets/rcon/rcon_auth_request.rb +28 -0
- data/pkg/steam-condenser-1.2.0/lib/steam/packets/rcon/rcon_auth_response.rb +30 -0
- data/pkg/steam-condenser-1.2.0/lib/steam/packets/rcon/rcon_exec_request.rb +28 -0
- data/pkg/steam-condenser-1.2.0/lib/steam/packets/rcon/rcon_exec_response.rb +37 -0
- data/pkg/steam-condenser-1.2.0/lib/steam/packets/rcon/rcon_goldsrc_request.rb +35 -0
- data/pkg/steam-condenser-1.2.0/lib/steam/packets/rcon/rcon_goldsrc_response.rb +34 -0
- data/pkg/steam-condenser-1.2.0/lib/steam/packets/rcon/rcon_packet.rb +57 -0
- data/pkg/steam-condenser-1.2.0/lib/steam/packets/rcon/rcon_packet_factory.rb +43 -0
- data/pkg/steam-condenser-1.2.0/lib/steam/packets/rcon/rcon_terminator.rb +29 -0
- data/pkg/steam-condenser-1.2.0/lib/steam/packets/request_with_challenge.rb +19 -0
- data/pkg/steam-condenser-1.2.0/lib/steam/packets/s2a_info2_packet.rb +62 -0
- data/pkg/steam-condenser-1.2.0/lib/steam/packets/s2a_info_base_packet.rb +35 -0
- data/pkg/steam-condenser-1.2.0/lib/steam/packets/s2a_info_detailed_packet.rb +61 -0
- data/pkg/steam-condenser-1.2.0/lib/steam/packets/s2a_logstring_packet.rb +30 -0
- data/pkg/steam-condenser-1.2.0/lib/steam/packets/s2a_player_packet.rb +44 -0
- data/pkg/steam-condenser-1.2.0/lib/steam/packets/s2a_rules_packet.rb +48 -0
- data/pkg/steam-condenser-1.2.0/lib/steam/packets/s2c_challenge_packet.rb +35 -0
- data/pkg/steam-condenser-1.2.0/lib/steam/packets/s2m_heartbeat2_packet.rb +71 -0
- data/pkg/steam-condenser-1.2.0/lib/steam/packets/steam_packet.rb +52 -0
- data/pkg/steam-condenser-1.2.0/lib/steam/packets/steam_packet_factory.rb +108 -0
- data/pkg/steam-condenser-1.2.0/lib/steam/servers/game_server.rb +392 -0
- data/pkg/steam-condenser-1.2.0/lib/steam/servers/goldsrc_server.rb +74 -0
- data/pkg/steam-condenser-1.2.0/lib/steam/servers/master_server.rb +182 -0
- data/pkg/steam-condenser-1.2.0/lib/steam/servers/server.rb +104 -0
- data/pkg/steam-condenser-1.2.0/lib/steam/servers/source_server.rb +98 -0
- data/pkg/steam-condenser-1.2.0/lib/steam/sockets/goldsrc_socket.rb +142 -0
- data/pkg/steam-condenser-1.2.0/lib/steam/sockets/master_server_socket.rb +30 -0
- data/pkg/steam-condenser-1.2.0/lib/steam/sockets/rcon_socket.rb +94 -0
- data/pkg/steam-condenser-1.2.0/lib/steam/sockets/source_socket.rb +78 -0
- data/pkg/steam-condenser-1.2.0/lib/steam/sockets/steam_socket.rb +86 -0
- data/pkg/steam-condenser-1.2.0/lib/steam/steam_player.rb +143 -0
- data/pkg/steam-condenser-1.2.0/steam-condenser.gemspec +25 -0
- data/pkg/steam-condenser-1.2.0/test/core_ext/test_stringio.rb +59 -0
- data/pkg/steam-condenser-1.2.0/test/fixtures/invalid.xml +2 -0
- data/pkg/steam-condenser-1.2.0/test/fixtures/sonofthor.xml +882 -0
- data/pkg/steam-condenser-1.2.0/test/fixtures/status_goldsrc +3 -0
- data/pkg/steam-condenser-1.2.0/test/fixtures/status_source +3 -0
- data/pkg/steam-condenser-1.2.0/test/fixtures/valve-members.xml +231 -0
- data/pkg/steam-condenser-1.2.0/test/helper.rb +45 -0
- data/pkg/steam-condenser-1.2.0/test/steam/communtiy/test_steam_group.rb +83 -0
- data/pkg/steam-condenser-1.2.0/test/steam/communtiy/test_steam_id.rb +111 -0
- data/pkg/steam-condenser-1.2.0/test/steam/communtiy/test_web_api.rb +98 -0
- data/pkg/steam-condenser-1.2.0/test/steam/packets/test_steam_packet.rb +37 -0
- data/pkg/steam-condenser-1.2.0/test/steam/servers/test_game_server.rb +296 -0
- data/pkg/steam-condenser-1.2.0/test/steam/servers/test_goldsrc_server.rb +59 -0
- data/pkg/steam-condenser-1.2.0/test/steam/servers/test_master_server.rb +131 -0
- data/pkg/steam-condenser-1.2.0/test/steam/servers/test_server.rb +72 -0
- data/pkg/steam-condenser-1.2.0/test/steam/servers/test_source_server.rb +126 -0
- data/pkg/steam-condenser-1.2.0/test/steam/sockets/test_goldsrc_socket.rb +127 -0
- data/pkg/steam-condenser-1.2.0/test/steam/sockets/test_master_server_socket.rb +42 -0
- data/pkg/steam-condenser-1.2.0/test/steam/sockets/test_rcon_socket.rb +109 -0
- data/pkg/steam-condenser-1.2.0/test/steam/sockets/test_source_socket.rb +77 -0
- data/pkg/steam-condenser-1.2.0/test/steam/sockets/test_steam_socket.rb +97 -0
- data/steam-condenser.gemspec +3 -3
- data/test/steam/communtiy/test_cacheable.rb +100 -0
- data/test/steam/servers/test_master_server.rb +3 -3
- metadata +366 -15
@@ -0,0 +1,182 @@
|
|
1
|
+
# This code is free software; you can redistribute it and/or modify it under
|
2
|
+
# the terms of the new BSD License.
|
3
|
+
#
|
4
|
+
# Copyright (c) 2008-2011, Sebastian Staudt
|
5
|
+
|
6
|
+
require 'errors/timeout_error'
|
7
|
+
require 'steam/packets/a2m_get_servers_batch2_packet'
|
8
|
+
require 'steam/packets/c2m_checkmd5_packet'
|
9
|
+
require 'steam/packets/s2m_heartbeat2_packet'
|
10
|
+
require 'steam/servers/server'
|
11
|
+
require 'steam/sockets/master_server_socket'
|
12
|
+
|
13
|
+
# This class represents a Steam master server and can be used to get game
|
14
|
+
# servers which are publicly available
|
15
|
+
#
|
16
|
+
# An intance of this class can be used much like Steam's server browser to get
|
17
|
+
# a list of available game servers, including filters to narrow down the search
|
18
|
+
# results.
|
19
|
+
#
|
20
|
+
# @author Sebastian Staudt
|
21
|
+
class MasterServer
|
22
|
+
|
23
|
+
include Server
|
24
|
+
|
25
|
+
# The default number of allowed retries
|
26
|
+
@@retries = 3
|
27
|
+
|
28
|
+
# The master server address to query for GoldSrc game servers
|
29
|
+
GOLDSRC_MASTER_SERVER = 'hl1master.steampowered.com', 27010
|
30
|
+
|
31
|
+
# The master server address to query for Source game servers
|
32
|
+
SOURCE_MASTER_SERVER = 'hl2master.steampowered.com', 27011
|
33
|
+
|
34
|
+
# The region code for the US east coast
|
35
|
+
REGION_US_EAST_COAST = 0x00
|
36
|
+
|
37
|
+
# The region code for the US west coast
|
38
|
+
REGION_US_WEST_COAST = 0x01
|
39
|
+
|
40
|
+
# The region code for South America
|
41
|
+
REGION_SOUTH_AMERICA = 0x02
|
42
|
+
|
43
|
+
# The region code for Europe
|
44
|
+
REGION_EUROPE = 0x03
|
45
|
+
|
46
|
+
# The region code for Asia
|
47
|
+
REGION_ASIA = 0x04
|
48
|
+
|
49
|
+
# The region code for Australia
|
50
|
+
REGION_AUSTRALIA = 0x05
|
51
|
+
|
52
|
+
# The region code for the Middle East
|
53
|
+
REGION_MIDDLE_EAST = 0x06
|
54
|
+
|
55
|
+
# The region code for Africa
|
56
|
+
REGION_AFRICA = 0x07
|
57
|
+
|
58
|
+
# The region code for the whole world
|
59
|
+
REGION_ALL = 0xFF
|
60
|
+
|
61
|
+
# Sets the number of consecutive requests that may fail, before getting
|
62
|
+
# the server list is cancelled (default: 3)
|
63
|
+
#
|
64
|
+
# @param [Fixnum] The number of allowed retries
|
65
|
+
def self.retries=(retries)
|
66
|
+
@@retries = retries
|
67
|
+
end
|
68
|
+
|
69
|
+
# Request a challenge number from the master server.
|
70
|
+
#
|
71
|
+
# This is used for further communication with the master server.
|
72
|
+
#
|
73
|
+
# @note Please note that this is **not** needed for finding servers using
|
74
|
+
# {#servers}.
|
75
|
+
# @return [Fixnum] The challenge number from the master server
|
76
|
+
# @see #send_heartbeat
|
77
|
+
def challenge
|
78
|
+
failsafe do
|
79
|
+
@socket.send C2M_CHECKMD5_Packet.new
|
80
|
+
@socket.reply.challenge
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
# Initializes the socket to communicate with the master server
|
85
|
+
#
|
86
|
+
# @see MasterServerSocket
|
87
|
+
def init_socket
|
88
|
+
@socket = MasterServerSocket.new @ip_address, @port
|
89
|
+
end
|
90
|
+
|
91
|
+
# Returns a list of game server matching the given region and filters
|
92
|
+
#
|
93
|
+
# Filtering:
|
94
|
+
# Instead of filtering the results sent by the master server locally, you
|
95
|
+
# should at least use the following filters to narrow down the results sent
|
96
|
+
# by the master server.
|
97
|
+
#
|
98
|
+
# Available filters:
|
99
|
+
#
|
100
|
+
# * `\type\d`: Request only dedicated servers
|
101
|
+
# * `\secure\1`: Request only secure servers
|
102
|
+
# * `\gamedir\[mod]`: Request only servers of a specific mod
|
103
|
+
# * `\map\[mapname]`: Request only servers running a specific map
|
104
|
+
# * `\linux\1`: Request only linux servers
|
105
|
+
# * `\emtpy\1`: Request only **non**-empty servers
|
106
|
+
# * `\full\1`: Request only servers **not** full
|
107
|
+
# * `\proxy\1`: Request only spectator proxy servers
|
108
|
+
#
|
109
|
+
# @note Receiving all servers from the master server is taking quite some
|
110
|
+
# time.
|
111
|
+
# @param [Fixnum] region_code The region code to specify a location of the
|
112
|
+
# game servers
|
113
|
+
# @param [String] filters The filters that game servers should match
|
114
|
+
# @param [Boolean] force Return a list of servers even if an error occured
|
115
|
+
# while fetching them from the master server
|
116
|
+
# @raise [SteamCondenser::TimeoutError] if too many timeouts occur while
|
117
|
+
# querying the master server
|
118
|
+
# @return [Array<Array<String>>] A list of game servers matching the given
|
119
|
+
# region and filters
|
120
|
+
# @see A2M_GET_SERVERS_BATCH2_Packet
|
121
|
+
# @see MasterServer.retries=
|
122
|
+
def servers(region_code = MasterServer::REGION_ALL, filters = '', force = false)
|
123
|
+
fail_count = 0
|
124
|
+
finished = false
|
125
|
+
current_server = '0.0.0.0:0'
|
126
|
+
server_array = []
|
127
|
+
|
128
|
+
begin
|
129
|
+
failsafe do
|
130
|
+
begin
|
131
|
+
@socket.send A2M_GET_SERVERS_BATCH2_Packet.new(region_code, current_server, filters)
|
132
|
+
begin
|
133
|
+
servers = @socket.reply.servers
|
134
|
+
servers.each do |server|
|
135
|
+
if server == '0.0.0.0:0'
|
136
|
+
finished = true
|
137
|
+
else
|
138
|
+
current_server = server
|
139
|
+
server_array << server.split(':')
|
140
|
+
end
|
141
|
+
end
|
142
|
+
fail_count = 0
|
143
|
+
rescue SteamCondenser::TimeoutError
|
144
|
+
raise $! if (fail_count += 1) == @@retries
|
145
|
+
end
|
146
|
+
end while !finished
|
147
|
+
end
|
148
|
+
rescue SteamCondenser::TimeoutError
|
149
|
+
raise $! unless force
|
150
|
+
end
|
151
|
+
|
152
|
+
server_array
|
153
|
+
end
|
154
|
+
|
155
|
+
# Sends a constructed heartbeat to the master server
|
156
|
+
#
|
157
|
+
# This can be used to check server versions externally.
|
158
|
+
#
|
159
|
+
# @param [Hash<Symbol, Object>] The data to send with the heartbeat request
|
160
|
+
# @raise [SteamCondenserError] if heartbeat data is missing the
|
161
|
+
# challenge number or the reply cannot be parsed
|
162
|
+
# @return [Array<SteamPacket>] Zero or more reply packets from the server.
|
163
|
+
# Zero means either the heartbeat was accepted by the master or there
|
164
|
+
# was a timeout. So usually it's best to repeat a heartbeat a few
|
165
|
+
# times when not receiving any packets.
|
166
|
+
# @see S2M_HEARTBEAT2_Packet
|
167
|
+
def send_heartbeat(data)
|
168
|
+
reply_packets = []
|
169
|
+
|
170
|
+
failsafe do
|
171
|
+
@socket.send S2M_HEARTBEAT2_Packet.new(data)
|
172
|
+
|
173
|
+
begin
|
174
|
+
loop { reply_packets << @socket.reply }
|
175
|
+
rescue SteamCondenser::TimeoutError
|
176
|
+
end
|
177
|
+
end
|
178
|
+
|
179
|
+
reply_packets
|
180
|
+
end
|
181
|
+
|
182
|
+
end
|
@@ -0,0 +1,104 @@
|
|
1
|
+
# This code is free software; you can redistribute it and/or modify it under
|
2
|
+
# the terms of the new BSD License.
|
3
|
+
#
|
4
|
+
# Copyright (c) 2011, Sebastian Staudt
|
5
|
+
|
6
|
+
require 'socket'
|
7
|
+
|
8
|
+
# This module is included by all classes implementing server functionality
|
9
|
+
#
|
10
|
+
# It provides basic name resolution features and the ability to rotate between
|
11
|
+
# different IP addresses belonging to a single DNS name.
|
12
|
+
#
|
13
|
+
# @author Sebastian Staudt
|
14
|
+
module Server
|
15
|
+
|
16
|
+
# Returns a list of host names associated with this server
|
17
|
+
#
|
18
|
+
# @return [Array<String>] The host names of this server
|
19
|
+
attr_reader :host_names
|
20
|
+
|
21
|
+
# Returns a list of IP addresses associated with this server
|
22
|
+
#
|
23
|
+
# @return [Array<String>] The IP addresses of this server
|
24
|
+
attr_reader :ip_addresses
|
25
|
+
|
26
|
+
# Creates a new server instance with the given address and port
|
27
|
+
#
|
28
|
+
# @param [String] address Either an IP address, a DNS name or one of them
|
29
|
+
# combined with the port number. If a port number is given, e.g.
|
30
|
+
# 'server.example.com:27016' it will override the second argument.
|
31
|
+
# @param [Fixnum] port The port the server is listening on
|
32
|
+
# @see init_socket
|
33
|
+
# @raise [SteamCondenserError] if an host name cannot be resolved
|
34
|
+
def initialize(address, port = nil)
|
35
|
+
address = address.to_s
|
36
|
+
address, port = address.split(':', 2) if address.include? ':'
|
37
|
+
|
38
|
+
@host_names = []
|
39
|
+
@ip_addresses = []
|
40
|
+
@ip_index = 0
|
41
|
+
@port = port
|
42
|
+
|
43
|
+
Socket.getaddrinfo(address, port, Socket::AF_INET, Socket::SOCK_DGRAM).
|
44
|
+
each do |address|
|
45
|
+
@host_names << address[2]
|
46
|
+
@ip_addresses << address[3]
|
47
|
+
end
|
48
|
+
|
49
|
+
@ip_address = @ip_addresses.first
|
50
|
+
|
51
|
+
init_socket
|
52
|
+
end
|
53
|
+
|
54
|
+
# Rotate this server's IP address to the next one in the IP list
|
55
|
+
#
|
56
|
+
# If this method returns `true`, it indicates that all IP addresses have been
|
57
|
+
# used, hinting at the server(s) being unreachable. An appropriate action
|
58
|
+
# should be taken to inform the user.
|
59
|
+
#
|
60
|
+
# Servers with only one IP address will always cause this method to return
|
61
|
+
# `true` and the sockets will not be reinitialized.
|
62
|
+
#
|
63
|
+
# @return [Boolean] `true`, if the IP list reached its end. If the list
|
64
|
+
# contains only one IP address, this method will instantly return
|
65
|
+
# `true`
|
66
|
+
# @see #init_socket
|
67
|
+
def rotate_ip
|
68
|
+
return true if @ip_addresses.size == 1
|
69
|
+
|
70
|
+
@ip_index = (@ip_index + 1) % @ip_addresses.size
|
71
|
+
@ip_address = @ip_addresses[@ip_index]
|
72
|
+
|
73
|
+
init_socket
|
74
|
+
|
75
|
+
@ip_index == 0
|
76
|
+
end
|
77
|
+
|
78
|
+
protected
|
79
|
+
|
80
|
+
# Execute an action in the context of this server's current IP address
|
81
|
+
#
|
82
|
+
# Any failure will cause the IP to rotate to the next IP in the server's IP
|
83
|
+
# list and the execution will be repeated for the next IP address. If the IP
|
84
|
+
# rotation reaches the end of the list, the error will be reraised.
|
85
|
+
#
|
86
|
+
# @param [Proc] proc The action to be executed in a failsafe way
|
87
|
+
# @see #rotate_ip
|
88
|
+
def failsafe(&proc)
|
89
|
+
begin
|
90
|
+
proc.call
|
91
|
+
rescue
|
92
|
+
raise $! if rotate_ip
|
93
|
+
failsafe &proc
|
94
|
+
end
|
95
|
+
end
|
96
|
+
|
97
|
+
# Initializes the socket(s) to communicate with the server
|
98
|
+
#
|
99
|
+
# @abstract Must be implemented in including classes to prepare sockets for
|
100
|
+
# server communication
|
101
|
+
def init_socket
|
102
|
+
end
|
103
|
+
|
104
|
+
end
|
@@ -0,0 +1,98 @@
|
|
1
|
+
# This code is free software; you can redistribute it and/or modify it under
|
2
|
+
# the terms of the new BSD License.
|
3
|
+
#
|
4
|
+
# Copyright (c) 2008-2011, Sebastian Staudt
|
5
|
+
|
6
|
+
require 'errors/rcon_no_auth_error'
|
7
|
+
require 'steam/packets/rcon/rcon_auth_request'
|
8
|
+
require 'steam/packets/rcon/rcon_auth_response'
|
9
|
+
require 'steam/packets/rcon/rcon_exec_request'
|
10
|
+
require 'steam/packets/rcon/rcon_terminator'
|
11
|
+
require 'steam/servers/game_server'
|
12
|
+
require 'steam/servers/master_server'
|
13
|
+
require 'steam/sockets/rcon_socket'
|
14
|
+
require 'steam/sockets/source_socket'
|
15
|
+
|
16
|
+
# This class represents a Source game server and can be used to query
|
17
|
+
# information about and remotely execute commands via RCON on the server
|
18
|
+
#
|
19
|
+
# A Source game server is an instance of the Source Dedicated Server (SrcDS)
|
20
|
+
# running games using Valve's Source engine, like Counter-Strike: Source,
|
21
|
+
# Team Fortress 2 or Left4Dead.
|
22
|
+
#
|
23
|
+
# @author Sebastian Staudt
|
24
|
+
# @see GoldSrcServer
|
25
|
+
class SourceServer
|
26
|
+
|
27
|
+
include GameServer
|
28
|
+
|
29
|
+
# Returns a master server instance for the default master server for Source
|
30
|
+
# games
|
31
|
+
#
|
32
|
+
# @return [MasterServer] The Source master server
|
33
|
+
def self.master
|
34
|
+
MasterServer.new *MasterServer::SOURCE_MASTER_SERVER
|
35
|
+
end
|
36
|
+
|
37
|
+
# Creates a new instance of a server object representing a Source server,
|
38
|
+
# i.e. SrcDS instance
|
39
|
+
#
|
40
|
+
# @param [String] address Either an IP address, a DNS name or one of them
|
41
|
+
# combined with the port number. If a port number is given, e.g.
|
42
|
+
# 'server.example.com:27016' it will override the second argument.
|
43
|
+
# @param [Fixnum] port The port the server is listening on
|
44
|
+
# @raise [SteamCondenserError] if an host name cannot be resolved
|
45
|
+
def initialize(address, port = 27015)
|
46
|
+
super
|
47
|
+
end
|
48
|
+
|
49
|
+
# Initializes the sockets to communicate with the Source server
|
50
|
+
#
|
51
|
+
# @see RCONSocket
|
52
|
+
# @see SourceSocket
|
53
|
+
def init_socket
|
54
|
+
@rcon_socket = RCONSocket.new @ip_address, @port
|
55
|
+
@socket = SourceSocket.new @ip_address, @port
|
56
|
+
end
|
57
|
+
|
58
|
+
# Authenticates the connection for RCON communication with the server
|
59
|
+
#
|
60
|
+
# @param [String] password The RCON password of the server
|
61
|
+
# @return [Boolean] whether authentication was successful
|
62
|
+
# @see #rcon_authenticated?
|
63
|
+
# @see #rcon_exec
|
64
|
+
def rcon_auth(password)
|
65
|
+
@rcon_request_id = rand 2**16
|
66
|
+
|
67
|
+
@rcon_socket.send RCONAuthRequest.new(@rcon_request_id, password)
|
68
|
+
@rcon_socket.reply
|
69
|
+
reply = @rcon_socket.reply
|
70
|
+
|
71
|
+
@rcon_authenticated = reply.request_id == @rcon_request_id
|
72
|
+
end
|
73
|
+
|
74
|
+
# Remotely executes a command on the server via RCON
|
75
|
+
#
|
76
|
+
# @param [String] command The command to execute on the server via RCON
|
77
|
+
# @return [String] The output of the executed command
|
78
|
+
# @see #rcon_auth
|
79
|
+
def rcon_exec(command)
|
80
|
+
raise RCONNoAuthError unless @rcon_authenticated
|
81
|
+
|
82
|
+
@rcon_socket.send RCONExecRequest.new(@rcon_request_id, command)
|
83
|
+
@rcon_socket.send RCONTerminator.new(@rcon_request_id)
|
84
|
+
|
85
|
+
response = []
|
86
|
+
begin
|
87
|
+
response_packet = @rcon_socket.reply
|
88
|
+
if response_packet.is_a? RCONAuthResponse
|
89
|
+
@rcon_authenticated = false
|
90
|
+
raise RCONNoAuthError
|
91
|
+
end
|
92
|
+
response << response_packet.response
|
93
|
+
end while response.size < 3 || response_packet.response.size > 0
|
94
|
+
|
95
|
+
response.join('').strip
|
96
|
+
end
|
97
|
+
|
98
|
+
end
|
@@ -0,0 +1,142 @@
|
|
1
|
+
# This code is free software; you can redistribute it and/or modify it under
|
2
|
+
# the terms of the new BSD License.
|
3
|
+
#
|
4
|
+
# Copyright (c) 2008-2011, Sebastian Staudt
|
5
|
+
|
6
|
+
require 'core_ext/stringio'
|
7
|
+
require 'errors/rcon_ban_error'
|
8
|
+
require 'errors/rcon_no_auth_error'
|
9
|
+
require 'errors/timeout_error'
|
10
|
+
require 'steam/packets/steam_packet_factory'
|
11
|
+
require 'steam/packets/rcon/rcon_goldsrc_request'
|
12
|
+
require 'steam/sockets/steam_socket'
|
13
|
+
|
14
|
+
# This class represents a socket used to communicate with game servers based on
|
15
|
+
# the GoldSrc engine (e.g. Half-Life, Counter-Strike)
|
16
|
+
#
|
17
|
+
# @author Sebastian Staudt
|
18
|
+
class GoldSrcSocket
|
19
|
+
|
20
|
+
include SteamSocket
|
21
|
+
|
22
|
+
# Creates a new socket to communicate with the server on the given IP address
|
23
|
+
# and port
|
24
|
+
#
|
25
|
+
# @param [String] ipaddress Either the IP address or the DNS name of the
|
26
|
+
# server
|
27
|
+
# @param [Fixnum] port_number The port the server is listening on
|
28
|
+
# @param [Boolean] is_hltv `true` if the target server is a HTLV instance.
|
29
|
+
# HLTV behaves slightly different for RCON commands, this flag
|
30
|
+
# increases compatibility.
|
31
|
+
def initialize(ipaddress, port_number = 27015, is_hltv = false)
|
32
|
+
super ipaddress, port_number
|
33
|
+
|
34
|
+
@is_hltv = is_hltv
|
35
|
+
end
|
36
|
+
|
37
|
+
# Reads a packet from the socket
|
38
|
+
#
|
39
|
+
# The Source query protocol specifies a maximum packet size of 1,400 bytes.
|
40
|
+
# Bigger packets will be split over several UDP packets. This method
|
41
|
+
# reassembles split packets into single packet objects.
|
42
|
+
#
|
43
|
+
# @return [SteamPacket] The packet replied from the server
|
44
|
+
def reply
|
45
|
+
receive_packet 1400
|
46
|
+
|
47
|
+
if @buffer.long == 0xFFFFFFFE
|
48
|
+
split_packets = []
|
49
|
+
begin
|
50
|
+
request_id = @buffer.long
|
51
|
+
packet_number_and_count = @buffer.byte
|
52
|
+
packet_count = packet_number_and_count & 0xF
|
53
|
+
packet_number = (packet_number_and_count >> 4) + 1
|
54
|
+
|
55
|
+
split_packets[packet_number - 1] = @buffer.get
|
56
|
+
|
57
|
+
puts "Received packet #{packet_number} of #{packet_count} for request ##{request_id}" if $DEBUG
|
58
|
+
|
59
|
+
if split_packets.size < packet_count
|
60
|
+
begin
|
61
|
+
bytes_read = receive_packet
|
62
|
+
rescue SteamCondenser::TimeoutError
|
63
|
+
bytes_read = 0
|
64
|
+
end
|
65
|
+
else
|
66
|
+
bytes_read = 0
|
67
|
+
end
|
68
|
+
end while bytes_read > 0 && @buffer.long == 0xFFFFFFFE
|
69
|
+
|
70
|
+
packet = SteamPacketFactory.reassemble_packet(split_packets)
|
71
|
+
else
|
72
|
+
packet = SteamPacketFactory.packet_from_data(@buffer.get)
|
73
|
+
end
|
74
|
+
|
75
|
+
puts "Got reply of type \"#{packet.class.to_s}\"." if $DEBUG
|
76
|
+
|
77
|
+
packet
|
78
|
+
end
|
79
|
+
|
80
|
+
# Executes the given command on the server via RCON
|
81
|
+
#
|
82
|
+
# @param [String] password The password to authenticate with the server
|
83
|
+
# @param [String] command The command to execute on the server
|
84
|
+
# @raise [RCONBanError] if the IP of the local machine has been banned on the
|
85
|
+
# game server
|
86
|
+
# @raise [RCONNoAuthError] if the password is incorrect
|
87
|
+
# @return [RCONGoldSrcResponse] The response replied by the server
|
88
|
+
# @see #rcon_challenge
|
89
|
+
# @see #rcon_send
|
90
|
+
def rcon_exec(password, command)
|
91
|
+
rcon_challenge if @rcon_challenge.nil? || @is_hltv
|
92
|
+
|
93
|
+
rcon_send "rcon #@rcon_challenge #{password} #{command}"
|
94
|
+
rcon_send "rcon #@rcon_challenge #{password}"
|
95
|
+
if @is_hltv
|
96
|
+
begin
|
97
|
+
response = reply.response
|
98
|
+
rescue SteamCondenser::TimeoutError
|
99
|
+
response = ''
|
100
|
+
end
|
101
|
+
else
|
102
|
+
response = reply.response
|
103
|
+
end
|
104
|
+
|
105
|
+
if response.strip == 'Bad rcon_password.'
|
106
|
+
raise RCONNoAuthError
|
107
|
+
elsif response.strip == 'You have been banned from this server.'
|
108
|
+
raise RCONBanError
|
109
|
+
end
|
110
|
+
|
111
|
+
begin
|
112
|
+
response_part = reply.response
|
113
|
+
response << response_part
|
114
|
+
end while response_part.size > 0
|
115
|
+
|
116
|
+
response
|
117
|
+
end
|
118
|
+
|
119
|
+
# Requests a challenge number from the server to be used for further requests
|
120
|
+
#
|
121
|
+
# @raise [RCONBanError] if the IP of the local machine has been banned on the
|
122
|
+
# game server
|
123
|
+
# @see #rcon_send
|
124
|
+
def rcon_challenge
|
125
|
+
rcon_send 'challenge rcon'
|
126
|
+
response = reply.response.strip
|
127
|
+
|
128
|
+
if response.strip == 'You have been banned from this server.'
|
129
|
+
raise RCONBanError
|
130
|
+
end
|
131
|
+
|
132
|
+
@rcon_challenge = response[14..-1]
|
133
|
+
end
|
134
|
+
|
135
|
+
# Wraps the given command in a RCON request packet and send it to the server
|
136
|
+
#
|
137
|
+
# @param [String] command The RCON command to send to the server
|
138
|
+
def rcon_send(command)
|
139
|
+
send RCONGoldSrcRequest.new(command)
|
140
|
+
end
|
141
|
+
|
142
|
+
end
|