Beispiel #1
0
        private static byte[] GetMessageBytes(CreateRoomResponseMessage response)
        {
            var json = JsonConvert.SerializeObject(response);

            byte[] bytes = Encoding.UTF8.GetBytes(json);
            return(bytes);
        }
Beispiel #2
0
        private void AddRoomToRoomsListBox(CreateRoomResponseMessage createRoomResponseMessage)
        {
            Action action = delegate
            {
                roomsListBox.Items.Add(createRoomResponseMessage.RoomInfo.RoomName);
            };

            if (InvokeRequired)
            {
                Invoke(action);
            }
            else
            {
                action();
            }
        }
Beispiel #3
0
        private void SendResponseCreateRoomMessage(CreateRoomResponseMessage message, IPEndPoint endPoint)
        {
            var dgram = GetMessageBytes(message);

            _udpClient.Send(dgram, dgram.Length, endPoint);
        }
Beispiel #4
0
 private void AddNewRoom(CreateRoomResponseMessage createRoomResponseMessage)
 {
     rooms.Add(createRoomResponseMessage.RoomInfo);
 }