Got iRacing working on ESDI, I will version this correctly when time comes
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"log"
|
"log"
|
||||||
|
"log/slog"
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@@ -31,6 +32,7 @@ type Replayer struct {
|
|||||||
|
|
||||||
func NewReplayer(input string, output string) (*Replayer, error) {
|
func NewReplayer(input string, output string) (*Replayer, error) {
|
||||||
ibt, err := goirsdk.Init(goirsdk.Options{
|
ibt, err := goirsdk.Init(goirsdk.Options{
|
||||||
|
Logger: slog.Default(),
|
||||||
SourceType: goirsdk.IBTFile,
|
SourceType: goirsdk.IBTFile,
|
||||||
SourcePath: "../testTelemetry/gt3_mustang_bathurst.ibt",
|
SourcePath: "../testTelemetry/gt3_mustang_bathurst.ibt",
|
||||||
IBTExportType: goirsdk.SharedMemoryFile,
|
IBTExportType: goirsdk.SharedMemoryFile,
|
||||||
@@ -77,9 +79,15 @@ func (r *Replayer) Replay(ctx context.Context, loop bool) error {
|
|||||||
gear := int32(r.SDK.Vars.Vars["Gear"].Value.(int))
|
gear := int32(r.SDK.Vars.Vars["Gear"].Value.(int))
|
||||||
rpm := int32(r.SDK.Vars.Vars["RPM"].Value.(float32))
|
rpm := int32(r.SDK.Vars.Vars["RPM"].Value.(float32))
|
||||||
speed := int32(r.SDK.Vars.Vars["Speed"].Value.(float32))
|
speed := int32(r.SDK.Vars.Vars["Speed"].Value.(float32))
|
||||||
|
sessionState := r.SDK.Vars.Vars["SessionState"].Value.(int)
|
||||||
|
|
||||||
fmt.Printf("\033[?25l\033[2J\033[H")
|
fmt.Printf("\033[?25l\033[2J\033[H")
|
||||||
fmt.Printf("Gear: %d, RPM: %d, Speed: %d", gear, rpm, speed)
|
fmt.Printf("Gear: %d, RPM: %d, Speed: %d\n", gear, rpm, speed)
|
||||||
|
fmt.Printf("\n")
|
||||||
|
fmt.Printf("IsConnected: %t\n", r.SDK.IsConnected())
|
||||||
|
fmt.Printf(" SessionStatusConnected: %t\n", r.SDK.SessionStatusConnected())
|
||||||
|
fmt.Printf(" SessionStatusInvalid: %t\n", r.SDK.SessionStateInvalid())
|
||||||
|
fmt.Printf(" SessionState: %d\n", sessionState)
|
||||||
|
|
||||||
<-mainLoopTicker.C
|
<-mainLoopTicker.C
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user