#ifndef SCS_TELEMETRY_COMMON_HPP
#define SCS_TELEMETRY_COMMON_HPP
#define PLUGIN_REVID 12
#define ETS2 1
#define ATS 2
#define UnknownGame 0
#define ETS2_PLUGIN_LOGGING_ON 0
#define ETS2_PLUGIN_LOGGING_SHAREDMEMORY 0
#define ETS2_PLUGIN_FILENAME_PREFIX "C:\ets2telem_"
#if ETS2_PLUGIN_LOGGING_ON == 1
#define SDK_ENABLE_LOGGING
#endif
#include "scssdk.h"
#define SCS_PLUGIN_MMF_NAME TEXT("Local\\SCSTelemetry")
#define SCS_PLUGIN_MMF_SIZE (32*1024)
#define stringsize 64
#define WHEEL_SIZE 14
#define SUBSTANCE_SIZE 25
bool check_min_version(unsigned const int min_ets2, unsigned const int min_ats);
bool check_max_version(unsigned const int min_ets2, unsigned const int min_ats);
enum configType { substances, controls, hshifter, truck, trailer, job };
enum gameplayType { cancelled, delivered, fined, tollgate, ferry, train };
void log_line(scs_log_type_t type, const char* text, ...);
void log_line(const char* text, ...);
typedef struct scsTrailer_s { struct {
bool wheelSteerable[16];
bool wheelSimulated[16];
bool wheelPowered[16];
bool wheelLiftable[16];
}con_b;
struct {
bool wheelOnGround[16];
bool attached;
}com_b;
char buffer_b[3];
struct {
unsigned int wheelSubstance[16];
}com_ui;
struct {
unsigned int wheelCount;
}con_ui;
struct {
float cargoDamage;
float wearChassis;
float wearWheels;
float wearBody;
float wheelSuspDeflection[16];
float wheelVelocity[16];
float wheelSteering[16];
float wheelRotation[16];
float wheelLift[16];
float wheelLiftOffset[16];
}com_f;
struct {
float wheelRadius[16];
}con_f;
struct {
float linearVelocityX;
float linearVelocityY;
float linearVelocityZ;
float angularVelocityX;
float angularVelocityY;
float angularVelocityZ;
float linearAccelerationX;
float linearAccelerationY;
float linearAccelerationZ;
float angularAccelerationX;
float angularAccelerationY;
float angularAccelerationZ;
}com_fv;
struct {
float hookPositionX;
float hookPositionY;
float hookPositionZ;
float wheelPositionX[16];
float wheelPositionY[16];
float wheelPositionZ[16];
}con_fv;
char buffer_fv[4];
struct {
double worldX;
double worldY;
double worldZ;
double rotationX;
double rotationY;
double rotationZ;
}com_dp;
struct {
char id[stringsize];
char cargoAcessoryId[stringsize];
char bodyType[stringsize];
char brandId[stringsize];
char brand[stringsize];
char name[stringsize];
char chainType[stringsize];
char licensePlate[stringsize];
char licensePlateCountry[stringsize];
char licensePlateCountryId[stringsize];
}con_s;
}scsTrailer_t;
typedef struct scsTelemetryMap_s
{
bool sdkActive;
char placeHolder[3];
bool paused;
char placeHolder2[3];
unsigned long long time;
unsigned long long simulatedTime;
unsigned long long renderTime;
long long multiplayerTimeOffset;
struct
{
unsigned int telemetry_plugin_revision;
unsigned int version_major;
unsigned int version_minor;
unsigned int game; unsigned int telemetry_version_game_major;
unsigned int telemetry_version_game_minor;
} scs_values;
struct {
unsigned int time_abs;
}common_ui;
struct {
unsigned int gears;
unsigned int gears_reverse;
unsigned int retarderStepCount;
unsigned int truckWheelCount;
unsigned int selectorCount;
unsigned int time_abs_delivery;
unsigned int maxTrailerCount;
unsigned int unitCount;
unsigned int plannedDistanceKm;
}config_ui;
struct {
unsigned int shifterSlot;
unsigned int retarderBrake;
unsigned int lightsAuxFront;
unsigned int lightsAuxRoof;
unsigned int truck_wheelSubstance[16];
unsigned int hshifterPosition[32];
unsigned int hshifterBitmask[32];
}truck_ui;
struct {
unsigned int jobDeliveredDeliveryTime;
unsigned int jobStartingTime;
unsigned int jobFinishedTime;
}gameplay_ui;
char buffer_ui[48];
struct {
int restStop;
}common_i;
struct {
int gear;
int gearDashboard;
int hshifterResulting[32];
}truck_i;
struct {
int jobDeliveredEarnedXp;
}gameplay_i;
char buffer_i[56];
struct {
float scale;
}common_f;
struct {
float fuelCapacity;
float fuelWarningFactor;
float adblueCapacity;
float adblueWarningFactor;
float airPressureWarning;
float airPressurEmergency;
float oilPressureWarning;
float waterTemperatureWarning;
float batteryVoltageWarning;
float engineRpmMax;
float gearDifferential;
float cargoMass;
float truckWheelRadius[16];
float gearRatiosForward[24];
float gearRatiosReverse[8];
float unitMass;
}config_f;
struct {
float speed;
float engineRpm;
float userSteer;
float userThrottle;
float userBrake;
float userClutch;
float gameSteer;
float gameThrottle;
float gameBrake;
float gameClutch;
float cruiseControlSpeed;
float airPressure;
float brakeTemperature;
float fuel;
float fuelAvgConsumption;
float fuelRange;
float adblue;
float oilPressure;
float oilTemperature;
float waterTemperature;
float batteryVoltage;
float lightsDashboard;
float wearEngine;
float wearTransmission;
float wearCabin;
float wearChassis;
float wearWheels;
float truckOdometer;
float routeDistance;
float routeTime;
float speedLimit;
float truck_wheelSuspDeflection[16];
float truck_wheelVelocity[16];
float truck_wheelSteering[16];
float truck_wheelRotation[16];
float truck_wheelLift[16];
float truck_wheelLiftOffset[16];
}truck_f;
struct {
float jobDeliveredCargoDamage;
float jobDeliveredDistanceKm;
float refuelAmount;
}gameplay_f;
struct {
float cargoDamage;
}job_f;
char buffer_f[28];
struct {
bool truckWheelSteerable[16];
bool truckWheelSimulated[16];
bool truckWheelPowered[16];
bool truckWheelLiftable[16];
bool isCargoLoaded;
bool specialJob;
}config_b;
struct {
bool parkBrake;
bool motorBrake;
bool airPressureWarning;
bool airPressureEmergency;
bool fuelWarning;
bool adblueWarning;
bool oilPressureWarning;
bool waterTemperatureWarning;
bool batteryVoltageWarning;
bool electricEnabled;
bool engineEnabled;
bool wipers;
bool blinkerLeftActive;
bool blinkerRightActive;
bool blinkerLeftOn;
bool blinkerRightOn;
bool lightsParking;
bool lightsBeamLow;
bool lightsBeamHigh;
bool lightsBeacon;
bool lightsBrake;
bool lightsReverse;
bool lightsHazard;
bool cruiseControl; bool truck_wheelOnGround[16];
bool shifterToggle[2];
bool differentialLock;
bool liftAxle;
bool liftAxleIndicator;
bool trailerLiftAxle;
bool trailerLiftAxleIndicator;
}truck_b;
struct
{
bool jobDeliveredAutoparkUsed;
bool jobDeliveredAutoloadUsed;
}gameplay_b;
char buffer_b[25];
struct {
float cabinPositionX;
float cabinPositionY;
float cabinPositionZ;
float headPositionX;
float headPositionY;
float headPositionZ;
float truckHookPositionX;
float truckHookPositionY;
float truckHookPositionZ;
float truckWheelPositionX[16];
float truckWheelPositionY[16];
float truckWheelPositionZ[16];
}config_fv;
struct {
float lv_accelerationX;
float lv_accelerationY;
float lv_accelerationZ;
float av_accelerationX;
float av_accelerationY;
float av_accelerationZ;
float accelerationX;
float accelerationY;
float accelerationZ;
float aa_accelerationX;
float aa_accelerationY;
float aa_accelerationZ;
float cabinAVX;
float cabinAVY;
float cabinAVZ;
float cabinAAX;
float cabinAAY;
float cabinAAZ;
}truck_fv;
char buffer_fv[60];
struct {
float cabinOffsetX;
float cabinOffsetY;
float cabinOffsetZ;
float cabinOffsetrotationX;
float cabinOffsetrotationY;
float cabinOffsetrotationZ;
float headOffsetX;
float headOffsetY;
float headOffsetZ;
float headOffsetrotationX;
float headOffsetrotationY;
float headOffsetrotationZ;
}truck_fp;
char buffer_fp[152];
struct {
double coordinateX;
double coordinateY;
double coordinateZ;
double rotationX;
double rotationY;
double rotationZ;
}truck_dp;
char buffer_dp[52];
struct {
char truckBrandId[stringsize];
char truckBrand[stringsize];
char truckId[stringsize];
char truckName[stringsize];
char cargoId[stringsize];
char cargo[stringsize];
char cityDstId[stringsize];
char cityDst[stringsize];
char compDstId[stringsize];
char compDst[stringsize];
char citySrcId[stringsize];
char citySrc[stringsize];
char compSrcId[stringsize];
char compSrc[stringsize];
char shifterType[16];
char truckLicensePlate[stringsize];
char truckLicensePlateCountryId[stringsize];
char truckLicensePlateCountry[stringsize];
char jobMarket[32];
}config_s;
struct {
char fineOffence[32];
char ferrySourceName[stringsize];
char ferryTargetName[stringsize];
char ferrySourceId[stringsize];
char ferryTargetId[stringsize];
char trainSourceName[stringsize];
char trainTargetName[stringsize];
char trainSourceId[stringsize];
char trainTargetId[stringsize];
}gameplay_s;
char buffer_s[20];
struct {
unsigned long long jobIncome;
}config_ull;
char buffer_ull[192];
struct {
long long jobCancelledPenalty;
long long jobDeliveredRevenue;
long long fineAmount;
long long tollgatePayAmount;
long long ferryPayAmount;
long long trainPayAmount;
}gameplay_ll;
char buffer_ll[52];
struct {
bool onJob;
bool jobFinished;
bool jobCancelled;
bool jobDelivered;
bool fined;
bool tollgate;
bool ferry;
bool train;
bool refuel;
bool refuelPayed;
}special_b;
char buffer_special[90];
struct {
char substance[SUBSTANCE_SIZE][stringsize];
}substances;
struct {
scsTrailer_t trailer[10];
}trailer;
} scsTelemetryMap_t;
#endif