-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathlaunch_v78.html
More file actions
116 lines (101 loc) · 5.24 KB
/
launch_v78.html
File metadata and controls
116 lines (101 loc) · 5.24 KB
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
<!DOCTYPE html>
<html lang='en'>
<head>
<meta charset='UTF-8'>
<title>Starsector 2 - Definitive WebLauncher (v78)</title>
<script src='https://cjrtnc.leaningtech.com/4.2/loader.js'></script>
<style>
body { background: #000; color: #fff; font-family: 'Segoe UI', sans-serif; text-align: center; }
.container { max-width: 1200px; margin: 0 auto; padding: 20px; }
#game-container { margin: 20px auto; width: 1024px; height: 768px; border: 2px solid #00d9ff; position: relative; background: #111; }
#log { background: #111; padding: 15px; height: 300px; overflow-y: auto; text-align: left; font-family: monospace; font-size: 12px; border-left: 4px solid #00ff88; margin-top: 20px; }
.btn { padding: 15px 30px; font-size: 18px; font-weight: bold; border: none; border-radius: 8px; cursor: pointer; background: #00d9ff; color: #000; text-transform: uppercase; transition: 0.3s; }
.btn:hover { background: #00b8e6; transform: translateY(-2px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
</style>
</head>
<body>
<div class="container">
<h1>🚀 Starsector 2 Web (v78 - ROOT JAR MAPPED)</h1>
<p>Running Java via CheerpJ & WebAssembly on GitHub Pages</p>
<div style="margin: 20px 0;">
<button id='startBtn' class="btn">🚀 LAUNCH STARSECTOR</button>
</div>
<div id='game-container'></div>
<div id='log'>
<div style="color: #888;">[SYSTEM] Waiting for initialization...</div>
</div>
</div>
<script>
function log(m, color = '#fff') {
const l = document.getElementById('log');
if (l) {
const entry = document.createElement('div');
entry.style.color = color;
entry.textContent = `[${new Date().toLocaleTimeString()}] ${m}`;
l.appendChild(entry);
l.scrollTop = l.scrollHeight;
}
console.log(m);
}
document.getElementById('startBtn').addEventListener('click', async () => {
const btn = document.getElementById('startBtn');
btn.disabled = true;
btn.textContent = '⌛ INITIALIZING...';
log('Initializing CheerpJ 4.2 Runtime (Java 17)...', '#00d9ff');
try {
const origin = 'https://adybag14-cyber.github.io/';
const projectUrl = origin + 'starsectorquick/';
await cheerpjInit({
version: 17,
enableX11: true,
javaProperties: [
`java.library.path=/app/starsectorquick/build/final/wasm-modules/`,
`user.dir=/files/`,
`com.fs.starfarer.settings.linux=true`,
`org.lwjgl.opengl.Display.allowSoftwareOpenGL=true`,
`com.fs.starfarer.settings.paths.logs=/files/`
],
libraries: {
'libGL.so.1': `/app/starsectorquick/build/final/wasm-modules/gl4es.wasm`,
'liblwjgl.so': `/app/starsectorquick/build/final/wasm-modules/lwjgl.js`,
'liblwjgl64.so': `/app/starsectorquick/build/final/wasm-modules/lwjgl.js`,
'libsun_misc_Unsafe.so': `/app/starsectorquick/build/final/wasm-modules/unsafe.wasm`
},
mounts: [
{ type: 'http', path: '/app/', url: origin },
{ type: 'http', path: '/', url: projectUrl + 'jars/starfarer.res.jar' } // Mount to ROOT
]
});
log('Mounting Display to Canvas...', '#00ff88');
cheerpjCreateDisplay(1024, 768, document.getElementById('game-container'));
const jarFiles = [
'stubs.jar',
'resources.jar',
'janino.jar', 'commons-compiler.jar', 'starfarer.api.jar',
'starfarer_obf.jar', 'jogg-0.0.7.jar', 'jorbis-0.0.15.jar',
'json.jar', 'lwjgl.jar', 'jinput.jar', 'log4j-1.2.9.jar',
'lwjgl_util.jar', 'fs.sound_obf.jar', 'fs.common_obf.jar',
'xstream-1.4.10.jar'
];
const cp = jarFiles.map(j => '/app/starsectorquick/jars/' + j).concat([
'/res/',
'/res/data/config/'
]).join(':');
log('Final ClassPath: ' + cp);
log('Starting Definitive Main: WebLauncher', '#ff9f43');
btn.textContent = '🚀 RUNNING';
// Pass "/res" as the resource path to WebLauncher
await cheerpjRunMain('WebLauncher', cp, '/res');
log('Execution loop started. Watch for Java output.', '#00ff88');
} catch (e) {
log(`CRITICAL ERROR: ${e ? e.message : 'Unknown'}`, '#ff4444');
console.error(e);
btn.disabled = false;
btn.textContent = '❌ RETRY LAUNCH';
}
});
log('Welcome to Starsector Web Edition. System ready.');
</script>
</body>
</html>