Beispiel #1
0
 protected virtual void OnGoodAuthentication(AuthenticationMessage message)
 {
     Server.GetWaitingListClient(message.ConnectionId).Send(new ExampleMessage()
     {
         Content = "[SERVER] You are authenticated"
     });
 }
Beispiel #2
0
 protected virtual void OnBadAuthentication(AuthenticationMessage message)
 {
     Server.GetWaitingListClient(message.ConnectionId).Send(new ExampleMessage()
     {
         Content = "[SERVER] Bad credentials"
     });
 }
Beispiel #3
0
        protected override void ProcessMessage(AuthenticationMessage message)
        {
            // todo: temporary
            Console.WriteLine("[AUTH HANDLER] Received auth! : " + message.Username + " / " + message.Password);

            if (!VerifyCredentials(message))
            {
                OnBadAuthentication(message);
                return;
            }

            OnGoodAuthentication(message);
            Server.AuthenticateClient(message.ConnectionId, message.Username);
        }
Beispiel #4
0
 public AuthenticationHandler(Server server) : base(server)
 {
 }