rewrote server main loop so it doesnt need pyglet