Skip to content

Commit

Permalink
Added 2 new commands and fixed loadMission
Browse files Browse the repository at this point in the history
  • Loading branch information
Yoshi-E committed Jun 24, 2019
1 parent 17427b3 commit a17c2c1
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
14 changes: 13 additions & 1 deletion bec_rcon.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit a17c2c1

Please sign in to comment.