forked from MrAntares/roBrowserLegacy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdemo.html
107 lines (96 loc) · 2.78 KB
/
demo.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
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
<!DOCTYPE html>
<html>
<head>
<title>roBrowserLegacy Demo</title>
<link rel="manifest" href="pwa/robrowser.webmanifest">
<meta name="mobile-web-app-capable" content="yes" />
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta name="theme-color" content="#ff8cb5">
<meta charset="UTF-8">
<style type="text/css">
html, div, body{
margin: 0;
padding: 0;
border: 0;
height: 100%;
width: 100%;
overflow: hidden;
}
</style>
<script type="text/javascript" src="api.js"></script>
<script type="text/javascript">
function initialize(gitHash) {
var ROConfig = {
target: document.getElementById("robrowser"),
type: ROBrowser.TYPE.FRAME,
application: ROBrowser.APP.ONLINE,
remoteClient: 'https://grf.robrowser.com/', //For main menu data
version: gitHash,
//enableConsole: true,
//disableConsole: true,
packetDump: false,
servers: [
{
display: 'roBrowser Demo Server',
desc: 'roBrowser\'s demo server',
//address: 'connect.robrowser.com',
address: '127.0.0.1',
port: 6900,
version: 25,
langtype: 12,
packetver: 20130618,
renewal: false,
worldMapSettings: { episode: 12 },
packetKeys: false,
socketProxy: 'wss://connect.robrowser.com',
remoteClient: 'https://grf.robrowser.com/',
adminList: [2000000]
},
// ADD PUBLIC TEST SERVERS HERE WITH _M _F REGISTRATION
],
development: true,
ThirdPersonCamera: true,
FirstPersonCamera: true,
CameraMaxZoomOut: 50
};
var RO = new ROBrowser(ROConfig);
RO.start();
}
var getJSON = function(url, callback) {
var xhr = new XMLHttpRequest();
xhr.open('GET', url, true);
xhr.responseType = 'json';
xhr.onload = function() {
var status = xhr.status;
if (status === 200) {
callback(null, xhr.response);
} else {
callback(status, xhr.response);
}
};
xhr.send();
};
window.addEventListener("load", function(){
//Get latest GIT hash first then initialize
getJSON('https://api.github.com/repos/MrAntares/roBrowserLegacy/commits/master',
function(err, data) {
var gitHash = 'NO_INFO';
if (err !== null) {
console.warn("Error reading latest GIT hash.");
} else {
if(data && data.sha){
gitHash = data.sha;
console.log("Latest GIT hash: "+gitHash);
} else {
console.warn('No hash found in response');
}
}
initialize(gitHash);
});
}, false);
</script>
</head>
<body>
<div id="robrowser">Initializing roBrowser...</div>
</body>
</html>