@@ -77,11 +77,14 @@ func main() {
77
77
c .sendBallLeftField ()
78
78
} else if strings .Compare ("botCrashUnique" , text ) == 0 {
79
79
c .sendBotCrashUnique ()
80
+ } else if strings .Compare ("doubleTouch" , text ) == 0 {
81
+ c .sendDoubleTouch ()
80
82
} else {
81
83
fmt .Println ("Available commands: " )
82
84
fmt .Printf (" %-20s: %s\n " , "help" , "Show this help text" )
83
85
fmt .Printf (" %-20s: %s\n " , "ballLeftField" , "Send game event" )
84
86
fmt .Printf (" %-20s: %s\n " , "botCrashUnique" , "Send game event" )
87
+ fmt .Printf (" %-20s: %s\n " , "doubleTouch" , "Send game event" )
85
88
}
86
89
}
87
90
}
@@ -141,6 +144,22 @@ func (c *Client) sendBallLeftField() {
141
144
c .sendRequest (& request , true )
142
145
}
143
146
147
+ func (c * Client ) sendDoubleTouch () {
148
+ event := refproto.GameEvent_AttackerDoubleTouchedBall_ {}
149
+ event .AttackerDoubleTouchedBall = new (refproto.GameEvent_AttackerDoubleTouchedBall )
150
+ event .AttackerDoubleTouchedBall .ByBot = new (uint32 )
151
+ * event .AttackerDoubleTouchedBall .ByBot = 2
152
+ event .AttackerDoubleTouchedBall .ByTeam = new (refproto.Team )
153
+ * event .AttackerDoubleTouchedBall .ByTeam = refproto .Team_BLUE
154
+ event .AttackerDoubleTouchedBall .Location = & refproto.Location {X : new (float32 ), Y : new (float32 )}
155
+ * event .AttackerDoubleTouchedBall .Location .X = 1
156
+ * event .AttackerDoubleTouchedBall .Location .Y = 4.5
157
+ gameEvent := refproto.GameEvent {Event : & event , Type : new (refproto.GameEventType )}
158
+ * gameEvent .Type = refproto .GameEventType_ATTACKER_DOUBLE_TOUCHED_BALL
159
+ request := refproto.AutoRefToController {GameEvent : & gameEvent }
160
+ c .sendRequest (& request , true )
161
+ }
162
+
144
163
func (c * Client ) sendBotCrashUnique () {
145
164
event := refproto.GameEvent_BotCrashUnique_ {}
146
165
event .BotCrashUnique = new (refproto.GameEvent_BotCrashUnique )
@@ -154,7 +173,7 @@ func (c *Client) sendBotCrashUnique() {
154
173
* event .BotCrashUnique .Location .X = 1
155
174
* event .BotCrashUnique .Location .Y = 4.5
156
175
gameEvent := refproto.GameEvent {Event : & event , Type : new (refproto.GameEventType )}
157
- * gameEvent .Type = refproto .GameEventType_BALL_LEFT_FIELD_TOUCH_LINE
176
+ * gameEvent .Type = refproto .GameEventType_BOT_CRASH_UNIQUE
158
177
request := refproto.AutoRefToController {GameEvent : & gameEvent }
159
178
c .sendRequest (& request , true )
160
179
}
@@ -194,6 +213,6 @@ func (c *Client) sendRequest(request *refproto.AutoRefToController, doLog bool)
194
213
195
214
func logIf (doLog bool , v ... interface {}) {
196
215
if doLog {
197
- log .Print (v )
216
+ log .Print (v ... )
198
217
}
199
218
}
0 commit comments