Author Topic: onJoinChannel fired more than once?  (Read 2938 times)

lynohd

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 21
    • View Profile
onJoinChannel fired more than once?
« on: May 26, 2017, 09:41:17 PM »
Hi,
for some reason when i use onJoinChannel it gets fired more than once
  1.  void OnNetworkJoinChannel (int channelID,bool succes,string message)
  2.     {
  3.         if (succes)
  4.         {
  5.             Debug.Log("Connected to Lobby: " + channelID);
  6.         }
  7.     }
  8.     private void OnEnable ()
  9.     {
  10.         TNManager.onConnect += OnNetworkConnect;
  11.         TNManager.onJoinChannel += OnNetworkJoinChannel;
  12.     }



devomage

  • Sr. Member
  • ****
  • Thank You
  • -Given: 7
  • -Receive: 67
  • Posts: 250
    • View Profile
Re: onJoinChannel fired more than once?
« Reply #1 on: May 27, 2017, 06:15:57 PM »
I recently faced a similar problem.  Do you have the accompanying removal of the event trigger?

  1. private void OnDisable ()
  2. {
  3.         TNManager.onConnect -= OnNetworkConnect;
  4.         TNManager.onJoinChannel -= OnNetworkJoinChannel;
  5. }

lynohd

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 21
    • View Profile
Re: onJoinChannel fired more than once?
« Reply #2 on: May 27, 2017, 06:49:09 PM »
Yes I do.

cmifwdll

  • Global Moderator
  • Sr. Member
  • *****
  • Thank You
  • -Given: 0
  • -Receive: 149
  • Posts: 285
  • TNet Alchemist
    • View Profile
Re: onJoinChannel fired more than once?
« Reply #3 on: May 27, 2017, 11:37:08 PM »
Multiple instances of the class?