Tasharen Entertainment Forum

Support => TNet 3 Support => Topic started by: Noi14 on March 02, 2014, 10:10:41 AM

Title: OnChangeHost event
Post by: Noi14 on March 02, 2014, 10:10:41 AM
Hi,
I'm trying to launch a client's function, at the change of the host, I try in this way:

  1. void Start()
  2. {
  3.         TNManager.client.packetHandlers[(byte)Packet.ResponseSetHost] = MyOnSetHost;
  4. }
  5. void MyOnSetHost(Packet response, BinaryReader reader, IPEndPoint source)
  6. {
  7.         Debug.Log ("ONSETHOST");
  8. }

But the MyOneSetHost function doesn't been called. How can I do it?
Title: Re: OnChangeHost event
Post by: ldw-bas on March 02, 2014, 04:59:55 PM
I had the same issue a week ago: http://www.tasharen.com/forum/index.php?topic=8218.0

TNManager.client.onSetHost
Title: Re: OnChangeHost event
Post by: Noi14 on March 02, 2014, 05:09:09 PM
Thank you so much.
I have a question, boolean parameter is true if client is choosen as host and false if is it assigned to another cliet?

  1. void MyOnSetHost(bool host)
  2. {
  3. Debug.Log ("ONSETHOSTTTTTTTTTTTTTTTTTTTT");
  4. }
Title: Re: OnChangeHost event
Post by: ldw-bas on March 02, 2014, 05:11:59 PM
yes that is what the boolean is for
Title: Re: OnChangeHost event
Post by: Noi14 on March 02, 2014, 05:12:23 PM
Thank you :D