playMaker

Author Topic: PhotonViewGetOwnerProperties does not seem to work  (Read 1793 times)

xunxun

  • Junior Playmaker
  • **
  • Posts: 53
PhotonViewGetOwnerProperties does not seem to work
« on: December 18, 2013, 07:23:05 AM »
hi,

I'm quite confuse about how to get owner (the user who is holding device) in Photon.

- I did try "PhotonIsMine". But this function only can get master client (who created the room) any other connected players are absolutely "NotMine".

- Another option is "PhotonViewGetOwnerProperties". But it PhotonViewGetOwnerProperties doesn't seem to work. It return False for both Bools (see image). Even when I created the room or joined the room.

My setup is following these steps below

- Joined/Created Room -> Set Is Message Queue Running (true)
- The FSMGameObject has both PhotonView and NetworkView (see image)

am I missing something?

My task is just simple that The players who hold their phone get in room always appear on a preset position and others could be in anywhere.

please help,

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: PhotonViewGetOwnerProperties does not seem to work
« Reply #1 on: December 18, 2013, 09:39:12 AM »
Hi,

 I think you are getting confused with several concepts:

-- "is Mine" refers to the application that instanciatated that Prefab, it is true only on that machine, and false everyone else. It has nothing do to with "master" concepts. So User A's Player Prefab will return true if you ask this question on User A's device, and false on User B's device. User's B player Prefab will return true on User B's Device and false on User A's device.

-- "master" within the Cloud system refers the running instance that is acting under the hood as the server, it has nothing to do with the "is mine" concept above. Also, don't rely on this "master" as it can change. If for example the device running currently as the master gets disconnected, another device within that room will be assigned as the master. Again, totally unrelated to "is Mine", and master switch do not affect the "is mine" checks you can run  on prefabs.

I am not sure what you are trying to achieve, but I would strongly recommand that you study the Samples provided for Photon networking and PlayMaker:

http://www.hutonggames.com/samples.php

This demo has all its fsm documented, so you can learn more about the connection processes.
https://hutonggames.fogbugz.com/?W928

Using GetOwnerProperties is something to use when your player is already connected and in a room ( it doesn't work if in the lobby). it's also quietly featured in the demo ( in the prefab 'Fsm Photon Player' fsm:'Custom Property'), but undocumented, I don't want to confused beginners here, I am thinking of doing an advanced section for this kind of actions. In there, you'll find the expected processes to access Owner's properties.

Bye,

 Jean