Skip to content
This repository was archived by the owner on Jan 9, 2023. It is now read-only.

Commit 696ee57

Browse files
committed
add version and tweak error messages
1 parent 4029e5f commit 696ee57

File tree

6 files changed

+29
-24
lines changed

6 files changed

+29
-24
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ Get the [latest version zip](https://github.com/muppet9010/Streamlabs-Rcon-Integ
1111
Create a free account at [Currency Layer website](https://currencylayer.com) and make a note of the API access key as needs to be entered in to the programs config later on.
1212
Unzip the files in to the desired folder.
1313
Open config.json in a text editor and add in your details.
14-
Run the: > Streamlabs Rcon Integration.exe
14+
Run the program: Streamlabs Rcon Integration.exe
1515
Select the desired profile from the dropdown and click Start.
1616
The integration is now running between the Streamlabs account and the game using the selected profile.
1717

18-
Should a critical error occur the progra may fail to load or close. Details can be found in the current log within the Logs folder.
18+
Should a critical error occur the program may fail to load or close. Details can be found in the most recent log file within the Logs folder.
1919

2020

2121
Usage Concepts
@@ -54,4 +54,4 @@ Uses the python modules and their dependcies:
5454
- PyInstaller = https://www.pyinstaller.org/
5555
- MCRcon = https://github.com/uncaught-exceptions/mcrcon
5656

57-
Build the scripts into an exe using PyInstaller via Build.bat. It will place the exe in the "build\dist" folder.
57+
Build the scripts into an exe using PyInstaller via Build.bat. It will place the exe and other files in the `build\dist` folder. This `dist` folder is the program and can be shared via zip.

Source/Gui.py

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
class GuiWindow():
55
def __init__(self, state):
66
root = TK.Tk()
7+
root.title("Streamlabs Rcon Integration - " + state.version)
78
root.minsize(500, 200)
89
root.geometry("1000x400")
910
root.protocol("WM_DELETE_WINDOW", state.OnQuitButtonHandler)
@@ -14,64 +15,64 @@ def __init__(self, state):
1415
class Gui(TK.Frame):
1516
def __init__(self, state, master=None):
1617
super().__init__(master)
17-
self.master=master
18+
self.master = master
1819
self.pack()
19-
self.state=state
20-
self.translations=state.translations
20+
self.state = state
21+
self.translations = state.translations
2122

2223
def CreateWidgets(self):
2324
self._CreateRunningBar(self.master)
2425
self._CreateActivityLog(self.master)
2526
# self._CreateBottomBar(self.master) # Don't bother with for just a quit button
2627

2728
def _CreateRunningBar(self, parent):
28-
runningContainer=TK.Frame(parent)
29+
runningContainer = TK.Frame(parent)
2930
runningContainer.pack(fill=TK.X, side=TK.TOP)
3031

31-
self.statusText=TK.StringVar()
32+
self.statusText = TK.StringVar()
3233
self.state.UpdateStatus()
33-
statusLabel=TK.Label(
34+
statusLabel = TK.Label(
3435
runningContainer, textvariable=self.statusText, height=1, width=30)
3536
statusLabel.pack(side=TK.LEFT)
3637

37-
self.selectedProfileName=TK.StringVar()
38-
self.sortedProfileNames=sorted(list(
38+
self.selectedProfileName = TK.StringVar()
39+
self.sortedProfileNames = sorted(list(
3940
self.state.profiles.profiles.keys()))
40-
configProfileDefault=self.state.config.GetSetting("Profile Default")
41+
configProfileDefault = self.state.config.GetSetting("Profile Default")
4142
if configProfileDefault != "" and configProfileDefault in self.sortedProfileNames:
4243
self.selectedProfileName.set(configProfileDefault)
4344
else:
4445
self.selectedProfileName.set(
4546
self.translations.currentTexts["Gui SelectProfile"])
46-
self.profileList=TK.OptionMenu(
47+
self.profileList = TK.OptionMenu(
4748
runningContainer, self.selectedProfileName, *self.sortedProfileNames)
4849
self.profileList.pack(side=TK.LEFT)
4950

50-
self.startButton=TK.Button(runningContainer,
51+
self.startButton = TK.Button(runningContainer,
5152
text=self.translations.currentTexts["Gui StartButton"], command=self.state.OnStartButtonHandler)
5253
self.startButton.pack(side=TK.LEFT)
5354

54-
self.stopButton=TK.Button(
55+
self.stopButton = TK.Button(
5556
runningContainer, text=self.translations.currentTexts["Gui StopButton"], command=self.state.OnStopButtonHandler)
5657
self.stopButton.pack(side=TK.LEFT)
5758

5859
self.OnStopped()
5960

6061
def _CreateActivityLog(self, parent):
61-
titleFrame=TK.LabelFrame(
62+
titleFrame = TK.LabelFrame(
6263
parent, text=self.translations.currentTexts["Gui ActivityLogTitle"])
6364
titleFrame.pack(fill=TK.BOTH, expand=True, side=TK.TOP, padx=3, pady=3)
64-
yScroll=TK.Scrollbar(titleFrame, orient=TK.VERTICAL)
65+
yScroll = TK.Scrollbar(titleFrame, orient=TK.VERTICAL)
6566
yScroll.pack(fill=TK.Y, expand=False, side=TK.RIGHT)
66-
self.activityLogText=TK.Text(
67+
self.activityLogText = TK.Text(
6768
titleFrame, height=5, wrap=TK.WORD, yscrollcommand=yScroll.set, state=TK.DISABLED)
6869
self.activityLogText.pack(fill=TK.BOTH, expand=True, side=TK.LEFT)
6970

7071
def _CreateBottomBar(self, parent):
71-
self.bottomBarContainer=TK.Frame(parent)
72+
self.bottomBarContainer = TK.Frame(parent)
7273
self.bottomBarContainer.pack(fill=TK.X, side=TK.TOP)
7374

74-
quitButton=TK.Button(self.bottomBarContainer, text=self.translations.currentTexts["Gui QuitButton"], fg="red",
75+
quitButton = TK.Button(self.bottomBarContainer, text=self.translations.currentTexts["Gui QuitButton"], fg="red",
7576
command=self.state.OnQuitButtonHandler)
7677
quitButton.pack(side=TK.LEFT)
7778

Source/Logging.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ def __init__(self, state):
1919
self.logFilePath = logFolder + "/" + logFileName
2020
self.debugLogFilePath = logFolder + "/Debug" + logFileName
2121
self.debugLogging = state.config.GetSetting("Logging DebugLogging")
22+
self.Log("Logging Started - " + self.state.version)
2223

2324
def _TidyUpOldLogFiles(self, logFolder, currentDT, daysLogsToKeep, dateFormat):
2425
for name in Os.listdir(logFolder):

Source/Rcon.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ def TestConnection(self):
1717
return True
1818
except Exception as ex:
1919
self.state.logging.RecordException(ex, "Rcon server test failed")
20-
self.state.RecordActivity(str(ex))
20+
self.state.RecordActivity(
21+
self.state.translations.currentTexts["Rcon TestErrorMessage"] + str(ex))
2122
return False
2223

2324
def SendCommand(self, commandString):

Source/Streamlabs Rcon Integration.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,13 @@
1212

1313
class State():
1414
def __init__(self):
15+
self.version = "0.1.0"
1516
self.config = Config(self)
1617
self.logging = Logging(self)
1718
self.config.LogMissingSettings()
18-
self.donationsIdsProcessed = {}
1919

2020
def Setup(self):
21+
self.donationsIdsProcessed = {}
2122
self.translations = Translations(self)
2223
self.currency = Currency(self)
2324
StreamlabsEvent.LoadEventDefinitions()
@@ -173,7 +174,7 @@ def UpdateStatus(self):
173174
self.translations.currentTexts["Status Stopped"])
174175

175176
def Run(self):
176-
self.logging.DebugLog("App Started")
177+
self.logging.Log("App Started")
177178
self.gui.mainloop()
178179

179180

Source/Translations.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,6 @@ def GetLocalisedTexts(self, language):
2828
"StreamlabsEvent NoProfileAction": "WARNING: no reaction found for event: ",
2929
"StreamlabsEvent EventHandled": "Event Handled: ",
3030
"Rcon CommandError": "ERROR: Rcon command failed, run manually: ",
31-
"Rcon CommandResponseWarning": "WARNING: Rcon got response from server: "
31+
"Rcon CommandResponseWarning": "WARNING: Rcon got response from server: ",
32+
"Rcon TestErrorMessage": "Rcon connection test message: "
3233
}

0 commit comments

Comments
 (0)