void Login(Views.LoginRequest request) { var player = RtaDb.ReadDocument <Views.PlayerInfo>("clients", request.token); if (player != null && player.password == request.password) { IsAuthnticated = true; SendAsync("login", player); } }
static void Main(string[] args) { // Init new RTS APP var app = new RealtimeApp(IPAddress.Any, 4455, TimeSpan.FromMinutes(2)); // Init the database RtaDb.Connect("rts-app"); // Add the DB Collections RtaDb.CreateCollection("clients"); // Add the Hubs app.AddHub <Hubs.AuthHub>(); app.AddHub <Hubs.IndexHub>(); app.AddHub <Hubs.PlayerHub>(); // Run the App app.Run(); }