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 6
6
"github.com/RoboCup-SSL/ssl-game-controller/pkg/timer"
7
7
"github.com/pkg/errors"
8
8
"log"
9
- "math"
10
9
"math/rand"
11
10
"strconv"
12
11
"strings"
@@ -354,12 +353,10 @@ func (e *Engine) Process(event Event) error {
354
353
if err != nil {
355
354
return err
356
355
}
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 ()
363
360
return nil
364
361
}
365
362
@@ -467,21 +464,13 @@ func (e *Engine) processModify(m *EventModifyValue) error {
467
464
return errors .Errorf ("Game event id %d is too large." , i )
468
465
}
469
466
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
- }
476
467
} else if err := e .processTeamModify (m ); err != nil {
477
468
return err
478
469
}
479
470
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 )
485
474
return nil
486
475
}
487
476
Original file line number Diff line number Diff line change @@ -122,7 +122,6 @@ type EventModifyValue struct {
122
122
GameEventBehavior * EventModifyGameEventBehavior `json:"gameEventBehavior,omitempty" yaml:"gameEventBehavior"`
123
123
BotSubstitutionIntend * bool `json:"botSubstitutionIntend,omitempty" yaml:"botSubstitutionIntend"`
124
124
RemoveGameEvent * int `json:"removeGameEvent,omitempty" yaml:"removeGameEvent"`
125
- Timestamp * int64 `json:"timestamp,omitempty" yaml:"timestamp"`
126
125
}
127
126
128
127
func (m EventModifyValue ) String () string {
You can’t perform that action at this time.
0 commit comments