Skip to content

Commit a88204a

Browse files
committed
Merge branch 'dev'
2 parents 569753e + bc01d9f commit a88204a

36 files changed

+2266
-4226
lines changed

README.md

Lines changed: 42 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -38,45 +38,52 @@ This plug-in stores it's data inside a Memory Mapped File, or "Shared Memory". T
3838

3939
Rev Numbers shows big changes on the shared memory and sometimes on the C# object. That means Rev 10 wont work with Rev 9. Doesn't matter which side is not updated. Sub Versions that you can see in changelog.md should work with small errors or completely without. The C# object is mostly not changed. Only if needed, because of new values (most of the cases) or structure changes (less the case). If this occurs i will notice that. (See changelog.md. If you directly access the shared memory you will find an overview about the changes here.)
4040

41-
### Plugin for 1.41/SDK1.13
41+
### Plugin for 1.45/SDK1.14
4242

4343
Lower SDK Version means there are less values / values that are zero. To get an overview which values that are look at the list at the middle of this document.
4444
Note to the SDK Version: SDK 1.13 is not the same like the sdk version of ETS2 or ATS. Both games have an own SDK version. See list under ATS.
45+
A version number with an asterisk (e.g. 1.46*) indicates that this version is currently in open beta.
4546

4647
### ETS2
4748

48-
|Game Version|SDK Version|Plugin State|
49-
|------------|-----------|------------|
50-
|1.26 and before|1.12 and before|Not Tested, could work with errors|
51-
|1.27 - 1.34 |1.13 | Should work|
52-
|1.35 |1.14 | Should work|
53-
|1.36 |1.15 | Should work|
54-
| - 1.40 |1.16 | Should work|
55-
|1.41 |1.17 | Works, Test Version|
49+
| Game Version | SDK Version | Plugin State |
50+
| --------------- | --------------- | ---------------------------------- |
51+
| 1.26 and before | 1.12 and before | Not Tested, could work with errors |
52+
| 1.27 - 1.34 | 1.13 | Should work |
53+
| 1.35 | 1.14 | Should work |
54+
| 1.36 | 1.15 | Should work |
55+
| - 1.40 | 1.16 | Should work |
56+
| 1.41 - 1.44 | 1.17 | Should work |
57+
| 1.45 - 1.46* | 1.18 | Works, Test Version |
58+
5659

5760
### ATS
5861

59-
|Game Version|SDK Version|Plugin State|
60-
|------------|-----------|------------|
61-
|1.34 and before|1.0 | Should work|
62-
|1.35 |1.01 | Should work|
63-
|1.36 |1.02 | Should work|
64-
| - 1.40 |1.03 | Should work|
65-
|1.41 |1.04 | Works, Test Version|
62+
| Game Version | SDK Version | Plugin State |
63+
| --------------- | ----------- | ------------------- |
64+
| 1.34 and before | 1.0 | Should work |
65+
| 1.35 | 1.01 | Should work |
66+
| 1.36 | 1.02 | Should work |
67+
| - 1.40 | 1.03 | Should work |
68+
| 1.41 - 1.44 | 1.04 | Should work |
69+
| 1.45 - 1.46* | 1.05 | Works, Test Version |
70+
6671

6772
### SDK VERSION AND GAME SDK VERSION
6873

69-
|SDK VERSION|ETS2 SDK Version|ATS SDK VERSION|
70-
|-----------|----------------|---------------|
71-
|1_1 |1.07 | - |
72-
|1_2 |1.08 | - |
73-
|1_4 |1.10 | - |
74-
|1_5 |1.12 | - |
75-
|1_9 |1.13 |1.00 |
76-
|1_10 |1.14 |1.01 |
77-
|1_11 |1.15 |1.02 |
78-
|1_12 |1.16 |1.03 |
79-
|1_13 |1.17 |1.04 |
74+
| SDK VERSION | ETS2 SDK Version | ATS SDK VERSION |
75+
| ----------- | ---------------- | --------------- |
76+
| 1_1 | 1.07 | - |
77+
| 1_2 | 1.08 | - |
78+
| 1_4 | 1.10 | - |
79+
| 1_5 | 1.12 | - |
80+
| 1_9 | 1.13 | 1.00 |
81+
| 1_10 | 1.14 | 1.01 |
82+
| 1_11 | 1.15 | 1.02 |
83+
| 1_12 | 1.16 | 1.03 |
84+
| 1_13 | 1.17 | 1.04 |
85+
| 1_14 | 1.18 | 1.05 |
86+
8087

8188

