File tree Expand file tree Collapse file tree 3 files changed +11
-4
lines changed Expand file tree Collapse file tree 3 files changed +11
-4
lines changed Original file line number Diff line number Diff line change 8
8
"github.com/RoboCup-SSL/ssl-go-tools/pkg/sslconn"
9
9
"log"
10
10
"net"
11
+ "time"
11
12
)
12
13
13
14
var udpAddress = flag .String ("udpAddress" , "224.5.23.1:10003" , "The multicast address of ssl-game-controller" )
@@ -26,7 +27,7 @@ type Client struct {
26
27
func main () {
27
28
flag .Parse ()
28
29
29
- client .LoadPrivateKey (* privateKeyLocation )
30
+ privateKey = client .LoadPrivateKey (* privateKeyLocation )
30
31
31
32
if * autoDetectAddress {
32
33
host := client .DetectHost (* udpAddress )
@@ -47,7 +48,11 @@ func main() {
47
48
48
49
c .register ()
49
50
c .sendGameEvent ()
50
- c .sendAutoRefMessage ("Hello World" )
51
+
52
+ for {
53
+ time .Sleep (1 * time .Second )
54
+ c .sendAutoRefMessage ("Hello World" )
55
+ }
51
56
}
52
57
53
58
func (c * Client ) register () {
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ type Client struct {
26
26
func main () {
27
27
flag .Parse ()
28
28
29
- client .LoadPrivateKey (* privateKeyLocation )
29
+ privateKey = client .LoadPrivateKey (* privateKeyLocation )
30
30
31
31
if * autoDetectAddress {
32
32
host := client .DetectHost (* udpAddress )
Original file line number Diff line number Diff line change @@ -36,15 +36,17 @@ func SetHost(address string, host string) string {
36
36
return host + ":" + parts [1 ]
37
37
}
38
38
39
- func LoadPrivateKey (privateKeyLocation string ) {
39
+ func LoadPrivateKey (privateKeyLocation string ) * rsa. PrivateKey {
40
40
if privateKeyLocation != "" {
41
41
privateKey := ReadPrivateKey (privateKeyLocation )
42
42
if privateKey != nil {
43
43
log .Print ("Found private key" )
44
+ return privateKey
44
45
} else {
45
46
log .Print ("No private key available" )
46
47
}
47
48
}
49
+ return nil
48
50
}
49
51
50
52
func ReadPrivateKey (privateKeyLocation string ) * rsa.PrivateKey {
You can’t perform that action at this time.
0 commit comments