Skip to content

Commit 0170e8c

Browse files
committed
[refactoring] Remove modify.timestamp again - replaced by CI server
1 parent 3cd6e91 commit 0170e8c

File tree

2 files changed

+7
-19
lines changed

2 files changed

+7
-19
lines changed

internal/app/controller/engine.go

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import (
66
"github.com/RoboCup-SSL/ssl-game-controller/pkg/timer"
77
"github.com/pkg/errors"
88
"log"
9-
"math"
109
"math/rand"
1110
"strconv"
1211
"strings"
@@ -354,12 +353,10 @@ func (e *Engine) Process(event Event) error {
354353
if err != nil {
355354
return err
356355
}
357-
if event.Modify == nil || event.Modify.Timestamp == nil {
358-
// do not execute this for timestamp updates
359-
e.updateMaxBots()
360-
e.updateNextCommand()
361-
e.appendHistory()
362-
}
356+
// do not execute this for timestamp updates
357+
e.updateMaxBots()
358+
e.updateNextCommand()
359+
e.appendHistory()
363360
return nil
364361
}
365362

@@ -467,21 +464,13 @@ func (e *Engine) processModify(m *EventModifyValue) error {
467464
return errors.Errorf("Game event id %d is too large.", i)
468465
}
469466
e.State.GameEvents = append(e.State.GameEvents[:i], e.State.GameEvents[i+1:]...)
470-
} else if m.Timestamp != nil {
471-
e.TimeProvider = timer.NewFixedTimeProviderFromNanoSeconds(*m.Timestamp)
472-
if math.Abs(e.TimeProvider().Sub(e.LastTimeUpdate).Seconds()) > 1 {
473-
// reset last time update - it might be in another time range
474-
e.LastTimeUpdate = e.TimeProvider()
475-
}
476467
} else if err := e.processTeamModify(m); err != nil {
477468
return err
478469
}
479470

480-
if m.Timestamp == nil {
481-
// do not log timestamp modification - it will be send very often, if sent
482-
e.LogModify(*m)
483-
log.Printf("Processed %v", m)
484-
}
471+
// do not log timestamp modification - it will be send very often, if sent
472+
e.LogModify(*m)
473+
log.Printf("Processed %v", m)
485474
return nil
486475
}
487476

internal/app/controller/events.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,6 @@ type EventModifyValue struct {
122122
GameEventBehavior *EventModifyGameEventBehavior `json:"gameEventBehavior,omitempty" yaml:"gameEventBehavior"`
123123
BotSubstitutionIntend *bool `json:"botSubstitutionIntend,omitempty" yaml:"botSubstitutionIntend"`
124124
RemoveGameEvent *int `json:"removeGameEvent,omitempty" yaml:"removeGameEvent"`
125-
Timestamp *int64 `json:"timestamp,omitempty" yaml:"timestamp"`
126125
}
127126

128127
func (m EventModifyValue) String() string {

0 commit comments

Comments
 (0)