Skip to content

Commit

Permalink
0.0.2.14 - Fix bug wiping guild tables on orphaned cleanup, add check…
Browse files Browse the repository at this point in the history
…s for ports, update buttons for readability
  • Loading branch information
skeezerbean committed Sep 9, 2021
1 parent 959fd04 commit 104b042
Show file tree
Hide file tree
Showing 29 changed files with 73 additions and 31 deletions.
21 changes: 21 additions & 0 deletions Models/SettingsManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public static bool SaveSettings(string path, object item)
public static BindableCollection<ConfigEntry> CreateCollectionFromConfigFile(string inFile)
{
string tmpDescription = string.Empty;
string errors = string.Empty;
BindableCollection<ConfigEntry> tempCollection = new BindableCollection<ConfigEntry>();

try
Expand Down Expand Up @@ -82,6 +83,17 @@ public static BindableCollection<ConfigEntry> CreateCollectionFromConfigFile(str
tempCollection.Add(entry);
tmpDescription = string.Empty; // reset our description
}
// If the entry doesn't start with # (comment), and doesn't contain '=' (setting)
// then it needs to be either the world or bnet config file declaration at the top
// otherwise this is an invalid entry
else if (!item.StartsWith("#")
&& !item.Contains("=")
&& item != "[worldserver]"
&& item != "[bnetserver]"
&& !string.IsNullOrWhiteSpace(item))
{
errors += $"Invalid row -> {item} \n";
}
else
{
// If we're here, then the line is part of the description or other line
Expand All @@ -97,6 +109,15 @@ public static BindableCollection<ConfigEntry> CreateCollectionFromConfigFile(str
}
catch { return new BindableCollection<ConfigEntry>(); } // if something failed, then return a default blank collection

// If there were errors caught, alert user
if (errors != string.Empty)
{
MessageBox.Show($"Alert! The following entries in {inFile} were found, and need fixed manually or there will be problems\n{errors}");

// Reset for the next file, if any
errors = string.Empty;
}

return tempCollection;
}

Expand Down
4 changes: 2 additions & 2 deletions Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.0.2.13")]
[assembly: AssemblyFileVersion("0.0.2.13")]
[assembly: AssemblyVersion("0.0.2.14")]
[assembly: AssemblyFileVersion("0.0.2.14")]
Binary file modified Resources/Buttons/Account_Manager.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Resources/Buttons/ApplyChangesToDatabase.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Resources/Buttons/CheckConfig.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Resources/Buttons/Config_Generator.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Resources/Buttons/CreateAccount.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Resources/Buttons/DeleteAccount.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Resources/Buttons/DeleteCharacter.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Resources/Buttons/DeleteOrphanedCharacters.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Resources/Buttons/ExportConfigs.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Resources/Buttons/ListOrphanedObjects.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Resources/Buttons/ReloadConfigs.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Resources/Buttons/RemoveOrphanedObjects.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Resources/Buttons/SetBuild.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Resources/Buttons/SetClientFolder.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Resources/Buttons/SetConfigsToDefault.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Resources/Buttons/SetIP.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Resources/Buttons/SetSPPFolder.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Resources/Buttons/Settings.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Resources/Buttons/ShowAccounts.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Resources/Buttons/ShowCharacters.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion SPP-LegionV2-Management.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>13</ApplicationRevision>
<ApplicationRevision>14</ApplicationRevision>
<ApplicationVersion>0.0.2.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
Expand Down
2 changes: 1 addition & 1 deletion ViewModels/AccountManagerViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,7 @@ private async Task<int> RemoveObjectRows(string table, string field, int guid =
+ $"{((OrphanedRowsLimit > 0) ? $" LIMIT {OrphanedRowsLimit}" : "")}", true);
}
// Handle account or queststatus related tables
if (table.Contains("legion_characters`.`account_") || table.Contains("legion_characters`.`character_queststatus"))
else if (table.Contains("legion_characters`.`account_") || table.Contains("legion_characters`.`character_queststatus"))
{
if (table.Contains("legion_characters`.`account_item_favorite_appearances"))
// This table refers to battlenet accounts rather than normal account id.
Expand Down
21 changes: 21 additions & 0 deletions ViewModels/ConfigGeneratorViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -652,6 +652,9 @@ public void CheckSPPConfig()
string wowConfigPortal = string.Empty;
string bnetBindIP = GetValueFromCollection(BnetCollection, "BindIP");
string worldBindIP = GetValueFromCollection(WorldCollection, "BindIP");
string worldServerPort = GetValueFromCollection(WorldCollection, "WorldServerPort");
string DBServerPort = MySqlManager.MySQLQueryToString(@"SELECT `port` FROM `legion_auth`.`realmlist` WHERE id = '1'");
string DBGamePort = MySqlManager.MySQLQueryToString(@"SELECT `gamePort` FROM `legion_auth`.`realmlist` WHERE id = '1'");
bool solocraft = IsOptionEnabled(WorldCollection, "Solocraft.Enable");
bool flexcraftHealth = IsOptionEnabled(WorldCollection, "HealthCraft.Enable");
bool flexcraftUnitMod = IsOptionEnabled(WorldCollection, "UnitModCraft.Enable");
Expand Down Expand Up @@ -770,6 +773,24 @@ public void CheckSPPConfig()
result += "⚠ Alert - both of these addresses should match, and probably both be set to 127.0.0.1\n\n";
}

