Skip to content

Make LiveryColour struct fields public for deserialization access#8

Merged
codegefluester merged 2 commits intofeat/udp-base-sourcefrom
copilot/sub-pr-4-yet-again
Feb 10, 2026
Merged

Make LiveryColour struct fields public for deserialization access#8
codegefluester merged 2 commits intofeat/udp-base-sourcefrom
copilot/sub-pr-4-yet-again

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 10, 2026

The LiveryColour struct fields were private, preventing consumers from reading decoded RGB values after binary deserialization.

Changes

  • Made red, green, blue fields public in LiveryColour struct

Field names preserve lowercase convention to match F1 game's C++ telemetry specification:

[StructLayout(LayoutKind.Sequential, Pack = 1)]
public struct LiveryColour
{
    public byte red;
    public byte green;
    public byte blue;
}

This aligns with other F1 telemetry structs that expose fields directly for binary interop.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: codegefluester <203914+codegefluester@users.noreply.github.com>
Copilot AI changed the title [WIP] WIP Address feedback from review on 'Add source for F1 games' PR Make LiveryColour struct fields public for deserialization access Feb 10, 2026
Copilot AI requested a review from codegefluester February 10, 2026 22:49
@codegefluester codegefluester marked this pull request as ready for review February 10, 2026 22:50
@codegefluester codegefluester merged commit d100533 into feat/udp-base-source Feb 10, 2026
@codegefluester codegefluester deleted the copilot/sub-pr-4-yet-again branch February 10, 2026 22:54
codegefluester added a commit that referenced this pull request Feb 11, 2026
* Added F1 2025 packets

* Added F1 2024 types

* Added F1 2023 structs

* Added F1 packets and fixtures

* Added F1 2025 packets

* Added F1 2024 types

* Added F1 2023 structs

* Added F1 packets and fixtures

* Remove legacy F1 implementation workflow file

* Remove debug tooling for F1

* Add F1 fixture files to test project

* Add refactoring plan for telemetry source interface

* Remove debug logging

* Added test cases for F1 packet parsing (super basic)

* Added tests for event details parsing in F1 2025

* Tested F1 recording and reading of session recording

* Update GamesDat.Demo.Wpf/Resources/Styles.xaml

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Björn Kaiser <masterchiefs2002@hotmail.com>

* Update GamesDat.Demo.Wpf/ViewModels/IRealtimeSource.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Björn Kaiser <masterchiefs2002@hotmail.com>

* [WIP] WIP Address feedback on adding source for F1 games (#5)

* Initial plan

* Fix: Change m_zoneFlag from byte to sbyte in F12025 MarshalZone

Co-authored-by: codegefluester <203914+codegefluester@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: codegefluester <203914+codegefluester@users.noreply.github.com>

* Apply BufferSize to UDP socket ReceiveBufferSize (#6)

* Initial plan

* Apply BufferSize to socket's ReceiveBufferSize property

Co-authored-by: codegefluester <203914+codegefluester@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: codegefluester <203914+codegefluester@users.noreply.github.com>

* Refactor UdpSourceBase to use proper Dispose pattern (#7)

* Initial plan

* Refactor UdpSourceBase to use Dispose pattern instead of manual disposal in finally block

Co-authored-by: codegefluester <203914+codegefluester@users.noreply.github.com>

* Add thread-safety to Dispose method in UdpSourceBase

Co-authored-by: codegefluester <203914+codegefluester@users.noreply.github.com>

* Move base.Dispose() inside lock for better thread-safety

Co-authored-by: codegefluester <203914+codegefluester@users.noreply.github.com>

* Set disposed flag before disposal operations for better exception safety

Co-authored-by: codegefluester <203914+codegefluester@users.noreply.github.com>

* Add try-finally to ensure base.Dispose() is always called

Co-authored-by: codegefluester <203914+codegefluester@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: codegefluester <203914+codegefluester@users.noreply.github.com>

* Make LiveryColour struct fields public for deserialization access (#8)

* Initial plan

* Make LiveryColour fields public to allow access

Co-authored-by: codegefluester <203914+codegefluester@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: codegefluester <203914+codegefluester@users.noreply.github.com>

* Remove unused BytesToStruct method from F1RealtimeTelemetrySource (#9)

* Initial plan

* Remove unused BytesToStruct method from F1RealtimeTelemetrySource

Co-authored-by: codegefluester <203914+codegefluester@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: codegefluester <203914+codegefluester@users.noreply.github.com>

* [WIP] WIP address feedback from review on adding source for F1 games (#10)

* Initial plan

* Remove .claude/settings.local.json files from repository

* Push changes - removed .claude/settings.local.json files

Co-authored-by: codegefluester <203914+codegefluester@users.noreply.github.com>

* Remove .claude/settings.local.json files and update .gitignore pattern

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: codegefluester <203914+codegefluester@users.noreply.github.com>

* Fix unsafe fixed buffer pointer handling in F1 telemetry extensions (#11)

* Initial plan

* Fix unsafe fixed buffer pointer handling and UTF-8 marshaling

- Fix F1TelemetryFrameExtensions to use Unsafe.Read<T> and direct pointer access for fixed buffers
- Change F12025 Participant m_name from ByValTStr to byte array for proper UTF-8 marshaling
- UdpSourceBase Dispose() implementation already correct (from previous PR)

Co-authored-by: codegefluester <203914+codegefluester@users.noreply.github.com>

* Add Name property helper for UTF-8 decoded participant name

Co-authored-by: codegefluester <203914+codegefluester@users.noreply.github.com>

* Fix AccessViolationException in GetPacket by using Unsafe.AsPointer

Use Unsafe.AsPointer(ref frame.RawData[0]) instead of Unsafe.Read to properly get a pointer to the fixed buffer. This resolves both the CS0213 compilation error and the runtime AccessViolationException.

Co-authored-by: codegefluester <203914+codegefluester@users.noreply.github.com>

* Fix frame extension and test

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: codegefluester <203914+codegefluester@users.noreply.github.com>
Co-authored-by: Björn Kaiser <bjoern@codegefluester.de>

---------

Signed-off-by: Björn Kaiser <masterchiefs2002@hotmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants