Skip to content

Commit 0ea0da1

Browse files
committed
tweak to var name
1 parent 0322f5d commit 0ea0da1

File tree

1 file changed

+42
-42
lines changed

1 file changed

+42
-42
lines changed

discord_module.py

Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,15 @@ def __init__(self, bot):
3737
self.creatcfg() #make empty cfg file
3838
raise Exception("Error: You have to configure the rcon_cfg first!")
3939

40-
self.epm_rcon = rcon.ARC(self.rcon_settings["ip"],
40+
self.arma_rcon = rcon.ARC(self.rcon_settings["ip"],
4141
self.rcon_settings["password"],
4242
self.rcon_settings["port"],
4343
{'timeoutSec' : self.rcon_settings["timeoutSec"]}
4444
)
4545

4646
#Add Event Handlers
47-
self.epm_rcon.add_Event("received_ServerMessage", self.rcon_on_msg_received)
48-
self.epm_rcon.add_Event("on_disconnect", self.rcon_on_disconnect)
47+
self.arma_rcon.add_Event("received_ServerMessage", self.rcon_on_msg_received)
48+
self.arma_rcon.add_Event("on_disconnect", self.rcon_on_disconnect)
4949

5050

5151

@@ -105,7 +105,7 @@ def rcon_on_msg_received(self, args):
105105
async def rcon_on_disconnect(self):
106106
await asyncio.sleep(10)
107107
print("Reconnecting to BEC Rcon")
108-
self.epm_rcon.reconnect()
108+
self.arma_rcon.reconnect()
109109

110110
###################################################################################################
111111
##### BEC Rcon custom commands ####
@@ -115,12 +115,12 @@ async def rcon_on_disconnect(self):
115115
brief="Toggles RCon debug mode",
116116
pass_context=True)
117117
async def cmd_debug(self, ctx, limit=20):
118-
if(self.epm_rcon.options['debug']==True):
119-
self.epm_rcon.options['debug'] = False
118+
if(self.arma_rcon.options['debug']==True):
119+
self.arma_rcon.options['debug'] = False
120120
else:
121-
self.epm_rcon.options['debug'] = True
121+
self.arma_rcon.options['debug'] = True
122122

123-
msg= "Set debug mode to:"+str(self.epm_rcon.options['debug'])
123+
msg= "Set debug mode to:"+str(self.arma_rcon.options['debug'])
124124
await ctx.message.channel.send(msg)
125125

126126
@commands.check(canUseCmds)
@@ -129,11 +129,11 @@ async def cmd_debug(self, ctx, limit=20):
129129
pass_context=True)
130130
async def status(self, ctx, limit=20):
131131
msg = ""
132-
if(self.epm_rcon.disconnected==False):
133-
msg+= "Connected to: "+ self.epm_rcon.serverIP+"\n"
132+
if(self.arma_rcon.disconnected==False):
133+
msg+= "Connected to: "+ self.arma_rcon.serverIP+"\n"
134134
else:
135-
msg+= "Currently not connected: "+ self.epm_rcon.serverIP+"\n"
136-
msg+= str(len(self.epm_rcon.serverMessage))+ " Messages collected"
135+
msg+= "Currently not connected: "+ self.arma_rcon.serverIP+"\n"
136+
msg+= str(len(self.arma_rcon.serverMessage))+ " Messages collected"
137137
await ctx.message.channel.send(msg)
138138

139139
@commands.check(canUseCmds)
@@ -142,7 +142,7 @@ async def status(self, ctx, limit=20):
142142
pass_context=True)
143143
async def getChat(self, ctx, limit=20):
144144
msg = ""
145-
data = self.epm_rcon.serverMessage.copy()
145+
data = self.arma_rcon.serverMessage.copy()
146146
start = len(data)-1
147147
if(start > limit):
148148
end = start-limit
@@ -166,7 +166,7 @@ async def getChat(self, ctx, limit=20):
166166
async def command(self, ctx, *message):
167167
message = " ".join(message)
168168
message = self.setEncoding(message)
169-
data = await self.epm_rcon.command(message)
169+
data = await self.arma_rcon.command(message)
170170
if(len(data) == 0):
171171
msg = "Executed command: ``"+str(message)+"`` and returned nothing (confirmed its execution)"
172172
else:
@@ -180,7 +180,7 @@ async def command(self, ctx, *message):
180180
async def kickPlayer(self, ctx, player_id: int, *message):
181181
message = " ".join(message)
182182
message = self.setEncoding(message)
183-
await self.epm_rcon.kickPlayer(player_id, message)
183+
await self.arma_rcon.kickPlayer(player_id, message)
184184

