Esempio n. 1
0
 private void TestPassword(string data, ServerClient c)
 {
     try
     {
         string       guess  = data.Substring(0, passwordLength);
         ServerClient target = null;
         nameToClient.TryGetValue(data.Substring(passwordLength), out target);
         if (target.CheckPassword(guess))
         {
             Send("004", new List <ServerClient> {
                 c
             });
         }
         else
         {
             Broadcast("Incorrect Password!", new List <ServerClient> {
                 c
             });
         }
     }
     catch (Exception e)
     {
         Debug.Log(e.Message);
         Broadcast("Incorrect Password!", new List <ServerClient> {
             c
         });
     }
 }