Actual fix random network sending + stopgame command
This commit is contained in:
@@ -26,7 +26,8 @@ namespace YJMPD_UWP.Model
|
||||
PictureUrl,
|
||||
DestinationReached,
|
||||
GameEnded,
|
||||
PlayerReady
|
||||
PlayerReady,
|
||||
StopGame
|
||||
}
|
||||
|
||||
public ApiHandler()
|
||||
@@ -94,6 +95,9 @@ namespace YJMPD_UWP.Model
|
||||
|
||||
App.Game.StopMatch();
|
||||
break;
|
||||
case Command.StopGame:
|
||||
App.Game.StopGame();
|
||||
break;
|
||||
default:
|
||||
//Do nothing
|
||||
break;
|
||||
|
||||
@@ -19,6 +19,22 @@ namespace YJMPD_UWP.ViewModels
|
||||
timer.Interval = TimeSpan.FromSeconds(1);
|
||||
timer.Tick += Timer_Tick;
|
||||
timer.Start();
|
||||
|
||||
App.Photo.OnStatusUpdate += Photo_OnStatusUpdate;
|
||||
}
|
||||
|
||||
private void Photo_OnStatusUpdate(object sender, Helpers.EventArgs.PhotoStatusUpdatedEventArgs e)
|
||||
{
|
||||
dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
|
||||
{
|
||||
if (e.Status == Model.PhotoHandler.PhotoStatus.NOPHOTO)
|
||||
timer.Start();
|
||||
else
|
||||
{
|
||||
secondsleft = 60;
|
||||
timer.Stop();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void Timer_Tick(object sender, object e)
|
||||
|
||||
Reference in New Issue
Block a user