From a17c2c14f2eced67055bffd4b733d26d55ed83ac Mon Sep 17 00:00:00 2001 From: Yoshi-E Date: Mon, 24 Jun 2019 13:47:08 +0200 Subject: [PATCH] Added 2 new commands and fixed loadMission --- README.md | 3 ++- bec_rcon.py | 14 +++++++++++++- setup.py | 2 +- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index fc21f95..e861e68 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,8 @@ def msg(args): import bec_rcon rcon_client = bec_rcon.ARC("192.168.0.1", "MyPassword", 2302) rcon_client.add_Event("received_ServerMessage", msg) - +rcon_client.loadMission("becti_0097_z1305.Altis.pbo") +rcon_client.addBan(player_id=1, reason="Rcon is watching!", time=0) ``` # Known Issues: * [Outbound messages can only contain ASCII charaters](https://github.com/Yoshi-E/Python-BEC-RCon/issues/1) diff --git a/bec_rcon.py b/bec_rcon.py index 9e4de42..43170d6 100644 --- a/bec_rcon.py +++ b/bec_rcon.py @@ -256,8 +256,19 @@ async def getMissions(self): return await self.waitForResponse() #Loads a mission + #Mission file name without .pbo at the end! async def loadMission(self, mission: str): - await self.send('mission '+mission) + await self.send('#mission '+mission) + return await self.waitForResponse() + + #Loads Events + async def loadEvents(self): + await self.send('loadEvents') + return await self.waitForResponse() + + #Loads Scripts + async def loadScripts(self): + await self.send('loadScripts') return await self.waitForResponse() #Ban a player's BE GUID from the server. If time is not specified or 0, the ban will be permanent. @@ -483,6 +494,7 @@ async def listenForData(self): except Exception as e: if(type(e) != BlockingIOError): #ignore "no data recevied" error traceback.print_exc() + self.disconnect() if(answer==""): await asyncio.sleep(0.5) diff --git a/setup.py b/setup.py index 0c99394..15bdfee 100644 --- a/setup.py +++ b/setup.py @@ -11,7 +11,7 @@ setup( name='bec_rcon', - version='0.1.0', + version='0.1.1', description='API for Battleye extended controls - Arma3', long_description=readme, author='Yoshi_E',