![]() |
Ip Config (for engines) - Printable Version +- Mirage Engine (https://mirage-engine.uk/forums) +-- Forum: Mirage Source (Nostalgia) (https://mirage-engine.uk/forums/forumdisplay.php?fid=61) +--- Forum: Archive (2006-2011) (https://mirage-engine.uk/forums/forumdisplay.php?fid=18) +---- Forum: Resources (https://mirage-engine.uk/forums/forumdisplay.php?fid=49) +---- Thread: Ip Config (for engines) (/showthread.php?tid=27) |
Ip Config (for engines) - grimsk8ter11 - 01-06-2006 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 Re: Ip Config (for engines) - Tayuke - 03-08-2007 Got an Error: using MSE1 In modClientTCP, under the TcpInit Sub, The 'ReadINI' function isn't recognised Help? -Tay Re: Ip Config (for engines) - Matt - 03-08-2007 ... Go server side, grab the putvar and getvar subs. Add them to the client. Learn to use them. Re: Ip Config (for engines) - Rian - 03-08-2007 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. Re: Ip Config (for engines) - Tayuke - 03-08-2007 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.... Re: Ip Config (for engines) - Matt - 03-08-2007 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") Re: Ip Config (for engines) - Rian - 03-08-2007 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. Re: Ip Config (for engines) - Tayuke - 03-08-2007 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. 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! Re: Ip Config (for engines) - Matt - 03-08-2007 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. Re: Ip Config (for engines) - Tayuke - 03-08-2007 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. :? Re: Ip Config (for engines) - Matt - 03-08-2007 GetTickCount has nothing to do with get/putvar. Show me the code you have setting the variable. The putvar call. Re: Ip Config (for engines) - Tayuke - 03-08-2007 [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 Re: Ip Config (for engines) - Matt - 03-08-2007 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 Re: Ip Config (for engines) - Tayuke - 03-08-2007 Still not working ![]() |