summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/Philipp15b/go-steam/servers.go
diff options
context:
space:
mode:
authorWim <wim@42.be>2017-06-22 01:00:27 +0200
committerWim <wim@42.be>2017-06-22 01:00:27 +0200
commit1f914618538920db4bfec7b106ee97038b157c9b (patch)
tree6bd0ab107fe1673dbacdf9dfd10004289cd7bfab /vendor/github.com/Philipp15b/go-steam/servers.go
parent1f9874102aaca09ce5e0289beff376c307b8c57b (diff)
downloadmatterbridge-msglm-1f914618538920db4bfec7b106ee97038b157c9b.tar.gz
matterbridge-msglm-1f914618538920db4bfec7b106ee97038b157c9b.tar.bz2
matterbridge-msglm-1f914618538920db4bfec7b106ee97038b157c9b.zip
Add vendor (steam)
Diffstat (limited to 'vendor/github.com/Philipp15b/go-steam/servers.go')
-rw-r--r--vendor/github.com/Philipp15b/go-steam/servers.go144
1 files changed, 144 insertions, 0 deletions
diff --git a/vendor/github.com/Philipp15b/go-steam/servers.go b/vendor/github.com/Philipp15b/go-steam/servers.go
new file mode 100644
index 00000000..a0763d42
--- /dev/null
+++ b/vendor/github.com/Philipp15b/go-steam/servers.go
@@ -0,0 +1,144 @@
+package steam
+
+import (
+ "math/rand"
+ "time"
+
+ "github.com/Philipp15b/go-steam/netutil"
+)
+
+// CMServers contains a list of worlwide servers
+var CMServers = [][]string{
+ { // North American Servers
+ // Chicago
+ "162.254.193.44:27018",
+ "162.254.193.44:27019",
+ "162.254.193.44:27020",
+ "162.254.193.44:27021",
+ "162.254.193.45:27017",
+ "162.254.193.45:27018",
+ "162.254.193.45:27019",
+ "162.254.193.45:27021",
+ "162.254.193.46:27017",
+ "162.254.193.46:27018",
+ "162.254.193.46:27019",
+ "162.254.193.46:27020",
+ "162.254.193.46:27021",
+ "162.254.193.47:27019",
+ "162.254.193.47:27020",
+
+ // Ashburn
+ "208.78.164.9:27017",
+ "208.78.164.9:27018",
+ "208.78.164.9:27019",
+ "208.78.164.10:27017",
+ "208.78.164.10:27018",
+ "208.78.164.10:27019",
+ "208.78.164.11:27017",
+ "208.78.164.11:27018",
+ "208.78.164.11:27019",
+ "208.78.164.12:27017",
+ "208.78.164.12:27018",
+ "208.78.164.12:27019",
+ "208.78.164.13:27017",
+ "208.78.164.13:27018",
+ "208.78.164.13:27019",
+ "208.78.164.14:27017",
+ "208.78.164.14:27018",
+ "208.78.164.14:27019",
+ },
+ { // Europe Servers
+ // Luxembourg
+ "146.66.152.10:27017",
+ "146.66.152.10:27018",
+ "146.66.152.10:27019",
+ "146.66.152.10:27020",
+ "146.66.152.11:27017",
+ "146.66.152.11:27018",
+ "146.66.152.11:27019",
+ "146.66.152.11:27020",
+
+ // Poland
+ "155.133.242.8:27017",
+ "155.133.242.8:27018",
+ "155.133.242.8:27019",
+ "155.133.242.8:27020",
+ "155.133.242.9:27017",
+ "155.133.242.9:27018",
+ "155.133.242.9:27019",
+ "155.133.242.9:27020",
+
+ // Vienna
+ "146.66.155.8:27017",
+ "146.66.155.8:27018",
+ "146.66.155.8:27019",
+ "146.66.155.8:27020",
+ "185.25.182.10:27017",
+ "185.25.182.10:27018",
+ "185.25.182.10:27019",
+ "185.25.182.10:27020",
+
+ // London
+ "162.254.196.40:27017",
+ "162.254.196.40:27018",
+ "162.254.196.40:27019",
+ "162.254.196.40:27020",
+ "162.254.196.40:27021",
+ "162.254.196.41:27017",
+ "162.254.196.41:27018",
+ "162.254.196.41:27019",
+ "162.254.196.41:27020",
+ "162.254.196.41:27021",
+ "162.254.196.42:27017",
+ "162.254.196.42:27018",
+ "162.254.196.42:27019",
+ "162.254.196.42:27020",
+ "162.254.196.42:27021",
+ "162.254.196.43:27017",
+ "162.254.196.43:27018",
+ "162.254.196.43:27019",
+ "162.254.196.43:27020",
+ "162.254.196.43:27021",
+
+ // Stockholm
+ "185.25.180.14:27017",
+ "185.25.180.14:27018",
+ "185.25.180.14:27019",
+ "185.25.180.14:27020",
+ "185.25.180.15:27017",
+ "185.25.180.15:27018",
+ "185.25.180.15:27019",
+ "185.25.180.15:27020",
+ },
+}
+
+// GetRandomCM returns back a random server anywhere
+func GetRandomCM() *netutil.PortAddr {
+ rng := rand.New(rand.NewSource(time.Now().UnixNano()))
+ servers := append(CMServers[0], CMServers[1]...)
+ addr := netutil.ParsePortAddr(servers[rng.Int31n(int32(len(servers)))])
+ if addr == nil {
+ panic("invalid address in CMServers slice")
+ }
+ return addr
+}
+
+// GetRandomNorthAmericaCM returns back a random server in north america
+func GetRandomNorthAmericaCM() *netutil.PortAddr {
+ rng := rand.New(rand.NewSource(time.Now().UnixNano()))
+ addr := netutil.ParsePortAddr(CMServers[0][rng.Int31n(int32(len(CMServers[0])))])
+ if addr == nil {
+ panic("invalid address in CMServers slice")
+ }
+ return addr
+}
+
+// GetRandomEuropeCM returns back a random server in europe
+func GetRandomEuropeCM() *netutil.PortAddr {
+ rng := rand.New(rand.NewSource(time.Now().UnixNano()))
+ addr := netutil.ParsePortAddr(CMServers[1][rng.Int31n(int32(len(CMServers[1])))])
+ if addr == nil {
+ panic("invalid address in CMServers slice")
+ }
+ return addr
+}