Connect a client to Photon Server over LAN
Options
Hello, I'm kind of new to Photon.
I've managed to setup the photon server on one machine and it runs offline.
I try to connect my second machine that's connected to the same wifi network.
(my firewall is off)
Could someone please help me connect a client to this machine.
What are the steps i need to follow to do this.
Is there some client sdk that I don't know about that I need to install on the client pcs?
I've managed to setup the photon server on one machine and it runs offline.
I try to connect my second machine that's connected to the same wifi network.
(my firewall is off)
Could someone please help me connect a client to this machine.
What are the steps i need to follow to do this.
Is there some client sdk that I don't know about that I need to install on the client pcs?
0
Comments
-
Hi, @roycefernandes3
it is not clear what did you set up. Please first try to get working everything on the same machine.
in order to get it working in LAN/WAN, you have to update LoadBalancing.dll.config. There is setting PublicIPAddress in 'Photon.LoadBalancing.GameServer.GameServerSettings' section of config. you should set it to external IP of your GS machine. Usually, this is something like 192.168.x.x
Next step would be connecting to this machine using regular client SDK. Please, take a look at our site: https://www.photonengine.com/en-US/sdks#realtime
best,
Ilya
1 -
Thanks for the advice sir!
It did start working.
I was also facing this error:
Operation failed: OperationResponse 226: ReturnCode: -2 (Join failed: UserId is not set, checkUserIdOnJoin=true expects a UserId.)
What I did was Photon Unity Networking > Plugins >PhotonNetwork > LoadBalancingPeer then go to line 157 and changed it to false.
" op[ParameterCode.CheckUserOnJoin] = false;
"
Because currently, I'm not really concerned with user authentication.
Now it works!
Thanks again!1 -
Hi @roycefernandes3.
You could also just simply set the userID to a GUID in your game code.
That way you don't need to make custom modifications to LoadBalancingPeer that you have to merge with every PUN update.2 -
hi, @roycefernandes3
The approach proposed by @Kaiserludi is better. Use it. We are getting rid of old stuff like this one.
best,
ilya1 -
Thanks @Kaiserludi @chvetsov !!! I shall try that.0
-
Hi @Kaiserludi , Could you please help me set the userId to GUID. I do not know exactly how to do that.0
-
@roycefernandes3
Just take any guid or other uniq id generator. .net framework build in class Guid may help you
best,
ilya1 -
Hi @roycefernandes3,
Thank you for choosing Photon!
Read this post on stackoverflow to make sure you create a new different GUID each time.1