I am playing around with a way to kick cheaters in Modern Warfare 2 (when you are the host). I have been able to use winpcap to sniff packages to identify the player names and their IPs.
I need a way to block all traffic (or just the target IPs UDP traffic to my machine). Hence the player will timeout/lagout.
Does anyone know of an available library that lets me do this easily. I could go about doing this the hard way and install Windows DDK and mess around in C++ to create a low level NDIS driver, but being Ã¼berly rusty on C++ and all the typical compile issues that comes when compiling template code for this, I prefer some ready coded library for this.
Or maybe someone has a better idea that would work?
Solution: Use Windows Firewall. Easy API to create and remove rules on the fly.
And a a test program that does this now works. I kicked 2 people out of the game. If the player is behind an Internet proxy, then you'll be blocking all traffic from anyone on the same proxy server.
以上就是Block any IP on a computer by coding in .Net (C#)的详细内容，更多请关注web前端其它相关文章！