Is there a way to use Photon library in offline mode? I am trying to access two android devices that are connected to a single hotspot without internet. Is there a way to achieve the communication?
I am using PhotonNetwork.OfflineMode = true
as given on their docs, but it does not work.
void Start()
{
PhotonNetwork.OfflineMode = true;
PhotonNetwork.ConnectUsingSettings();
print("Connecting...");
}
public override void OnConnectedToMaster()
{
PhotonNetwork.JoinLobby(TypedLobby.Default);
print("Connected");
}
public override void OnJoinedLobby()
{
print("On Joined Lobby");
}
public override void OnJoinedRoom()
{
Debug.Log("Player has joined");
}
public override void OnDisconnected(DisconnectCause cause)
{
print("DisconnectFrom Photon");
}
Photon in offline mode is true single-player mode – no network calls are made.
It sounds like you're trying to set up the game in LAN mode.
Photon always uses a dedicated server, so even in LAN you need a Photon Server running. You'll need to download Photon server and run it locally on your machine for this to work.
I don't know if it's possible to start a server on a mobile device, like you can on PC.
If LAN is a priority PUN might not be the best choice.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With