Ping added in client

This commit is contained in:
Yorick Rommers
2016-01-21 21:18:33 +01:00
parent 1782dfbb0e
commit a37f78a119
+10
View File
@@ -40,6 +40,10 @@ namespace YJMPD_UWP.Model
switch (c)
{
case Command.Hi:
Debug.WriteLine("Keep alive message received!");
SendHi();
break;
case Command.PlayerJoined:
Debug.WriteLine("Played joined");
PlayerJoined(o[Command.PlayerJoined.ToString()].ToString());
@@ -118,6 +122,12 @@ namespace YJMPD_UWP.Model
});
}
public async Task SendHi()
{
JObject obj = JObject.FromObject(new { command = Command.Hi.ToString() });
await App.Network.Write(obj.ToString(Formatting.None));
}
//API stuff
public async Task<bool> JoinGame()
{