Fix save errors blocking play session recording. Fix route that SDK client hits for play sessions
parent
8b3f2c6cde
commit
b863080842
|
@ -333,11 +333,18 @@ namespace LANCommander.PlaynitePlugin
|
|||
{
|
||||
if (args.Game.PluginId == Id)
|
||||
{
|
||||
SaveController.Download(args.Game);
|
||||
|
||||
var gameId = Guid.Parse(args.Game.GameId);
|
||||
|
||||
LANCommanderClient.StartPlaySession(gameId);
|
||||
|
||||
try
|
||||
{
|
||||
SaveController.Download(args.Game);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger?.Error(ex, "Could not download save");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -345,11 +352,18 @@ namespace LANCommander.PlaynitePlugin
|
|||
{
|
||||
if (args.Game.PluginId == Id)
|
||||
{
|
||||
SaveController.Upload(args.Game);
|
||||
|
||||
var gameId = Guid.Parse(args.Game.GameId);
|
||||
|
||||
LANCommanderClient.EndPlaySession(gameId);
|
||||
|
||||
try
|
||||
{
|
||||
SaveController.Upload(args.Game);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger?.Error(ex, "Could not upload save");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -384,14 +384,14 @@ namespace LANCommander.SDK
|
|||
{
|
||||
Logger?.LogTrace("Starting a game session...");
|
||||
|
||||
PostRequest<object>($"/api/PlaySession/Start/{gameId}");
|
||||
PostRequest<object>($"/api/PlaySessions/Start/{gameId}");
|
||||
}
|
||||
|
||||
public void EndPlaySession(Guid gameId)
|
||||
{
|
||||
Logger?.LogTrace("Ending a game session...");
|
||||
|
||||
PostRequest<object>($"/api/PlaySession/End/{gameId}");
|
||||
PostRequest<object>($"/api/PlaySessions/End/{gameId}");
|
||||
}
|
||||
|
||||
private string GetMacAddress()
|
||||
|
|
Loading…
Reference in New Issue