예제 #1
0
        public void Handle_S2C_RoomIP(S2C_RoomIP value)
        {
            var sip = new IPEndPoint(new IPAddress(value.address), value.port);

            ConenteToClinetServer(sip);
            Send(new C2S_LinkRoom());
        }
예제 #2
0
        public void LinkRoom()
        {
            int min = Math.Min(m_waitIPList.Count, m_roomIPList.Count);

            for (int i = 0; i < min; i++)
            {
                var roomIP = m_roomIPList[0];
                var waitIP = m_waitIPList[0];
                m_roomIPList.RemoveAt(0);
                m_waitIPList.RemoveAt(0);
                S2C_RoomIP value = new S2C_RoomIP()
                {
                    address = roomIP.Address.GetAddressBytes(),
                    port    = roomIP.Port
                };
                Listener.S2C_Send(waitIP, value);
                Console.WriteLine($"{waitIP} 链接了房间 {roomIP}");
            }
        }