static void FullUserListUpdate()
{
for (int i = 0; i < Channels.Length; i++)
{
List<object> values = new List<object> {(byte) ServerPacket.UserList};
//It would make more sense to loop through the connections only once and build up a few arrays to send out at the end.
foreach (Client c in Listener.Clients)
{
if (c.Value.Authenticated && c.Value.Channel == i)
{
values.AddRange(new object[] { c.Value.UserId, c.Value.Username, c.Value.Rank, c.Value.Idle });
}
}
byte[] data = Packer.Serialize(values.ToArray());
Broadcast((byte)i, data);
}
}