Merge pull request 'campaign' (#3) from campaign into master
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #3
This commit is contained in:
commit
496c221fba
@ -1,3 +1,4 @@
|
|||||||
|
using System;
|
||||||
using Sledgemapper.Shared.Entities;
|
using Sledgemapper.Shared.Entities;
|
||||||
|
|
||||||
namespace Sledgemapper.Api.Commands
|
namespace Sledgemapper.Api.Commands
|
||||||
@ -6,7 +7,7 @@ namespace Sledgemapper.Api.Commands
|
|||||||
{
|
{
|
||||||
public Tile Tile { get; private set; }
|
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;
|
Tile = tile;
|
||||||
}
|
}
|
||||||
|
@ -40,6 +40,13 @@ namespace Sledgemapper.Api.Controllers
|
|||||||
await _mediator.Send(new DeleteNoteCommand(campaign, mapName, note, UserId));
|
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]
|
[HttpGet]
|
||||||
public async Task<Session> Get(Guid campaign, Guid mapName)
|
public async Task<Session> Get(Guid campaign, Guid mapName)
|
||||||
{
|
{
|
||||||
|
@ -166,9 +166,20 @@ namespace Sledgemapper.Api.Hubs
|
|||||||
foreach (var userSession in userSessions)
|
foreach (var userSession in userSessions)
|
||||||
{
|
{
|
||||||
var session = _dbContext.Sessions.FirstOrDefault(m => m.SessionId == userSession.SessionId);
|
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();
|
await _dbContext.SaveChangesAsync();
|
||||||
|
@ -35,7 +35,7 @@ namespace Sledgemapper
|
|||||||
_queue = new ChannelsQueue(Messenger);
|
_queue = new ChannelsQueue(Messenger);
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
var baseAddress = "http://localhost:5000";
|
var baseAddress = "http://localhost:5000";
|
||||||
baseAddress = "http://hub.michelescandura.com:5001";
|
//baseAddress = "http://hub.michelescandura.com:5001";
|
||||||
#else
|
#else
|
||||||
var baseAddress = "http://hub.michelescandura.com:5001";
|
var baseAddress = "http://hub.michelescandura.com:5001";
|
||||||
#endif
|
#endif
|
||||||
|
@ -21,7 +21,7 @@ namespace Sledgemapper.UI
|
|||||||
_messenger = messenger;
|
_messenger = messenger;
|
||||||
|
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
TxtEmail.Text = "michele.scandura@sloutlook.com";
|
TxtEmail.Text = "michele.scandura@outlook.com";
|
||||||
TxtPassword.Text = "slePharland!79";
|
TxtPassword.Text = "slePharland!79";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user