it's not necessary to set var sockets

If you want to save some data with the special connection, you can just
use socket itself. And socket.id is a good unique id. the code ships[id] = {}; the id is actually the name, you can consider use socket.id instead.