Fix not sending session name when joining a public session.

This commit is contained in:
2021-02-12 20:48:52 -06:00
parent fc869caa93
commit 6fc29100bd
3 changed files with 4 additions and 6 deletions

View File

@@ -18,9 +18,5 @@
<ProjectReference Include="..\Gameboard.ShogiUI.Sockets.ServiceModels\Gameboard.ShogiUI.Sockets.ServiceModels.csproj" /> <ProjectReference Include="..\Gameboard.ShogiUI.Sockets.ServiceModels\Gameboard.ShogiUI.Sockets.ServiceModels.csproj" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<Folder Include="Models\" />
</ItemGroup>
</Project> </Project>

View File

@@ -35,7 +35,8 @@ namespace Gameboard.ShogiUI.Sockets.Managers.ClientActionHandlers
var joinGameResponse = await gameboardRepository.PutJoinPublicSession(request.GameName, new PutJoinPublicSession var joinGameResponse = await gameboardRepository.PutJoinPublicSession(request.GameName, new PutJoinPublicSession
{ {
PlayerName = userName PlayerName = userName,
SessionName = request.GameName
}); });
if (joinGameResponse.JoinSucceeded) if (joinGameResponse.JoinSucceeded)

View File

@@ -71,7 +71,7 @@ namespace Gameboard.ShogiUI.Sockets.Repositories
public async Task<PutJoinPublicSessionResponse> PutJoinPublicSession(string gameName, PutJoinPublicSession request) public async Task<PutJoinPublicSessionResponse> PutJoinPublicSession(string gameName, PutJoinPublicSession request)
{ {
var uri = $"Session/{gameName}/Join"; var uri = $"Session/Join";
var content = new StringContent(JsonConvert.SerializeObject(request), Encoding.UTF8, "application/json"); var content = new StringContent(JsonConvert.SerializeObject(request), Encoding.UTF8, "application/json");
var response = await client.PutAsync(Uri.EscapeUriString(uri), content); var response = await client.PutAsync(Uri.EscapeUriString(uri), content);
var json = await response.Content.ReadAsStringAsync(); var json = await response.Content.ReadAsStringAsync();
@@ -114,6 +114,7 @@ namespace Gameboard.ShogiUI.Sockets.Repositories
{ {
var uri = $"Player/{playerName}"; var uri = $"Player/{playerName}";
var response = await client.GetAsync(Uri.EscapeUriString(uri)); var response = await client.GetAsync(Uri.EscapeUriString(uri));
Console.WriteLine(response);
var json = await response.Content.ReadAsStringAsync(); var json = await response.Content.ReadAsStringAsync();
return JsonConvert.DeserializeObject<GetPlayerResponse>(json); return JsonConvert.DeserializeObject<GetPlayerResponse>(json);
} }