Quantcast
Channel: Photon Unity Networking (PUN) — Photon Engine
Viewing all 8947 articles
Browse latest View live

PUN Works in Editor, but not in the build

$
0
0
I just created a empty project in Unity 2019.4.3f (LTS) and imported the PUN 2 asset from asset store. When I run the example scenes it works perfectly in Unity editor, but when I generated a build it doesn't work. I tested with Windows build (32 and 64) and WebGL build. In both I got the "Abnormal disconnection" error.

This is the log file from a windows build:

Mono path[0] = 'C:/GameBuildFolder/PhotonTest/Desktop/PhotonTest_Data/Managed'
Mono config path = 'C:/GameBuildFolder/PhotonTest/Desktop/MonoBleedingEdge/etc'
PlayerConnection initialized from C:/GameBuildFolder/PhotonTest/Desktop/PhotonTest_Data (debug = 0)
PlayerConnection initialized network socket : 0.0.0.0 55145
Multi-casting "[IP] 192.168.0.61 [Port] 55145 [Flags] 2 [Guid] 3444603142 [EditorId] 3066427587 [Version] 1048832 [Id] WindowsPlayer(DESKTOP-5U4OQH4) [Debug] 0 [PackageName] WindowsPlayer [ProjectName] PhotonTest" to [225.0.0.222:54997]...
Started listening to [0.0.0.0:55145]
PlayerConnection already initialized - listening to [0.0.0.0:55145]
Initialize engine version: 2019.4.3f1 (f880dceab6fe)
[Subsystems] Discovering subsystems at path C:/GameBuildFolder/PhotonTest/Desktop/PhotonTest_Data/UnitySubsystems
GfxDevice: creating device client; threaded=1
Direct3D:
Version: Direct3D 11.0 [level 11.1]
Renderer: NVIDIA GeForce GTX 1060 6GB (ID=0x1c03)
Vendor: (null)
VRAM: 3072 MB
Driver: 27.21.14.5148
Begin MonoManager ReloadAssembly
- Completed reload, in 0.216 seconds
D3D11 device created for Microsoft Media Foundation video decoding.
Fallback handler could not load library C:/GameBuildFolder/PhotonTest/Desktop/PhotonTest_Data/Mono/PhotonCryptoPlugin
Fallback handler could not load library C:/GameBuildFolder/PhotonTest/Desktop/PhotonTest_Data/Mono/PhotonCryptoPlugin.dll
Fallback handler could not load library C:/GameBuildFolder/PhotonTest/Desktop/PhotonTest_Data/Mono/PhotonCryptoPlugin
Fallback handler could not load library C:/GameBuildFolder/PhotonTest/Desktop/PhotonTest_Data/Mono/libPhotonCryptoPlugin
Fallback handler could not load library C:/GameBuildFolder/PhotonTest/Desktop/PhotonTest_Data/Mono/libPhotonCryptoPlugin.dll
Fallback handler could not load library C:/GameBuildFolder/PhotonTest/Desktop/PhotonTest_Data/Mono/libPhotonCryptoPlugin
Fallback handler could not load library C:/GameBuildFolder/PhotonTest/Desktop/PhotonTest_Data/Mono/PhotonSocketPlugin
Fallback handler could not load library C:/GameBuildFolder/PhotonTest/Desktop/PhotonTest_Data/Mono/PhotonSocketPlugin.dll
Fallback handler could not load library C:/GameBuildFolder/PhotonTest/Desktop/PhotonTest_Data/Mono/PhotonSocketPlugin
Fallback handler could not load library C:/GameBuildFolder/PhotonTest/Desktop/PhotonTest_Data/Mono/libPhotonSocketPlugin
Fallback handler could not load library C:/GameBuildFolder/PhotonTest/Desktop/PhotonTest_Data/Mono/libPhotonSocketPlugin.dll
Fallback handler could not load library C:/GameBuildFolder/PhotonTest/Desktop/PhotonTest_Data/Mono/libPhotonSocketPlugin
Fallback handler could not load library C:/GameBuildFolder/PhotonTest/Desktop/PhotonTest_Data/Mono/PhotonEncryptorPlugin
Fallback handler could not load library C:/GameBuildFolder/PhotonTest/Desktop/PhotonTest_Data/Mono/PhotonEncryptorPlugin.dll
Fallback handler could not load library C:/GameBuildFolder/PhotonTest/Desktop/PhotonTest_Data/Mono/PhotonEncryptorPlugin
Fallback handler could not load library C:/GameBuildFolder/PhotonTest/Desktop/PhotonTest_Data/Mono/libPhotonEncryptorPlugin
Fallback handler could not load library C:/GameBuildFolder/PhotonTest/Desktop/PhotonTest_Data/Mono/libPhotonEncryptorPlugin.dll
Fallback handler could not load library C:/GameBuildFolder/PhotonTest/Desktop/PhotonTest_Data/Mono/libPhotonEncryptorPlugin
<RI> Initializing input.

<RI> Input initialized.

<RI> Initialized touch support.

UnloadTime: 1.501000 ms
Unloading 7 Unused Serialized files (Serialized files now loaded: 0)
UnloadTime: 2.657700 ms
System memory in use before: 39.0 MB.
System memory in use after: 38.8 MB.

Unloading 11 unused Assets to reduce memory usage. Loaded Objects now: 768.
Total: 0.536000 ms (FindLiveObjects: 0.099300 ms CreateObjectMapping: 0.015900 ms MarkObjects: 0.399900 ms DeleteObjects: 0.020300 ms)