// Check the port setting in config vs DB
if (worldServerPort != DBServerPort)
{
result += $"WorldServerPort - {worldServerPort}\n";
result += $"Server Port from DB - {DBServerPort}\n";
result += "⚠ Alert - both of these ports should match or you won't be able to connect\n\n";
}

// Check ports vs defaults
if (worldServerPort != "8198")
{
result += "⚠ Warning - WorldServerPort is not 8198, which is the default. This may lead to unexpected issues\n\n";
}
if (DBGamePort != "8086")
{
result += "⚠ Warning - Database realm gamePort is not 8086, which is the default. This may lead to unexpected issues\n\n";
}

// Check our solocraft settings compared to FlexCraft entries
// If both are enabled, this is a problem
if (solocraft)
Expand Down
28 changes: 14 additions & 14 deletions Views/AccountManagerView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,17 @@
<!-- Buttons for left side -->
<WrapPanel Orientation="Horizontal" HorizontalAlignment="Center" >

<Button x:Name="RetrieveAccounts" Margin="5" MaxWidth="265"
<Button x:Name="RetrieveAccounts" Margin="5" MaxWidth="200"
local:EyeCandyForeGround.Image="/Resources/Buttons/ShowAccounts.png"
Style="{DynamicResource ImageButtonStyle}" Background="Transparent"
ToolTip="Retreives Legion Account/BNET account info from the database" />

<Button x:Name="AddAccount" Margin="5" MaxWidth="265"
<Button x:Name="AddAccount" Margin="5" MaxWidth="200"
local:EyeCandyForeGround.Image="/Resources/Buttons/CreateAccount.png"
Style="{DynamicResource ImageButtonStyle}" Background="Transparent"
ToolTip="Open Dialog to create an account and BNET account" />

<Button x:Name="DeleteSelectedAccount" Margin="5" MaxWidth="265"
<Button x:Name="DeleteSelectedAccount" Margin="5" MaxWidth="200"
local:EyeCandyForeGround.Image="/Resources/Buttons/DeleteAccount.png"
Style="{DynamicResource ImageButtonStyle}" Background="Transparent"
ToolTip="Delete the selected account, may take a while if there are a lot of database objects" />
Expand Down Expand Up @@ -81,8 +81,8 @@
<!-- Buttons for top-right side -->
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Grid.Column="1">

<Button x:Name="ApplyAccountChanges" Margin="5" MaxWidth="450"
local:EyeCandyForeGround.Image="/Resources/Buttons/ApplyChangesToDatabase.png" MaxHeight="60"
<Button x:Name="ApplyAccountChanges" Margin="5" MaxWidth="200"
local:EyeCandyForeGround.Image="/Resources/Buttons/ApplyChangesToDatabase.png"
Style="{DynamicResource ImageButtonStyle}" Background="Transparent"
ToolTip="Save any account changes to the database" />
</StackPanel>
Expand Down Expand Up @@ -148,12 +148,12 @@

<WrapPanel Orientation="Horizontal" HorizontalAlignment="Center">

<Button x:Name="RetrieveCharacters" Margin="5" MaxWidth="265"
<Button x:Name="RetrieveCharacters" Margin="5" MaxWidth="200"
local:EyeCandyForeGround.Image="/Resources/Buttons/ShowCharacters.png"
Style="{DynamicResource ImageButtonStyle}" Background="Transparent"
ToolTip="Retreives character info from the database" />

<Button x:Name="DeleteSelectedCharacter" Margin="5" MaxWidth="265"
<Button x:Name="DeleteSelectedCharacter" Margin="5" MaxWidth="200"
local:EyeCandyForeGround.Image="/Resources/Buttons/DeleteCharacter.png"
Style="{DynamicResource ImageButtonStyle}" Background="Transparent"
ToolTip="Delete the selected account" />
Expand Down Expand Up @@ -190,8 +190,8 @@
<!-- Buttons for top-right side -->
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Grid.Column="1">

