Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Multi IP Block


phoenixpirated
 Share

Recommended Posts

OK i was ask by a friend to show how i blocked multi IP connections in my Game(s)

So why not show all how to do it aswell.

Ok everything is Server side edits
AS ALWAYS MAKE A BACKUP OF YOUR FILES.
look in modServerTCP
find Sub SockectConnected

replace the whole sub with this one:
```
Sub SocketConnected(ByVal Index As Long)
Dim i As Long

  If Index <> 0 Then

  ' make sure they're not banned
  If Not IsBanned(GetPlayerIP(Index)) Then
  Call TextAdd("Received connection from " & GetPlayerIP(Index) & ".")
        Else
            Call AlertMsg(Index, "You have been banned from " & Options.Game_Name & ", and can no longer play.")
        End If

        ' re-set the high index
        Player_HighIndex = 0
        For i = MAX_PLAYERS To 1 Step -1
            If IsConnected(i) Then
                Player_HighIndex = i
                Exit For
            End If
        Next

' now that player is connected lets check for multi(ip) connections

        If Not IsMultiIPOnline(GetPlayerIP(Index)) Then
            Call TextAdd("Received connection from " & GetPlayerIP(Index) & ".")
        Else
            Call AlertMsg(Index, "Multi Connections From Same Ip Is Not Alowed Any Longer.")
        End If
        ' send the new highindex to all logged in players
        SendHighIndex
    End If
End Sub
```

next find Sub IsMultiIPOnline
and under the
```
Dim n as long
```add this:
```
    n = 0
```
then in the same sub change this:
```
          If (n > 0) then
```
to this:
```
          if (n > 1) then
```

that should be all you need to do

what we have done is tell the server to check for multi IPs when a new client is connecting

the first IP wil be numbered (1)
so we block anything that is more than (1)
if you find a problem please post so i can edit

this may not be the best way to block IPs but is what i needed for my game(s)
Please enjoy
you may message me for edits,  if i feel it is needed to be done i will add it when i have free time to do so
Link to comment
Share on other sites

Silly argument. Plenty of other things you can do to block a player from running the game on the same computer. Hardware serials are probably a good shot.

Also, keep in mind it's _insanely_ easy to change your IP. Hell, it's easy to fake just about any data leaving your computer.

If you're really having so much trouble from someone you should fix whatever system they're abusing, not ignore it all and try and cut them out.

Trolls will be trolls no matter what you do.
Link to comment
Share on other sites

I have already coded the client to run a check and call "Destroygame" if the client is running on a the same computer.
but that does not stop a player with more than one computer,
(this is the problem i had)
so i with the multi IP block this problem no longer happens

(yes i know a player can get help from friends in trying to cheat the game)

But anyway like the first post says
I was asked how "I" block the same IP from multi connecting
if you feel so strongly that this is wrong  then remove the topic     
this was only added here thinking it might could be modified or improved by other users
( i won't make that mistake again)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...