Skip to content

Commit

Permalink
Merge pull request #4 from TheXorog/testing
Browse files Browse the repository at this point in the history
Testing
  • Loading branch information
TheXorog authored Oct 26, 2021
2 parents eae39fb + ccafc9c commit 990c442
Show file tree
Hide file tree
Showing 11 changed files with 10,164 additions and 2 deletions.
15 changes: 15 additions & 0 deletions OBSControl/DataPullerWebSocket/DataPuller.cs
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ internal static void LiveDataMessageRecieved(string e)

internal static void MapDataReconnected(ReconnectionInfo msg)
{
Program.SendNotification("Connected to Beat Saber", 1000, Objects.MessageType.INFO);
if (msg.Type != ReconnectionType.Initial)
{
_logger.LogWarn($"[BS-DP1] Reconnected: {msg.Type}");
Expand All @@ -164,7 +165,10 @@ internal static void MapDataDisconnected(DisconnectionInfo msg)
if (!processCollection.Any(x => x.ProcessName.ToLower().StartsWith("beat")))
{
if (Objects.LastDP1Warning != Objects.ConnectionTypeWarning.NO_PROCESS)
{
_logger.LogWarn($"[BS-DP1] Couldn't find a BeatSaber process, is BeatSaber started? ({msg.Type})");
Program.SendNotification("Couldn't connect to BeatSaber, is it even running?", 5000, Objects.MessageType.ERROR);
}
Objects.LastDP1Warning = Objects.ConnectionTypeWarning.NO_PROCESS;
}
else
Expand All @@ -184,20 +188,29 @@ internal static void MapDataDisconnected(DisconnectionInfo msg)
else
{
if (Objects.LastDP1Warning != Objects.ConnectionTypeWarning.NOT_MODDED)
{
_logger.LogCritical($"[BS-DP1] Beat Saber seems to be running but the BSDataPuller modifaction doesn't seem to be installed. Is your game even modded? (If haven't modded it, please do it: https://bit.ly/2TAvenk. If already modded, install BSDataPuller: https://bit.ly/3mcvC7g) ({msg.Type})");
Program.SendNotification("Couldn't connect to Beat Saber. Have you modded your game?", 10000, Objects.MessageType.ERROR);
}
Objects.LastDP1Warning = Objects.ConnectionTypeWarning.NOT_MODDED;
}

if (FoundWebSocketDll)
{
if (Objects.LastDP1Warning != Objects.ConnectionTypeWarning.MOD_INSTALLED)
{
_logger.LogCritical($"[BS-DP1] Beat Saber seems to be running and the BSDataPuller modifaction seems to be installed. Please make sure you put in the right port and you installed all of BSDataPuller' dependiencies! (If not installed, please install it: https://bit.ly/3mcvC7g) ({msg.Type})");
Program.SendNotification("Couldn't connect to Beat Saber. Please make sure you selected the right port.", 10000, Objects.MessageType.ERROR);
}
Objects.LastDP1Warning = Objects.ConnectionTypeWarning.MOD_INSTALLED;
}
else
{
if (Objects.LastDP1Warning != Objects.ConnectionTypeWarning.MOD_NOT_INSTALLED)
{
_logger.LogCritical($"[BS-DP1] Beat Saber seems to be running but the BSDataPuller modifaction doesn't seem to be installed. Please make sure to install BSDataPuller! (If not installed, please install it: https://bit.ly/3mcvC7g) ({msg.Type})");
Program.SendNotification("Couldn't connect to Beat Saber. Please make sure DataPuller is installed.", 10000, Objects.MessageType.ERROR);
}
Objects.LastDP1Warning = Objects.ConnectionTypeWarning.MOD_NOT_INSTALLED;
}
}
Expand Down Expand Up @@ -435,12 +448,14 @@ internal static void HandleFile(DataPullerObjects.DataPullerMain BeatmapInfo, Da
_logger.LogInfo($"[OBSC] Renaming \"{fileInfo.Name}\" to \"{NewName}{FileExists}{fileInfo.Extension}\"..");
File.Move(OldFileName, NewFileName);
_logger.LogInfo($"[OBSC] Successfully renamed.");
Program.SendNotification("Recording renamed.", 1000, Objects.MessageType.INFO);
}
else
{
_logger.LogInfo($"[OBSC] Deleting \"{fileInfo.Name}\"..");
File.Delete(OldFileName);
_logger.LogInfo($"[OBSC] Successfully deleted.");
Program.SendNotification("Recording deleted.", 1000, Objects.MessageType.INFO);
}
}
catch (Exception ex)
Expand Down
Loading

0 comments on commit 990c442

Please sign in to comment.