185185
msg = "kicked player: "+str(player_id)
186186
await ctx.message.channel.send(msg)
@@ -193,7 +193,7 @@ async def sayGlobal(self, ctx, *message):
193193
name = ctx.message.author.name
194194
message = " ".join(message)
195195
message = self.setEncoding(message)
196-
await self.epm_rcon.sayGlobal(name+": "+message)
196+
await self.arma_rcon.sayGlobal(name+": "+message)
197197
msg = "Send: ``"+message+"``"
198198
await ctx.message.channel.send(msg)
199199

@@ -207,7 +207,7 @@ async def sayPlayer(self, ctx, player_id: int, *message):
207207
name = ctx.message.author.name
208208
if(len(message)<2):
209209
message = "Ping"
210-
await self.epm_rcon.sayPlayer(player_id, name+": "+message)
210+
await self.arma_rcon.sayPlayer(player_id, name+": "+message)
211211
msg = "Send msg: ``"+str(player_id)+"``"+message
212212
await ctx.message.channel.send(msg)
213213

@@ -216,7 +216,7 @@ async def sayPlayer(self, ctx, player_id: int, *message):
216216
brief="Loads the 'scripts.txt' file without the need to restart the server",
217217
pass_context=True)
218218
async def loadScripts(self, ctx):
219-
await self.epm_rcon.loadScripts()
219+
await self.arma_rcon.loadScripts()
220220
msg = "Loaded Scripts!"
221221
await ctx.message.channel.send(msg)
222222

@@ -225,7 +225,7 @@ async def loadScripts(self, ctx):
225225
brief="Changes the MaxPing value. If a player has a higher ping, he will be kicked from the server",
226226
pass_context=True)
227227
async def maxPing(self, ctx, ping: int):
228-
await self.epm_rcon.maxPing(ping)
228+
await self.arma_rcon.maxPing(ping)
229229
msg = "Set maxPing to: "+ping
230230
await ctx.message.channel.send(msg)
231231

@@ -235,7 +235,7 @@ async def maxPing(self, ctx, ping: int):
235235
pass_context=True)
236236
async def changePassword(self, ctx, *password):
237237
password = " ".join(password)
238-
await self.epm_rcon.changePassword(password)
238+
await self.arma_rcon.changePassword(password)
239239
msg = "Set Password to: ``"+password+"``"
240240
await ctx.message.channel.send(msg)
241241

@@ -244,7 +244,7 @@ async def changePassword(self, ctx, *password):
244244
brief="(Re)load the BE ban list from bans.txt",
245245
pass_context=True)
246246
async def loadBans(self, ctx):
247-
await self.epm_rcon.loadBans()
247+
await self.arma_rcon.loadBans()
248248
msg = "Loaded Bans!"
249249
await ctx.message.channel.send(msg)
250250

