forked from Tommy-42/go-steam
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathservers.go
More file actions
125 lines (121 loc) · 3.02 KB
/
servers.go
File metadata and controls
125 lines (121 loc) · 3.02 KB
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
package steam
import (
"math/rand"
"time"
"github.com/an0nfunc/go-steam/v3/netutil"
)
// CMServers contains a list of worlwide servers
var CMServers = []string{
"162.254.197.39:27019",
"155.133.226.78:27018",
"162.254.197.39:27017",
"155.133.226.78:27017",
"155.133.226.75:27027",
"162.254.197.39:27020",
"155.133.226.75:27021",
"162.254.197.54:27027",
"162.254.197.39:27023",
"162.254.197.39:27018",
"162.254.197.54:27022",
"162.254.197.54:27019",
"155.133.226.78:27026",
"162.254.197.39:27021",
"155.133.226.78:27022",
"155.133.226.75:27023",
"162.254.197.54:27026",
"162.254.197.54:27018",
"162.254.197.39:27025",
"155.133.226.75:27018",
"162.254.197.54:27023",
"155.133.226.75:27022",
"155.133.226.75:27019",
"155.133.226.75:27025",
"162.254.197.54:27020",
"162.254.197.54:27021",
"162.254.197.39:27024",
"162.254.197.39:27027",
"162.254.197.54:27017",
"155.133.226.78:27020",
"155.133.226.75:27024",
"155.133.226.75:27017",
"162.254.197.39:27022",
"155.133.226.78:27025",
"155.133.226.78:27019",
"162.254.197.54:27025",
"162.254.197.54:27024",
"155.133.226.75:27026",
"155.133.226.78:27021",
"155.133.226.78:27023",
"155.133.226.75:27020",
"155.133.226.78:27027",
"162.254.197.39:27026",
"155.133.226.78:27024",
"162.254.198.44:27020",
"155.133.252.54:27024",
"162.254.198.44:27017",
"162.254.198.104:27025",
"155.133.252.39:27018",
"162.254.198.104:27021",
"162.254.198.104:27020",
"162.254.198.44:27023",
"155.133.252.54:27022",
"155.133.252.54:27017",
"155.133.252.54:27023",
"155.133.252.54:27025",
"155.133.252.39:27019",
"162.254.198.104:27018",
"162.254.198.44:27019",
"162.254.198.44:27025",
"162.254.198.104:27017",
"162.254.198.104:27023",
"155.133.252.39:27017",
"162.254.198.44:27024",
"155.133.252.54:27019",
"162.254.198.44:27021",
"155.133.252.39:27025",
"162.254.198.44:27022",
"162.254.198.104:27024",
"155.133.252.39:27021",
"155.133.252.39:27020",
"162.254.198.44:27018",
"162.254.198.104:27022",
"155.133.252.39:27024",
"155.133.252.54:27021",
"155.133.252.54:27018",
"155.133.252.39:27023",
"162.254.198.104:27019",
"155.133.252.54:27020",
"155.133.252.39:27022",
"185.25.182.76:27018",
"185.25.182.77:27021",
"155.133.248.38:27022",
"185.25.182.76:27020",
"185.25.182.77:27017",
"155.133.248.39:27021",
"185.25.182.77:27019",
"185.25.182.76:27019",
"185.25.182.76:27021",
"185.25.182.77:27018",
"185.25.182.77:27020",
"155.133.248.39:27022",
"155.133.248.38:27024",
"155.133.248.39:27024",
"155.133.248.38:27020",
"155.133.248.38:27018",
"155.133.248.39:27018",
"155.133.248.38:27017",
"155.133.248.38:27023",
"155.133.248.39:27023",
}
// GetRandomCM returns a random server from a built-in IP list.
//
// Prefer Client.Connect(), which uses IPs from the Steam Directory,
// which is always more up-to-date.
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
}