8289
### Telemetry fields and the c# object
@@ -94,6 +101,7 @@ New stuff is marked with the <ins>inserted</ins> Tag.
94101
│ ├── Telemetry Timestamp (<mark>not the in-game time</mark>, only for usage in code, see documentation for more information #todo add link) (<mark>now ulong</mark>)
95102
│ ├── Simulation Timestamp
96103
│ ├── Render Timestamp
104+
│ ├── <ins>Multiplayer Time Offset</ins> (1.18/1.05/1.45)
97105
│ ├── Paused, game state
98106
│ ├── SCSGame identifier as enum, currently ets2/ats/unknown
99107
│ ├── GameVersion and Game Telemetry Version (major.minor)
@@ -148,10 +156,10 @@ New stuff is marked with the <ins>inserted</ins> Tag.
148156
│ │ ├── <strong>Current Values (Values that change a lot)</strong>:
149157
│ │ │ ├── Electric Enabled
150158
│ │ │ ├── Engine Enabled
151-
│ │ │ ├── <ins>LiftAxle</ins> (1.17/1.04/1.41)
152-
│ │ │ ├── <ins>LiftAxleIndicator</ins> (1.17/1.04/1.41)
153-
│ │ │ ├── <ins>TrailerLiftAxle</ins> (1.17/1.04/1.41)
154-
│ │ │ ├── <ins>TrailerLiftAxleIndicator</ins> (1.17/1.04/1.41)
159+
│ │ │ ├── LiftAxle (1.17/1.04/1.41)
160+
│ │ │ ├── LiftAxleIndicator (1.17/1.04/1.41)
161+
│ │ │ ├── TrailerLiftAxle (1.17/1.04/1.41)
162+
│ │ │ ├── TrailerLiftAxleIndicator (1.17/1.04/1.41)
155163
│ │ │ ├── <strong>Motor Values</strong>:
156164
│ │ │ │ ├── <strong>Gear Values</strong>:
157165
│ │ │ │ │ ├── HShifterSlot
@@ -210,7 +218,7 @@ New stuff is marked with the <ins>inserted</ins> Tag.
210218
│ │ │ │ ├── Beacon
211219
│ │ │ │ ├── Brake
212220
│ │ │ │ ├── Reverse
213-
│ │ │ │ └── <ins>HazardWarningLights</ins> (1.17/1.04/1.41)
221+
│ │ │ │ └── HazardWarningLights (1.17/1.04/1.41)
214222
│ │ │ ├── <strong>Wheels</strong>:
215223
│ │ │ │ ├── Substance
216224
│ │ │ │ ├── SuspDeflection
@@ -264,6 +272,7 @@ New stuff is marked with the <ins>inserted</ins> Tag.
264272
│ │ │ ├── Cargo (1.14/1.01/1.35)
265273
│ │ │ ├── Wheels
266274
│ │ │ └── Chassis
275+
│ │ │ └── <ins>Body</ins> (1.18/1.05/1.45)
267276
│ │ ├── Chassis (code)
268277
│ │ ├── Id (code)
269278
│ │ ├── Name
@@ -316,7 +325,7 @@ New stuff is marked with the <ins>inserted</ins> Tag.
316325
│ │ └── Speed Limit
317326
│ ├── <strong>SpecialEvents</strong>:
318327
│ │ ├── On Job
319-
│ │ ├── Job Cancelled (1.14/1.01/1.35) (may not work atm?)
328+
│ │ ├── Job Cancelled (1.14/1.01/1.35)
320329
│ │ ├── Job Delivered (1.14/1.01/1.35)
321330
│ │ ├── Fined (1.14/1.01/1.35)
322331
│ │ ├── Tollgate (1.14/1.01/1.35)

changelog.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
# Changelog
22

3+
## Rev 11 Update 1 (Some breaking changes for Trailer, but 12 is reserved)
4+
5+
### Important Changes
6+
7+
- added trailer wearBody, see changes on the telemetry. It is placed after the other wear-values in the trailer
8+
9+
### New Values
10+
11+
- Trailer wear body
12+
- multiplayer time offset
13+
314
## Rev 11 (coming early due to some changes)
415

516
### Important Changes

scs-client/C#/SCSSdkClient.Demo/SCSSdkClient.Demo/SCSSdkClientDemo.cs

Lines changed: 47 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@
55
using SCSSdkClient.Object;
66

77
namespace SCSSdkClient.Demo {
8+
89
/// <inheritdoc />
910
public partial class SCSSdkClientDemo : Form {
11+
1012
/// <summary>
1113
/// The SCSSdkTelemetry object
1214
/// </summary>
@@ -31,7 +33,6 @@ public SCSSdkClientDemo() {
3133
Telemetry.RefuelEnd += TelemetryRefuelEnd;
3234
Telemetry.RefuelPayed += TelemetryRefuelPayed;
3335

34-
3536
if (Telemetry.Error != null) {
3637
lbGeneral.Text =
3738
"General info:\r\nFailed to open memory map " +
@@ -45,47 +46,32 @@ public SCSSdkClientDemo() {
4546
l_updateRate.Text = Telemetry.UpdateInterval + "ms";
4647
}
4748

48-
private void TelemetryOnJobStarted(object sender, EventArgs e) =>
49-
MessageBox.Show("Just started job OR loaded game with active.");
50-
51-
private void TelemetryJobCancelled(object sender, EventArgs e) =>
52-
MessageBox.Show("Job Cancelled");
53-
54-
private void TelemetryJobDelivered(object sender, EventArgs e) =>
55-
MessageBox.Show("Job Delivered");
56-
57-
private void TelemetryFined(object sender, EventArgs e) =>
58-
MessageBox.Show("Fined");
59-
60-
private void TelemetryTollgate(object sender, EventArgs e) =>
61-
MessageBox.Show("Tollgate");
62-
63-
private void TelemetryFerry(object sender, EventArgs e) =>
64-
MessageBox.Show("Ferry");
65-
66-
private void TelemetryTrain(object sender, EventArgs e) =>
67-
MessageBox.Show("Train");
68-
private void TelemetryRefuel(object sender, EventArgs e) => rtb_fuel.Invoke((MethodInvoker)(()=>rtb_fuel.BackColor = Color.Green));
69-
private void TelemetryRefuelEnd(object sender, EventArgs e) => rtb_fuel.Invoke((MethodInvoker)(()=>rtb_fuel.BackColor = Color.Red));
49+
private void SCSSdkClientDemo_FormClosing(object sender, FormClosingEventArgs e) {
50+
Telemetry.pause(); // that line make it possible, but not every application wants to ask the user to quit, need to see if i can change that, when not use the try catch and IGNORE it (nothing changed )
51+
if (MessageBox.Show("Are you sure you want to quit?", "My Application", MessageBoxButtons.YesNo) ==
52+
DialogResult.No) {
53+
e.Cancel = true;
54+
Telemetry.resume();
55+
return;
56+
}
7057

71-
private void TelemetryRefuelPayed(object sender, EventArgs e) {
72-
MessageBox.Show("Fuel Payed: " + fuel);
58+
Telemetry.Dispose();
7359
}
7460

75-
7661
private void Telemetry_Data(SCSTelemetry data, bool updated) {
77-
if (!updated) return;
62+
if (!updated)
63+
return;
7864
try {
7965
if (InvokeRequired) {
8066
Invoke(new TelemetryData(Telemetry_Data), data, updated);
8167
return;
8268
}
8369

84-
l_updateRate.Text = Telemetry.UpdateInterval+ "ms";
70+
l_updateRate.Text = Telemetry.UpdateInterval + "ms";
8571

8672
lbGeneral.Text = "General info:\n " +
8773
"\t SDK Running:\n" +
88-
$"\t\t\t{data.SdkActive}\n"+
74+
$"\t\t\t{data.SdkActive}\n" +
8975
"\tSDK Version:\n" +
9076
$"\t\t\t{data.DllVersion}\n" +
9177
"\tGame:\n " +
@@ -100,6 +86,8 @@ private void Telemetry_Data(SCSTelemetry data, bool updated) {
10086
$"\t\t\t{data.SimulationTimestamp}\n" +
10187
"\tRender TimeStamp:\n" +
10288
$"\t\t\t{data.RenderTimestamp}\n" +
89+
"\tMultiplayer Time Offset:\n" +
90+
$"\t\t\t{data.MultiplayerTimeOffset}\n" +
10391
"\tGame Paused:\n" +
10492
$"\t\t\t{data.Paused}\n" +
10593
"\tOn Job:\n" +
@@ -117,7 +105,7 @@ private void Telemetry_Data(SCSTelemetry data, bool updated) {
117105
"\tferry:\n" +
118106
$"\t\t\t{data.SpecialEventsValues.Ferry}\n" +
119107
"\ttrain:\n" +
120-
$"\t\t\t{data.SpecialEventsValues.Train}\n"+
108+
$"\t\t\t{data.SpecialEventsValues.Train}\n" +
121109
"\tRefuel Payed:\n" +
122110
$"\t\t\t{data.SpecialEventsValues.RefuelPayed}\n";
123111

@@ -132,25 +120,41 @@ private void Telemetry_Data(SCSTelemetry data, bool updated) {
132120
navigation.Text = JsonConvert.SerializeObject(data.NavigationValues, Formatting.Indented);
133121
substances.Text = JsonConvert.SerializeObject(data.Substances, Formatting.Indented);
134122
gameplayevent.Text = JsonConvert.SerializeObject(data.GamePlay, Formatting.Indented);
135-
rtb_fuel.Text = data.TruckValues.CurrentValues.DashboardValues.FuelValue.Amount + " "+ data.SpecialEventsValues.Refuel ;
136-
fuel = data.GamePlay.RefuelEvent.Amount;
137-
123+
rtb_fuel.Text = data.TruckValues.CurrentValues.DashboardValues.FuelValue.Amount + " " + data.SpecialEventsValues.Refuel;
124+
fuel = data.GamePlay.RefuelEvent.Amount;
138125
} catch (Exception ex) {
139126
// ignored atm i found no proper way to shut the telemetry down and down call this anymore when this or another thing is already disposed
140127
Console.WriteLine("Telemetry was closed: " + ex);
141128
}
142129
}
143130

144-
private void SCSSdkClientDemo_FormClosing(object sender, FormClosingEventArgs e) {
145-
Telemetry.pause(); // that line make it possible, but not every application wants to ask the user to quit, need to see if i can change that, when not use the try catch and IGNORE it (nothing changed )
146-
if (MessageBox.Show("Are you sure you want to quit?", "My Application", MessageBoxButtons.YesNo) ==
147-
DialogResult.No) {
148-
e.Cancel = true;
149-
Telemetry.resume();
150-
return;
151-
}
131+
private void TelemetryFerry(object sender, EventArgs e) =>
132+
MessageBox.Show("Ferry");
152133

153-
Telemetry.Dispose();
134+
private void TelemetryFined(object sender, EventArgs e) =>
135+
MessageBox.Show("Fined");
136+
137+
private void TelemetryJobCancelled(object sender, EventArgs e) =>
138+
MessageBox.Show("Job Cancelled");
139+
140+
private void TelemetryJobDelivered(object sender, EventArgs e) =>
141+
MessageBox.Show("Job Delivered");
142+
143+
private void TelemetryOnJobStarted(object sender, EventArgs e) =>
144+
MessageBox.Show("Just started job OR loaded game with active.");
145+
146+
private void TelemetryRefuel(object sender, EventArgs e) => rtb_fuel.Invoke((MethodInvoker)(() => rtb_fuel.BackColor = Color.Green));
147+
148+
private void TelemetryRefuelEnd(object sender, EventArgs e) => rtb_fuel.Invoke((MethodInvoker)(() => rtb_fuel.BackColor = Color.Red));
149+
150+
private void TelemetryRefuelPayed(object sender, EventArgs e) {
151+
MessageBox.Show("Fuel Payed: " + fuel);
154152
}
153+
154+
private void TelemetryTollgate(object sender, EventArgs e) =>
155+
MessageBox.Show("Tollgate");
156+
157+
private void TelemetryTrain(object sender, EventArgs e) =>
158+
MessageBox.Show("Train");
155159
}
156-
}
160+
}

scs-client/C#/SCSSdkClient/Object/SCSTelemetry.Common.cs

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
#pragma warning disable 1570
22

33
namespace SCSSdkClient.Object {
4+
45
public partial class SCSTelemetry {
6+
57
/// <summary>
68
/// Telemetry specific channels which might be used by more than one game.
79
/// </summary>
810
public class Common {
11+
912
/// <summary>
1013
/// initialise a Common object
1114
/// </summary>
@@ -16,19 +19,6 @@ public Common() {
1619

1720
/// About: Scale
1821
/// Games which use real 1:1 maps will not provide this channel
19-
20-
/// <summary>
21-
/// Scale applied to distance and time to compensate for the scale of the map(e.g. 1s of real time corresponds to
22-
/// local_scale minutes of simulated game time).
23-
/// </summary>
24-
/// <!---->
25-
/// **INFORMATION**
26-
/// <!---->
27-
/// Games which use real 1:1 maps will not provide this channel.
28-
/// <!---->
29-
/// **INFORMATION**
30-
/// <!---->
31-
public float Scale { get; internal set; }
3222

3323
/// <summary>
3424
/// Absolute in-game time.
@@ -69,7 +59,20 @@ public Common() {
6959
/// NextRestStopTime == 04.01.0001 22:00 // Pseudocode
7060
/// </code>
7161
/// </example>
72-
public Time NextRestStopTime => new Time {Value = (uint) ((int) GameTime.Value + NextRestStop.Value)};
62+
public Time NextRestStopTime => new Time { Value = (uint)((int)GameTime.Value + NextRestStop.Value) };
63+
64+
/// <summary>
65+
/// Scale applied to distance and time to compensate for the scale of the map(e.g. 1s of real time corresponds to
66+
/// local_scale minutes of simulated game time).
67+
/// </summary>
68+
/// <!---->
69+
/// **INFORMATION**
70+
/// <!---->
71+
/// Games which use real 1:1 maps will not provide this channel.
72+
/// <!---->
73+
/// **INFORMATION**
74+
/// <!---->
75+
public float Scale { get; internal set; }
7376
}
7477
}
75-
}
78+
}

0 commit comments

Comments
 (0)