ID:278415
 
Well, not sure if this goes here.
I've been working on my project (uses world.Export() to a Main Server) i started it and worked fine, Main Server received the data as:

"test=Action=test&IP_Address=192.168.1.1&Key=Ocean+King", but the IP Address isn't the correct.

I've loged from bookmarks, shouldn't my ip be the real ip?
Depends how it's connected to you, if both servers are local, that IP is correct.
In response to Stephen001
I don't get what you mean by local (Not a good hoster, though). But i'm using Dream Daemon for both servers.
In response to Ocean King
Well, 192.168.0.0./16 is a local range IP address. It doesn't route over the internet, but is available for local networks to use. That is physically your PC's IP address.
In response to Stephen001
Is there anyway to fix this? I'm using router, never had this problem.
Also, i now tryed with Modem, and world.Export() stills doesn't get the server. But it sends all correct data...
In response to Ocean King
It's a local routing thing, and the information it's provided is correct, it's just not what you want. You'd want to parse a site similar to whatismyip.com for your external address, and send that.
In response to Stephen001
I do. I've looked my ip on whatismyip.com for external address but i still get that connection is failing on Export(). And yes, the master server is online....
In response to Ocean King
It's not an address that makes sense locally, that's what I'm telling you. Similarly have you port forwarded for this stuff?
In response to Stephen001
I never hard to port forward with router. I always have been able to host.
In response to Ocean King
If you're using an external IP address and that address isn't local to your machine, you need to port forward. Otherwise, how does the data get to the appropriate PC inside your network when it reaches the router?
In response to Stephen001
I did portforward. Still same. :/

Well, i'll provide a code. Since, i don't know if it's the Router or Code which is failing.

var/list/connectedIPs = new

#define DEBUG

proc/SendLoginInfo(var/Key)
var/list/Data2Send = new
Data2Send["Action"] = "Player Connected"
Data2Send["Key"] = Key
for(var/A in connectedIPs)
world.Export("[A]?mypcshare:[list2params(Data2Send)]")

world/Topic(A)
world << A
var/list/B = url_decode(params2list(A))
world << B
if(findtext(B, "mypcshare:") == 1)
if(B["Action"] == "ConnectPlayer")
connectedIPs += B["IP_Address"]
SendLoginInfo(B["Key"])

// Client

client/proc/ConnectToMainServer()
var/list/Data2Send = new
Data2Send["Action"] = "Connect Player"
Data2Send["IP_Address"] = src.address
Data2Send["Key"] = src.key
var/Connect = world.Export("[MainServerAddress]?mypcshare=[list2params(Data2Send)]")
if(!Connect)
src << "Error while connecting to server"


world/Topic(A)
var/list/B = params2list(A)
if(findtext(B, "mypcshare:") == 1)
if(B["Action"] == "Player Connected")
world << output("<b>[B["Key"]] has joined in the server</b>", "MainWindow.Chatoutput")

client/New()
..()
src.ConnectToMainServer()

var
MainServerAddress = "byond://190.19.253.228:1001"



In response to Ocean King
It's your local ip assigned by your router you would have to connect to the server by typing: the address you get from whatismyip.com:port in open location. It will be very leggy.
In response to Sinfall
That ip i showed it's my WAN Ip. Showed on Router, Whatsmyip, etc. Since if i do

http://[theserverip]:[serverport]?ping

It doesn't return any error. If i do:

byond://[theserverip]:[serveport]?ping

Returns error....
In response to Ocean King
I'm not sure what you are saying, nor what you are trying to do. Simple put you are getting a local connection, see here for more information: http://en.wikipedia.org/wiki/Private_network
I'm still not entirely sure what you're trying to do, after reading the thread.

If your problem is that you're using client/address and it's returning a 192.168 etc. address, you can use world/internet_address for the host, and continue using client/address for everybody else. (as client/address will only show the local IP for the host computer)
Ocean King wrote:
"test=Action=test&IP_Address=192.168.1.1&Key=Ocean+King", but the IP Address isn't the correct.

I've loged from bookmarks, shouldn't my ip be the real ip?

The 'real ip' is indeed the question here. Depending on your setup, it could be external 'as seen from sites like whatismyip.net', private/local/LAN (192.168.1.0/24), or just plain local (127.0.0.1).

You can configure manual IP's, or have one assigned from modem/router via DHCP. Some routers will give their own IP address when you attempt to connect to your external. If this is causing issues (such that you might want a private/LAN IP) try forging a hostname in your hosts file, or connect to the IP directly (such as byond://192.168.1.xxx:port). That will correctly reveal your LAN IP.

You can discover more about your local setup with the ipconfig command:
http://support.microsoft.com/kb/314850

I hope this adequately addresses your question.