void OnCommandAccepted(UdpStream buffer) { if (IsClient) { if (CheckState(UdpConnectionState.Connecting)) { if (buffer.CanRead(8) && buffer.ReadByte(8) == UdpEvent.INTERNAL_COMMAND_HASOBJECT) { serializer.Unpack(buffer, ref hailMessage); } ChangeState(UdpConnectionState.Connected); } } else { ConnectionError(UdpConnectionError.IncorrectCommand); } }
void OnCommandAccepted(UdpStream buffer) { if (IsClient) { if (CheckState(UdpConnectionState.Connecting)) { if (buffer.CanRead(8) && buffer.ReadByte(8) == UdpEvent.INTERNAL_COMMAND_HASOBJECT) serializer.Unpack(buffer, ref hailMessage); ChangeState(UdpConnectionState.Connected); } } else { ConnectionError(UdpConnectionError.IncorrectCommand); } }