# hllrcon **Repository Path**: FLFKTG/hllrcon ## Basic Information - **Project Name**: hllrcon - **Description**: 人间地狱和人间地狱越南的RCON - **Primary Language**: Python - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-05-30 - **Last Updated**: 2026-07-11 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # hllrcon

Release PyPI Branch Coverage License

**hllrcon** is an asynchronous Python implementation of the [Hell Let Loose](https://www.hellletloose.com/game/hll) RCON protocol. It allows you to interact with your HLL servers programmatically, supporting modern Python async features and robust error handling. ## Features - Full async/await support - Command execution and response parsing - Collection of vanilla maps, factions, weapons, and more - Alternative interfaces for synchronous applications - Well-typed and tested ## Installation ```sh pip install hllrcon ``` ## Quick Start ### Asynchronous Usage ```python import asyncio from hllrcon import Rcon, Layer async def main(): # Initialize client rcon = Rcon( host="127.0.0.1", port=12345, password="your_rcon_password", ) # Send commands. The client will (re)connect for you. await rcon.broadcast("Hello, HLL!") await rcon.change_map(Layer.STALINGRAD_WARFARE_DAY) players = await rcon.get_players() # Close the connection rcon.disconnect() # Alternatively, use the context manager interface async with rcon.connect(): assert rcon.is_connected() is True await rcon.broadcast("Hello, HLL!") if __name__ == "__main__": asyncio.run(main()) ``` ### Synchronous Usage For integration with synchronous applications, a `SyncRcon` class is provided. ```python from hllrcon.sync import SyncRcon rcon = SyncRcon( host="127.0.0.1", port=12345, password="your_rcon_password", ) # Connect and send a broadcast message with rcon.connect(): rcon.broadcast("Hello, HLL!") ``` ## Core Concepts ### Data Models The library contains extensive data about in-game maps, factions, weapons, vehicles, and more. ```python from hllrcon import Weapon # Find a weapon by its ID weapon_id = "COAXIAL M1919 [Stuart M5A1]" weapon = Weapon.by_id(weapon_id) # Print out which vehicle seat the attacker must have been in if weapon.vehicle: for seat in weapon.vehicle.seats: if weapon in seat.weapons: print("This weapon belongs to the", seat.type.name, "seat") break ``` ### Working with Maps and Layers ```python from hllrcon import Rcon, Map, Layer, Team # Get the AA Network capture zone (SMDM, 3rd sector, 2nd capture zone) sector = Layer.STMARIEDUMONT_WARFARE_DAY.sectors[2] capture_zone = sector.capture_zones[1] assert capture_zone.strongpoint.name == "AA Network" # Get the current online players rcon = Rcon(...) players = await rcon.get_players() # Calculate each team's capture strength towards the sector strength = {Team.ALLIES: 0, Team.AXIS: 0} for player in players.players: if player.faction is None: continue if player.world_position == (0.0, 0.0, 0.0): # Player is dead. Note: Does not exclude players bleeding out continue # Grant 3 strength if inside the strongpoint if capture_zone.strongpoint.is_inside(player.world_position): strength[player.faction.team] += 3 # Only grant 1 strength if inside the capture zone elif capture_zone.is_inside(player.world_position): strength[player.faction.team] += 1 print("Allied cap weight:", strength[Team.ALLIES]) print("Axis cap weight:", strength[Team.AXIS]) ``` ## Available Commands The library provides methods for various server management tasks: - **Player Management**: `get_players`, `get_player`, `message_player`, `kick_player`, `ban_player` - **Map Control**: `change_map`, `get_map_rotation`, `add_map_to_rotation`, `remove_map_from_rotation` - **Squad Management**: `disband_squad`, `remove_player_from_squad`, `force_team_switch` - **Server Settings**: `get_server_config`, `get_server_session`, `set_auto_balance_enabled`, `set_vote_kick_enabled` - **Admin Functions**: `get_admin_log`, `get_admin_users`, `get_admin_groups`, `add_admin`, `remove_admin` - **Broadcasting**: `broadcast`, `message_all_players` - **VIP Management**: `get_vip_users`, `add_vip`, `remove_vip` ## Versioning Hell Let Loose is a constantly evolving game, and game updates might alter its RCON interfaces in ways that are not backward-compatible. This affects any tools and libraries that depend on it. Releases of `hllrcon` only guarantee compatibility with the latest version of the game at the time of release. See the release notes for more information. This project uses its own versioning system similar to [Pragmatic Versioning principles](https://pragver.github.io/spec/) (i.e. `GRADE`.`MAJOR`.`MINOR`.`PATCH`): - **`GRADE`** - Reserved for structural changes. Likely to increase only with the release of Hell Let Loose: Vietnam. - **`MAJOR`** - Incremented when backward-incompatible changes are released. - **`MINOR`** - Incremented when support for the previously supported game version is dropped. - **`PATCH`** - Incremented when backward-compatible changes are released. When specifying `hllrcon` as a dependency, it is recommended to pin the `MINOR` version but not the `PATCH` version. ## License This project is licensed under the MIT License. See [`LICENSE`](LICENSE) for details.