PUN 2 wont connect to server

N1warheadN1warhead ✭✭
edited May 3 in Photon Server
Hello everyone, been awhile since i've been around in here. Finally trying PUN 2 out with Photon Server. Well, i'm trying at least.

I've been trying to connect to Photon Server for hours and I'm simply not understanding why it's not working.
(Sorry this is long) but rather get as much info as possible for yall.

Steps:
1- Download PUN 2 Free.
2- Download Photon Server SDK.
3- Make a script in Unity and do ConnectUsingSettings or ConnectToMaster
4- Make sure Photon Server Settings is correct(as I'm doing OnPremise, I just put a random App ID, etc).
5- I've tried multiple IP's (127.0.0.1, 192.168.0.29, and (public IP).
6- Connecting to Photon Cloud DOES work.
7- I make sure Photon Server is pointed at public IP (I've tried local, etc as well).
8- I've literally DMZ'd my router and turned off my firewall (I know don't do this, but was testing).
9- Yes I've forwarded ports in router 5055 (UDP) and 4530 (TCP)
10- Yes I also unlocked the ports in the firewall.
11- Yes I've tried putting the server on another computer on my network as well. (I do get something that happens on this end though) the client connection times out.

(All the below is testing from server on testing PC). I've used PUN 1 and Server in the past all the time, so it should still be possible right?

Okay now what's going on, well two things (they may be part of the same problem idk).
First thing - Trying to connect to public IP literally does absolutely nothing, doesn't connect to the master server, simply just doesn't fire any events such as OnConnected, OnConnectedTomaster, etc.

Which I assume is simply because the server is on the same machine as game. Which okay that's fine, so I'll connect locally, which does show a result. However not a result that helps with what's wrong.

Now if I try to connect via 127.0.0.1, then I ALWAYS get this specific error inside
public override void OnDisconnected(DisconnectCause cause) {
I debug out the cause.ToString().
Which is - "DisconnectedByServerReasonUnknown". That doesn't help me isolate what the problem is nor does it help you help me lol.

I've been doing tons of google searches and looking at the server logs (yes I've been looking at them lol). There is something about the - 49792: 22:30:39.641 - CENetThreadPool::Process - Exception - CENetPeerBase::HandleIncomingCommands() - PeerAppSelection()- Init: Unexpected protocol, expected value is between 1.2 and 1.7 : id = 15 [0] Datagram: 00 0F 00 01 00 00 02 1D 63 4E BE C5 06 00 01 04 00 00 00 35 00 00 00 01 F3 00 01 08 1E 41 05 02 00 31 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 - ........cN.........5.........A...1............................... from: 127.0.0.1:59204 on: 127.0.0.1:5055

So that lead me to a couple threads here on the forums from a few years ago, the solutions on there didn't appear to help at all.

any help would be appreciated.
Thank you everyone.

Comments

  • Hi @N1warhead,

    Sorry for the inconvenience!

    I think you might have missed this from changelog:
    v2.29 (15. March 2021)
    Removed: Setting of protocol 1.6 when connecting directly to a Master Server. This was a workaround for older Photon Server SDKs.
    Note: If you host Photon yourself, you can set the LoadBalancingClient.SerializationProtocol to SerializationProtocol.GpBinaryV16, before you connect.

    So you need to set PhotonNetwork.NetworkingClient.SerializationProtocol = SerializationProtocol.GpBinaryV16 before connecting.
  • N1warheadN1warhead ✭✭
    JohnTube wrote: »
    Hi @N1warhead,

    Sorry for the inconvenience!

    I think you might have missed this from changelog:
    v2.29 (15. March 2021)
    Removed: Setting of protocol 1.6 when connecting directly to a Master Server. This was a workaround for older Photon Server SDKs.
    Note: If you host Photon yourself, you can set the LoadBalancingClient.SerializationProtocol to SerializationProtocol.GpBinaryV16, before you connect.

    So you need to set PhotonNetwork.NetworkingClient.SerializationProtocol = SerializationProtocol.GpBinaryV16 before connecting.

    Thank you. That was it.

    But I still cannot connect via public IP.

    I can successfully connected via 127.0.0.1 and the local static IP on the network. But public IP isn't connecting. (On the same network at least), I can't test outside of my network as I have no other network to test on lol.


  • N1warheadN1warhead ✭✭
    I believe I might have just determined my issue LOL.
    I had moved a few months ago and was always on a business internet plan with a nice static IP, etc. And never even put a thought about it until just a few moments ago.

    I believe the reason I can't connect to public IP, is simply the fact that my current internet plan here is behind a CGNAT I believe, so of course it's not going to work lol.

    We'll i'll be getting my new business license and such here in a few days (at the new location), so i'll hopefully be good then lol.
Sign In or Register to comment.