Chcę napisać program który będzie pobierał informacje z gry przez port UDP. Przy próbie odebrania danych
- Kod: Zaznacz cały
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
ServerSocket1->Active = false;
ServerSocket1->Port = 7000;
ServerSocket1->Active = true;
OutGaugePack pakiet;
ServerSocket1->Socket->ReceiveBuf(&pakiet,sizeof(pakiet));
}
wyskakuje błąd

Pod spodem daje informacje na temat połączenia i struktury pakietu który wysyła gra.
- Kod: Zaznacz cały
// OutGauge - EXTERNAL DASHBOARD SUPPORT
// ========
// The user's car in multiplayer or the viewed car in single player or
// single player replay can output information to a dashboard system
// while viewed from an internal view.
// This can be controlled by 5 lines in the cfg.txt file :
// OutGauge Mode 0 :0-off 1-driving 2-driving+replay
// OutGauge Delay 1 :minimum delay between packets (100ths of a sec)
// OutGauge IP 0.0.0.0 :IP address to send the UDP packet
// OutGauge Port 0 :IP port
// OutGauge ID 0 :if not zero, adds an identifier to the packet
// Each update sends the following UDP packet :
struct OutGaugePack
{
unsigned Time; // time in milliseconds (to check order)
char Car[4]; // Car name
word Flags; // OG_FLAGS (see below)
byte Gear; // Reverse:0, Neutral:1, First:2...
byte SpareB;
float Speed; // M/S
float RPM; // RPM
float Turbo; // BAR
float EngTemp; // C
float Fuel; // 0 to 1
float OilPress; // BAR
float Spare1;
float Spare2;
float Spare3;
float Throttle; // 0 to 1
float Brake; // 0 to 1
float Clutch; // 0 to 1
char Display1[16]; // Usually Fuel
char Display2[16]; // Usually Settings
int ID; // optional - only if OutGauge ID is specified
};
#define OG_SHIFTLIGHT 1
#define OG_FULLBEAM 2
#define OG_HANDBRAKE 4
#define OG_PITSPEED 8
#define OG_TC 16
#define OG_HEADLIGHTS 32
#define OG_SIGNAL_L 64
#define OG_SIGNAL_R 128
#define OG_REDLINE 256
#define OG_OILWARN 512
#define OG_1 1024
#define OG_2 2048
#define OG_3 4096
#define OG_4 8192
#define OG_KM 16384
#define OG_BAR 32768
//////
#endif



