I am trying to configure my game to work on LAN with no internet using photon. Is this possible?
I built my game and ran the exe separately which should be making the server.
Then when I run my game in unity, it just says ExcpetionOnReceive while connecting to 127.0.0.1
I my settings file, I have the following:
Self Hosted
127.0.0.1
5055
Udp
AppId [blank]
Do I need appid even for a local server? If yes, then is there any unity networking package that will work completely offline?
Or maybe if I have appid, it will work offline?
Here is the code I am using:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Network : MonoBehaviour
{
// Use this for initialization
void Start ()
{
Connect ();
}
void Connect()
{
PhotonNetwork.ConnectUsingSettings ("v001");
}
void OnGUI()
{
GUILayout.Label (PhotonNetwork.connectionStateDetailed.ToString ());
}
void OnJoinedLobby()
{
PhotonNetwork.JoinRoom ("BEAST");
}
void OnPhotonRandomJoinFailed()
{
PhotonNetwork.CreateRoom ("BEAST");
}
void OnJoinedRoom()
{
GUILayout.Label ("It WORKED!!!!!");
}
}
PUN does not support hosting the game within some client. You always need a dedicated Photon Server for the clients to connect to. There are various pros for this approach and some cons, of course. Itâs simply the way Photon works.
Photon Bolt can host the game in a Unity instance but still, you need a Photon Server for matchmaking and potentially for relay. So itâs not an alternative for pure local network (without internet connectivity).
Using Photon Bolt Pro and having Photon Server running - will it be possible to have few players playing a game in LAN without ANY internet connection at any stage?
Thanks for the answer. I have a project that is long time in development and still in âprototypeâ mode, using Unity 5.6 and PUN and now there is a requirement to have it running âwithâ and âwithoutâ internet connection modes. So besides having possibility of âLAN onlyâ I want to upgrade to latest Unity version and start using DOTS. And there is a problem that âConnected gamesâ feature is âtoo freshâ, and Bolt is too âoldâ and doesnât support it as far as I know : ) So iâm confused of what path to choose⌠: )
I start the app, by default the cloud mode is switched on, I connect to the cloud server successfully. I disconnect.
I switch to LAN mode, I connect to the LAN server successfully. I disconnect.
I switch back to the cloud mode and try to connect and receive an error: OperationResponse 230: ReturnCode: 32756 (). Parameters: {} Server: NameServer Address: my LAN IP:my LAN port*
So⌠Despite the fact I did âSwitch to cloudâ (code above) Photon somehow still tries to connect to my LAN IP address.
Is there any way to âresetâ the thing on runtime? Or maybe Iâm missing something here?