Author Topic: [TNet 3.0] Trying to execute a function before it it has been created  (Read 5836 times)

IonRift

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 10
    • View Profile
I've recently upgraded to TNet 3 but I'm now struggling with this issue.

I'm creating objects dynamically which worked fine in the old version; these are essentially the steps leading to the issue.

1: create TNObject (I've tried assigning different channel and uid's)
2: connect
3: join a channel
4: send "TestMessage" to the joining client
5: [TNet] Trying to execute a function 'TestMessage' on TNObject #0 before it has been created.

:[

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: [TNet 3.0] Trying to execute a function before it it has been created
« Reply #1 on: April 10, 2016, 09:51:28 PM »
You can't create a TNObject randomly. It must be done inside a channel because objects belong to channels.

If you want some "global" object used for communication, join a "global" channel first (Tnet 3 supports multiple channels). For example, use channel #1 for your chat.

IonRift

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 10
    • View Profile
Re: [TNet 3.0] Trying to execute a function before it it has been created
« Reply #2 on: April 11, 2016, 12:38:29 AM »
Great, Thanks Aren, that works for me.
I'm up and running again : )