campaign #3
@ -1,3 +1,4 @@
|
||||
using System;
|
||||
using Sledgemapper.Shared.Entities;
|
||||
|
||||
namespace Sledgemapper.Api.Commands
|
||||
@ -6,7 +7,7 @@ namespace Sledgemapper.Api.Commands
|
||||
{
|
||||
public Tile Tile { get; private set; }
|
||||
|
||||
public DeleteTileCommand(string sessionName, Tile tile, string userId) : base(sessionName, userId)
|
||||
public DeleteTileCommand(Guid campaign, Guid mapName, Tile tile, string userId) : base(campaign, mapName, userId)
|
||||
{
|
||||
Tile = tile;
|
||||
}
|
||||
|
@ -40,6 +40,13 @@ namespace Sledgemapper.Api.Controllers
|
||||
await _mediator.Send(new DeleteNoteCommand(campaign, mapName, note, UserId));
|
||||
}
|
||||
|
||||
|
||||
[HttpDelete("tile")]
|
||||
public async Task Delete(Guid campaign, Guid mapName, [FromBody] Tile tile)
|
||||
{
|
||||
await _mediator.Send(new DeleteTileCommand(campaign, mapName, tile, UserId));
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
public async Task<Session> Get(Guid campaign, Guid mapName)
|
||||
{
|
||||
|
@ -166,9 +166,20 @@ namespace Sledgemapper.Api.Hubs
|
||||
foreach (var userSession in userSessions)
|
||||
{
|
||||
var session = _dbContext.Sessions.FirstOrDefault(m => m.SessionId == userSession.SessionId);
|
||||
if (session != null)
|
||||
{
|
||||
|
||||
try
|
||||
{
|
||||
await Clients.GroupExcept(session.SessionId.ToString(), new List<string> { Context.ConnectionId }).RemovePlayer(new Player { UserId = userId }); //send remove player
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Console.WriteLine(e);
|
||||
}
|
||||
_dbContext.SessionUsers.Remove(userSession);
|
||||
}
|
||||
|
||||
await Clients.Group(session.SessionName).RemovePlayer(new Player { UserId = userId }); //send remove player
|
||||
_dbContext.SessionUsers.Remove(userSession);
|
||||
}
|
||||
}
|
||||
await _dbContext.SaveChangesAsync();
|
||||
|
@ -35,7 +35,7 @@ namespace Sledgemapper
|
||||
_queue = new ChannelsQueue(Messenger);
|
||||
#if DEBUG
|
||||
var baseAddress = "http://localhost:5000";
|
||||
baseAddress = "http://hub.michelescandura.com:5001";
|
||||
//baseAddress = "http://hub.michelescandura.com:5001";
|
||||
#else
|
||||
var baseAddress = "http://hub.michelescandura.com:5001";
|
||||
#endif
|
||||
|
@ -21,7 +21,7 @@ namespace Sledgemapper.UI
|
||||
_messenger = messenger;
|
||||
|
||||
#if DEBUG
|
||||
TxtEmail.Text = "michele.scandura@sloutlook.com";
|
||||
TxtEmail.Text = "michele.scandura@outlook.com";
|
||||
TxtPassword.Text = "slePharland!79";
|
||||
#endif
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user