SHARE
TWEET

Untitled

a guest Jan 21st, 2020 73 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.    public void resetClient()
  2.     {
  3.         try
  4.         {
  5.             Debug.Log(gms.MaxIPNum);
  6.             IPNum = gms.MaxIPNum;
  7.             gms.clients = new List<GameObject>();
  8.             gms.CurrentIPAddresses = new List<string>();
  9.  
  10.             for (int i = 0; i < IPNum; i++)
  11.             {
  12.                 string res = "";
  13.                 for (int j = 0; j < 4; i++)
  14.                 {
  15.                     int a = rand.Next(0, 255);
  16.                     res = res + a.ToString() + ".";
  17.                 }
  18.                 gms.CurrentIPAddresses.Add(res);
  19.                 res.Remove(res.Length - 1);
  20.  
  21.                 var instantiatedClient = Instantiate(clientPrefab);
  22.                 Client clientScript = instantiatedClient.GetComponent<Client>();
  23.                 clientScript.IPAddress = res;
  24.                 clientScript.passwordProtected = false;
  25.                 gms.clients.Add(instantiatedClient);
  26.                 Debug.Log("ran");
  27.             }
  28.         }
  29.         catch (Exception e)
  30.         {
  31.             Debug.LogException(e);
  32.         }
  33.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top