@@ -253,7 +253,7 @@ async def loadBans(self, ctx):
253253
brief="lists current players on the server",
254254
pass_context=True)
255255
async def players(self, ctx):
256-
players = await self.epm_rcon.getPlayersArray()
256+
players = await self.arma_rcon.getPlayersArray()
257257
msgtable = prettytable.PrettyTable()
258258
msgtable.field_names = ["ID", "Name", "IP", "GUID"]
259259
msgtable.align["ID"] = "r"
@@ -290,7 +290,7 @@ async def players(self, ctx):
290290
brief="lists current admins on the server",
291291
pass_context=True)
292292
async def admins(self, ctx):
293-
admins = await self.epm_rcon.getAdminsArray()
293+
admins = await self.arma_rcon.getAdminsArray()
294294
msgtable = prettytable.PrettyTable()
295295
msgtable.field_names = ["ID", "IP"]
296296
msgtable.align["ID"] = "r"
@@ -325,15 +325,15 @@ async def admins(self, ctx):
325325
brief="Gets a list of all Missions",
326326
pass_context=True)
327327
async def getMissions(self, ctx):
328-
missions = await self.epm_rcon.getMissions()
328+
missions = await self.arma_rcon.getMissions()
329329
await self.sendLong(ctx, missions)
330330

331331
@commands.check(canUseCmds)
332332
@commands.command(name='loadMission',
333333
brief="Loads a mission",
334334
pass_context=True)
335335
async def loadMission(self, ctx, mission: str):
336-
missions = await self.epm_rcon.getMissions(mission)
336+
missions = await self.arma_rcon.getMissions(mission)
337337
msg = "Loaded mission: ``"+str(missions)+"``"
338338
await ctx.message.channel.send(msg)
339339

@@ -345,9 +345,9 @@ async def banPlayer(self, ctx, player_id, time=0, *message):
345345
message = " ".join(message)
346346
message = self.setEncoding(message)
347347
if(len(message)<2):
348-
await self.epm_rcon.banPlayer(player=player, time=time)
348+
await self.arma_rcon.banPlayer(player=player, time=time)
349349
else:
350-
await self.epm_rcon.banPlayer(player, message, time)
350+
await self.arma_rcon.banPlayer(player, message, time)
351351

352352
msg = "Banned player: ``"+str(player)+" - "+matches[0]+"`` with reason: "+message
353353
await ctx.message.channel.send(msg)
@@ -364,9 +364,9 @@ async def addBan(self, ctx, GUID: str, time=0, *message):
364364
if(len(GUID) != 32):
365365
raise Exception("Invalid GUID")
366366
if(len(message)<2):
367-
await self.epm_rcon.addBan(player=player, time=time)
367+
await self.arma_rcon.addBan(player=player, time=time)
368368
else:
369-
await self.epm_rcon.addBan(player, message, time)
369+
await self.arma_rcon.addBan(player, message, time)
370370

371371
msg = "Banned player: ``"+str(player)+" - "+matches[0]+"`` with reason: "+message
372372
await ctx.message.channel.send(msg)
@@ -376,7 +376,7 @@ async def addBan(self, ctx, GUID: str, time=0, *message):
376376
brief="Removes a ban",
377377
pass_context=True)
378378
async def removeBan(self, ctx, banID: int):
379-
await self.epm_rcon.removeBan(banID)
379+
await self.arma_rcon.removeBan(banID)
380380

381381
msg = "Removed ban: ``"+str(banID)+"``"
382382
await ctx.message.channel.send(msg)
@@ -386,7 +386,7 @@ async def removeBan(self, ctx, banID: int):
386386
brief="Removes a ban",
387387
pass_context=True)
388388
async def getBans(self, ctx):
389-
bans = await self.epm_rcon.getBansArray()
389+
bans = await self.arma_rcon.getBansArray()
390390
bans.reverse() #news bans first
391391
msgtable = prettytable.PrettyTable()
392392
msgtable.field_names = ["ID", "GUID", "Time", "Reason"]
@@ -427,7 +427,7 @@ async def getBans(self, ctx):
427427
brief="Gets the current version of the BE server",
428428
pass_context=True)
429429
async def getBEServerVersion(self, ctx):
430-
version = await self.epm_rcon.getBEServerVersion()
430+
version = await self.arma_rcon.getBEServerVersion()
431431
msg = "BE version: ``"+str(version)+"``"
432432
await ctx.message.channel.send(msg)
433433

