Self hosting with unity help

Options
cj31387
cj31387
edited November 2013 in Photon Server
So far I've made a simple multiplayer game using the photon cloud In unity. Now I want to self host. I downloaded the server SDK and I load the win64 control panel version. I port forwarded all the ports it says to forward and I was able to connect to myself where as before i port forwarded I wasn't able to connect to myself using my public IP. But other people still can't connect to my game when I send them my build. I see in the documentation something called Load Balancing IP config that is in the control panel. Is that the same as, Game Server IP Config, because i don't see Load Balancing IP config? I am on windows 7 64 bit, I was thinking of just turning off my firewall to see if that is the problem, but don't have someone to test with at this moment. As for the firewall I allowed photon control, photon sockets, and I even browsed to my deploy directory to select the win64 socketserver.exe and added that one to my firewall too. Can you walk me through getting self hosting working from my computer to all people I test with from a unity client? Thanks.

If you need this information here it is
Windows 7 64 bit ultimate
Linksys WRT160Nv3 router
Current Unity and PUN

Comments

  • Hello,

    yes, "Loadbalancing IP config" and "Game Server IP config" are the same - sorry for the confusion, we'll update the wording in the documentation.

    Background:
    - clients connect to the "Master Server" application first.
    - the Master tells them to which "Game Server" address they should connect. (think of a scenario where you have multiple game servers that handle several hundreds or thousand clients).

    So the Master needs to know the correct addresses of the Game Servers. To achieve this, each game server registers at the master and tells him at which adress it can be reached. The master then sends that specific address to the clients, which try to connect to that address.

    The "Game Server IP config" option configures the Game Servers to register with one of the following IPs:
    - set local IP (e.g.: 192.168.0.1) -> clients try to connect to Photon at the internal IP. This will only work if your clients + Photon are running in the same network (e.g., your office network).
    - set public IP -> the public IP of your internet router. You need to choose that one if you want to Photon to be accessible from the internet. In that case, you need to configure port forwarding in your router (like you already did).

    - autodetect -> this is basically the same as "public IP". The Game Server detects its public IP automatically, by calling a service like whatismyip.com, and registers at the Master with that IP. This is useful for live deployments: if you deploy your Game Servers to several different servers, you don't need to configure an explicit IP at each sever, they can simply autodetect their IP. I

    So, in your case - set the "public IP" or "autodetect" and it should work.
  • cj31387
    Options
    I am testing with a friend right now. I tried turning off my windows firewall completely. It still wont let him connect. Everything in this post I forwarded. http://doc.exitgames.com/photon-server/ ... ng_started . I tried the 64 bit control panel and the 32 bit one, He cannot connect. Yet he can connect when i set it to the pun unity photon cloud. Is http://doc.exitgames.com/photon-server/ ... ng_started ,the 100% full list of ports? I see in Netstat that photonsocket.exe is using some ports that aren't on that requirements page.

    Also is there special code I need to implement that is different than the photon cloud. Do I need some different code in unity that is specific to self hosting instead of using the cloud?

    This is my current Join code.

    [code2=csharp]using UnityEngine;
    using System.Collections;

    public class MPManager : Photon.MonoBehaviour
    {

    public GameObject[] spawnPoints;


    // Use this for initialization
    void Start()
    {
    spawnPoints = GameObject.FindGameObjectsWithTag("SpawnPoint");
    PhotonNetwork.ConnectUsingSettings("Aftermath alpha 0.2");

    //int spawnRand = Random.Range(0, spawnPoints.Length);
    }

    void OnGUI()
    {
    GUILayout.Label(PhotonNetwork.connectionStateDetailed.ToString());
    }

    void OnJoinedLobby()
    {
    PhotonNetwork.JoinRandomRoom();
    }

    void OnPhotonRandomJoinFailed()
    {
    PhotonNetwork.CreateRoom("Aftermath - AW");
    }

    void OnJoinedRoom()
    {
    //555 Stupid inconsistency with random.range, it starts at 1 instead of 0.
    GameObject myPlayer = PhotonNetwork.Instantiate("Player_MP", spawnPoints[Random.Range(1, spawnPoints.Length)].transform.position, spawnPoints[Random.Range(1, spawnPoints.Length)].transform.rotation, 0);
    }

    void OnDisconnectedFromPhoton()
    {
    PhotonNetwork.DestroyPlayerObjects(photonView.ownerId);
    print(photonView.ownerId + " objects destroyed from server");
    }
    }[/code2]
  • Hey,

    please send us a client log that shows which connections are made (to which addresses?) and which operations are called. We need to determine at which point the "connection fails" (connection to master app? connection to game server app?).

    Please provide the Photon Server log files from /deploy/log as well, especially the "GSGame..." and "MSMaster.." log file(s).

    I'm quite sure that this is not related to your client side code, but either a problem of the Photon configuration (did you set the correct Game Server IP?) or with your router / port forwarding configuration.

    Thanks!