Added BoardcastMessage, Username Changed event via Broadcast, remove json parsing from ChatMessage
This commit is contained in:
@@ -80,6 +80,15 @@ namespace PolyChat
|
||||
});
|
||||
}
|
||||
|
||||
public void SendBroadcastMessage(string type, string content)
|
||||
{
|
||||
Debug.WriteLine("--- Controller.Broadcast ---");
|
||||
foreach (KeyValuePair<string, Connection> entry in Connections)
|
||||
{
|
||||
SendMessage(entry.Key, type, content);
|
||||
}
|
||||
}
|
||||
|
||||
public void SendMessage(string ip, string type, string content)
|
||||
{
|
||||
Debug.WriteLine("--- Controller.SendMessage ---");
|
||||
@@ -111,7 +120,7 @@ namespace PolyChat
|
||||
Connections[IP].Close();
|
||||
Connections.Remove(IP);
|
||||
}
|
||||
CloseChatUI(IP,wasConnected);
|
||||
CloseChatUI(IP, wasConnected);
|
||||
}
|
||||
|
||||
private void CloseChatUI(string IP, bool wasConnected = true)
|
||||
@@ -123,7 +132,7 @@ namespace PolyChat
|
||||
|
||||
private bool isInConnections(string IP)
|
||||
{
|
||||
if(Connections.ContainsKey(IP))
|
||||
if (Connections.ContainsKey(IP))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user