File tree Expand file tree Collapse file tree 3 files changed +342
-65
lines changed Expand file tree Collapse file tree 3 files changed +342
-65
lines changed Original file line number Diff line number Diff line change @@ -60,7 +60,7 @@ func main() {
60
60
}
61
61
62
62
for {
63
- time . Sleep ( time . Second )
63
+ c . ReplyToChoices ( )
64
64
}
65
65
}
66
66
@@ -109,6 +109,19 @@ func (c *Client) sendDesiredKeeper(id int32) (accepted bool) {
109
109
return c .sendRequest (& request )
110
110
}
111
111
112
+ func (c * Client ) ReplyToChoices () {
113
+ request := rcon.ControllerToTeam {}
114
+ if err := sslconn .ReceiveMessage (c .reader , & request ); err != nil {
115
+ log .Fatal ("Failed receiving controller request: " , err )
116
+ }
117
+ if request .GetAdvantageChoice () != nil {
118
+ log .Printf ("Received choice for: %v" , * request .GetAdvantageChoice ().Foul )
119
+ }
120
+ reply := rcon.TeamToController_AdvantageResponse_ {AdvantageResponse : rcon .TeamToController_CONTINUE }
121
+ response := rcon.TeamToController {Msg : & reply }
122
+ c .sendRequest (& response )
123
+ }
124
+
112
125
func (c * Client ) sendRequest (request * rcon.TeamToController ) (accepted bool ) {
113
126
if privateKey != nil {
114
127
request .Signature = & rcon.Signature {Token : & c .token , Pkcs1V15 : []byte {}}
You can’t perform that action at this time.
0 commit comments