Where is the code for the Client_OnConnect
event handler and the Client_NetStatus
event handlers? You are adding the events here in your lines , but you didn't implement the code. Unless you forgot to paste it in the question.
Client.OnConnect += new ConnectHandler(Client_OnConnect);
Client.NetStatus += new NetStatusHandler(Client_NetStatus);
You if you look at the documentation link this is the code
void netConnection_OnConnect(object sender, EventArgs e)
{
//The NetConnection object is connected now
netConnection.Call("serverHelloMsg", new ServerHelloMsgHandler(), "some text");
}
You should replace netConnection_OnConnect
to Client_OnConnect
and write the code in the method, maybe like this
void Client_OnConnect(object sender, EventArgs e)
{
//handle connection below and do whatever needs to be done
}