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

Objects owned by the scene become owned by the new master client when the master client switches.

$
0
0
I have noticed that when the Master client drops from a game, all the photon views that used to be owned by "Scene" become owned by whichever client becomes the new master client. Is this intended behavior?

I understand that Scene objects are owned by the master in a certain sense, but before the master drops they are NOT owned by the master player, they are owned by "Scene" so I would imagine they should continue to be owned by "Scene" when the master client migrates.

I am not using "OnMasterClientSwitched" anywhere.

Thank you.

How to Get Room Properties if all I have is the room name?

$
0
0
I want to return a list of rooms my friends are playing in, but in my lobbies the room name is actually a custom room property, so when I get the list back in OnUpdatedFriendList() I only have access to the string of the room name (which in my case is just a GUID).

I need to access the custom room properties of the room, but all I have is the room name, is there any way to lookup the room details if all I have is the room name?

Is there some photon files who works diferents in build/build&run?

$
0
0
Hi there, I am running last Pun free asset and unity 2017 version. I get a strange photon error only when I build and run (for android) separately just at the start of runing the app and there is no way to connect the photon lobby from there, if i run and build directly on the phone or on PC there is no error.

Error:
NullReferenceException: Object reference not set to an instance of an object at PhotonNetwork..cctor () [0x00000] in :0 Rethrow as TypeInitializationException: An exception was thrown by the type initializer for PhotonNetwork at ExitGames.Client.Photon.SupportClass+<>c__DisplayClass7_0.b__0 () [0x00000] in :0 (Filename: Line: -1)

jdk1.8.0_45 and last android studio 2.3.0 SDK

Thanks.

We are facing legs

$
0
0
Hi, the ping time is ~200, we are facing a lot of legs.
We are using photon the free package, is this the reason for that ?

Connecting to photon cloud if self hosted photon server fails

$
0
0
Hi! I am just starting out with Photon, but the game(unity) I am tasked to work on is currently connecting to photon cloud. We would like to try out hosting our own instance of Photon Server, would it be possible to try to connect to our own server first and connect to photon cloud if it fails? From what I understood in the documentation, I have to use "ConnectUsingSettings" and "ConnectToMaster" if using photon server. But I am not sure how to move forward. Hope to hear from you all soon, TIA.

Two Colliders of Photon objects are acting like one!

$
0
0
I am developing an Unity game app with PUN. I put two photon objects in the same game room by logging in from 2 devices. Those two objects are the same thing, having a Sphere collider. But, of course, each object is owned by different client.
The problem is that the 2 colliders of those 2 objects are acting like one object. When a collider of an object detects collision, the other collider also detects collision that doesn't happen.
I guess I missed something when I define those objects. What I did is that I put Photon View Script onto the object and
create them by PhotonNetwork.Instantiate. I guess I need a lot more knowledge about Photon.
Please help me. Any advice will be so appreciated.



Possible to disable some regions?

$
0
0
Hello,

Based on this link:
https://doc.photonengine.com/en/realtime/current/reference/regions

There are about 10+ regions available. I understand that, its good to connect players in the same region so that they can play in the best ping. However, right now, our players are scattered all over the world, and we do not have large users base. Most of the times, they could not find games/rooms. Thus, I would like to check is it possible to disable certain regions so that our players only connect to certain regions and will have higher chances to find games/rooms?

Please advise. Thank you.

Regions: Russia, Russia, East

$
0
0
Hi guys! I have a problem with region settings.
According article https://doc.photonengine.com/en/pun/current/reference/regions there is 2 regions available in russia (tokens ru, rue).
But, for some reason, i cant see those regions in PhotonServerSettings, or in [enum CloudRegionCode]
Are those regions not supported anymore, or am i doing something wrong?
Thank you!

Cannot set player custom properties

$
0
0
Hello, I am trying to save and read a single custom property in my PhotonPlayers, but apparently nothing has worked so far: every time I try to read that property, it returns null. After reading many threads in this forum this is what I got, and it still doesn't work:

