Updated UserModel and started on making the polling http calls to the server.
Started with the Polling command: What I'm thinking is that I should have the command consecutively make calls every 5 seconds, not sure how it will work without hanging the thread, will figure out tomorrow :)
This commit is contained in:
parent
0f96994773
commit
e134751745
@ -100,5 +100,26 @@ namespace EFB.Controllers
|
|||||||
}
|
}
|
||||||
return RedirectToAction("Index", "Home");
|
return RedirectToAction("Index", "Home");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public async Task<IActionResult> Poll(){
|
||||||
|
if (HttpContext.Session.GetString("User") != null)
|
||||||
|
{//If the user is currently logged in
|
||||||
|
UserModel User = HttpContext.Session.GetObject<UserModel>("User");
|
||||||
|
|
||||||
|
if (User.Route != null)
|
||||||
|
{//If the user has a route object (e.g, they have been to the route page)
|
||||||
|
|
||||||
|
//Make calls to the server to fetch route
|
||||||
|
return RedirectToAction("Index", "Route");
|
||||||
|
|
||||||
|
}else{
|
||||||
|
return RedirectToAction("Index", "Route");
|
||||||
|
}
|
||||||
|
|
||||||
|
}else{
|
||||||
|
return RedirectToAction("Index", "Route");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -21,7 +21,7 @@ namespace EFB.Models
|
|||||||
public TokenModel Token { get; set; } = null;
|
public TokenModel Token { get; set; } = null;
|
||||||
|
|
||||||
//Contains the most recent route generated by the user through the App
|
//Contains the most recent route generated by the user through the App
|
||||||
public object Route { get; set; } = null;
|
public RouteModel Route { get; set; } = null;
|
||||||
|
|
||||||
//Contains the most recently stored position of the user in the simulator
|
//Contains the most recently stored position of the user in the simulator
|
||||||
public object SimPosition { get; set; } = null;
|
public object SimPosition { get; set; } = null;
|
||||||
|
Loading…
Reference in New Issue
Block a user