How this is done has been answered a few times on this forum. Here is how it can be done for CoD WaW:
post10697.html#p10697This is how it's probably done for most games, depending upon the difficulty of the protocol. Basically intercepting & editing the response packet your server sends to clients who request how many players are in it.