Пример #1
0
 //Gets Called If The Client Ask To Login
 void Login(Connection <Entry> con, LoginInfo loginInfo)
 {
     if (MyUsers.HaveRoom)
     {
         string error;
         if (database.VerifyUser(loginInfo, out error))
         {
             con.Send(Entry.Login, new VerifyClientLogin(MyUsers.GetAllUsers));  //send the new user all the users that are connected
             OnLoginSuccess(con, loginInfo);
         }
         else
         {
             con.Send(Entry.Login, new VerifyClientLogin(error));
             con.Close();
         }
     }
     else
     {
         con.Send(Entry.Login, new VerifyClientLogin("Server Is Full"));
         con.Close();
     }
 }