This is my code for writing the custom property:
ExitGames.Client.Photon.Hashtable hashtable = new ExitGames.Client.Photon.Hashtable();
hashtable.Add("PlayerStatus", "LoadingLevel");
PhotonNetwork.player.SetCustomProperties(hashtable);


This is my code for reading it:
string status = player.CustomProperties["PlayerStatus"].ToString();

This same code works fine for Room custom properties, but not for PhotonPlayer custom properties. What's wrong here? It's like it never gets updated.
Thanks!

Unity PUN auto disconnects on scene change

$
0
0
Hello all, i know this question should have been asked a few times here. However my issue wasnt solved no matter which solved solution i followed.

My Unity version is 5.5.0f3 and PUN is v1.87
I am calling (PhotonNetwork.automaticallySyncScene = true;) for every player on Start() before calling (PhotonNetwork.LoadLevel("scenename");) on MasterClient
Sending RPC "DoStartGame" to target: All or player:.
Received RPC: DoStartGame
PUN-instantiated 'GameManager' got destroyed by engine. This is OK when loading levels. Otherwise use: PhotonNetwork.Destroy().
Registered PhotonView: 2
OperationResponse 252: ReturnCode: 0.
OperationResponse 254: ReturnCode: 0.
OnStatusChanged: Disconnect current State: DisconnectingFromGameserver
OnStatusChanged: Connect current State: ConnectingToMasterserver
Connected to masterserver.
OnStatusChanged: EncryptionEstablished current State: Authenticating
OnEvent: Event 226.
OperationResponse 230: ReturnCode: 0.
RPCs can only be sent in rooms. Call of "DoSetGameReady" gets executed locally only, if at all.
This is my current log. Upon changing scene both the players will automatically no longer be in the same room.
What i figured:
-using DontDestroyOnLoad on a gameObject that has PhotonView will cause a duplicate error upon scene change
-calling PhotonNetwork.isMessageQueueRunning = false isnt necessary because PhotonNetwork.LoadLevel() settles it

Why does my players automatically disconnect from the room?

opus_egpv.dll caused an Access Violation (0xc0000005)

$
0
0
This has been causing build crashes whenever a player gets kicked from an online room by a host. Can anyone inform me on how to resolve this?

Thanks,
Andy

Photon after 8pm GMT makes my game a joke!

$
0
0
After 8pm GMT the lag with photon makes my game totally unplayable. EU servers. I was playing my game with only 2 people and the lag is totally unplayable. Any time during the day its pretty decent but any time after 8pm gmt its totally unplayable. For a paid service, this is a total joke. 2 players and 4 second lag.

Ownership transfer of SceneObjects on disconnecting MasterClient

$
0
0
Hello,

i am using PhotonNetwork.InstantiateSceneObject("BrickWall", t.position, t.rotation, 0, null); to let the MasterClient instantiate the destroyable world.
In Unity this SceneObjects are shown on MasterClient as
- Owner: Scene
- ViewID: 1
- Controlled Locally (master): yes

After the MasterClient is disconnecting, looks like the ownership of the SceneObjects get automatically transferred by PUN. After this the Ownersship is not anymore Scene for the new MasterClient:
- Owner: 2
- ViewID: 1
- Controlled Locally (master): yes

How to solve this problem? This should not be normal?

