-
Notifications
You must be signed in to change notification settings - Fork 1
/
ts3.html
48 lines (42 loc) · 1.64 KB
/
ts3.html
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
<!DOCTYPE html>
<html>
<head>
<title>Steam Redirect</title>
<script>
function getQueryParams(qs) {
qs = qs.split("+").join(" ");
var params = {}, tokens,
re = /[?&]?([^=]+)=([^&]*)/g;
while (tokens = re.exec(qs)) {
params[decodeURIComponent(tokens[1])]
= decodeURIComponent(tokens[2]);
}
return params;
}
var params = getQueryParams(document.location.search);
function redirect() {
if (typeof params.ip === "undefined" || typeof params.port === "undefined") return;
var redirect = "ts3server://" + params.ip + "?";
if (typeof params.port != "undefined") redirect = redirect + "port=" + params.port + "&";
if (typeof params.password != "undefined") redirect = redirect + "password=" + params.password + "&";
if (typeof params.channel != "undefined") redirect = redirect + "channel=" + params.channel + "&";
if (typeof params.cid != "undefined") redirect = redirect + "cid=" + params.cid + "&";
if (typeof params.channelpassword != "undefined") redirect = redirect + "channelpassword=" + params.channelpassword + "&";
window.location = redirect;
}
redirect();
setTimeout(function(){ window.history.back() }, 2000);
</script>
</head>
<body bgcolor="#333333">
<font face="verdana" color="white"><b><p id="info" align=center>Redirecting you to your location...</p></b></font>
<script>
var string;
if (typeof params.ip === "undefined" || typeof params.port === "undefined")
string = "URL must be filled with IP and Port params to work.";
else
string = "You are beeing redirected to " + params.ip + ":" + params.port + " TS3 server...";
document.getElementById("info").innerHTML = string;
</script>
</body>
</html>