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:
void
Start
(
)
{
TNManager
.
client
.
packetHandlers
[
(
byte
)
Packet
.
ResponseSetHost
]
=
MyOnSetHost
;
}
void
MyOnSetHost
(
Packet response, BinaryReader reader, IPEndPoint source
)
{
Debug
.
Log
(
"ONSETHOST"
)
;
}
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?
void
MyOnSetHost
(
bool
host
)
{
Debug
.
Log
(
"ONSETHOSTTTTTTTTTTTTTTTTTTTT"
)
;
}
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