<Button x:Name="ApplyCharacterChanges" Margin="5" MaxWidth="450"
local:EyeCandyForeGround.Image="/Resources/Buttons/ApplyChangesToDatabase.png" MaxHeight="60"
<Button x:Name="ApplyCharacterChanges" Margin="5" MaxWidth="200"
local:EyeCandyForeGround.Image="/Resources/Buttons/ApplyChangesToDatabase.png"
Style="{DynamicResource ImageButtonStyle}" Background="Transparent"
ToolTip="Save any character changes to the database" />
</StackPanel>
Expand Down Expand Up @@ -231,12 +231,12 @@

<WrapPanel Orientation="Horizontal" HorizontalAlignment="Center">

<Button x:Name="RetrieveOrphanedCharacters" Margin="5" MaxWidth="265"
<Button x:Name="RetrieveOrphanedCharacters" Margin="5" MaxWidth="200"
local:EyeCandyForeGround.Image="/Resources/Buttons/ShowCharacters.png"
Style="{DynamicResource ImageButtonStyle}" Background="Transparent"
ToolTip="Retreives character info from the database" />

<Button x:Name="DeleteOrphanedCharacters" Margin="5" MaxWidth="265" MaxHeight="35"
<Button x:Name="DeleteOrphanedCharacters" Margin="5" MaxWidth="200"
local:EyeCandyForeGround.Image="/Resources/Buttons/DeleteOrphanedCharacters.png"
Style="{DynamicResource ImageButtonStyle}" Background="Transparent"
ToolTip="Delete the orphaned characters (may take a while)" />
Expand Down Expand Up @@ -270,7 +270,7 @@

<!-- Buttons for top-right side -->
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Grid.Column="1">
<Button x:Name="ApplyOrphanedCharacterChanges" Margin="5" MaxWidth="450" MaxHeight="60"
<Button x:Name="ApplyOrphanedCharacterChanges" Margin="5" MaxWidth="200"
local:EyeCandyForeGround.Image="/Resources/Buttons/ApplyChangesToDatabase.png"
Style="{DynamicResource ImageButtonStyle}" Background="Transparent"
ToolTip="Save any character changes to the database" />
Expand Down Expand Up @@ -307,12 +307,12 @@
</Grid.RowDefinitions>

<WrapPanel Orientation="Horizontal" HorizontalAlignment="Center">
<Button x:Name="GetOrphanedData" Margin="5" MaxWidth="537"
<Button x:Name="GetOrphanedData" Margin="5" MaxWidth="200"
local:EyeCandyForeGround.Image="/Resources/Buttons/ListOrphanedObjects.png"
Style="{DynamicResource ImageButtonStyle}" Background="Transparent"
ToolTip="Calculate the orphaned objects" />

<Button x:Name="RemoveOrphanedItems" Margin="5" MaxWidth="537"
<Button x:Name="RemoveOrphanedItems" Margin="5" MaxWidth="200"
local:EyeCandyForeGround.Image="/Resources/Buttons/RemoveOrphanedObjects.png"
Style="{DynamicResource ImageButtonStyle}" Background="Transparent"
ToolTip="Delete the orphaned objects (may take a while)" />
Expand Down
12 changes: 6 additions & 6 deletions Views/ConfigGeneratorView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,27 +25,27 @@
<WrapPanel Orientation="Horizontal" HorizontalAlignment="Center">

