private void HandleUpdateClientsEvent(object sender, UpdateClientsEventArgs e) { var msg = new Message() { MessageId = CommunicationMessageIds.RoomMessage, Contents = new RoomMessage() { RoomMessageId = RoomUpdate.MessageId, RoomId = e.RoomId, Contents = new RoomUpdate() { State = e.ClientAState, NetworkTimeSync = e.NetworkTimeSync } } }; var bytes = msg.Serialize(); MessageServer.Send(bytes, ClientMacAddressToConnectionDictionary[e.ClientAState.ClientA.Id]); msg = new Message() { MessageId = CommunicationMessageIds.RoomMessage, Contents = new RoomMessage() { RoomMessageId = RoomUpdate.MessageId, RoomId = e.RoomId, Contents = new RoomUpdate() { State = e.ClientBState, NetworkTimeSync = e.NetworkTimeSync } } }; bytes = msg.Serialize(); MessageServer.Send(bytes, ClientMacAddressToConnectionDictionary[e.ClientBState.ClientB.Id]); }
public void OnUpdateClientsEvent(UpdateClientsEventArgs updateClientEventArgs) { UpdateClientsEvent?.Invoke(this, updateClientEventArgs); }