Add column drop, game info DTO, and disconnect

Introduce column-based drop mechanics and game info transfer; add disconnect handling and related API/interface updates. GameField API renamed Place->Drop and PlaceResult->DropResult, added ColumnFull, IsFull, and updated drop logic to insert at lowest empty row. Game model now exposes Players, adds GetPlayerByTag and makes StartGame public. New GameInformationDto conveys game state and field. Hub methods updated: GameCreated->GameJoined, RequestGameInformation, Place now forwards to Drop, and OnDisconnectedAsync notifies GameManager. GameManager implements RequestGameInformation, Drop (validates moves, broadcasts FieldUpdated and GameEnded on win/draw), improved JoinGame logic to auto-start when two players join, and handles player disconnects. Repository and interface extended with GetOneByConnectionId. Also tightened SignalR timeouts in Program.
This commit is contained in:
Jonas
2026-03-03 20:26:53 +01:00
parent 955d1e18c6
commit e8b45fa235
9 changed files with 165 additions and 31 deletions
+10
View File
@@ -0,0 +1,10 @@
namespace API.Models.Game
{
public class GameInformationDto
{
public string Id { get; set; }
public List<Player> Players { get; set; }
public GameState? State { get; set; }
public int[,] CurrentField { get; set; }
}
}