<!-- Top row of buttons -->
<Button x:Name="SetIP" Margin="5" MaxWidth="250"
<Button x:Name="SetIP" Margin="5" MaxWidth="200"
local:EyeCandyForeGround.Image="/Resources/Buttons/SetIP.png"
Style="{DynamicResource ImageButtonStyle}" Background="Transparent"
ToolTip="Set the listening/realm IP for the repack. This is for playing on a separate machine on the LAN or setting up the pack for internet connectivity. This will update the server config, DB and WoW Legion client config if able." />
<Button x:Name="SetBuild" Margin="5" MaxWidth="250"
<Button x:Name="SetBuild" Margin="5" MaxWidth="200"
local:EyeCandyForeGround.Image="/Resources/Buttons/SetBuild.png"
Style="{DynamicResource ImageButtonStyle}" Background="Transparent"
ToolTip="Sets the Game.Build.Version in the config/database" />
<Button x:Name="SetDefaults" Margin="5" MaxWidth="350"
<Button x:Name="SetDefaults" Margin="5" MaxWidth="200"
local:EyeCandyForeGround.Image="/Resources/Buttons/SetConfigsToDefault.png"
Style="{DynamicResource ImageButtonStyle}" Background="Transparent"
ToolTip="Sets default entries in the SPP config. This will overwrite current settings from the local default template file." />
<Button x:Name="LoadSettings" Margin="5" MaxWidth="250"
<Button x:Name="LoadSettings" Margin="5" MaxWidth="200"
local:EyeCandyForeGround.Image="/Resources/Buttons/ReloadConfigs.png"
Style="{DynamicResource ImageButtonStyle}" Background="Transparent"
ToolTip="This reloads the Settings file, default templates and SPP world/bnet files from disk. This is helpful to undo any changes in the current session instead of restarting the app." />
<Button x:Name="CheckSPPConfig" Margin="5" MaxWidth="250"
<Button x:Name="CheckSPPConfig" Margin="5" MaxWidth="200"
local:EyeCandyForeGround.Image="/Resources/Buttons/CheckConfig.png"
Style="{DynamicResource ImageButtonStyle}" Background="Transparent"
ToolTip="This will check the current SPP config for some potential issues." />
<Button x:Name="SaveConfig" Margin="5" MaxWidth="250"
<Button x:Name="SaveConfig" Margin="5" MaxWidth="200"
local:EyeCandyForeGround.Image="/Resources/Buttons/ExportConfigs.png"
Style="{DynamicResource ImageButtonStyle}" Background="Transparent"
ToolTip="Save settings and generate configs to SPP installation and database." />
Expand Down
4 changes: 2 additions & 2 deletions Views/SettingsView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@
<StackPanel Margin="10">
<WrapPanel Orientation="Horizontal" Margin="10">
<Button x:Name="SPPFolderBrowse" Margin="5" Style="{DynamicResource ImageButtonStyle}" Background="Transparent"
local:EyeCandyForeGround.Image="/Resources/Buttons/SetSPPFolder.png" MaxWidth="400" MaxHeight="47" />
local:EyeCandyForeGround.Image="/Resources/Buttons/SetSPPFolder.png" MaxWidth="300" MaxHeight="47" />

<TextBlock x:Name="SPPFolderLocation" Margin="5,11" VerticalAlignment="Center" />
</WrapPanel>

<WrapPanel Orientation="Horizontal" Margin="10">
<Button x:Name="WowConfigBrowse" Margin="5" local:EyeCandyForeGround.Image="/Resources/Buttons/SetClientFolder.png"
Style="{DynamicResource ImageButtonStyle}" Background="Transparent" MaxWidth="400" MaxHeight="47" />
Style="{DynamicResource ImageButtonStyle}" Background="Transparent" MaxWidth="300" MaxHeight="47" />

<TextBlock x:Name="WOWConfigLocation" Margin="5,9" VerticalAlignment="Center" />
</WrapPanel>
Expand Down
10 changes: 5 additions & 5 deletions Views/ShellView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@
<!-- Top buttons for switching pages -->
<StackPanel DockPanel.Dock="Top">
<WrapPanel Orientation="Horizontal" HorizontalAlignment="Center">
<Button x:Name="LoadPageConfigGenerator" Width="180" Margin="5,5,15,5"
<Button x:Name="LoadPageConfigGenerator" Width="200" Margin="5,5,15,5"
local:EyeCandyForeGround.Image="/Resources/Buttons/Config_Generator.png"
Style="{DynamicResource ImageButtonStyle}" Background="Transparent" />
<Button x:Name="LoadPageAccountManager" Width="180" Margin="5,5,15,5"
<Button x:Name="LoadPageAccountManager" Width="200" Margin="5,5,15,5"
local:EyeCandyForeGround.Image="/Resources/Buttons/Account_Manager.png"
Style="{DynamicResource ImageButtonStyle}" Background="Transparent" />
<Button x:Name="LoadPageSettings" Width="180" Margin="5,5,5,5"
<Button x:Name="LoadPageSettings" Width="200" Margin="5,5,5,5"
local:EyeCandyForeGround.Image="/Resources/Buttons/Settings.png"
Style="{DynamicResource ImageButtonStyle}" Background="Transparent" />
</WrapPanel>
Expand All @@ -66,12 +66,12 @@
<TextBlock Text="Database Connection:" Margin="5" FontWeight="Bold" />
<TextBlock x:Name="SQLConnectionStatus" Margin="0,5,15,5" FontWeight="Bold" />
</WrapPanel>
<WrapPanel DockPanel.Dock="Top" HorizontalAlignment="Center" Margin="50,0">
<!--<WrapPanel DockPanel.Dock="Top" HorizontalAlignment="Center" Margin="50,0">
<Button MaxWidth="850" MaxHeight="60"
local:EyeCandyForeGround.Image="/Resources/Background/MdicBangsMoms.png"
local:EyeCandyBackGround.ImageBackGround="/Resources/Background/MdicYourMom.png"
Style="{DynamicResource DualImageButtonStyle}" Background="Transparent"/>
</WrapPanel>
</WrapPanel>-->

<!-- ActiveItem is Caliburn, marks this as the active child form -->
<ContentControl x:Name="ActiveItem" Margin="35,30,35,60" />
Expand Down

0 comments on commit 104b042

Please sign in to comment.