public void SendTextMessage(string textMessage) { var msg = new TextMessage { message = textMessage, }; msg.channel_id.Add(OurUserState.channel_id); msg.actor = ServerSync.session; Debug.Log("Now session length = " + msg.session.Count); _tcpConnection.SendMessage(MessageType.TextMessage, msg); }
public void SendTextMessage(string textMessage) { if (OurUserState == null) { return; } var msg = new TextMessage { Message = textMessage, ChannelIds = new uint[] { OurUserState.ChannelId }, Actor = ServerSync.Session }; Debug.Log("Now session length = " + msg.Sessions.Length); _tcpConnection.SendMessage(MessageType.TextMessage, msg); }
internal void SendVoicePacket(byte[] voicePacket) { if (!_isConnected) { Debug.LogError("Not yet connected"); return; } try { if (_mumbleClient.UseLocalLoopBack) { UnpackOpusVoicePacket(voicePacket, true); } //Debug.Log("Sending UDP packet! Length = " + voicePacket.Length); if (_useTcp) { //Debug.Log("Using TCP!"); UDPTunnel udpMsg = new UDPTunnel { Packet = voicePacket }; _tcpConnection.SendMessage(MessageType.UDPTunnel, udpMsg); return; } else { byte[] encrypted = _cryptState.Encrypt(voicePacket, voicePacket.Length); lock (_sendLock) { _udpClient.Send(encrypted, encrypted.Length); } } NumPacketsSent++; }catch (Exception e) { Debug.LogError("Error sending packet: " + e); } }