Im not sure if my game is running on the internet or just on lan. I have two computers behind a router.
I am using Photon with Unity 3 and I have the server and client up on one computer and another client up on my other computer.
I can see both players on both computers, however I dont know if I am connected via lan or over the internet.
In the PhotonSocketServer.xml I put my machine ip address that runs the server witch is 192.168.0…
I also used that address in the GameC# script in the client.
However I read that this might not be the correct adress for internet. When I look at this http://whatismyipaddress.com it tells me a different number and I assume that this may be the one I have to use for over the internet. I read in here http://forum.exitgames.com/viewtopic.php?f=5&t=57&start=0 that if you are behind a router then there is an additional step I think.
When I tried using the address in the PhotonSocketServer.xml I got from http://whatismyipaddress.com the server shuts down in the logs.
In short I would really like to know if I am running over the internet atm, I dont have anyway of checking. Atm Unity Forums isnt letting me upload my game but I can email if someone is willing to check very fast if two cubes moving around when they load it.
In the end this will help me regaurdless because I am not sure what ip to use or not with unity reguardless of network backend.
Any help is greatly appreciated thanks for your time!
shutdown your server on the other pc and connect with the client. if your able to connect, it’s connected to an exterior server. if it fails…
also in PhotonSocketServer.xml ( which is the server config file ) you only edit the server ip. in the game file in the unity client you edit the client ip.
type in the URL:
192.168.0.1
This will connect you to your router, and ask you for your user/pw to your router. You need to set the port forwarding to the system you are running Photon on, and need to set your computer to have a static IP through your router. I don’t have the time atm to post step by step how to do this, but I’m sure you can google for it.
in the photon settings, you’re going to use the whatsmyip.com number.
If your port forwarding is set up properly, you will be connected to your server.
My router allows DHCP Reservations, is setting this up the same thing as a static IP or should I disable DHCP Server and then in my network Connections - Internet Protocol set up my static IP?
One google search for port forwarding brought up this step by step example:
Just to clarify, your actual IP (found at whatsmyip.com or w/e) is set by your ISP, and is most likely dynamic (changes), so if you plan to actually host the server yourself, you will need to contact your ISP to pay for a static IP.
When I go into properties for my connection I have two different Internet Protocols. I have one that says Internet Protocol Version 6 (TCP/IPv6) and one that says Internet Protocol Version 4 (TCP/IPv4), should I set it for both or just one?
I am curious what is the difference between a dhcp reservation and static ip?
Will I need to disable the DHCP Server in my router?
How do you check if you have a dynamic ip set by your ISP? Also can you use it for a short while and just change the code with the server and client ever so often when it changes or do you absolutely need a static ip set by your ISP?
I have my static IP working now on my computer, however when I use the IP from http://whatismyipaddress.com in the PhotonSocketServer.xml and try to start up my server it just shuts down and says the requested address is not valid in its context.
Does this mean I first have to purchase a satic IP from my ISP first before I can get it to work?
When I use my computer IP in the PhotonSocketServer.xml my server works fine and I can even connect with my other computer but I dont know if this is just lan or if this is over the internet…
Lan only, your using a private reserved ip address range 192.168, those are never routed on the internet.
this will not work if the ip isn’t located on the same device. if you want the server to be reachable from the internet you will need some kind of routing on your lan and port forwarding.
Its weird I have forwarded the 5055 port they use to this computer, when I run PFPortChecker some times it says the port is open and then some times it says its closed. Im not sure about the routing. I also opened the port on my firewall.
Is there a better alternative for me like a dedicated server? Something cheap like 100$ that is easy to use from this computer?
you mean $100 / month? you should be able to get away cheaper even through amazons EC2 cloud or webtopia or at worst even vpsland (the later are more website dedicated targeted but to have something cheap out of house both would be something you could consider to test out)
Yes sorry I meant 100 $ a month hehe, do these all offer an interface like windows you can use from your own computer? Im not very familiar with dedicated servers is there somewhere I can learn more about them? I will of corse look up your recommendatios though thanks Dreamora!
Ok so I may have figured it out I was looking over at SmartFox Forums and found this thread: http://www.smartfoxserver.com/forums/viewtopic.php?t=306
and basically what it explains relates to photon as well. For example I should have my 192.168.0… in my
PhotonSocketServer.xml and have my http://whatismyipaddress.com in the game.c# script.
I have done this and the server works correctly and I can get into my game on the same computer many times. I will be checking to see if I can on my other computer but I think this means I might be brodcasting over the internet… Can anyone confirm?
if you have the ip produced by http://whatismyipaddress.com in your game script then your packets will be routed to your router and then back into your LAN. there are tools that could show you this but you better do a search on Google for route tracing tools. But to make sure you stay withing your LAN, just change the ip in the game script to the internal ( 192.168..) ip of the device where the server runs on.
I want to be able to run over the internet, I have LAN play working, I want others to connect to my server that are not on my LAN. I will check out these route tracing tools.
If your client side settings are set to connect to the IP from whatsmyipaddress.com and you are able to connect yourself to the server, then you have succeeded and therefore have your answer.
If you’re using one of photons demos, you can verify this yourself by opening multiple clients.
Oh Ezzerland <3 you getting me excited I hope this is the case and I am online, my friend is going to be checking it for me later, I send him the client. I do think opening numerous clients though doesnt madder because I was able to do that before when I was just over LAN. The true test will be if my friend can see me and his cube then I know for sure I am online and ive just conqured a big mile stone for myself anyway. Cross your fingers and wish me luck