public void changePermissionRequest(string myIP, string myPort, string IPPort, string read, string write)
{
try
{
string myIPPort = myIP + ":" + myPort;
string[] tempPermissions = (string[])permissions[IPPort];
if ((read == "false" && write == "true") || (tempPermissions[1].ToString() == "true" && write == "false") || (tempPermissions[0].ToString() == "true" && read == "false"))
{
}
else
{
string[] privileges = { read, write };
permissions[IPPort] = privileges;
List<string> endPoints = Peers();
Hashtable temp = conn.GetIPtoPeer();
Hashtable tempToSend = new Hashtable();
foreach (DictionaryEntry item in temp)
{
if (endPoints.Contains(item.Key.ToString()))
{
tempToSend.Add(item.Key, item.Value);
}
}
string permissionMessage = changePermissionMessage(IPPort, read, write);
//Console.WriteLine(permissionMessage);
AsynchronousClient client = new AsynchronousClient();
client.SetMultiMsg(tempToSend, permissionMessage, myIPPort);
Thread t = new Thread(new ThreadStart(client.SendMultiClientChat));
t.IsBackground = true;
t.Start();
}
}
catch (Exception e)
{ Console.WriteLine(e.ToString()); }
}
//public void finalCodeChange(string changes)