forked from Orkin/roBrowser
-
Notifications
You must be signed in to change notification settings - Fork 0
/
api.html
47 lines (43 loc) · 1.85 KB
/
api.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
<!DOCTYPE html>
<html>
<head>
<title>Ragnarok Online in the Browser powered by roBrowser</title>
<script type="text/javascript">
var ROConfig = {};
addEventListener('message', function()
{
return function OnMessage( event )
{
removeEventListener( 'message', OnMessage, false );
ROConfig.grfList = event.data.grfList || null;
ROConfig.servers = event.data.servers || 'data/clientinfo.xml';
ROConfig.remoteClient = event.data.remoteClient || '';
ROConfig.packetver = event.data.packetver || 'auto';
ROConfig.development = event.data.development || false;
ROConfig.API = event.data.api || false;
ROConfig.socketProxy = event.data.socketProxy || null;
ROConfig.packetKeys = event.data.packetKeys || false;
ROConfig.skipServerList = event.data.skipServerList || false;
ROConfig.skipIntro = event.data.skipIntro || false;
ROConfig.autoLogin = event.data.autoLogin || [];
ROConfig.version = event.data.version || '';
if (ROConfig.development) {
var script = document.createElement('script');
script.src = 'src/Vendors/require.js?' + ROConfig.version;
script.type = 'text/javascript';
script.setAttribute('data-main', 'src/App/' + event.data.application) + '?' + ROConfig.version;
document.getElementsByTagName('head')[0].appendChild(script);
event.source.postMessage('ready', '*' );
}
else {
var app = document.createElement('script');
app.type = 'text/javascript';
app.src = 'build/' + event.data.application + '.js?' + ROConfig.version;
document.getElementsByTagName('head')[0].appendChild(app);
event.source.postMessage('ready', '*' );
}
};
}(), false);
</script>
</head>
</html>