Author Topic: URGENT: Problem with TNMananger.Create ()  (Read 2793 times)

newDeveloper

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 5
    • View Profile
URGENT: Problem with TNMananger.Create ()
« on: November 06, 2014, 04:15:12 AM »
hello people,
I have been using NGUI from a lot, but I new to TNet.
I am trying to instantiate an object using TNMananger.Create
when there is no network, no connection, it instantiates everything i ask it to do, but once the network is setted up, server and client are connected to it, it doesn't instantiate anything anymore.
If server calls instantiate, (TNManager.Create) there is no new object neither on server, nor on client, same if client calls instantiation.
I have tried also with TNAutoCreate.cs, ExampleCreate.cs, but no ones works when network is setted up.
@ArenMook, if you need my project to have a in depth look, i can send it to you
Hope someone can help.
Thanks!
newDev ();

HellFireKoder

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1
    • View Profile
Re: URGENT: Problem with TNMananger.Create ()
« Reply #1 on: November 07, 2014, 02:31:42 AM »
Well, the section of the code that is calling it might help us help you (preferably the whole script if it's not to long... might need it all even if it is long, it depends), could you please post the code calling it on something like pastebin? 
 
Did you define the prefab in the first level loaded (or one before they join the server) as one that can be instantiated on the network? 
 
Do all the clients (if there are two or more) have the exact same build/prefab version? 
 
Do you have code specific to only offline players? 
 
Sorry I can't help more without more details, I have only recently started with TNet myself (and have had no problems when following the directions I got from the tutorials, yet anyway...), but it helps with any problem if we know whether or not it's your code, or an undefined prefab, or something else.
« Last Edit: November 07, 2014, 02:44:00 AM by HellFireKoder »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: URGENT: Problem with TNMananger.Create ()
« Reply #2 on: November 07, 2014, 04:15:48 PM »
You must not only be connected, but actually be inside a channel for this to work.

newDeveloper

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 5
    • View Profile
Re: URGENT: Problem with TNMananger.Create ()
« Reply #3 on: November 08, 2014, 10:13:05 AM »
ya, i got it working by creating a new empty project and then importing TNet.
but I am having the problem that on PS Vita, the Example Scene 03, crashes :
IN Depth:
Quote
if the android connected to ps vita is moving the cube, then everything is fine, but just once the PS Vita moves a cube it crashes after few frames, giving me the option to report bug to sony.
I have made no changes in your code, just imported and build.
Then i have tried to edit to see what is going on.
I got it that when it is syncronized by using VOID Call, it crash, so i tried to do TN Auto Sync, making public the variable mTarget, and now it does not freezes, but it lags.
I would like to have the VOID Call method, as it has no lags, but that crashes.
I think this is caused by:
Android device has x number of frames, PS Vita device has y number of frames.
y > x, so Android can not receive so many calls, causing PS Vita to crash because a lot of calls didn't have a response.
How can I fix this?
Thanks.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: URGENT: Problem with TNMananger.Create ()
« Reply #4 on: November 09, 2014, 09:37:33 PM »
Nothing in Mono can crash the device. The worst it can do is cause an exception. If a crash happens, then it's somewhere lower level, such as in C++.

I am not sure what you mean by "VOID Call".

Framerate has no effect on packets. TNet's packets arrive on a separate thread and get queued to be processed by the main thread when it's ready.

I suggest investigating what the Vita supports. Main TNet communication is done via TCP. TNAutoSync also uses TCP unless the "important" checkbox is unchecked. The 3rd example with the moving boxes uses UDP, not TCP -- so if you run into an issue there, that suggests that Vita doesn't support UDP traffic.

Easiest thing to do is to disable UDP. When starting the server, you get to explicitly start UDP. Don't start it, and it won't be used.