move netcode into net class in net.hpp/net.cpp