ping on map feature complete
This commit is contained in:
parent
17cce56866
commit
bce97de302
19 changed files with 1002 additions and 233 deletions
|
@ -35,7 +35,5 @@ namespace Sledgemapper.Api.Commands
|
|||
await _mediator.Publish(new NewTileNotification(session, notification.Tile, notification.UserId));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
28
Sledgemapper.Api/Handlers/PingCommandHandler.cs
Normal file
28
Sledgemapper.Api/Handlers/PingCommandHandler.cs
Normal file
|
@ -0,0 +1,28 @@
|
|||
// using MediatR;
|
||||
// using Sledgemapper.Api.Data;
|
||||
// using System.Threading;
|
||||
// using System.Threading.Tasks;
|
||||
// using Sledgemapper.Api.Notifications;
|
||||
// using System.Linq;
|
||||
|
||||
// namespace Sledgemapper.Api.Commands
|
||||
// {
|
||||
// public class PingCommandHandler : IRequestHandler<PingCommand, bool>
|
||||
// {
|
||||
// private readonly MyDbContext _dbcontext;
|
||||
// private readonly IMediator _mediator;
|
||||
|
||||
// public PingCommandHandler(IMediator mediator, MyDbContext dbcontext) { _dbcontext = dbcontext; _mediator = mediator; }
|
||||
|
||||
// public async Task<bool> Handle(PingCommand notification, CancellationToken cancellationToken)
|
||||
// {
|
||||
// var session = _dbcontext.Sessions.First(m => m.SessionName == notification.SessionName);
|
||||
|
||||
|
||||
// await _mediator.Publish(new PingNotification(session, notification.Location, notification.UserId));
|
||||
// return true;
|
||||
// }
|
||||
|
||||
|
||||
// }
|
||||
// }
|
23
Sledgemapper.Api/Handlers/SendPingMessage.cs
Normal file
23
Sledgemapper.Api/Handlers/SendPingMessage.cs
Normal file
|
@ -0,0 +1,23 @@
|
|||
// using MediatR;
|
||||
// using Microsoft.AspNetCore.SignalR;
|
||||
// using Sledgemapper.Api.Notifications;
|
||||
// using Sledgemapper.Clients;
|
||||
// using System.Threading;
|
||||
// using System.Threading.Tasks;
|
||||
// using Sledgemapper.Api.Hubs;
|
||||
|
||||
// namespace Sledgemapper.Api.Handlers
|
||||
// {
|
||||
// public class SendPingMessage : INotificationHandler<PingNotification>
|
||||
// {
|
||||
// private readonly IHubContext<SledgemapperHub, ISledgemapperClient> _hub;
|
||||
|
||||
// public SendPingMessage(IHubContext<SledgemapperHub, ISledgemapperClient> hub) => _hub = hub;
|
||||
|
||||
// public async Task Handle(PingNotification notification, CancellationToken cancellationToken)
|
||||
// {
|
||||
|
||||
// await _hub.Clients.Groups(notification.Session.SessionName).Ping(notification.Location, notification.UserId);
|
||||
// }
|
||||
// }
|
||||
// }
|
Loading…
Add table
Add a link
Reference in a new issue