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

v1.74 (15. August 2016) Does not compile into iOS build

$
0
0
It won't compile if Api compatibility level is set to .NET 2.0 subset

Error shown below:

Failed running
/Applications/Unity/Unity.app/Contents/Frameworks/Tools/UnusedByteCodeStripper2/UnusedBytecodeStripper2.exe -out "/Users/Desktop/Projects/BattleSpaceships/Temp/StagingArea/Data/Managed/tempStrip" -l none -c link -b False -x "/Applications/Unity/PlaybackEngines/iOSSupport/Whitelists/Core.xml" -f "/Applications/Unity/Unity.app/Contents/Frameworks/il2cpp/LinkerDescriptors" -x "/Users/Desktop/Projects/BattleSpaceships/Temp/StagingArea/Data/Managed/../platform_native_link.xml" -x "/Users/Desktop/Projects/BattleSpaceships/Temp/StagingArea/Data/methods_pointedto_by_uievents.xml" -x "/Users/Desktop/Projects/BattleSpaceships/Temp/StagingArea/Data/preserved_derived_types.xml" -x "/Users/Desktop/Projects/BattleSpaceships/Assets/link.xml" -x "/Users/Desktop/Projects/BattleSpaceships/Assets/Photon Unity Networking/link.xml" -d "/Users/Desktop/Projects/BattleSpaceships/Temp/StagingArea/Data/Managed" -a  "/Users/Desktop/Projects/BattleSpaceships/Temp/StagingArea/Data/Managed/Assembly-CSharp-firstpass.dll" -a  "/Users/Desktop/Projects/BattleSpaceships/Temp/StagingArea/Data/Managed/Assembly-CSharp.dll" -a  "/Users/Desktop/Projects/BattleSpaceships/Temp/StagingArea/Data/Managed/Assembly-UnityScript-firstpass.dll" -a  "/Users/Desktop/Projects/BattleSpaceships/Temp/StagingArea/Data/Managed/UnityEngine.Advertisements.dll" -a  "/Users/Desktop/Projects/BattleSpaceships/Temp/StagingArea/Data/Managed/UnityEngine.UI.dll" -a  "/Users/Desktop/Projects/BattleSpaceships/Temp/StagingArea/Data/Managed/UnityEngine.Analytics.dll" -a  "/Users/Desktop/Projects/BattleSpaceships/Temp/StagingArea/Data/Managed/RAIN.dll" -a  "/Users/Desktop/Projects/BattleSpaceships/Temp/StagingArea/Data/Managed/Tapjoy.dll"

