Page 3 of 3 FirstFirst 123
Results 21 to 26 of 26

Thread: C# Udp V2 library

  1. #21
    WMD Member Sampo's Avatar
    Join Date
    Jun 2012
    Location
    Finland
    Posts
    596
    Platform
    PC
    Remember that the PacketBase contains 3 important values. mPartialPacketIndex, mPartialPacketNumber, mPacketType. Without those you can't decipher the udp packets correctly. Unless your library does that for the user, of course.
    CPU Intel i5 3570K @ 4.2 GHz | Motherboard Asus P8Z77-V LK | RAM 16GB 1600MHz DDR3 | GPU nVidia GTX980 4GB (390.77) | Audio Realtek 5.1 on MB | Screen AOC U3477PQU | OS Windows 7 Pro 64-bit | Wheel Logitech G27
    In-game settings: 2560x1080 / 3440x1440 | Texture Resolution HIGH | AF 16x | VSync ON | AA None | Reflections MED | Envmap MED | Vehicle HIGH | World HIGH | Shadows MED | Motion Blur NO | Render Frames Ahead 1 | Particles MED/MED/MED

    PC2Info, a PC program that shows most memory mapped stats the game provides.

  2. #22
    Superkart Pilot
    Join Date
    Sep 2017
    Posts
    266
    Platform
    XBOX1
    Thanks, it makes more and more sense to me. I enjoy tampering with things like this, but sometimes it's a bit overwhelming.
    Thrustmaster TX, Italia 458 wheel, 2 pedals, Firmware 53, XBox One OG, Samsung P2350 monitor
    Don't miss Yorkie065's excellent videos: Ep26-LiveTrack pt1. Ep 27-LiveTrack pt2.

  3. #23
    Superkart Pilot
    Join Date
    Oct 2017
    Posts
    150
    Platform
    PC
    Quote Originally Posted by Sampo View Post
    Remember that the PacketBase contains 3 important values. mPartialPacketIndex, mPartialPacketNumber, mPacketType. Without those you can't decipher the udp packets correctly. Unless your library does that for the user, of course.
    It does that for them currently in the object definition.

  4. #24
    Superkart Pilot
    Join Date
    Sep 2017
    Posts
    266
    Platform
    XBOX1
    Thanks @cpcdem, I could actually get it to work! My understanding of arrays has gone from 3% to at least 12%
    Thrustmaster TX, Italia 458 wheel, 2 pedals, Firmware 53, XBox One OG, Samsung P2350 monitor
    Don't miss Yorkie065's excellent videos: Ep26-LiveTrack pt1. Ep 27-LiveTrack pt2.
    The following user likes this Post: cpcdem


  5. #25
    Superkart Pilot
    Join Date
    Oct 2017
    Posts
    150
    Platform
    PC
    Updated the library added, timing (split times) and then participant info, so you can get the following attributes now.

    for (int i = 0; i < 32; i++)
    {
    ParticipantInfo[i, 0] = Convert.ToDouble(binaryReader.ReadInt16()); //WorldPosition
    ParticipantInfo[i, 1] = Convert.ToDouble(binaryReader.ReadInt16()); //WorldPosition
    ParticipantInfo[i, 2] = Convert.ToDouble(binaryReader.ReadInt16()); //WorldPosition
    ParticipantInfo[i, 3] = Convert.ToDouble(binaryReader.ReadInt16()); //Orientation
    ParticipantInfo[i, 4] = Convert.ToDouble(binaryReader.ReadInt16()); //Orientation
    ParticipantInfo[i, 5] = Convert.ToDouble(binaryReader.ReadInt16()); //Orientation
    ParticipantInfo[i, 6] = Convert.ToDouble(binaryReader.ReadUInt16()); //sCurrentLapDistance
    ParticipantInfo[i, 7] = Convert.ToDouble(binaryReader.ReadByte()) - 128; //sRacePosition
    byte Sector_ALL = binaryReader.ReadByte();
    var Sector_Extracted = Sector_ALL & 0x0F;
    ParticipantInfo[i, 8] = Convert.ToDouble(Sector_Extracted+1); //sSector
    ParticipantInfo[i, 9] = Convert.ToDouble(binaryReader.ReadByte()); //sHighestFlag
    ParticipantInfo[i, 10] = Convert.ToDouble(binaryReader.ReadByte()); //sPitModeSchedule
    ParticipantInfo[i, 11] = Convert.ToDouble(binaryReader.ReadUInt16());//sCarIndex
    ParticipantInfo[i, 12] = Convert.ToDouble(binaryReader.ReadByte()); //sRaceState
    ParticipantInfo[i, 13] = Convert.ToDouble(binaryReader.ReadByte()); //sCurrentLap
    ParticipantInfo[i, 14] = Convert.ToDouble(binaryReader.ReadSingle()); //sCurrentTime
    ParticipantInfo[i, 15] = Convert.ToDouble(binaryReader.ReadSingle()); //sCurrentSectorTime
    }

    Just keep in mind the index is not equal to race position. however if you just want the data for yourself (lets say your "Current Sector Time" for your car your object called would look like this . MyCurrentSectorTime = uDP.ParticipantInfo[uDP.ViewedPlayerIndex,15].
    The following 2 users likes this Post: Maskmagog, ZeDuncan


  6. #26
    GT5 Pilot
    Join Date
    Jul 2017
    Posts
    1,851
    Platform
    PC
    Quote Originally Posted by Zeratall View Post
    Just keep in mind the index is not equal to race position. however if you just want the data for yourself (lets say your "Current Sector Time" for your car your object called would look like this . MyCurrentSectorTime = uDP.ParticipantInfo[uDP.ViewedPlayerIndex,15].
    Thanks, that's very helpful information!

Similar Threads

  1. Simresults.net - a webbased result reader & PHP library
    By Mauserrifle in forum Multiplayer
    Replies: 121
    Last Post: 27-05-2018, 18:32
  2. Interest in GTE championship?
    By p66pittfan in forum Project CARS 2 on XBOX One
    Replies: 1
    Last Post: 19-02-2018, 20:08
  3. Project Cars closed, but keeps running in steam library
    By Kunal_Racedriver in forum PC - Technical Help & Support
    Replies: 2
    Last Post: 14-02-2016, 15:41
  4. Aug old vs new DLC not showing under Library/DLC in steam
    By Kobus Maree in forum General Discussion
    Replies: 6
    Last Post: 30-08-2015, 23:02
  5. highlight video to capture library question
    By BORIStheBLADE1 in forum PS4 - Technical Help & Support
    Replies: 1
    Last Post: 19-05-2015, 02:03

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •