code cleanup
This commit is contained in:
@@ -1,7 +1,5 @@
|
|||||||
using PathFinding;
|
using PathFinding;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
|
||||||
using System.Numerics;
|
|
||||||
|
|
||||||
namespace Gameboard.ShogiUI.BoardState.Pieces
|
namespace Gameboard.ShogiUI.BoardState.Pieces
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ using PathFinding;
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Numerics;
|
using System.Numerics;
|
||||||
using System.Text;
|
|
||||||
|
|
||||||
namespace Gameboard.ShogiUI.BoardState
|
namespace Gameboard.ShogiUI.BoardState
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,13 +2,13 @@
|
|||||||
|
|
||||||
namespace Gameboard.ShogiUI.Sockets.ServiceModels.Api.Messages
|
namespace Gameboard.ShogiUI.Sockets.ServiceModels.Api.Messages
|
||||||
{
|
{
|
||||||
public class GetTokenResponse
|
public class GetTokenResponse
|
||||||
{
|
{
|
||||||
public Guid OneTimeToken { get; }
|
public Guid OneTimeToken { get; }
|
||||||
|
|
||||||
public GetTokenResponse(Guid token)
|
public GetTokenResponse(Guid token)
|
||||||
{
|
{
|
||||||
OneTimeToken = token;
|
OneTimeToken = token;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
namespace Gameboard.ShogiUI.Sockets.ServiceModels.Socket.Interfaces
|
namespace Gameboard.ShogiUI.Sockets.ServiceModels.Socket.Interfaces
|
||||||
{
|
{
|
||||||
public interface IRequest
|
public interface IRequest
|
||||||
{
|
{
|
||||||
ClientAction Action { get; set; }
|
ClientAction Action { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
namespace Gameboard.ShogiUI.Sockets.ServiceModels.Socket.Interfaces
|
namespace Gameboard.ShogiUI.Sockets.ServiceModels.Socket.Interfaces
|
||||||
{
|
{
|
||||||
public interface IResponse
|
public interface IResponse
|
||||||
{
|
{
|
||||||
string Action { get; }
|
string Action { get; }
|
||||||
string Error { get; set; }
|
string Error { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
namespace Gameboard.ShogiUI.Sockets.ServiceModels.Socket.Types
|
namespace Gameboard.ShogiUI.Sockets.ServiceModels.Socket.Types
|
||||||
{
|
{
|
||||||
public enum ClientAction
|
public enum ClientAction
|
||||||
{
|
{
|
||||||
ListGames,
|
ListGames,
|
||||||
CreateGame,
|
CreateGame,
|
||||||
JoinGame,
|
JoinGame,
|
||||||
JoinByCode,
|
JoinByCode,
|
||||||
LoadGame,
|
LoadGame,
|
||||||
Move,
|
Move,
|
||||||
KeepAlive
|
KeepAlive
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using Gameboard.ShogiUI.Sockets.ServiceModels.Socket.Types;
|
using Gameboard.ShogiUI.Sockets.ServiceModels.Socket.Types;
|
||||||
using System.Net.WebSockets;
|
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Gameboard.ShogiUI.Sockets.Managers.ClientActionHandlers
|
namespace Gameboard.ShogiUI.Sockets.Managers.ClientActionHandlers
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ using Newtonsoft.Json;
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Concurrent;
|
using System.Collections.Concurrent;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
|
||||||
using System.Net.WebSockets;
|
using System.Net.WebSockets;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ namespace Gameboard.ShogiUI.Sockets.Repositories.Utility
|
|||||||
this.SetBearerToken(tokenResponse.AccessToken);
|
this.SetBearerToken(tokenResponse.AccessToken);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async new Task<HttpResponseMessage> GetAsync(string requestUri)
|
public new async Task<HttpResponseMessage> GetAsync(string requestUri)
|
||||||
{
|
{
|
||||||
var response = await base.GetAsync(requestUri);
|
var response = await base.GetAsync(requestUri);
|
||||||
if (response.StatusCode == HttpStatusCode.Unauthorized)
|
if (response.StatusCode == HttpStatusCode.Unauthorized)
|
||||||
@@ -73,7 +73,7 @@ namespace Gameboard.ShogiUI.Sockets.Repositories.Utility
|
|||||||
await response.Content.ReadAsStringAsync());
|
await response.Content.ReadAsStringAsync());
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
public async new Task<HttpResponseMessage> PostAsync(string requestUri, HttpContent content)
|
public new async Task<HttpResponseMessage> PostAsync(string requestUri, HttpContent content)
|
||||||
{
|
{
|
||||||
var response = await base.PostAsync(requestUri, content);
|
var response = await base.PostAsync(requestUri, content);
|
||||||
if (response.StatusCode == HttpStatusCode.Unauthorized)
|
if (response.StatusCode == HttpStatusCode.Unauthorized)
|
||||||
@@ -90,7 +90,7 @@ namespace Gameboard.ShogiUI.Sockets.Repositories.Utility
|
|||||||
await response.Content.ReadAsStringAsync());
|
await response.Content.ReadAsStringAsync());
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
public async new Task<HttpResponseMessage> PutAsync(string requestUri, HttpContent content)
|
public new async Task<HttpResponseMessage> PutAsync(string requestUri, HttpContent content)
|
||||||
{
|
{
|
||||||
var response = await base.PutAsync(requestUri, content);
|
var response = await base.PutAsync(requestUri, content);
|
||||||
if (response.StatusCode == HttpStatusCode.Unauthorized)
|
if (response.StatusCode == HttpStatusCode.Unauthorized)
|
||||||
@@ -107,7 +107,7 @@ namespace Gameboard.ShogiUI.Sockets.Repositories.Utility
|
|||||||
await response.Content.ReadAsStringAsync());
|
await response.Content.ReadAsStringAsync());
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
public async new Task<HttpResponseMessage> DeleteAsync(string requestUri)
|
public new async Task<HttpResponseMessage> DeleteAsync(string requestUri)
|
||||||
{
|
{
|
||||||
var response = await base.DeleteAsync(requestUri);
|
var response = await base.DeleteAsync(requestUri);
|
||||||
if (response.StatusCode == HttpStatusCode.Unauthorized)
|
if (response.StatusCode == HttpStatusCode.Unauthorized)
|
||||||
|
|||||||
@@ -1,5 +1,10 @@
|
|||||||
using Gameboard.ShogiUI.Sockets.Repositories.RepositoryManagers;
|
|
||||||
using Gameboard.ShogiUI.Sockets.Extensions;
|
using Gameboard.ShogiUI.Sockets.Extensions;
|
||||||
|
using Gameboard.ShogiUI.Sockets.Managers;
|
||||||
|
using Gameboard.ShogiUI.Sockets.Managers.ClientActionHandlers;
|
||||||
|
using Gameboard.ShogiUI.Sockets.Repositories;
|
||||||
|
using Gameboard.ShogiUI.Sockets.Repositories.RepositoryManagers;
|
||||||
|
using Gameboard.ShogiUI.Sockets.Repositories.Utility;
|
||||||
|
using Gameboard.ShogiUI.Sockets.ServiceModels.Socket.Types;
|
||||||
using Microsoft.AspNetCore.Authentication.JwtBearer;
|
using Microsoft.AspNetCore.Authentication.JwtBearer;
|
||||||
using Microsoft.AspNetCore.Builder;
|
using Microsoft.AspNetCore.Builder;
|
||||||
using Microsoft.AspNetCore.Hosting;
|
using Microsoft.AspNetCore.Hosting;
|
||||||
@@ -12,11 +17,6 @@ using Newtonsoft.Json.Serialization;
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Gameboard.ShogiUI.Sockets.Managers;
|
|
||||||
using Gameboard.ShogiUI.Sockets.Managers.ClientActionHandlers;
|
|
||||||
using Gameboard.ShogiUI.Sockets.Repositories;
|
|
||||||
using Gameboard.ShogiUI.Sockets.Repositories.Utility;
|
|
||||||
using Gameboard.ShogiUI.Sockets.ServiceModels.Socket.Types;
|
|
||||||
|
|
||||||
namespace Gameboard.ShogiUI.Sockets
|
namespace Gameboard.ShogiUI.Sockets
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user