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

[EO 2.0] Internal IP and Port


Sunku
 Share

Recommended Posts

I've scrolled through the the source tutorials and didn't see this so I'm putting a tutorial here for anyone that can't figure this out.

This is so your game can read the IP and Port from the game it's self instead of the config.ini

Client Side Only!

Okay, so first off, you'll go to modClientTCP. After that you'll scroll down a bit until you see

```

Sub TcpInit()

' If debug mode, handle error then exit out'

If Options.Debug = 1 Then On Error GoTo errorhandler

Set PlayerBuffer = New clsBuffer

frmMain.Socket.RemoteHost = Options.IP

frmMain.Socket.RemotePort = Options.Port

' Error handler'

Exit Sub

errorhandler:

HandleError "TcpInit", "modClientTCP", Err.Number, Err.Description, Err.Source, Err.HelpContext

Err.Clear

Exit Sub

End Sub

```

Just change the Options.IP and Options.Port to look like this

```

frmMain.Socket.RemoteHost = "localhost*"

frmMain.Socket.RemotePort = 7001**

```
* this will be changed to the IP it's connecting to

** this will be changed to the port that it's connecting to

There you have it, but if you want to make it so there isn't the IP and Port option in the config, you'll have to

first go to the config.ini and delete the two lines. Then you'll go to modDatabase and look up:

```

Public Sub SaveOptions()

```

Then you can just comment out or delete:

```

Call PutVar(fileName, "Options", "IP", Options.IP)

Call PutVar(fileName, "Options", "Port", Str(Options.Port))

```

That's all there is to it.
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...