Skip to content

Commit a17c2c1

Browse files
committed
Added 2 new commands and fixed loadMission
1 parent 17427b3 commit a17c2c1

File tree

3 files changed

+16
-3
lines changed

3 files changed

+16
-3
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ def msg(args):
2222
import bec_rcon
2323
rcon_client = bec_rcon.ARC("192.168.0.1", "MyPassword", 2302)
2424
rcon_client.add_Event("received_ServerMessage", msg)
25-
25+
rcon_client.loadMission("becti_0097_z1305.Altis.pbo")
26+
rcon_client.addBan(player_id=1, reason="Rcon is watching!", time=0)
2627
```
2728
# Known Issues:
2829
* [Outbound messages can only contain ASCII charaters](https://github.com/Yoshi-E/Python-BEC-RCon/issues/1)

bec_rcon.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,8 +256,19 @@ async def getMissions(self):
256256
return await self.waitForResponse()
257257

258258
#Loads a mission
259+
#Mission file name without .pbo at the end!
259260
async def loadMission(self, mission: str):
260-
await self.send('mission '+mission)
261+
await self.send('#mission '+mission)
262+
return await self.waitForResponse()
263+
264+
#Loads Events
265+
async def loadEvents(self):
266+
await self.send('loadEvents')
267+
return await self.waitForResponse()
268+
269+
#Loads Scripts
270+
async def loadScripts(self):
271+
await self.send('loadScripts')
261272
return await self.waitForResponse()
262273

263274
#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):
483494
except Exception as e:
484495
if(type(e) != BlockingIOError): #ignore "no data recevied" error
485496
traceback.print_exc()
497+
self.disconnect()
486498
if(answer==""):
487499
await asyncio.sleep(0.5)
488500

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
setup(
1313
name='bec_rcon',
14-
version='0.1.0',
14+
version='0.1.1',
1515
description='API for Battleye extended controls - Arma3',
1616
long_description=readme,
1717
author='Yoshi_E',

0 commit comments

Comments
 (0)