playMaker

Author Topic: Destroy  (Read 2655 times)

caesarhernandez

  • Playmaker Newbie
  • *
  • Posts: 30
Destroy
« on: December 01, 2013, 03:47:51 PM »
Hello,

I'm not sure what to expect when a network instantiated player leaves a game because the game client is shut down (hard, no direct call to any network Destroy methods). For instance (windows game client):

- player 1 joins the room and is network instantiated
- player 2 joins the room and is network instantiated
- both players can be seen in both clients
- player 1 hard closes his game client

...what should I expect?

In an earlier version of PlayMaker/Photon, the networked gameobject was automatically destroyed on all connected clients when the a player hard closed his game window/client , but in the new version this does not happen and I get a new warning:

OnDestroy for PhotonView View (0)1001 on c  but GO is still in instantiatedObjects. instantiationId: 1001. Use PhotonNetwork.Destroy().

I'm not sure where to go from here or how to rpc destroy network instantiated gameobjects/players

Thanks!
Caesar

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Destroy
« Reply #1 on: December 02, 2013, 01:37:07 AM »
Hi,

 that's odd, I am not aware of any changes on that front within Photon nor PlayMaker integration ( all is handled within photon for network destroy).

I just doubled check here, and the demo is working fine, I have both instance running, if I hard quit one, the other doesn't fire any error, all expected events are fired, master is switched properly, etc etc.

Could you actually be in a situation where the photon version is not the same? like you are running two instances of different versions?

 Bye,

 Jean

caesarhernandez

  • Playmaker Newbie
  • *
  • Posts: 30
Re: Destroy
« Reply #2 on: December 02, 2013, 06:09:42 AM »
Well here's what I did:

1. On the project that works, I did an upgrade to Unity 4.3 and did not update Playmaker or Photon.

2. On the project that doesn't work, it is a new project after I upgraded to 4.3 and got new assets from the asset store (Playmaker/photon). The version is definitely newer as some of the scripts are different (namely the OnDestroy methods in the PhotonView.cs). I even tried replacing the entire Photon Unity Networking folder with the one from the working project and I still get the same result.



Thanks,
Caesar

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Destroy
« Reply #3 on: December 02, 2013, 06:41:35 AM »
Hi,

 hardquiting the app will not call any playmaker actions, so even of the networkdestroy action changed, I don't think it's affecting the behavior you are witnessing.

 Also, if you completly changed the pun folder, I guess the problem is a little more twisted.

Have you published the apps you are testing with the project that doesn't work? or is it a mix? I am still not sure if you are testing with two instances that were published using the same project and same photon versions.


 Bye,

 Jean

caesarhernandez

  • Playmaker Newbie
  • *
  • Posts: 30
Re: Destroy
« Reply #4 on: December 02, 2013, 07:10:15 AM »
They are two completely separate projects. One project is the old one that works (hard quitting eliminates all other network instanced player), and a new project that I created using a newer version of playmaker. Do newer versions of playmaker include newer versions of Photon?

I did notice that in the new version of Photon (which is being used by the newer/broken project) that they have removed a method in NetworkingPeer that is the first line in PhotonView::OnDestroy...I can't recall what it is as I'm not in front of my development environment at the moment. But for sure the OnDestroy in the new version of PhotonView.cs (which is being used in the broken project) is different than the old version (which is used by the project that works).


jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Destroy
« Reply #5 on: December 04, 2013, 05:38:16 AM »
Hi,

 The very latest version of photon will be shipped with the next playmaker update. what are the photons versions on both of your projects?


bye,

 Jean