Unloading 2 Unused Serialized files (Serialized files now loaded: 0)
UnloadTime: 0.456400 ms
System memory in use before: 39.2 MB.
System memory in use after: 39.2 MB.

Unloading 8 unused Assets to reduce memory usage. Loaded Objects now: 1116.
Total: 0.714700 ms (FindLiveObjects: 0.108500 ms CreateObjectMapping: 0.019800 ms MarkObjects: 0.556400 ms DeleteObjects: 0.029400 ms)

Unloading 5 Unused Serialized files (Serialized files now loaded: 0)
UnloadTime: 0.600400 ms
System memory in use before: 39.3 MB.
System memory in use after: 39.2 MB.

Unloading 9 unused Assets to reduce memory usage. Loaded Objects now: 768.
Total: 0.560600 ms (FindLiveObjects: 0.093700 ms CreateObjectMapping: 0.015100 ms MarkObjects: 0.432300 ms DeleteObjects: 0.018800 ms)

JoinRandomRoom failed. Client is on NameServer (must be Master Server for matchmaking) but not ready for operations (State: Disconnecting). Wait for callback: OnJoinedLobby or OnConnectedToMaster.
UnityEngine.DebugLogHandler:Internal_Log(LogType, LogOption, String, Object)
UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
UnityEngine.Logger:Log(LogType, Object)
UnityEngine.Debug:LogError(Object)
Photon.Pun.PhotonNetwork:JoinRandomRoom(Hashtable, Byte, MatchmakingMode, TypedLobby, String, String[]) (at C:\UnityProject\PhotonTest\PhotonTest\Assets\Photon\PhotonUnityNetworking\Code\PhotonNetwork.cs:1598)
Photon.Pun.PhotonNetwork:JoinRandomRoom() (at C:\UnityProject\PhotonTest\PhotonTest\Assets\Photon\PhotonUnityNetworking\Code\PhotonNetwork.cs:1532)
Photon.Pun.Demo.PunBasics.Launcher:Connect() (at C:\UnityProject\PhotonTest\PhotonTest\Assets\Photon\PhotonUnityNetworking\Demos\PunBasics-Tutorial\Scripts\Launcher.cs:111)
UnityEngine.Events.InvokableCall:Invoke()
UnityEngine.Events.UnityEvent:Invoke()
UnityEngine.UI.Button:Press() (at C:\Program Files\Unity3D\2019.4.3f1\Editor\Data\Resources\PackageManager\BuiltInPackages\com.unity.ugui\Runtime\UI\Core\Button.cs:68)
UnityEngine.UI.Button:OnPointerClick(PointerEventData) (at C:\Program Files\Unity3D\2019.4.3f1\Editor\Data\Resources\PackageManager\BuiltInPackages\com.unity.ugui\Runtime\UI\Core\Button.cs:110)
UnityEngine.EventSystems.ExecuteEvents:Execute(IPointerClickHandler, BaseEventData) (at C:\Program Files\Unity3D\2019.4.3f1\Editor\Data\Resources\PackageManager\BuiltInPackages\com.unity.ugui\Runtime\EventSystem\ExecuteEvents.cs:50)
UnityEngine.EventSystems.ExecuteEvents:Execute(GameObject, BaseEventData, EventFunction`1) (at C:\Program Files\Unity3D\2019.4.3f1\Editor\Data\Resources\PackageManager\BuiltInPackages\com.unity.ugui\Runtime\EventSystem\ExecuteEvents.cs:261)
UnityEngine.EventSystems.StandaloneInputModule:ReleaseMouse(PointerEventData, GameObject) (at C:\Program Files\Unity3D\2019.4.3f1\Editor\Data\Resources\PackageManager\BuiltInPackages\com.unity.ugui\Runtime\EventSystem\InputModules\StandaloneInputModule.cs:195)
UnityEngine.EventSystems.StandaloneInputModule:ProcessMousePress(MouseButtonEventData) (at C:\Program Files\Unity3D\2019.4.3f1\Editor\Data\Resources\PackageManager\BuiltInPackages\com.unity.ugui\Runtime\EventSystem\InputModules\StandaloneInputModule.cs:644)
UnityEngine.EventSystems.StandaloneInputModule:ProcessMouseEvent(Int32) (at C:\Program Files\Unity3D\2019.4.3f1\Editor\Data\Resources\PackageManager\BuiltInPackages\com.unity.ugui\Runtime\EventSystem\InputModules\StandaloneInputModule.cs:552)
UnityEngine.EventSystems.StandaloneInputModule:ProcessMouseEvent() (at C:\Program Files\Unity3D\2019.4.3f1\Editor\Data\Resources\PackageManager\BuiltInPackages\com.unity.ugui\Runtime\EventSystem\InputModules\StandaloneInputModule.cs:532)
UnityEngine.EventSystems.StandaloneInputModule:Process() (at C:\Program Files\Unity3D\2019.4.3f1\Editor\Data\Resources\PackageManager\BuiltInPackages\com.unity.ugui\Runtime\EventSystem\InputModules\StandaloneInputModule.cs:289)
UnityEngine.EventSystems.EventSystem:Update() (at C:\Program Files\Unity3D\2019.4.3f1\Editor\Data\Resources\PackageManager\BuiltInPackages\com.unity.ugui\Runtime\EventSystem\EventSystem.cs:377)

(Filename: C:/UnityProject/PhotonTest/PhotonTest/Assets/Photon/PhotonUnityNetworking/Code/PhotonNetwork.cs Line: 1598)

Setting up 3 worker threads for Enlighten.
Thread -> id: 91c -> priority: 1
Thread -> id: 1c74 -> priority: 1
Thread -> id: 3354 -> priority: 1
##utp:{"type":"MemoryLeaks","version":2,"phase":"Immediate","time":1596486096828,"processId":10448,"allocatedMemory":9989,"memoryLabels":[{"Permanent":24},{"NewDelete":220},{"Thread":136},{"Manager":1404},{"VertexData":336},{"GfxDevice":4392},{"GfxThread":12},{"Physics":40},{"Serialization":24},{"String":149},{"DynamicArray":2352},{"PoolAlloc":32},{"Sprites":52},{"GI":184},{"VR":1128},{"Subsystems":4294966800}]}

PUN Asynchronous Turn-based Game?

$
0
0
Hello,

I'm new to Photon. I have a Unity project that I would like to turn into an asynchronous turn-based game. This topic has been addressed numerous times in the documentation and in these forums and I've done my best to process it all.

I think my question boils down to... is it possible to make an asynchronous turn-based game (like Words with Friends) in Unity using PUN? Or is Realtime a better option, even though I'm using Unity?

I've found this article, but it seems to assume one is using Realtime:
https://doc.photonengine.com/en-us/realtime/current/tutorials/async-and-turnbased

There are several links in the above article, including the Room Persistence Guide, which also appears to be using Realtime (I think):
https://doc.photonengine.com/en-us/realtime/current/tutorials/persistence-guide

And the Webhooks guide:
https://doc.photonengine.com/en-us/realtime/current/gameplay/web-extensions/webhooks

When I use webhooks in my dashboard, it suggests I upgrade to v1.2 since the current version is about to be deprecated, and refers me to here:
https://doc.photonengine.com/en-us/realtime/current/gameplay/web-extensions/webhooks-v1-2

So is Webhooks v1.2 the version I should use?

I also found this in the FAQ:
https://doc.photonengine.com/en-us/realtime/current/troubleshooting/faq#what_is_the_difference_between_photon_realtime_and_pun_

which seems to imply that PUN may not be sufficient for persisting room states for an asynchronous-type game.

It then links to this article, but this article is for PUN v1:
https://doc.photonengine.com/en-us/pun/v1/demos-and-tutorials/package-demos/rockpaperscissors-demo#do_s_and_don_ts

If I try the PUN v2 link at the top of that article, it takes me to a page that lists demos, but none of them are turn-based demos.

Some of the pages I've found also mention an "isPersistent" option that can be turned on in the Dashboard, like this one:
https://forum.photonengine.com/discussion/comment/29851/#Comment_29851

But I haven't been able to find that option in my Dashboard for either a PUN or a Realtime application. Does it still exist? Perhaps I'm just looking in the wrong place.

I've searched through the forums and have found numerous threads, but many of them are 5-10 years old at this point, so I'm unsure if they are current. I did find this one from a few days ago, which I've already replied to:
https://forum.photonengine.com/discussion/comment/52143

and in that thread there's a post from Tobias that mentions PUN may not be the best way to go.

I've also seem some mention in the forums of a "Photon Turnbased" but I read in a Unity forum that this probably doesn't exist any more, if it ever did...?

Could someone offer any guidance or point me to some (current) online resources that will help me get started making a turn-based asynchronous game in Unity? Thank you!

NullReferenceException: Object reference not set to an instance of an object when calling RPC

$
0
0
Hello! I am currently working on a small school project and ran into this issue. I can't for the life of me figure out where I went wrong. Some assistance would be much appreciated! Sorry in advance for the spaghetti. Still learning! :)

NullReferenceException: Object reference not set to an instance of an object
TeamManager.Set () (at Assets/Scripts/TeamManager/TeamManager.cs:77)
UnityEngine.Events.InvokableCall.Invoke () (at <e98ed0368295432e8c11e52d6243ee11>:0)
UnityEngine.Events.UnityEvent.Invoke () (at <e98ed0368295432e8c11e52d6243ee11>:0)
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using Photon.Pun;

public class TeamManager : MonoBehaviourPun
{
    public string houseSelected;
    public string teamSelected;
    public string ID;
    public bool ready;
    public int readyCount;

    [SerializeField] private Button glasheen;
    [SerializeField] private Button reed;
    [SerializeField] private Button daffey;
    [SerializeField] private Button fitzgerald;
    [SerializeField] private Button hider;
    [SerializeField] private Button seeker;
    [SerializeField] private Button set;

    PhotonView pv;

    List<TeamManager> teamUserData;

    Color original = new Color(250, 250, 250);
    private void Start()
    {
        teamUserData = new List<TeamManager>();
        pv = GetComponent<PhotonView>();
    }

    private void Update()
    {
        Debug.Log("ID: " + ID + " / House: " + houseSelected + " / Team: " + teamSelected + " / ready: " + ready);
        foreach (TeamManager a in teamUserData)
        {
            Debug.Log("ID: " + a.ID + " / House: " + a.houseSelected + " / Team: " + a.teamSelected + " / ready: " + a.ready);
        }
    }

    public TeamManager (string UserID, string house, string team, bool isReady)
    {
        ID = UserID;
        houseSelected = house;
        teamSelected = team;
        ready = isReady;
    }

    [PunRPC]
    void RoomReady(string sentID, string sentHouse, string sentTeam, bool ready)
    {
        UpdateTeamData(sentID, sentHouse, sentTeam, ready);
        SetReady(1);
    }

    void UpdateTeamData(string updateID, string updateHouse, string updateTeam, bool isReady)
    {
        teamUserData.Add(new TeamManager(updateID, updateHouse, updateTeam, isReady));
    }

    void SetReady(int num)
    {
        readyCount += num;

        if (readyCount == PhotonNetwork.CurrentRoom.MaxPlayers)
        {
            gameObject.SetActive(false);
        }
       
    }

    public void Set()
    {
        ready = true;
        pv.RPC("RoomReady", RpcTarget.AllViaServer, pv.Owner.UserId, houseSelected, teamSelected, true);
    }
   

    public void HouseSelect(string house)
    {
        houseSelected = house;

        HouseButtonCheck();
    }

    public void TeamSelect(string team)
    {
        teamSelected = team;

        TeamButtonCheck();
    }

    private void HouseButtonCheck()
    {
        ColorBlock colors;

        if (glasheen.name == houseSelected)
        {
            colors = glasheen.colors;
            colors.normalColor = glasheen.colors.highlightedColor;
            glasheen.colors = colors;
        }
        else
        {
            colors = glasheen.colors;
            colors.normalColor = original;
            glasheen.colors = colors;
        }

        if (reed.name == houseSelected)
        {
            colors = reed.colors;
            colors.normalColor = reed.colors.highlightedColor;
            reed.colors = colors;
        }
        else
        {
            colors = reed.colors;
            colors.normalColor = original;
            reed.colors = colors;
        }

        if (daffey.name == houseSelected)
        {
            colors = daffey.colors;
            colors.normalColor = daffey.colors.highlightedColor;
            daffey.colors = colors;
        }
        else
        {
            colors = daffey.colors;
            colors.normalColor = original;
            daffey.colors = colors;
        }

        if (fitzgerald.name == houseSelected)
        {
            colors = fitzgerald.colors;
            colors.normalColor = fitzgerald.colors.highlightedColor;
            fitzgerald.colors = colors;
        }
        else
        {
            colors = fitzgerald.colors;
            colors.normalColor = original;
            fitzgerald.colors = colors;
        }
    }

    private void TeamButtonCheck()
    {
        ColorBlock colors;

        if (hider.name == teamSelected)
        {
            colors = hider.colors;
            colors.normalColor = hider.colors.highlightedColor;
            hider.colors = colors;
        }
        else
        {
            colors = hider.colors;
            colors.normalColor = original;
            hider.colors = colors;
        }

        if (seeker.name == teamSelected)
        {
            colors = seeker.colors;
            colors.normalColor = seeker.colors.highlightedColor;
            seeker.colors = colors;
        }
        else
        {
            colors = seeker.colors;
            colors.normalColor = original;
            seeker.colors = colors;
        }
    }
}

Photon Voice does not work after Fallback handler could not load library Mono/AudioIn

$
0
0
I can't post the log file here because it says its too long. But i get this on start.

Mono path[0] = 'D:/Unity Projects/Multiplayer/Builds/My Experience Centre v9/My Experience Centre_Data/Managed'
Mono config path = 'D:/Unity Projects/Multiplayer/Builds/My Experience Centre v9/MonoBleedingEdge/etc'
PlayerConnection initialized from D:/Unity Projects/Multiplayer/Builds/My Experience Centre v9/My Experience Centre_Data (debug = 0)
PlayerConnection initialized network socket : 0.0.0.0 55256
Multi-casting "[IP] 192.168.0.101 [Port] 55256 [Flags] 3 [Guid] 1597778250 [EditorId] 3447433525 [Version] 1048832 [Id] WindowsPlayer(YASHPC) [Debug] 1 [PackageName] WindowsPlayer" to [225.0.0.222:54997]...
Waiting for connection from host on [0.0.0.0:55256]...
PlayerConnection accepted from [192.168.0.101] handle:0x408
Started listening to [0.0.0.0:55256]
Using monoOptions --debugger-agent=transport=dt_socket,embedding=1,server=y,suspend=n,address=0.0.0.0:56250
PlayerConnection already initialized - listening to [0.0.0.0:55256]
Initialize engine version: 2018.3.14f1 (d0e9f15437b1)
GfxDevice: creating device client; threaded=1
Direct3D:
Version: Direct3D 11.0 [level 11.1]
Renderer: NVIDIA GeForce RTX 2080 (ID=0x1e87)
Vendor:
VRAM: 8010 MB
Driver: 26.21.14.4274
Begin MonoManager ReloadAssembly
- Completed reload, in 0.836 seconds
<RI> Initializing input.

<RI> Input initialized.

<RI> Initialized touch support.

UnloadTime: 0.545100 ms
Fallback handler could not load library D:/Unity Projects/Multiplayer/Builds/My Experience Centre v9/My Experience Centre_Data/Mono/AudioIn
Fallback handler could not load library D:/Unity Projects/Multiplayer/Builds/My Experience Centre v9/My Experience Centre_Data/Mono/AudioIn.dll
Fallback handler could not load library D:/Unity Projects/Multiplayer/Builds/My Experience Centre v9/My Experience Centre_Data/Mono/AudioIn
Fallback handler could not load library D:/Unity Projects/Multiplayer/Builds/My Experience Centre v9/My Experience Centre_Data/Mono/libAudioIn
Fallback handler could not load library D:/Unity Projects/Multiplayer/Builds/My Experience Centre v9/My Experience Centre_Data/Mono/libAudioIn.dll
Fallback handler could not load library D:/Unity Projects/Multiplayer/Builds/My Experience Centre v9/My Experience Centre_Data/Mono/libAudioIn
Fallback handler could not load library D:/Unity Projects/Multiplayer/Builds/My Experience Centre v9/My Experience Centre_Data/Mono/AudioIn
Fallback handler could not load library D:/Unity Projects/Multiplayer/Builds/My Experience Centre v9/My Experience Centre_Data/Mono/AudioIn.dll
Fallback handler could not load library D:/Unity Projects/Multiplayer/Builds/My Experience Centre v9/My Experience Centre_Data/Mono/AudioIn
Fallback handler could not load library D:/Unity Projects/Multiplayer/Builds/My Experience Centre v9/My Experience Centre_Data/Mono/libAudioIn
Fallback handler could not load library D:/Unity Projects/Multiplayer/Builds/My Experience Centre v9/My Experience Centre_Data/Mono/libAudioIn.dll
Fallback handler could not load library D:/Unity Projects/Multiplayer/Builds/My Experience Centre v9/My Experience Centre_Data/Mono/libAudioIn
Fallback handler could not load library D:/Unity Projects/Multiplayer/Builds/My Experience Centre v9/My Experience Centre_Data/Mono/AudioIn
Fallback handler could not load library D:/Unity Projects/Multiplayer/Builds/My Experience Centre v9/My Experience Centre_Data/Mono/AudioIn.dll
Fallback handler could not load library D:/Unity Projects/Multiplayer/Builds/My Experience Centre v9/My Experience Centre_Data/Mono/AudioIn
Fallback handler could not load library D:/Unity Projects/Multiplayer/Builds/My Experience Centre v9/My Experience Centre_Data/Mono/libAudioIn
Fallback handler could not load library D:/Unity Projects/Multiplayer/Builds/My Experience Centre v9/My Experience Centre_Data/Mono/libAudioIn.dll
Fallback handler could not load library D:/Unity Projects/Multiplayer/Builds/My Experience Centre v9/My Experience Centre_Data/Mono/libAudioIn
DllNotFoundException: AudioIn
at (wrapper managed-to-native) ExitGames.Client.Photon.Voice.AudioInEnumerator.Photon_Audio_In_CreateMicEnumerator()
at ExitGames.Client.Photon.Voice.AudioInEnumerator.Refresh () [0x00008] in D:\Unity Projects\Multiplayer\Source\v17\Assets\Plugins\PhotonVoiceApi\Platforms\Unity\AudioInEnumerator.cs:43
at ExitGames.Client.Photon.Voice.AudioInEnumerator..ctor () [0x0000f] in D:\Unity Projects\Multiplayer\Source\v17\Assets\Plugins\PhotonVoiceApi\Platforms\Unity\AudioInEnumerator.cs:35
at PhotonVoiceNetwork..ctor () [0x0000e] in D:\Unity Projects\Multiplayer\Source\v17\Assets\PUNVoice\Scripts\PhotonVoiceNetwork.cs:191
UnityEngine.GameObject:Internal_AddComponentWithType(Type)
UnityEngine.GameObject:AddComponent(Type)
UnityEngine.GameObject:AddComponent()
PhotonVoiceNetwork:get_instance() (at D:\Unity Projects\Multiplayer\Source\v17\Assets\PUNVoice\Scripts\PhotonVoiceNetwork.cs:45)
PhotonVoiceHandler:Awake() (at D:\Unity Projects\Multiplayer\Source\v17\Assets\PUNVoice\Scripts\PhotonVoiceHandler.cs:113)
UnityEngine.GameObject:Internal_AddComponentWithType(Type)
UnityEngine.GameObject:AddComponent(Type)
UnityEngine.GameObject:AddComponent()
PhotonVoiceHandler:RuntimeInitializeOnLoad() (at D:\Unity Projects\Multiplayer\Source\v17\Assets\PUNVoice\Scripts\PhotonVoiceHandler.cs:104)

(Filename: D:/Unity Projects/Multiplayer/Source/v17/Assets/Plugins/PhotonVoiceApi/Platforms/Unity/AudioInEnumerator.cs Line: 43)

Fallback handler could not load library D:/Unity Projects/Multiplayer/Builds/My Experience Centre v9/My Experience Centre_Data/Mono/libc
Fallback handler could not load library D:/Unity Projects/Multiplayer/Builds/My Experience Centre v9/My Experience Centre_Data/Mono/libc.dll
Fallback handler could not load library D:/Unity Projects/Multiplayer/Builds/My Experience Centre v9/My Experience Centre_Data/Mono/libc
eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6Imh1Tjk1SXZQZmVocTM0R3pCRFoxR1hHaXJuTSIsImtpZCI6Imh1Tjk1SXZQZmVocTM0R3pCRFoxR1hHaXJuTSJ9.eyJhdWQiOiJiYzZmNjQ2Zi03NmVmLTQyZDgtYjgwZC1hMjllMTczODlkZDEiLCJpc3MiOiJodHRwczovL3N0cy53aW5kb3dzLm5ldC9mMzIxMWQwZS0xMjViLTQyYzMtODZkYi0zMjJiMTlhNjVhMjIvIiwiaWF0IjoxNTk2MTg3Njg1LCJuYmYiOjE1OTYxODc2ODUsImV4cCI6MTU5NjE5MTU4NSwiYWlvIjoiRTJCZ1lMZ3BQM21pd2hvbHpxZG4xSGx1ekt5OERnQT0iLCJhcHBpZCI6IjgzM2ZhNDA2LTgyOTgtNGQzZS04OTFhLTM3MGRjNDEzMzE4MyIsImFwcGlkYWNyIjoiMSIsImlkcCI6Imh0dHBzOi8vc3RzLndpbmRvd3MubmV0L2YzMjExZDBlLTEyNWItNDJjMy04NmRiLTMyMmIxOWE2NWEyMi8iLCJvaWQiOiJjZWIwN2MxOS02ZGUxLTQ2OWUtYWQyOS03OTkxZmIyMGIyMDkiLCJyb2xlcyI6WyJyZWFkX3dyaXRlXzczNTk0X2Vzb19yb2xlIl0sInN1YiI6ImNlYjA3YzE5LTZkZTEtNDY5ZS1hZDI5LTc5OTFmYjIwYjIwOSIsInRpZCI6ImYzMjExZDBlLTEyNWItNDJjMy04NmRiLTMyMmIxOWE2NWEyMiIsInV0aSI6ImQtLXpSa2VNUUVtUXptN0lLOHBVQUEiLCJ2ZXIiOiIxLjAifQ.MLY5hAHmp1G1s70kyXb3kxyOiqGKMccfBh8Gi78_Yc5LpcBMCkwC0_0cM2B-wN2dRlASkezusXE9n9ZaxImDqyHSYgyex77Mzg7KK4tCRIWuBuO64i2-6ait6Cn_CWfav0QBfxIiKYccZ0ysmeHfaNamKOpmUIH0YhwzztcbNIBbUMazA9ktADHNeLRtL3YJJ0pRtxxQQOFzTL7HDeC2ICKMKoMUeGJX8zWzrMZhweHhODWoiMjgIAZvZCZG0N5lpTisauAmFOqzzJAxWsK9JQoL1MCD_vWdfYPSFNT0XyqzIheUiUWS6Nh1BmqKVhbMYD6GljLVPcY17K1hVamSwQ
UnityEngine.DebugLogHandler:Internal_Log(LogType, String, Object)
UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
UnityEngine.Logger:Log(LogType, Object)
UnityEngine.Debug:Log(Object)
UnityEngine.MonoBehaviour:print(Object)


I keep getting this error every frame then

NullReferenceException: Object reference not set to an instance of an object
at PhotonVoiceNetwork.Update () [0x00013] in D:\Unity Projects\Multiplayer\Source\v17\Assets\PUNVoice\Scripts\PhotonVoiceNetwork.cs:292

(Filename: D:/Unity Projects/Multiplayer/Source/v17/Assets/PUNVoice/Scripts/PhotonVoiceNetwork.cs Line: 292)

NullReferenceException: Object reference not set to an instance of an object
at PhotonVoiceHandler.Update () [0x00001] in D:\Unity Projects\Multiplayer\Source\v17\Assets\PUNVoice\Scripts\PhotonVoiceHandler.cs:125

(Filename: D:/Unity Projects/Multiplayer/Source/v17/Assets/PUNVoice/Scripts/PhotonVoiceHandler.cs Line: 125)

Find IP of local self hosted server

$
0
0
Hi, is there any way to find out the IP address of the local (LAN) self hosted server with PUN? ie: instead of setting the IP manually in the game, it would be nice to just show the player a list of local servers on their LAN that they could pick from.

BUG in PUN: Specified cast is not valid

$
0
0
We have a project that uses PUN to play multiplayer in Unity. At first we tried the free version and were able to work. But once we move on to the full plugin, we get stuck in the login stages. Attach the errors in the console.
We will be happy for a solution.
Thanks

THE ERRORS:
InvalidCastException: Specified cast is not valid.
Photon.Pun.UtilityScripts.CountdownTimer.TryGetStartTime (System.Int32& startTimestamp) (at Assets/Photon/PhotonUnityNetworking/UtilityScripts/Room/CountdownTimer.cs:153)
Photon.Pun.UtilityScripts.CountdownTimer.Initialize () (at Assets/Photon/PhotonUnityNetworking/UtilityScripts/Room/CountdownTimer.cs:123)
Photon.Pun.UtilityScripts.CountdownTimer.OnRoomPropertiesUpdate (ExitGames.Client.Photon.Hashtable propertiesThatChanged) (at Assets/Photon/PhotonUnityNetworking/UtilityScripts/Room/CountdownTimer.cs:116)
Photon.Realtime.InRoomCallbacksContainer.OnRoomPropertiesUpdate (ExitGames.Client.Photon.Hashtable propertiesThatChanged) (at Assets/Photon/PhotonRealtime/Code/LoadBalancingClient.cs:4027)
Photon.Realtime.LoadBalancingClient.ReadoutProperties (ExitGames.Client.Photon.Hashtable gameProperties, ExitGames.Client.Photon.Hashtable actorProperties, System.Int32 targetActorNr) (at Assets/Photon/PhotonRealtime/Code/LoadBalancingClient.cs:2070)
Photon.Realtime.LoadBalancingClient.OnEvent (ExitGames.Client.Photon.EventData photonEvent) (at Assets/Photon/PhotonRealtime/Code/LoadBalancingClient.cs:3077)
ExitGames.Client.Photon.PeerBase.DeserializeMessageAndCallback (ExitGames.Client.Photon.StreamBuffer stream) (at <a497a6f18e1f4b419421b940add27a6e>:0)
ExitGames.Client.Photon.TPeer.DispatchIncomingCommands () (at <a497a6f18e1f4b419421b940add27a6e>:0)
ExitGames.Client.Photon.PhotonPeer.DispatchIncomingCommands () (at <a497a6f18e1f4b419421b940add27a6e>:0)
Photon.Pun.PhotonHandler.Dispatch () (at Assets/Photon/PhotonUnityNetworking/Code/PhotonHandler.cs:208)
Photon.Pun.PhotonHandler.FixedUpdate () (at Assets/Photon/PhotonUnityNetworking/Code/PhotonHandler.cs:142)

PhotonNetwork.AutomaticallySyncScenes NOT WORKING???

$
0
0
Hi! I'm new at this and am having trouble with PhotonNetwork.AutomaticallySyncScenes. I have a find room scene set up and everything is working fine, until I try and start the actual game. I try PhotonNetwork.LoadLevel() on the Master Client and the scene only loads on the Master Client which is expected (I think), so then I set PhotonNetwork.AutomaticallySyncScenes = true on the other client, but nothing happens. It stays on the room scene.
Is there something I'm not grasping? Am I using it right? Should I be doing it another way?
Any help is greatly appreciated, thank you.

IPv6 for Unity iOS Exports

$
0
0
Apple now requires iOS apps to support pure IPv6 connections. We tested PUN v1.75 and it supports IPv6, including the "Best Region" setting. If you use the Photon Cloud, you only have to make sure your PUN version is up to date. If you run a Photon Server, you need to use a recent 4.x server.

Test All Builds

Unity's support for IPv6 begins with 5.3.4p4. They posted about adding IPv6 support. Several versions of Unity do not successfully support IPv6, so you should test each build. If you get a client-side error like this, your client needs an update; Connect() to 'x.x.x.x' failed: System.Net.Sockets.SocketException: Network is unreachable in a IPv6 network.

Test Procedure

Read "Test for IPv6 DNS64/NAT64 Compatibility Regularly" to learn how to test IPv6 support easily. We do this for PUN before release. Make sure there is not some other plugin failing!

Handling Rejections

We know that some apps got rejected, despite using PUN v1.75 or newer. If your app gets rejected, please get in touch with the Apple review team. Point out that you're using PUN and that we and you both tested the networkcode versus their own test procedures. Explicitly point to their own test-description page. Apple suggests:
If the iOS application is successful in working across the macOS NAT64 test environment, then the next step is to submit a bug report. We ask developers to use the Apple Developer Bug Report web page - http://bugreport.apple.com to submit the bug report. The bug report is to indicate that there is some compatibility issue between the app and the App Review test environment. In the bug report, the developer provides evidence that the iOS application worked successfully across the macOS NAT64 test environment by including a packet trace to show the success of the connection process. Note that the bug report is not an indication as to where the problem lies, but the fact that the iOS app works in the test environment and not in App Review is an indication that the app / App Review interaction needs further review. Once the bug report is submitted, there issue is then assigned to investigation by an App Review group. Once a bug report is assigned to App Review, the next thing is to follow up with the bug report by communication with App Review - “appreview@apple.com”. While the email inquiries may not always get a response - all of the correspondence is viewed.

Cloud and Server

The Photon Cloud can not provide public IPv6 addresses in the short term. However, Apple's requirement is only that clients can cope with IPv6 addresses in their network, if that provides "IP translation", as described in their article. For anyone using Photon Server (OnPremise), this means, you can likely continue to run it as IPv4 service. If you want to setup a true IPv6 server, we have some docs for that. Get Photon Unity Networking in the Asset Store.

How do I separate players for controlling something?

$
0
0
This feels like a super rudimentary problem, so I apologize for my noobness, but I have a working multiplayer lobby and game where each player has a spaceship. The problem is that each player can control EVERY ship in the scene. I'm trying to figure out how to separate them.

I assume I need to add a "if this is your ship, then you can access these controls" but I can't seem to figure out how to assign each instantiated ship with its own unique player/ownership tag that can be reliably checked against. That way I can lock out controls on all the other ships. How can I check, upon spawning a new ship, who instantiated it? If I can answer that question, the rest will, hypothetically, domino into place.

Thank you

Avatar Hand synchronization not working

$
0
0
hello,
I'm working on the multiplayer application. I implement multi avatars using PUN2. everything working fine except hands synchronization on networks. can you please suggest any solution for this problem.

Thanks

PhotonNetwork.PhotonServerSettings.AppSettings.FixedRegion Don't Work For Last Updates

$
0
0
I was using Photon 2.13 but passed to the latest release. There is one new feature called Dev Region. I'am deleting Dev Region preference. Testing at iPhone with release build but this( PhotonNetwork.PhotonServerSettings.AppSettings.FixedRegion) don't work it connects to always eu even selecting other server. It was working with 2.13. What can I make for this situation. Thank You.

Creating a new AppID for Every Update

$
0
0
I am in the process of developing an online multiplayer system for a mobile game. Since the AppID can be cracked fairly easily, especially on Android, I am wondering if it is feasible to deactivate the old AppID and create a new one every update. By deactivating the old AppID, this should stop users on cracked versions of the app from joining multiplayer, forcing players to update to the newest version to grab the new AppID. Is this something that is possible? Will I reach some sort of app creation limit after some time?

THE NAMESPACE using Photon.Pun is not working is it called something else now.

$
0
0
Assets\scripts\Launcher.cs(4,14): error CS0234: The type or namespace name 'Pun' does not exist in the namespace 'Photon' (are you missing an assembly reference?)
this is the error I am getting

How to increase the CCU limit of 100?

$
0
0
Hi, I'm making a multiplayer android game which I'm hoping could accommodate more than +300 concurrent players but it has come to my notice that PUN 2 pro version has a CCU limit of 100 players. I was wondering if there was any ways to crank those numbers up.
Thanking in advance.

Players not joining/creating rooms. WebGL, wws, PUN2

$
0
0
Hello.
I'm quite fresh. Need help.
Players pass the connecting and stay in matchmaking state. Everything works fine in localhost.
using UnityEngine;
using Photon.Pun;
using Photon.Realtime;
using Hashtable = ExitGames.Client.Photon.Hashtable;
using System.Collections.Generic;
using ExitGames.Client.Photon;

public class LobbyManager : MonoBehaviourPunCallbacks

   private ConnectionProtocol TransportProtocol;

   
    public void ConnectedPlay()
    {
        this.TransportProtocol = ConnectionProtocol.WebSocketSecure;
        if (!PhotonNetwork.IsConnected)
            PhotonNetwork.ConnectUsingSettings();
            
    }

    public override void OnConnectedToMaster()
    {
        PhotonNetwork.AutomaticallySyncScene = true;
        FindMatch();

    }

    public void FindMatch()
    {
        PhotonNetwork.JoinRandomRoom();
        
    }
    public override void OnJoinRandomFailed(short returnCode, string message)
    {
        Debug.Log("creating room");
        MakeRoom();
    }

    void MakeRoom()
    {
        int randomRoomName = Random.Range(0, 5000);
        RoomOptions roomOptions =
            new RoomOptions()
            {
                IsVisible = true,
                IsOpen = true,
                MaxPlayers = 2
            };

        Hashtable RoomCustomProps = new Hashtable();
        RoomCustomProps.Add("P1Health", 0);
        RoomCustomProps.Add("P2Health", 0);
        roomOptions.CustomRoomProperties = RoomCustomProps;

        PhotonNetwork.CreateRoom("RoomName_" + randomRoomName, roomOptions);
        Debug.Log("room created - waiting for player");
    }

PhotonServerSettings:
https://ibb.co/sypJMHg


I add WebSocket folder in Assets/Plugins.
Unity 2019.4.1f1 LTS

Please, help :(

Change App Id During RunTime???

$
0
0
I am trying to change the app id during runtime.

but I cannot check that server is full or not.

how to find is the server full?

Could not resolve host 'ns.exitgames.com on HoloLens

$
0
0
When trying to connect to another room from an HoloLens it fails and shows this error: Connect() to 'ns.exitgames.com' () failed: System.Net.Sockets.SocketException (0x80004005): Could not resolve host 'ns.exitgames.com' Here is the complete log from Visual Studio: https://pastebin.com/PpVQB53t What is strange is that my other app with the same "Connection code" is working perfectly. When I switch from IL2CPP to .NET Scripting backend it suddenly works but the other application works with IL2CPP. This is my "Connection code: https://pastebin.com/T61dHzj7 It is one very simple script. It works in the editor too but it fails on HoloLens Emulator or HoloLens device. I use: Unity 2018.2.0f2 PUN 1.91

Instantiating a gameobject and syncing it

$
0
0
Hi There, I've spent months working through PUN2 documentation and tutorials and with much trial and error I am at a point where both players connect to the same room and the game scene launches.

There are no moving parts other than a timer and a score that I need to send/receive. I have added IPunObservable and added the necessary gameobjects that need to be sent/recieived as the example in the basics tutorial.

What happens: The timer only appears on the MasterClient (as it would) but does not appear on the other players game.

Photon registers the Photonviews applied.

What I want: The timer to be synced and instantiated from the Masterclient to all players

Issue with v2.20 on HoloLens

$
0
0
Hi, I've been investigating a problem today in a Unity HoloLens project that I began earlier this week.
The project is very basic so far as does little more than get the app connected to a Photon room and share the positions of each player.

It worked fine running in the Unity editor but fails on HoloLens. I make the call to ConnectUsingSettings, but then there's nothing. Turning on INFO level logging, the last output is something like "???, .Net, Unity" (sorry I don't have the log anymore and can't remember the first word!), but there is no response from the Nameserver - the attempt doesn't even fail or time out.

A week or two back I had successfully set up and tested Microsoft's Photon-based "multi-user capabilities" tutorials, running on the same home network and on the same HoloLens device. After seeing that my new code worked when transplanted into the older tutorial project, I eventually ran a comparison between the two and realized that I had picked up Photon 2.20 on Aug 03 when I created the new project. When I swapped out v2.20 for 2.19.3 then instantly the connection worked.

Any thoughts welcome!

Deserialization failed for internal Operation Response. System.Exception: Deserialize(): 7 pos: 6 by

$
0
0
Hello guys
please I need help, I'm stuck for two days thanks in advance :smile:

Deserialization failed for internal Operation Response. System.Exception: Deserialize(): 7 pos: 6 bytes: 55. F3-07-01-FF-FF-07-2F-4D-69-73-73-69-6E-67-20-76-61-6C-75-65-20-31-20-28-50-69-6E-67-52-65-71-75-65-73-74-2E-43-6C-69-65-6E-74-54-69-6D-65-53-74-61-6D-70-29-0D-0A-00
at ExitGames.Client.Photon.Protocol16.Deserialize (ExitGames.Client.Photon.StreamBuffer din, System.Byte type) [0x0021b] in <7c99d57ff1b84df1ab45b8023b1063e2>:0
at ExitGames.Client.Photon.Protocol16.DeserializeOperationResponse (ExitGames.Client.Photon.StreamBuffer stream) [0x0002b] in <7c99d57ff1b84df1ab45b8023b1063e2>:0
at ExitGames.Client.Photon.PeerBase.DeserializeMessageAndCallback (ExitGames.Client.Photon.StreamBuffer stream) [0x0030d] in <7c99d57ff1b84df1ab45b8023b1063e2>:0
Viewing all 8947 articles
Browse latest View live