예제 #1
0
            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!");
            }
예제 #2
0
        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.");
        }
예제 #3
0
        public static void MutedMic(int _fromClient, Packet _packet)
        {
            bool _muted = _packet.ReadBool();

            ServerSend.SendChatterMicMuted(_fromClient, _muted);
        }
예제 #4
0
        public static void EnabledWebcam(int _fromClient, Packet _packet)
        {
            bool _enabled = _packet.ReadBool();

            ServerSend.SendChatterWebcamEnabled(_fromClient, _enabled);
        }