public void Register(ShareableImmutableDictionary <string, Client> register) { this.register = register; var broadcastListEnumerator = new BroadcastListEnumerator(this, this.register); stream.BroadcastList = broadcastListEnumerator; register.Add(Name, this); SendMessage(new InternalMessage() { MessageType = InternalMessageType.ClientList, Sender = SERVER_SIDE_CLIENT_NAME, Content = broadcastListEnumerator.ToString() }); foreach (var client in this.register) { if (client == this) { continue; } client.SendMessage(new InternalMessage() { MessageType = InternalMessageType.ClientConnected, Sender = SERVER_SIDE_CLIENT_NAME, Content = ToString() }); } completeIntroduction(); completeIntroduction = null; }
public BroadcastListEnumerator(Client parent, ShareableImmutableDictionary <string, Client> registerOfClients) { this.parent = parent; this.registerOfClients = registerOfClients; }