Closed asusralis closed 4 years ago
Ofc
Master without Bluetooth is up2date 7f8b2c010d8515a4590faa6fc43a7dc1da666a81
Thank you so much!
PS: Feel free to create a new ticket if that doesn't solve your problem. "InvokePacketThreadException" occurs usually if there is an issue within your provided delegate.
I think you're right. I was doing what was explained in #54, but it seems to be something else.
Post the delegate you are using
I'm using a few different delegates. This is all server side. Client makes sure to register Welcome and Message.
Welcome:
private void OnConnectionEstablished(Connection connection, ConnectionType connectionType)
{
connection.RegisterRawDataHandler("Welcome", OnWelcomeMessageReceived);
}
private void OnWelcomeMessageReceived(RawData data, Connection connection)
{
string username = RawDataConverter.ToASCIIString(data);
// Check if username can connect (if not, disconnect)
....
ConnectionEstablished?.Invoke(this, connection);
connection.SendRawData("Welcome", _packer.SerializeMessage(ServerReplicator.CreateInitialBundle(controller)));
connection.RegisterRawDataHandler("Message", OnMessageReceived);
}
And message:
private void OnMessageReceived(RawData data, Connection connection)
{
PlayerController controller = _connectedConnections[connection];
Message message = _packer.DeserializeMessage<Message>(data.Data);
ServerReplicator.ReceiveMessage(message, controller);
}
The "_packer" uses Ceras, and I'm pretty sure it doesn't work well with threads. I'm not sure if that is a reason why?
Continued on https://github.com/Toemsel/Network/issues/64
Hello! I'm using the no bluetooth branch, but I'm getting a "InvokePacketThreadException" disconnection reason that I suspect is explained in issue 54. Is is it possible to update the branch to the latest?