-
Notifications
You must be signed in to change notification settings - Fork 0
/
index_multiplayertest.html
183 lines (165 loc) · 7.47 KB
/
index_multiplayertest.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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
<html>
<head>
<meta charset="utf-8">
<title>ClassiCube (Loading...)</title>
<link type="image/x-icon" rel="shortcut icon" href="images/cc-logo.svg" />
<meta name="viewport" content="width=device-width">
<meta name="theme-color" content="#9873ac">
<link href="css/css.css" rel="stylesheet" type="text/css">
<link href="css/fi.css" rel="stylesheet" type="text/css">
<link href="css/style.css" rel="stylesheet" type="text/css">
</head>
<body>
<div id="header">
<div class="row">
<a href="https://www.classicube.net/"><h1 class="small-12 medium-1 columns">ClassiCube</h1></a>
<span id="mnav_cont" class="show-for-small-only">
<label for="navtoggle">
<div id="navtoggle_btn"><i class="fi-list"> </i></div>
</label>
<input type="checkbox" style="display:none;" id="navtoggle">
<div id="mnav">
<a href="index_multiplayertest.html">Reload</a><a href="https://github.com/Richi2PL/Offline-Singleplayer-ClassiCube/">Source</a><a href="https://github.com/Richi2PL/Offline-Singleplayer-ClassiCube/issues/">Issues</a><a href="https://github.com/Richi2PL/" class="button">Richi2's Github</a>
</div>
</span>
<div id="nav" class="show-for-medium-up">
<a href="index_multiplayertest.html">Reload</a><a href="https://github.com/Richi2PL/Offline-Singleplayer-ClassiCube/">Source</a><a href="https://github.com/Richi2PL/Offline-Singleplayer-ClassiCube/issues/">Issues</a><a href="https://github.com/Richi2PL/" class="button">Richi2's Github</a>
</div>
</div>
</div>
<div id="body">
<style>
#main {
border-top: #594965 1px solid;
background-color: #977dab;
background-image: url(images/geometric.png),url(images/content_pgradient.png),url(images/content_pnoise.png);
background-repeat: repeat, repeat-x, repeat;
background-attachment: fixed,scroll,scroll;
}
.container {
width: 1024px;
margin: auto;
}
#game {
box-shadow: 0px 3px 5px rgba(0,0,0,.5);
border: 1px #4F435A solid;
}
#content {
padding: 0px 0;
background: url(images/bc_gradient.png) repeat-x;
}
.emscripten { padding-right: 0; margin-left: auto; margin-right: auto; display: block; }
div.emscripten { text-align: center; }
div.emscripten_border { border: 1px solid black; }
/* the canvas *must not* have any border or padding, or mouse coords will be wrong */
canvas.emscripten { border: 0px none; background-color: black; }
</style>
<div id="main">
<div class="container" style="width: 854px; height: 480px; padding: 25px 0;">
<div id="game">
<canvas class="emscripten" id="canvas" oncontextmenu="event.preventDefault()" tabindex="-1" width="854" height="480"></canvas>
</div>
<span id="logmsg" style="font-size:18px;font-family:'Source Sans Pro', sans-serif;color:#F67;text-shadow:1px 1px 5px rgba(0,0,0,.5);font-weight:bold;text-align:center;">Running...</span>
</div>
</div>
<script type="text/javascript" referrerpolicy="no-referrer-when-downgrade">
function logText(text) {
console.log(text);
var logElement = document.getElementById('logmsg');
logElement.innerHTML = text;
}
// ensure game still runs even without IndexedDB
var idb = window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB;
if (!idb) { alert('IndexedDB unsupported, therefore\nmaps and settings will not save');window.mozIndexedDB = {}; }
// need to load IndexedDB before running the game
function preloadIndexedDB() { _interop_LoadIndexedDB(); }
function forceTouchLayout() {
var elem;
try {
elem = document.getElementById('footer');
elem.parentNode.removeChild(elem);
elem = document.getElementById('content');
elem.parentNode.removeChild(elem);
} catch (err) { }
}
function getCssInt(styles, prop) { return parseInt(styles.getPropertyValue(prop), 10); }
function calcViewportWidth(elem) {
var parent = elem.parentNode;
var styles = window.getComputedStyle(parent, null);
return parent.offsetWidth - getCssInt(styles, 'padding-left') - getCssInt(styles, 'padding-right');
}
function resizeGameCanvas() {
var cc_canv = document.getElementById('canvas');
var dpi = window.devicePixelRatio;
var aspect_ratio = 16/9;
var viewport_w = calcViewportWidth(cc_canv);
var viewport_h = viewport_w / aspect_ratio;
var canv_w = Math.round(viewport_w);
var canv_h = Math.round(viewport_h);
if (canv_h % 2) { canv_h = canv_h - 1; }
if (canv_w % 2) { canv_w = canv_w - 1; }
cc_canv.width = canv_w * dpi;
cc_canv.height = canv_h * dpi;
}
function logFatal(event) {
Module.setStatus('ClassiCube has crashed (' + event + ')\nPlease report this on the ClassiCube forums or to UnknownShadow200\n\nTo see more details, open Developer Tools and go to Console tab');
Module.setStatus = function(text) {
if (event) Module.printErr('[post-exception status] ' + event);
};
}
var Module = {
preRun: [ preloadIndexedDB, resizeGameCanvas ],
postRun: [],
arguments: ['(YOURNAMEHERE)', '(NEWPASSWORDWHENJOININGTOSERVER)', '(IP/WS OFSERVER)', '(PORTOFSERVER)'],
print: function(text) {
if (arguments.length > 1) text = Array.prototype.slice.call(arguments).join(' ');
console.log(text);
},
printErr: function(text) {
if (arguments.length > 1) text = Array.prototype.slice.call(arguments).join(' ');
console.error(text);
},
canvas: (function() {
return document.getElementById('canvas');
})(),
setStatus: logText,
totalDependencies: 0,
monitorRunDependencies: function(left) {
this.totalDependencies = Math.max(this.totalDependencies, left);
Module.setStatus(left ? 'Preparing... (' + (this.totalDependencies-left) + '/' + this.totalDependencies + ')' : 'All downloads complete.');
},
onAbort: function(why) { logFatal('abort: ' + why); }
};
Module.setStatus('Downloading...');
window.onerror = function(event) { logFatal(event); };
function onDownloadFailed(src) {
// retry without CORS
logText('Failed to download ClassiCube.js, retrying..');
var root = src.parentNode;
root.removeChild(src);
var elem = document.createElement('script');
elem.setAttribute('async', '');
elem.setAttribute('src', 'ClassiCube.js');
root.appendChild(elem);
}
</script>
<script async="" crossorigin="" type="text/javascript" src="ClassiCube.js" onerror="onDownloadFailed(this)" referrerpolicy="no-referrer-when-downgrade"></script>
<div id="content">
<div class="container" style="text-align:center;">
<h3>Default Controls</h3>
<img src="images/controls.png" style="margin:auto;">
</div>
</div>
</div>
<div id="footer" class="row">
<div class="small-6 medium-4 columns flinks">
<a href="https://github.com/Richi2PL/Offline-Singleplayer-ClassiCube"><i class="fi-social-github"></i> Client Source Code</a>
<a href="https://github.com/Richi2PL/Offline-Singleplayer-ClassiCube/issues" class="h-alert"><i class="fi-alert"></i> Client Issues</a>
<a href="https://github.com/Richi2PL/" class="h-discord"><i class="fi-comments"></i> Richi2's Github</a>
</div>
<div class="small-12 medium-4 columns">
<p id="copyright">ClassiCube is in no way affiliated with Mojang AB, Microsoft, or any of their partners or products. <a href="https://www.classicube.net/terms/"> ClassiCube Terms of use</a></p>
<img src="images/newblocks.png" style="margin:auto;">
</div>
</div>
</body></html>