The New World Posted February 27, 2011 Author Share Posted February 27, 2011 This is to ensure that the client can only connect a hard coded IP Address && Port. It's a fairly simple tutorial.This will all be done via Client-Side.In modClientTCP, in _sub TcpInit_, find:```' connectfrmMain.Socket.RemoteHost = Options.IPfrmMain.Socket.RemotePort = Options.Port```Change Options.IP, and Options.Port to match your server's IP Address, and Port.Next!In modDatabase, within _Public Sub SaveOptions()_, find:```Call PutVar(fileName, "Options", "IP", Options.IP)Call PutVar(fileName, "Options", "Port", Str(Options.Port))```Delete both of these lines.Next in modDatabase, within _Public Sub LoadOptions()_, find:```Options.IP = "127.0.0.1"Options.Port = 7001```Delete both of these lines.And within the same module and sub, find:```Options.IP = GetVar(fileName, "Options", "IP")Options.Port = Val(GetVar(fileName, "Options", "Port"))```Omit these lines as well. (Omit means delete or remove. >_>)Now in your client folder, open up Config.ini, and delete the IP= and Port= variables from the file so that it now looks like this:```[Options]Game_Name=Username=Password=SavePass= MenuMusic=Music= 1Sound= 1Debug= 0```All done! :) :bstar: Link to comment Share on other sites More sharing options...
Dzastin Posted February 27, 2011 Share Posted February 27, 2011 Thanks :) Link to comment Share on other sites More sharing options...
The New World Posted March 1, 2011 Author Share Posted March 1, 2011 @Dåттêòåyþ:> Thanks :)You're very welcome. Link to comment Share on other sites More sharing options...
Devogen Posted March 1, 2011 Share Posted March 1, 2011 This is all fine until your ISP cycles your IP and all the clients you distributed no longer have a working server IP to point toward.I would ammend this tutorial with a No-IP addition (www.no-ip.com) it is alot easier to manage a client you have distributed that contains a yourserver.serveftp assigned IP address rather than a static one that requires you to tell everyone to manually update their clients when they try to log in one day and realise they cant anymore - also would save you distributing a new client on every IP change. Link to comment Share on other sites More sharing options...
The New World Posted March 1, 2011 Author Share Posted March 1, 2011 @Devo:> This is all fine until your ISP cycles your IP and all the clients you distributed no longer have a working server IP to point toward.> > I would ammend this tutorial with a No-IP addition (www.no-ip.com) it is alot easier to manage a client you have distributed that contains a yourserver.serveftp assigned IP address rather than a static one that requires you to tell everyone to manually update their clients when they try to log in one day and realise they cant anymore - also would save you distributing a new client on every IP change.Simple enough, and well noted. Thanks devogen. I kind of figured they'd be using a no-ip by default in the first place, these external IP addresses are hideous. :P Link to comment Share on other sites More sharing options...
Devogen Posted March 1, 2011 Share Posted March 1, 2011 I would be lost without No-IP personally, my ISP decides to cycle my IP at random.. it might be fine for 3 months then one day, it changes 3 times within the day. Link to comment Share on other sites More sharing options...
The New World Posted March 1, 2011 Author Share Posted March 1, 2011 @Devo:> I would be lost without No-IP personally, my ISP decides to cycle my IP at random.. it might be fine for 3 months then one day, it changes 3 times within the day.My ISP rarely ever changes. But I guess to machine it's own. Link to comment Share on other sites More sharing options...
SpiceyWolf Posted July 20, 2011 Share Posted July 20, 2011 dont know if it would be concidered the BEST idea… but i was tryna make option buttons out of that... and allow checking one to choose which IP u connect to... ones thats coded in using that method... (between 2 options) or using the ini ip... i was tryna post like thisIf frmMenu.optINI = 1 Then(ini IP)(ini PORT)Else"127.0.0.1"7001If frmMenu.optINI = 0 ThenEnd IfEnd IfIf frmMenu.optLocalIP = 1 Then(ip that u need to connect to my pc)7001If frmMenu.LocalIP = 0 ThenEnd IfEnd Ifand so on..(obviously i didnt leave it that bear... i pu the actual stuff that was needed ... i didnt leave just ip and port there like it was gunna do anything >.>'frmMain.Socket.RemoteHost = Options.IP 'frmMain.Socket.RemotePort = Options.Portthat part...Whenever i try this it doesnt work... obviously im still kinda noob and its probly not the right thing to do but how would i make that work? Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now