[EO 2.0] Internal IP and Port

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.

There is already an tut for this and thats HArdcoded 😉

But Nice

There is already an tut for this and thats HArdcoded 😉

But Nice

Didn’t know that, but thanks.

There’s already a tut on this. But nice anyways.

Log in to reply