@@ -436,7 +436,7 @@ async def getBEServerVersion(self, ctx):
436436
brief="Locks the server. No one will be able to join",
437437
pass_context=True)
438438
async def lock(self, ctx):
439-
data = await self.epm_rcon.lock()
439+
data = await self.arma_rcon.lock()
440440
msg = "Locked the Server"
441441
await ctx.message.channel.send(msg)
442442

@@ -445,7 +445,7 @@ async def lock(self, ctx):
445445
brief="Unlocks the Server",
446446
pass_context=True)
447447
async def unlock(self, ctx):
448-
data = await self.epm_rcon.unlock()
448+
data = await self.arma_rcon.unlock()
449449
msg = "Unlocked the Server"
450450
await ctx.message.channel.send(msg)
451451

@@ -454,7 +454,7 @@ async def unlock(self, ctx):
454454
brief="Shutdowns the Server",
455455
pass_context=True)
456456
async def shutdown(self, ctx):
457-
data = await self.epm_rcon.shutdown()
457+
data = await self.arma_rcon.shutdown()
458458
msg = "Shutdown the Server"
459459
await ctx.message.channel.send(msg)
460460

@@ -463,7 +463,7 @@ async def shutdown(self, ctx):
463463
brief="Restart mission with current player slot selection",
464464
pass_context=True)
465465
async def restart(self, ctx):
466-
data = await self.epm_rcon.restart()
466+
data = await self.arma_rcon.restart()
467467
msg = "Restarting the Mission"
468468
await ctx.message.channel.send(msg)
469469

@@ -472,7 +472,7 @@ async def restart(self, ctx):
472472
brief="Shuts down and restarts the server immediately",
473473
pass_context=True)
474474
async def restartServer(self, ctx):
475-
data = await self.epm_rcon.restartServer()
475+
data = await self.arma_rcon.restartServer()
476476
msg = "Restarting the Server"
477477
await ctx.message.channel.send(msg)
478478

@@ -481,7 +481,7 @@ async def restartServer(self, ctx):
481481
brief="Shuts down and restarts the server after mission ends",
482482
pass_context=True)
483483
async def restartserveraftermission(self, ctx):
484-
data = await self.epm_rcon.restartserveraftermission()
484+
data = await self.arma_rcon.restartserveraftermission()
485485
msg = "Restarting the Server after mission ends"
486486
await ctx.message.channel.send(msg)
487487

@@ -490,7 +490,7 @@ async def restartserveraftermission(self, ctx):
490490
brief="Shuts down the server after mission ends",
491491
pass_context=True)
492492
async def shutdownserveraftermission(self, ctx):
493-
data = await self.epm_rcon.shutdownserveraftermission()
493+
data = await self.arma_rcon.shutdownserveraftermission()
494494
msg = "Restarting the Server after mission ends"
495495
await ctx.message.channel.send(msg)
496496

@@ -499,7 +499,7 @@ async def shutdownserveraftermission(self, ctx):
499499
brief="Shuts down the server after mission ends",
500500
pass_context=True)
501501
async def reassign(self, ctx):
502-
data = await self.epm_rcon.reassign()
502+
data = await self.arma_rcon.reassign()
503503
msg = "Restart the mission with new player slot selection"
504504
await ctx.message.channel.send(msg)
505505

@@ -508,7 +508,7 @@ async def reassign(self, ctx):
508508
brief="Shows performance information in the dedicated server console. Interval 0 means to stop monitoring.",
509509
pass_context=True)
510510
async def monitords(self, ctx, interval: int):
511-
data = await self.epm_rcon.monitords(interval)
511+
data = await self.arma_rcon.monitords(interval)
512512
msg = "Restart the mission with new player slot selection"
513513
await ctx.message.channel.send(msg)
514514

@@ -517,7 +517,7 @@ async def monitords(self, ctx, interval: int):
517517
brief="Users can vote for the mission selection.",
518518
pass_context=True)
519519
async def goVote(self, ctx):
520-
data = await self.epm_rcon.goVote()
520+
data = await self.arma_rcon.goVote()
521521
msg = "Restart the mission with new player slot selection"
522522
await ctx.message.channel.send(msg)
523523

0 commit comments

Comments
 (0)