Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


C# How do i get player Public IP from game
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Pingo
Grandmaster Cheater
Reputation: 8

Joined: 12 Jul 2007
Posts: 571

PostPosted: Mon Mar 26, 2012 6:38 am    Post subject: C# How do i get player Public IP from game Reply with quote

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
View user's profile Send private message
HomerSexual
Grandmaster Cheater Supreme
Reputation: 5

Joined: 03 Feb 2007
Posts: 1657

PostPosted: Mon Mar 26, 2012 9:41 am    Post subject: Reply with quote

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
View user's profile Send private message
Pingo
Grandmaster Cheater
Reputation: 8

Joined: 12 Jul 2007
Posts: 571

PostPosted: Mon Mar 26, 2012 10:44 am    Post subject: Reply with quote

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
View user's profile Send private message
HomerSexual
Grandmaster Cheater Supreme
Reputation: 5

Joined: 03 Feb 2007
Posts: 1657

PostPosted: Mon Mar 26, 2012 11:40 am    Post subject: Reply with quote

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
View user's profile Send private message
Cryoma
Member of the Year
Reputation: 198

Joined: 14 Jan 2009
Posts: 1819

PostPosted: Mon Mar 26, 2012 12:14 pm    Post subject: Reply with quote

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
View user's profile Send private message
Pingo
Grandmaster Cheater
Reputation: 8

Joined: 12 Jul 2007
Posts: 571

PostPosted: Mon Mar 26, 2012 12:46 pm    Post subject: Reply with quote

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
View user's profile Send private message
Pingo
Grandmaster Cheater
Reputation: 8

Joined: 12 Jul 2007
Posts: 571

PostPosted: Tue Mar 27, 2012 3:06 am    Post subject: Reply with quote

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
View user's profile Send private message
HomerSexual
Grandmaster Cheater Supreme
Reputation: 5

Joined: 03 Feb 2007
Posts: 1657

PostPosted: Wed Mar 28, 2012 6:37 am    Post subject: Reply with quote

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
View user's profile Send private message
Pingo
Grandmaster Cheater
Reputation: 8

Joined: 12 Jul 2007
Posts: 571

PostPosted: Wed Mar 28, 2012 7:36 am    Post subject: Reply with quote

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
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 471

Joined: 09 May 2003
Posts: 25832
Location: The netherlands

PostPosted: Wed Mar 28, 2012 10:32 am    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
Pingo
Grandmaster Cheater
Reputation: 8

Joined: 12 Jul 2007
Posts: 571

PostPosted: Thu Mar 29, 2012 2:38 am    Post subject: Reply with quote

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
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 471

Joined: 09 May 2003
Posts: 25832
Location: The netherlands

PostPosted: Thu Mar 29, 2012 3:09 am    Post subject: This post has 1 review(s) Reply with quote

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
View user's profile Send private message MSN Messenger
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8587
Location: 127.0.0.1

PostPosted: Thu Mar 29, 2012 11:43 am    Post subject: This post has 1 review(s) Reply with quote

You can, see this article:
http://technet.microsoft.com/en-us/library/dd734783%28v=ws.10%29.aspx#BKMK_3_add

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
Pingo
Grandmaster Cheater
Reputation: 8

Joined: 12 Jul 2007
Posts: 571

PostPosted: Mon Apr 02, 2012 4:50 am    Post subject: Reply with quote

That might actually do it. I never thought of that.
_________________
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8587
Location: 127.0.0.1

PostPosted: Tue Apr 03, 2012 11:40 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites