| View previous topic :: View next topic |
| Author |
Message |
Pingo Grandmaster Cheater
Reputation: 8
Joined: 12 Jul 2007 Posts: 571
|
Posted: Mon Mar 26, 2012 6:38 am Post subject: C# How do i get player Public IP from game |
|
|
I do have a legit reason for this. When i ban someone from the game server, it bans the ip address. But that info is only stored in memory and is lifted once the game is restarted.
Does anyone know of a way to get the public ip when the player connects.
So if i ban a player, i can save the IP to a tmp file and have the app auto ban them if they rejoin at a later date.
Im sure its possible but i have no clue where to start. I cant store the ip from reading the memory, i tried.
_________________
|
|
| Back to top |
|
 |
HomerSexual Grandmaster Cheater Supreme
Reputation: 5
Joined: 03 Feb 2007 Posts: 1657
|
Posted: Mon Mar 26, 2012 9:41 am Post subject: |
|
|
Load the ban list when you start the server? It sounds like you already have a way of getting the IP address.
_________________
|
|
| Back to top |
|
 |
Pingo Grandmaster Cheater
Reputation: 8
Joined: 12 Jul 2007 Posts: 571
|
Posted: Mon Mar 26, 2012 10:44 am Post subject: |
|
|
Sure i can get the ip after the person has been banned. But all that gets wiped when the game restarts. I cant get the ip before the ban so i have nothing to compare to. The ip doesnt exist in memory before the ban.
_________________
|
|
| Back to top |
|
 |
HomerSexual Grandmaster Cheater Supreme
Reputation: 5
Joined: 03 Feb 2007 Posts: 1657
|
Posted: Mon Mar 26, 2012 11:40 am Post subject: |
|
|
Hence my obvious confusion. You are getting the ip when you ban so you should be able to get the ip before you ban. What is your "game server". Is it your own or someone else's?
My point was that if you are holding the ip in memory then you could write it to a ban file and load the ban file upon server startup. Anytime there is a request, make sure the ip is not in the ban ip list
_________________
|
|
| Back to top |
|
 |
Cryoma Member of the Year
Reputation: 198
Joined: 14 Jan 2009 Posts: 1819
|
Posted: Mon Mar 26, 2012 12:14 pm Post subject: |
|
|
| Learn the server software you're using, we can't read your mind and probably won't do the work for you anyway.
|
|
| Back to top |
|
 |
Pingo Grandmaster Cheater
Reputation: 8
Joined: 12 Jul 2007 Posts: 571
|
Posted: Mon Mar 26, 2012 12:46 pm Post subject: |
|
|
| Cryoma wrote: | | Learn the server software you're using, we can't read your mind and probably won't do the work for you anyway. |
I was asking where to start. I wasnt asking to be spoonfed. Iv never asked anyone to do the work for me for anything. Just to point me in the right direction.
Can anyone atleast tell me if its possible?
@HomerSexual sorry if you thought i was having a go, i wasnt.
_________________
|
|
| Back to top |
|
 |
Pingo Grandmaster Cheater
Reputation: 8
Joined: 12 Jul 2007 Posts: 571
|
Posted: Tue Mar 27, 2012 3:06 am Post subject: |
|
|
| Shrooms wrote: | get the ip. put the ip into a text file. load the text file on game start of server. when a player joins, get their ip and find a match in the loaded file list. if no match, they are fine. if match, banned.
did you code the game server in c#? |
No the server isnt coded in C# but the server tool is.
Thats the problem Shrooms. I can grab the ip after the person gets banned and store it in a text file. But once the game is restarted the ip doesnt exist in memory. So if i load that ip from the text file, i have no way of knowing who this person is.
If the person cheated again and i banned them, then id know they've already been banned cause they're in the txt file already.
I was thinking there maybe something that could read ip/port of those connected to be.
I keep looking for a solution, i'll post it here if i find anything.
_________________
|
|
| Back to top |
|
 |
