File tree Expand file tree Collapse file tree 2 files changed +7
-19
lines changed
Expand file tree Collapse file tree 2 files changed +7
-19
lines changed Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff 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
128127func (m EventModifyValue ) String () string {
You can’t perform that action at this time.
0 commit comments