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() {
6060 }
6161
6262 for {
63- time . Sleep ( time . Second )
63+ c . ReplyToChoices ( )
6464 }
6565}
6666
@@ -109,6 +109,19 @@ func (c *Client) sendDesiredKeeper(id int32) (accepted bool) {
109109 return c .sendRequest (& request )
110110}
111111
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+
112125func (c * Client ) sendRequest (request * rcon.TeamToController ) (accepted bool ) {
113126 if privateKey != nil {
114127 request .Signature = & rcon.Signature {Token : & c .token , Pkcs1V15 : []byte {}}
You can’t perform that action at this time.
0 commit comments