HomerSexual Grandmaster Cheater Supreme
Reputation: 5
Joined: 03 Feb 2007 Posts: 1657
|
Posted: Wed Mar 28, 2012 6:37 am Post subject: |
|
|
| Pingo wrote: | | Shrooms wrote: | get the ip. put the ip into a text file. load the text file on game start of server. when a player joins, get their ip and find a match in the loaded file list. if no match, they are fine. if match, banned.
did you code the game server in c#? |
No the server isnt coded in C# but the server tool is.
Thats the problem Shrooms. I can grab the ip after the person gets banned and store it in a text file. But once the game is restarted the ip doesnt exist in memory. So if i load that ip from the text file, i have no way of knowing who this person is.
If the person cheated again and i banned them, then id know they've already been banned cause they're in the txt file already.
I was thinking there maybe something that could read ip/port of those connected to be.
I keep looking for a solution, i'll post it here if i find anything. |
It doesn't change the fact that if you don't tell us what you're using, then we can't help.
_________________
|
|
| Back to top |
|
 |
Pingo Grandmaster Cheater
Reputation: 8
Joined: 12 Jul 2007 Posts: 571
|
Posted: Wed Mar 28, 2012 7:36 am Post subject: |
|
|
| Shrooms wrote: |
otherwise, I guess you would have to code a "ip scanner" on character connect to server so you then can automatically match the ip with a ip in the list. |
This is what im trying to get help with. Atm im trying UdpClient.
@HomerSexual
The dedi server is for DH2005. Im only running the server for testing purposes. A friend is the one who runs it 24/7 but has problems keeping cheaters out. I'v helped keep all the cheaters out by detecting if they're cheating but im unable to keep them out permanently.
The ports used to recieve data is connection UDP 23459 query UDP 34567
I can view the the packets sent and recieved with TCPView. Iv never done anything like this so im unsure where to start.
UdpClient maybe, i'll keep at it.
_________________
|
|
| Back to top |
|
 |
Dark Byte Site Admin
Reputation: 471
Joined: 09 May 2003 Posts: 25832 Location: The netherlands
|
Posted: Wed Mar 28, 2012 10:32 am Post subject: |
|
|
Thought about a firewall rule that blocks their ip ?
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
| Back to top |
|
 |
Pingo Grandmaster Cheater
Reputation: 8
Joined: 12 Jul 2007 Posts: 571
|
Posted: Thu Mar 29, 2012 2:38 am Post subject: |
|
|
Yea i thought about that and i joined the server with my laptop firewall turned off.
Maybe its my firewall on the server pc, i did just update it. I checked my router logs, nothing gets blocked.
_________________
|
|
| Back to top |
|
 |
Dark Byte Site Admin
Reputation: 471
Joined: 09 May 2003 Posts: 25832 Location: The netherlands
|
Posted: Thu Mar 29, 2012 3:09 am Post subject: |
|
|
I was thinking about adding a firewall rule to the server that blocks the banned person's ip, not a rule on the client
for example, when I ban someone on this website, I use "iptables -I INPUT -s 11.22.33.44 -j DROP"
(These get removed on reboot, but if I want to make it permanent, I add this line to a init file)
I believe windows also supports a commandline access to the firewall, and the ability to block specific ip's
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
|
| Back to top |
|
 |
Pingo Grandmaster Cheater
Reputation: 8
Joined: 12 Jul 2007 Posts: 571
|
Posted: Mon Apr 02, 2012 4:50 am Post subject: |
|
|
That might actually do it. I never thought of that.
_________________
|
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
Posted: Tue Apr 03, 2012 11:40 am Post subject: |
|
|
Another route you could take is modding the server binary and creating your own framework around the parts you need to work with. Something like SourceMod for games like Counter-Strike, TF2, etc.
Would require a bit more work than just adding people to a firewall list but it would allow you to do a lot more in the end instead of just banning as well.
_________________
- Retired. |
|
| Back to top |
|
 |
|