This is security 101 people. Don't trust what the client says.
This is why DRM is fundamentally broken for singleplayer games (or music , or movies) in that you have to trust the client.
For mulitplayer games that require a server, you only allow them to connect and do the multiplayer bit if they have paid. Simples.
Your choice is either to do as these guys did and run all the servers themselves in which case you need to factor the lifetime cost of running the servers into the purchase price or charge subscriptions.
If you ever take the game servers offline the game then becomes unplayable and will preclude modded servers (which were fun in games like CS) and LAN play. There's till a risk that if your game is popular enough someone will reimplement the server.
So the other way to do it is to allow third party servers or build the game to work on a type P2P system (I think a lot of xbox games still work this way). At that point you are basically back to the original problem.
If it runs server side you can redirect those packets (often as simple as changing HOSTS file) to a server that you control which can be set to always say "yes, you are legit!"
This is why a lot of games are now removing LAN play, because if you can run the pirated game on a LAN you can use a VPN to turn it into an internet game etc.