public IActionResult StartNewSession(string user)
        {
            _logger.LogInformation("StartNewSession user: {0}", user);
            string sessionCode = _sessionHandler.CreateSession(user);

            return(Redirect("/Home/Session?code=" + sessionCode));
        }
 public bool BeforeUdpMessageReceived(UdpReceiveResult result)
 {
     if (SessionHandler.HasSession(result.RemoteEndPoint) == false)
     {
         SessionHandler.CreateSession(result.RemoteEndPoint);
     }
     return(true);
 }
        private Session GetSession()
        {
            SessionHandler handler   = GetHandler();
            var            orderLine = new PaymentsOrderLine("test", 2, 1000, 2500);
            SessionRequest req       = new SessionRequest(new List <PaymentsOrderLine> {
                orderLine
            }, "sv-se", "SE", "SEK");
            var s = handler.CreateSession(req);

            return(s);
        }
예제 #4
0
        public async Task CreateSession(string userId, bool[] permissions)
        {
            if (SessionHandler.GetUsersSession(userId) == "")
            {
                string sessionId = SessionHandler.CreateSession(permissions);
                userId = SessionHandler.CreateAndAddUser(sessionId);
                SessionHandler.AddHostUser(sessionId, userId);
                await Groups.AddToGroupAsync(Context.ConnectionId, sessionId);

                await Clients.Caller.SendAsync("SessionCreated", sessionId, userId);
            }
        }
예제 #5
0
 public void insertSession(int cargoId, string departureTime, string arrivalTime, int truckId, string destAddress, string destCity)
 {
     SessionHandler.CreateSession(cargoId, departureTime, arrivalTime, truckId, destAddress, destCity);
 }