forked from Philipp15b/go-steam
/
servers.go
64 lines (61 loc) · 1.54 KB
/
servers.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
package steam
import (
"github.com/Philipp15b/go-steam/netutil"
"math/rand"
"time"
)
var CMServers = []string{
// Qwest, Seattle
"72.165.61.174:27017",
"72.165.61.174:27018",
"72.165.61.175:27017",
"72.165.61.175:27018",
"72.165.61.176:27017",
"72.165.61.176:27018",
"72.165.61.185:27017",
"72.165.61.185:27018",
"72.165.61.187:27017",
"72.165.61.187:27018",
"72.165.61.188:27017",
"72.165.61.188:27018",
// Inteliquent, Luxembourg, cm-[01-04].lux.valve.net
"146.66.152.12:27017",
"146.66.152.12:27018",
"146.66.152.12:27019",
"146.66.152.13:27017",
"146.66.152.13:27018",
"146.66.152.13:27019",
"146.66.152.14:27017",
"146.66.152.14:27018",
"146.66.152.14:27019",
"146.66.152.15:27017",
"146.66.152.15:27018",
"146.66.152.15:27019",
/* Highwinds, Netherlands (not live)
"81.171.115.5":27017",
"81.171.115.5":27018",
"81.171.115.5":27019",
"81.171.115.6":27017",
"81.171.115.6":27018",
"81.171.115.6":27019",
"81.171.115.7":27017",
"81.171.115.7":27018",
"81.171.115.7":27019",
"81.171.115.8":27017",
"81.171.115.8":27018",
"81.171.115.8":27019",*/
// Highwinds, Kaysville
"209.197.29.196:27017",
"209.197.29.197:27017",
/* Starhub, Singapore (non-optimal route)
"103.28.54.10":27017",
"103.28.54.11":27017}*/
}
func GetRandomCM() *netutil.PortAddr {
rng := rand.New(rand.NewSource(time.Now().UnixNano()))
addr := netutil.ParsePortAddr(CMServers[rng.Int31n(int32(len(CMServers)))])
if addr == nil {
panic("invalid address in CMServers slice")
}
return addr
}