small fix

This commit is contained in:
Nick I. A
2022-08-13 02:39:18 +02:00
parent edae7a075a
commit f9a411833a
2 changed files with 3 additions and 3 deletions

View File

@ -27,6 +27,7 @@ namespace RageCoop.Client.Sync
public static void InitRecording() public static void InitRecording()
{ {
// I tried without thread but the game will lag without
_thread = new Thread(new ThreadStart(() => _thread = new Thread(new ThreadStart(() =>
{ {
while (true) while (true)
@ -43,7 +44,6 @@ namespace RageCoop.Client.Sync
} }
} }
})); }));
_thread.Start(); _thread.Start();
_waveIn = new WaveInEvent _waveIn = new WaveInEvent
@ -79,6 +79,7 @@ namespace RageCoop.Client.Sync
try try
{ {
_waveProvider.AddSamples(e.Buffer, 0, e.BytesRecorded); _waveProvider.AddSamples(e.Buffer, 0, e.BytesRecorded);
Networking.SendVoiceMessage(e.Buffer); Networking.SendVoiceMessage(e.Buffer);
} catch (Exception ex) } catch (Exception ex)
{ {

View File

@ -487,8 +487,7 @@ namespace RageCoop.Server
case PacketType.Voice: case PacketType.Voice:
{ {
var msg = MainNetServer.CreateMessage(); var msg = MainNetServer.CreateMessage();
Packets.Voice packet = data.GetPacket<Packets.Voice>(); data.GetPacket<Packets.Voice>().Pack(msg);
packet.Deserialize(data);
MainNetServer.SendMessage(msg, MainNetServer.Connections, NetDeliveryMethod.ReliableOrdered, (int)ConnectionChannel.Voice); MainNetServer.SendMessage(msg, MainNetServer.Connections, NetDeliveryMethod.ReliableOrdered, (int)ConnectionChannel.Voice);
} }
break; break;