public void Connect(TcpClient _socket) { socket = _socket; socket.ReceiveBufferSize = dataBufferSize; socket.SendBufferSize = dataBufferSize; stream = socket.GetStream(); receivedData = new Packet(); receiveBuffer = new byte[dataBufferSize]; stream.BeginRead(receiveBuffer, 0, dataBufferSize, ReceiveCallback, null); ServerSend.Welcome(id, "Welcome to the server!"); }
public void Disconnect() { Console.WriteLine($"{tcp.socket.Client.RemoteEndPoint} has disconnected."); string _username = chatter.username; ThreadManager.ExecuteOnMainThread(() => { chatter = null; }); tcp.Disconnect(); udp.Disconnect(); ServerSend.ChatterDisconnected(id); ServerSend.ServerChatMessage($"{_username} disconnected from chat."); }
public static void MutedMic(int _fromClient, Packet _packet) { bool _muted = _packet.ReadBool(); ServerSend.SendChatterMicMuted(_fromClient, _muted); }
public static void EnabledWebcam(int _fromClient, Packet _packet) { bool _enabled = _packet.ReadBool(); ServerSend.SendChatterWebcamEnabled(_fromClient, _enabled); }