Beispiel #1
0
 void LoginQuery(Messenger messenger, string key, LoginQuery query)
 {
     try
     {
         try
         {
             using (var account = new StreamReader(new FileStream(accountPath + "\\" + query.id, FileMode.Open)))
             {
                 var pw = account.ReadLine();
                 var name = account.ReadLine();
                 if (query.pw == pw)
                 {
                     messenger.Send("Login", new LoginAnswer(query.confirmID, true, name, "Town"));
                 }
                 else
                 {
                     throw new InvalidLoginException("PW가 다릅니다.");
                 }
             }
         }
         catch (IOException)
         {
             throw new InvalidLoginException("존재하지 않는 ID입니다.");
         }
     }
     catch (InvalidLoginException e)
     {
         var answer = new LoginAnswer(query.confirmID, false, "", "");
         answer.message = e.message;
         messenger.Send("Login", answer);
     }
 }
Beispiel #2
0
 void LoginQuery(Messenger messenger, string key, LoginQuery query)
 {
     messenger.Send("Database", query);
 }
Beispiel #3
0
 void LoginQuery(Messenger messenger, string key, LoginQuery query)
 {
     _server._messenger.Send("Login", query);
 }