-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
31bc90e
commit a3258c2
Showing
8 changed files
with
70 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
*.rst |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
Installation | ||
============ | ||
|
||
You can install the OpenGSQ library using pip: | ||
|
||
.. code-block:: console | ||
(.venv) $ pip install --upgrade opengsq | ||
Alternatively, you can install from source manually: | ||
|
||
.. code-block:: console | ||
(.venv) $ python setup.py install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
Usage | ||
===== | ||
|
||
Here's an example of how to query a server using the Source protocol: | ||
|
||
.. code-block:: python | ||
import asyncio | ||
from opengsq.protocols import Source | ||
async def main(): | ||
source = Source(host='45.147.5.5', port=27015) | ||
info = await source.get_info() | ||
print(info) | ||
asyncio.run(main()) | ||
You can also use the Source Remote Console: | ||
|
||
.. code-block:: python | ||
import asyncio | ||
from opengsq.exceptions import AuthenticationException | ||
from opengsq.protocols import Source | ||
async def main(): | ||
with Source.RemoteConsole('123.123.123.123', 27015) as rcon: | ||
try: | ||
await rcon.authenticate('serverRconPassword') | ||
result = await rcon.send_command('cvarlist') | ||
print(result) | ||
except AuthenticationException: | ||
print('Failed to authenticate') | ||
asyncio.run(main()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters