if (Packets[id] == null)
        // ...
    var packet = Packets[id]();