stdout:
ERROR: Failed to resolve base type System.Configuration.ConfigurationException for type System.Configuration.ConfigurationErrorsException
Fatal error in Mono CIL Linker
System.Exception: ERROR: Failed to resolve base type System.Configuration.ConfigurationException for type System.Configuration.ConfigurationErrorsException
at UnusedBytecodeStripper2.ResolveFromMonoBehaviours.IsMonoBehaviourOrScriptableObject (Mono.Cecil.TypeDefinition type) [0x00000] in <filename unknown>:0
at System.Linq.Enumerable+<CreateWhereIterator>c__Iterator1E`1[Mono.Cecil.TypeDefinition].MoveNext () [0x00000] in <filename unknown>:0
at UnusedBytecodeStripper2.ResolveFromMonoBehaviours.Process (Mono.Linker.LinkContext context) [0x00000] in <filename unknown>:0
at Mono.Linker.Pipeline.Process (Mono.Linker.LinkContext context) [0x00000] in <filename unknown>:0
at Mono.Linker.Driver.Run () [0x00000] in <filename unknown>:0
at Mono.Linker.Driver.RunDriverWithErrorHandling (Mono.Linker.Driver driver) [0x00000] in <filename unknown>:0
at Mono.Linker.Driver.RunDriver (Mono.Linker.Driver driver) [0x00000] in <filename unknown>:0
stderr:

UnityEngine.Debug:LogError(Object)
UnityEditorInternal.Runner:RunManagedProgram(String, String, String, CompilerOutputParserBase) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:94)
UnityEditorInternal.AssemblyStripper:RunAssemblyLinker(IEnumerable`1, String&, String&, String, String) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/AssemblyStripper.cs:107)
UnityEditorInternal.AssemblyStripper:StripAssembliesTo(String[], String[], String, String, String&, String&, String, IIl2CppPlatformProvider, IEnumerable`1, Boolean) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/AssemblyStripper.cs:100)
UnityEditorInternal.AssemblyStripper:RunAssemblyStripper(String, IEnumerable, String, String[], String[], String, IIl2CppPlatformProvider, RuntimeClassRegistry, Boolean) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/AssemblyStripper.cs:204)
UnityEditorInternal.AssemblyStripper:StripAssemblies(String, IIl2CppPlatformProvider, RuntimeClassRegistry, Boolean) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/AssemblyStripper.cs:131)
UnityEditorInternal.IL2CPPBuilder:Run() (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:201)
UnityEditorInternal.IL2CPPUtils:RunIl2Cpp(String, String, IIl2CppPlatformProvider, Action`1, RuntimeClassRegistry, Boolean) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:128)
UnityEditor.HostView:OnGUI()
Exception: /Applications/Unity/Unity.app/Contents/Frameworks/Tools/UnusedByteCodeStripper2/UnusedBytecodeStripper2.exe did not run properly!
UnityEditorInternal.Runner.RunManagedProgram (System.String exe, System.String args, System.String workingDirectory, UnityEditor.Scripting.Compilers.CompilerOutputParserBase parser) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:96)
UnityEditorInternal.AssemblyStripper.RunAssemblyLinker (IEnumerable`1 args, System.String& out, System.String& err, System.String linkerPath, System.String workingDirectory) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/AssemblyStripper.cs:107)
UnityEditorInternal.AssemblyStripper.StripAssembliesTo (System.String[] assemblies, System.String[] searchDirs, System.String outputFolder, System.String workingDirectory, System.String& output, System.String& error, System.String linkerPath, IIl2CppPlatformProvider platformProvider, IEnumerable`1 additionalBlacklist, Boolean developmentBuild) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/AssemblyStripper.cs:100)
UnityEditorInternal.AssemblyStripper.RunAssemblyStripper (System.String stagingAreaData, IEnumerable assemblies, System.String managedAssemblyFolderPath, System.String[] assembliesToStrip, System.String[] searchDirs, System.String monoLinkerPath, IIl2CppPlatformProvider platformProvider, UnityEditor.RuntimeClassRegistry rcr, Boolean developmentBuild) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/AssemblyStripper.cs:204)
UnityEditorInternal.AssemblyStripper.StripAssemblies (System.String stagingAreaData, IIl2CppPlatformProvider platformProvider, UnityEditor.RuntimeClassRegistry rcr, Boolean developmentBuild) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/AssemblyStripper.cs:131)
UnityEditorInternal.IL2CPPBuilder.Run () (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:201)
UnityEditorInternal.IL2CPPUtils.RunIl2Cpp (System.String tempFolder, System.String stagingAreaData, IIl2CppPlatformProvider platformProvider, System.Action`1 modifyOutputBeforeCompile, UnityEditor.RuntimeClassRegistry runtimeClassRegistry, Boolean developmentBuild) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:128)
UnityEditor.iOS.PostProcessiPhonePlayer.PostProcess (BuildTarget target, System.String stagingAreaData, System.String stagingArea, System.String stagingAreaDataManaged, System.String playerPackage, System.String installPath, System.String companyName, System.String productName, BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry) (at /Users/builduser/buildslave/unity/build/PlatformDependent/iPhonePlayer/Extensions/Common/BuildPostProcessor.cs:444)
UnityEditor.iOS.iOSBuildPostprocessor.PostProcess (BuildPostProcessArgs args) (at /Users/builduser/buildslave/unity/build/PlatformDependent/iPhonePlayer/Extensions/Common/ExtensionModule.cs:27)
UnityEditor.PostprocessBuildPlayer.Postprocess (BuildTarget target, System.String installPath, System.String companyName, System.String productName, Int32 width, Int32 height, System.String downloadWebplayerUrl, System.String

Lag compensation

$
0
0
I think that I read all the topics about this subject and no one solved my problem, so I need some help again. I try to lerp the movements of the others players, but the problem is that instead of "lerping" between the both last positions receveid, the object lerps between its postion and (0,0,0).I tried the CubeLerp script, the CubeInter script and every scripts available on internet but it never worked. Even if they said that they fixed this problem, it never worked for me. The GameObject has the same properties as the cubes in the "synchonisation demo scene". The only difference is that I instantiate it at the start with PhotonNetwork.Instantiate.

That would be so cool if I could finish my game before my holiday's end, and this is a big barrier to me!
Thank you

1000 GameObject Limit and Server Lag.

$
0
0
My game is like Agar.io / Slither.io. There are two issues that i am facing,
1)Photon restricts us for creating more than 1000 Gameobjects. (900 of them are static ). I want to create more than 1000 objects.
2)When only 2 players connects, the server starts to lag. (with 3 players, maximum message rate is 90/sec).

ReconnectAndRejoin: AuthValues == null is not correct?

$
0
0
I am attempting to use PhotonNetwork.ReconnectAndRejoin() to get back in a room after a mobile user gets disconnected by the OS when the app goes to the background.

It doesn't seem to work and throws an error: "ReconnectAndRejoin() with AuthValues == null is not correct!"

I don't understand why AuthValues are required for reconnect but not the normal connect?

I attempted to set some AuthValues or just use a blank AuthValues but I get errors when creating a room about not having an AppId (I'm using on-premise hosted version) or the Auth type not being supported.

I've also tried using the normal Connect function after disconnected by iOS but it doesn't work and I don't receive either of the OnFailedToConnectToPhoton, OnConnectedToLobby, OnConnectedToMaster callbacks...

Using Photon Unity Networking 1.73

PUN Custom Authentication - Steam?

$
0
0
Hi,

I noticed in the code for LoadBalancingPeer.cs, that there are three CustomAuthenticationTypes : None, Custom, Facebook, and Steam. I was suprised about steam, as I had not seen that documented in the authentication docs.

Is this steam authentication implemented and ready to use? If so, is usage documented anywhere?

Thank you

S

PUN not removing disconnected players

$
0
0
Are there any known issues with photon not cleaning up players when a player disconnects? I'm running latest version as of 7-25-16 from unity asset store. I searched the forums and couldn't come up with anything.

Basically what is happening is I have a scene that players auto join a random room or create a room.

If one player leaves, then the disconnected players game object (a ship in this case) is controlled by the remaining player. So the only player in the room is controlling 2 ships at this point. If I rejoin with another game then there are 3 ships. Two being controlled by one player and the third by the last joined.

I looked into the clean cache options on room create as well as the auto clean player objects book set to true. Still same results. Any help would be appreciated. Thanks.

Detected issue with Unity 5.4 - Changing scene - OnLevelWasLoaded() method

$
0
0
In Unity 5.4, OnLevelWasLoaded() method has been deprecated. Photon Engine knows this and has commented the method OnLevelWasLoaded() located at PhotonHandler.cs. However this causes that the method NewSceneLoaded() in NetworkingPeer.cs is never called and the network mesage-queue is not enabled again as it's stated in the documentation of LoadLevel():

While loading levels, it makes sense to not dispatch messages received by other players. This method takes care of that by setting PhotonNetwork.isMessageQueueRunning = false and enabling the queue when the level was loaded.

I suppose this will be solved in the future but as now, the solution is emulate the OnLevelWasLoaded method:
		void OnLevelWasLoadedFixed(Scene scene, LoadSceneMode loadSceneMode){
PhotonNetwork.networkingPeer.NewSceneLoaded();
PhotonNetwork.networkingPeer.SetLevelInPropsIfSynced(SceneManagerHelper.ActiveSceneName);
}
And call it using:

SceneManager.sceneLoaded += OnLevelWasLoadedFixed;

Hope it helps!

Unity PUN Basics Tutorial not working (leaveRoom)

$
0
0
I've been going throught the "PUN Basics Tutorial" and in the Part 4 I've noticed that the "Quit Room" button it's not working. Thinking that could be something I made wrong I've loaded the PunBasics-Tutorial that is included in the Photon Unity Networking folder (downloaded the Assets Store) but the problem is there too.

How can I solve this? What could be the problem? I think that the change of scene has something to do because I've tried to connect and leave in the Launch scene and it works.

V1.74 + Unity 5.4.0p1 + UWP 10 Problem

$
0
0
Hello guys :) have problem with new version and unity UWP 10

Update playerName for FindFriends without reconnecting

$
0
0
Is there a way to update he playerName without reconnecting? From what I have seen is that you have to set the playerName before connecting.

My game flow works like this for new players
1. Player starts the game as an anonymous player
2. Player clicks Facebook and it returns his ID
3. Then I set PhotonNetwork.playerName = facebookID

4. Disconnect and reconnect this is the step I want to skip!

5. PlayerName is updated and other people can see the status

differentiate cloning objects with different tag names on PUNRPC

$
0
0
I try to change the tag names of instantiate game object on PUNRPC but it doesn't effect , tags names are not changing. This is the code i have used:-

IEnumerator SpawnPlayer(float respawnTime)
{
yield return new WaitForSeconds(respawnTime);

int index = Random.Range (0, spawnPoints.Length);

player = PhotonNetwork.Instantiate ("A03", spawnPoints [index].position, spawnPoints [index].rotation, 0);
photonView.RPC ("PlayerTag", PhotonTargets.All, player);


[PunRPC]
void PlayerTag(GameObject player)
{
if (playerCount == 1) {
player.tag = "One";
}
if (playerCount == 2) {
player.tag = "Two";
}
}

Please send me the solution.

How i get my UserId or a player UserId?

$
0
0
I used Custom Authentication. How i get my UserId retrieved from auth server? How i get UserId from PhotonPlayer of other player in the room (for example to add it to my friends)?

RPC ONLY for new players

$
0
0
Hi, i have a question, i want to create an rpc only for new connecting players.
In my case when a player disconnects every connected player executes a function

public void OnPhotonPlayerDisconnected(PhotonPlayer LeftPlayer){
Debug.Log ("Remove spawn point Locally");
Debug.Log ("Remove spawn point for new players");
}


I can't just run an RPC with "AllBuffered" because everyone else will call an rpc to everyone else.
I just want to locally call my function, and later run an RPC to all the new upcoming players

Having errors when I added a function in the RPSCore.

$
0
0
I added EnemyHP.value = EnemyHP.value - local.GetScore (); in the RPSCore code.

public void UpdatePlayerTexts()
{
PhotonPlayer remote = PhotonNetwork.player.GetNext();
PhotonPlayer local = PhotonNetwork.player;

if (remote != null)
{
// should be this format: "name 00"
this.RemotePlayerText.text = remote.name + " " + remote.GetScore().ToString("D2");
EnemyHP.value = EnemyHP.value - local.GetScore ();
}
else
{

TimerFillImage.anchorMax = new Vector2(0f,1f);
this.TimeText.text = "";
this.RemotePlayerText.text = "waiting for another player 00";
}

if (local != null)
{
// should be this format: "YOU 00"
this.LocalPlayerText.text = "YOU " + local.GetScore().ToString("D2");
PlayerHP.value = PlayerHP.value - remote.GetScore ();
}
}


and now im currently having these errors..
NullReferenceException: Object reference not set to an instance of an object
ScoreExtensions.GetScore (.PhotonPlayer player) (at Assets/Photon Unity Networking/UtilityScripts/PunPlayerScores.cs:35)
RpsCore.UpdatePlayerTexts () (at Assets/Photon Unity Networking/Demos/DemoRockPaperScissors/Scripts/RpsCore.cs:429)
RpsCore.Update () (at Assets/Photon Unity Networking/Demos/DemoRockPaperScissors/Scripts/RpsCore.cs:182)


can someone help me please.. Thanks

Difference between RPC and RpcSecure

$
0
0
I would like to know what the advantages and disadvantages are for using either of these.

GameClose, Type: "Save" web hook

$
0
0
Hi,

I originally posted this question to unity forum and redirected to here by tobiass.

We are trying to use GameClose, Type: "Save" web hook.

We are using custom room properties heavily during gameplay and we need to persist in game close hook.

In our tests we see that custom room properties do not exist in under CustomProperties tag in received from photon web call. Instead custom room properties are under debuginfo tag in json.

How can we save custom room properties GameClose, Type: "Save" web hook and load them later ?

Additionally, how can I set EmptyRoomTTL to 300000 and PlayerTTL to 0 in PUN Free ? There is no EmptyRoomTTL parameter in RoomOptions class as far as I can see.

Thanks.

... and tobiass said(for contextual purpose):
I will have to forward the questions about WebHooks and the content of the "save" hook to my colleagues. Those are best discussed in a dedicated thread in our forum.

About PlayerTTL and EmptyRoomTTL: In PUN you can only set one to simplify matters. PUN is not fully compatible with persisted games (using PhotonViews and ownership is a bit tricky, when you return to the room). But it seems you rely mostly on props.
If you would set PlayerTTL to 0, any player who loses connection will be timed out and can't simply return to the room.
Let me guess, you try to create a persistent world with as many/few players as happen to be there?

Please post more details of what you want to achieve in our forum. A discussion of this is too complex for this super long thread. http://forum.photonengine.com

Photon 1.74 warning

$
0
0
I just updated my Unity project to Photon 1.74 and I am getting this warning.

Assembly 'Photon3Unity3d' has non matching file name: 'Photon3Unity3D.dll'. This can cause build issues on some platforms. UnityEditor.HostView:OnGUI()

MasterClient player not shown on all clients

$
0
0
Hello,

Let me explain my game's scenario:
Players are in the main menu scene, they matchmake randomly into rooms. When the room is full they select the character they want to play with and press the "ready" button which send an RPC to the master client.
When all players are ready, the master client loads the game scene using the following code:

PhotonNetwork.LoadLevel("Game Scene");

PhotonNetwork.automaticallySyncScene is also set to true, so all clients will sync the scene.
Now when the master clients loads his scene, all other players are there when they load their scenes and instantiate their player prefab. while the other players just can't see the master client's player, but they can see each other's players.

This is kind of weird because I have read that PhotonNetwork.LoadLevel() is supposed to handle this using room properties, and I have seen almost the same case scenario on this forum:
http://forum.unity3d.com/threads/solved-players-that-join-a-game-cant-see-other-previously-instantiated-objects-pun.324508/

But in my case I wasn't able to handle this.

Am I doing anything wrong? Should I handle something?

Any suggestions are appreciated.

Thank you!

Send an array of int[] via RPC

$
0
0
I need to send an array of ints via RPC
I tried the following, and it does not give an error, but the values do not get sent over properly:

int[] myints=new int[2];
myints[0]=0;
myints[1]=1;

photonView.RPC("sendints",PhotonTargets.Others,(int[])myints);
...
[PunRPC]
void sendints(int[] myints) {
myints[0]....says 0
myints[1]....says 0


anyone know how to do this?
I need to send array of vectors, floats and ints

How to works Photon Cloud?

$
0
0
Photon use relay server? Or clients directly send traffic to each other?
Thanks for answer.
Viewing all 8947 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>