ping on map feature complete

This commit is contained in:
Michele 2021-02-09 17:13:52 +00:00
parent 17cce56866
commit bce97de302
19 changed files with 1002 additions and 233 deletions

View file

@ -155,6 +155,11 @@ namespace Sledgemapper
p.Position = player.Position;
}
});
Connection.On<Ping>("Ping", (ping) =>
{
SessionData.Pings.TryAdd(Guid.NewGuid(), ping);
});
}
private Task<string> GetToken()
@ -233,6 +238,14 @@ namespace Sledgemapper
}
}
internal async Task Ping(Tile hoveredTile)
{
if (Connection!=null && Connection.State == HubConnectionState.Connected)
{
await Connection.InvokeAsync("Ping",SessionData.SessionName, hoveredTile);
}
}
}
class AuthenticatedHttpClientHandler : HttpClientHandler