making your game use certificate pinning should be enough and possibly better since you're releasing source code for the server but not the client
still, there is no way to stop people from figuring this out, if there's enough interest people absolutely will patch anything you do out, the only chance would be to not run the game on people's computers (think of it like cloud gaming, except mandatory), but i'm not even sure if this would end up being legal