Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Ip Config (for engines)
#1
Difficuly: 2/5

Only Client Side:

1st make a new form and name it frmIpconfig
Make 2 txtBoxes named txtIP and txtPort
Make 2 picBoxes named picConfirm and picCancel
In the code put the following:

[code]Option Explicit

Private Sub Form_Load()
Dim FileName As String
FileName = App.Path & "\config.ini"
txtIP = ReadINI("IPCONFIG", "IP", FileName)
txtPort = ReadINI("IPCONFIG", "PORT", FileName)
End Sub

Private Sub picCancel_Click()
frmMainMenu.Visible = True
frmIpconfig.Visible = False
End Sub

Private Sub picConfirm_Click()
Dim IP, Port As String
Dim fErr As Integer
Dim Texto As String

IP = txtIP
Port = Val(txtPort)

fErr = 0
If fErr = 0 And Len(Trim(IP)) = 0 Then
fErr = 1
Call MsgBox("Inform a correct IP.", vbCritical, GAME_NAME)
Exit Sub
End If
If fErr = 0 And Port
Reply
#2
Got an Error: using MSE1

In modClientTCP, under the TcpInit Sub, The 'ReadINI' function isn't recognised

Help?

-Tay
Reply
#3
...

Go server side, grab the putvar and getvar subs.

Add them to the client.

Learn to use them.
Reply
#4
Bah, noob. He needs the ReadINI and WriteINI functions for this tutorial. Though using getVar and PutVar is easier, since it is already in the server.
Reply
#5
O.k, so I get rid of that Error, after making those two sub's ReadINI and WriteINI ... but, now its work's fine, but doesn't write the variable's, and still is using the IP and Port set in VB6....
Reply
#6
Sonire Wrote:Bah, noob. He needs the ReadINI and WriteINI functions for this tutorial. Though using getVar and PutVar is easier, since it is already in the server.

Dude, I know. But getvar and putvar are easier to use for several reasons.

You add the subs, and I think 2 lines declaring the file used for them.

Then..

It's just ip = getvar(app.path & "/filename.ini", "HEADER", "Data")

So..

IP = GetVar(App.Path & "/settings.ini", "IPCONFIG", "IP")
Reply
#7
Well, seeing as I'm at work and you're just wasting precious air, I think you should write the kid a new tutorial on using getVar and putVar.
Reply
#8
Perfekt Wrote:
Sonire Wrote:Bah, noob. He needs the ReadINI and WriteINI functions for this tutorial. Though using getVar and PutVar is easier, since it is already in the server.

Dude, I know. But getvar and putvar are easier to use for several reasons.

You add the subs, and I think 2 lines declaring the file used for them.

Then..

It's just ip = getvar(app.path & "/filename.ini", "HEADER", "Data")

So..

IP = GetVar(App.Path & "/settings.ini", "IPCONFIG", "IP")

I tried that. The error went away, but it still isn't working. As I said before, its still just using the value's set in the code itself. Its also not even writing the value's into the config.ini. Its not even loading the value's into the form, set in the .ini file itself!
Reply
#9
It's simple dude.

First off, if it's still using the stuff set in the code itself, you messed something up. As remote_host should be read from the file. Also, same for port.
Reply
#10
I even did this entire Tut. on a blank copy of MSE1, and after replacing all the ReadINI and WriteINI with GetVar and PutVar, it still isn't making the file, loading the value's up, or saving the vaule's of the IP/Port.

Unless this code is revelant to the The GetVar/PutVar:

Code:
Public Declare Function GetTickCount Lib "kernel32" () As Long

*cough*Unlikey*cough*

OR I have to remove/replace the IP/Port Value's set in the code, something that hasn't been said yet

...something is stuffed up. :?
Reply
#11
GetTickCount has nothing to do with get/putvar.

Show me the code you have setting the variable. The putvar call.
Reply
#12
[code]Private Sub picConfirm_Click()
Dim IP, Port As String
Dim fErr As Integer
Dim Texto As String

IP = txtIP
Port = Val(txtPort)

fErr = 0
If fErr = 0 And Len(Trim(IP)) = 0 Then
fErr = 1
Call MsgBox("Inform a correct IP.", vbCritical, GAME_NAME)
Exit Sub
End If
If fErr = 0 And Port
Reply
#13
Try this..

[code]Private Sub picConfirm_Click()
Dim IP, Port As String
Dim fErr As Integer
Dim Texto As String

IP = txtIP
Port = Val(txtPort)

fErr = 0
If fErr = 0 And Len(Trim(IP)) = 0 Then
fErr = 1
Call MsgBox("Inform a correct IP.", vbCritical, GAME_NAME)
Exit Sub
End If
If fErr = 0 And Port
Reply
#14
Still not working Sad Anyone else want to give it a shot. This is the only feature I need added in to my code, before I send it over to my game's temp. game server host, while myself and other's build in-game stuff.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)