Tasharen Entertainment Forum
Support => TNet 3 Support => Topic started by: Milkman on February 06, 2013, 04:37:01 PM
-
Hi.
I have a very simple project which spawns a prefab if it is hosting the game, or another prefab for the client. When I click these prefabs from the same client, the game logs information about the objectOwnerId.
The issue is that clicking the same prefab multiple times (from the same client) gives me different results. Sometimes I get the right result about the owner of the object, sometimes isThisMyObject returns a diffent result.
This is the Debug.log:
Player ID: 2 objectOwnerID: 2 isThisMyObject = True
Player ID: 2 objectOwnerID: 1 isThisMyObject = False
Is this the expected behavior of isThisMyObject??
If not, is there any known cause for this?
Thanks in advance.
-
isThisMyObject is supposed to be checked only once -- in the the Awake() function of a script attached to that object. It always points to the very last created object's flag.
In the next version TNObject gains the "isMine" flag that's actually permanent.
-
Great! When will the next version be available? Thanks!
-
It was supposed to be available this weekend, but I moved to a new place and it delayed everything. I am also polishing the UPnP logic to work with non-gateway devices, so I'd say -- this weekend.
-
@ArenMook: Oh! Does that mean some kind of automated port forwarding via NAT? That would be slick! I'm assuming the link below covers what you are working on?
http://en.wikipedia.org/wiki/Internet_Gateway_Device_Protocol
Thanks! - Kris
-
Yup. Here's example code:
up.OpenTCP(5127);
up.OpenUDP(5128);
...that's it. :)