This is a problem for me because: If a bullet hits anything, i check if it hits the player itselfe, to ignore himselfe. (In my game the owner of the bullet should not be hit by it).
if (bulletOwnerId == other.photonView.ownerId) { //ignore }
In this case after the MasterClient disconnects and the ownership of the SceneObjects is transferred automatically, the new MasterClient can not hit any SceneObject anymore, because all SceneObjects have now the MasterClients OwnerID,

PUN Pricing

$
0
0
Sorry if there is another topic about it but I still cannot understand one thing. If I buy 100 CCU for 95$ for 60 months. But for example I need 200 CCU. Can I buy another 100 CCU for some higher price (without a discount) than the first one, or I can only by 500 CCU? Thanks.

PhotonNetwork.Destroy have be worked,but still have error

$
0
0
I am very new to photon, apologies if the questions are extremely basic.
sorry about my bad expression because English is not my first language

question:

I have a room for two players,and the Master do: PhotonNetwork.Instantiate to produce some gameobject
when the Master to do PhotonNetwork.Destroy。it worded,both master and un-master。their scene both have destroyed the gameobject。but there still have some error in console:

PhotonView with ID 1095 wasn't properly unregistered! Please report this case to developer@photonengine.com

Why.... :cry:

My static variables are not working with Photon

$
0
0
So I have an issue with Photon. I am trying to make each player's own separate rank display on the scoreboard of the room. What happens right now? Well it is currently showing the local player's rank amongst all others players and vise versa on the that other player's rank. For example if your playing my game on your local machine and your rank is 2 then all the other player's ranks will show 2 on their names in the room...

Script 1 - Main Menu
Here's my variable -
public static int rank_number;

Script 2 - Scoreboard

GUILayout.Label("Rank " + (int)ConnectMenu.rank_number);
//Display player name
GUILayout.BeginHorizontal();
if(teamTmp[i].customProperties["PlayerHP"] == null || (int)teamTmp[i].customProperties["PlayerHP"] < 1){
GUI.color = GameSettings.customRedColor;
GUILayout.Label("*");
GUILayout.Space(5);
}

GUI.color = (int)teamTmp[i].customProperties["Team"] == 1 ? GameSettings.teamAColor : GameSettings.teamBColor;
playerRank = ConnectMenu.currentRank;
GUILayout.Label(teamTmp[i].name);


Do I need customProperties set?
Let me know if you have any idea of a fix please :)

Handling Disconnection issues

$
0
0
HI , i want to know how to properly handle disconnection in photon. When a player is currently on a dungeon and he / she disconnects. Do I put a reconnect and join on the OnPhotonDisconnect function but will i be able to spawn the player on his previous position ? + my camera is attached on this player so it also goes away upon disconnecting.
Thanks! :)

Is it possible to transfer the master client role to another player if the master client dies?

$
0
0
We have a scenario where the master client player dies, all the AI monster handled by him stops (previous requirement before implementing multiplayer) , so i need to transfer the master client role to another "living" player.
Thanks! :)

crashing on play

$
0
0
anyone run into this before?


Unity Editor [version: Unity 2017.2.0f3_46dda1414e51]

Unity.exe caused an Access Violation (0xc0000005)
in module Unity.exe at 0033:4071f9cf.

Error occurred at 2017-10-21_094330.
E:\3d software\Editor\Unity.exe, run by Nick.
52% memory in use.
16272 MB physical memory [7783 MB free].
32542 MB paging file [23742 MB free].
8388608 MB user address space [8386388 MB free].
Read from location 00000000 caused an access violation.

Context:
RDI: 0x0022b543 RSI: 0x04b107f2 RAX: 0x00000000
RBX: 0x3ab1eaa0 RCX: 0x00000000 RDX: 0x0022b3e0
RIP: 0x4071f9cf RBP: 0x0022b510 SegCs: 0x00000033
EFlags: 0x00010206 RSP: 0x0022b410 SegSs: 0x0000002b
R8: 0x0022b220 R9: 0x6d25f2f4 R10: 0x00000014
R11: 0x00000046 R12: 0x3ab1e9d0 R13: 0x04b893d0
R14: 0x00000000 R15: 0x3ab3fa20

Different Players SendRate in same Room? Change sendRate dynamically?

$
0
0
Hello,

I am curious about one thing.

What happens when there are
10 players in one room

5 players have this settings
PhotonNetwork.sendRate = 18;
PhotonNetwork.sendRateOnSerialize = 9;

2 players this
PhotonNetwork.sendRate = 10;
PhotonNetwork.sendRateOnSerialize = 5;

3 players
PhotonNetwork.sendRate = 8;
PhotonNetwork.sendRateOnSerialize = 4;


Will there be any problems?


I am thinking to change the sendrate for players dynamically on mobile devices depending on the FrameRate.
My hope lower sendrate -> better performance

Will this cause some weird stuff among other players in the room?

thanks
Viewing all 8947 articles
Browse latest View live