Skip to content

Commit f8042e2

Browse files
Upload files
0 parents  commit f8042e2

File tree

8 files changed

+199
-0
lines changed

8 files changed

+199
-0
lines changed

build/icon.png

218 KB
Loading

build_win32.bat

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
call npm run dist-32bit
2+
pause
3+
Echo "Command Finished Successfully!"

package.json

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"name": "Sploder",
3+
"version": "1.0.0",
4+
"author": "Saptarshi",
5+
"description": "Sploder Launcher",
6+
"license": "MIT",
7+
"scripts": {
8+
"dev": "electron-webpack dev",
9+
"compile": "electron-webpack",
10+
"dist": "yarn compile && electron-builder",
11+
"dist-32bit": "yarn compile && electron-builder --ia32",
12+
"dist:dir": "yarn dist --dir -c.compression=store -c.mac.identity=null"
13+
},
14+
"dependencies": {
15+
"source-map-support": "^0.5.16"
16+
},
17+
"devDependencies": {
18+
"electron": "^8.2.0",
19+
"electron-builder": "^22.4.1",
20+
"electron-devtools-installer": "^3.2.0",
21+
"electron-webpack": "^2.8.2",
22+
"webpack": "~4.42.1"
23+
},
24+
"build": {
25+
"appId": "com.sploder",
26+
"productName": "Sploder",
27+
"nsis": {
28+
"allowElevation": "true",
29+
"oneClick": "false",
30+
"perMachine": "true",
31+
"allowToChangeInstallationDirectory": "true",
32+
"deleteAppDataOnUninstall": "true",
33+
"runAfterFinish": "true"
34+
},
35+
"extraResources": [
36+
"./plugins/**"
37+
]
38+
}
39+
}

plugins/libpepflashplayer.so

18 MB
Binary file not shown.

plugins/x32/pepflashplayer32.dll

17.1 MB
Binary file not shown.

plugins/x64/pepflashplayer.dll

29.9 MB
Binary file not shown.

src/main/index.js

Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
const { app, BrowserWindow } = require("electron");
2+
const path = require("path");
3+
const fs = require("fs");
4+
const { Menu } = require('electron')
5+
const isMac = process.platform === 'darwin'
6+
const template = [
7+
// { role: 'appMenu' }
8+
...(isMac ? [{
9+
label: app.name,
10+
submenu: [
11+
{ role: 'about' },
12+
{ type: 'separator' },
13+
{ role: 'services' },
14+
{ type: 'separator' },
15+
{ role: 'hide' },
16+
{ role: 'hideOthers' },
17+
{ role: 'unhide' },
18+
{ type: 'separator' },
19+
{ role: 'quit' }
20+
]
21+
}] : []),
22+
// { role: 'fileMenu' }
23+
{
24+
label: 'File',
25+
submenu: [
26+
isMac ? { role: 'close' } : { role: 'quit' }
27+
]
28+
},
29+
// { role: 'editMenu' }
30+
{
31+
label: 'Edit',
32+
submenu: [
33+
{ role: 'undo' },
34+
{ role: 'redo' },
35+
{ type: 'separator' },
36+
{ role: 'cut' },
37+
{ role: 'copy' },
38+
{ role: 'paste' },
39+
...(isMac ? [
40+
{ role: 'pasteAndMatchStyle' },
41+
{ role: 'delete' },
42+
{ role: 'selectAll' },
43+
{ type: 'separator' },
44+
{
45+
label: 'Speech',
46+
submenu: [
47+
{ role: 'startSpeaking' },
48+
{ role: 'stopSpeaking' }
49+
]
50+
}
51+
] : [
52+
{ role: 'delete' },
53+
{ type: 'separator' },
54+
{ role: 'selectAll' }
55+
])
56+
]
57+
},
58+
// { role: 'viewMenu' }
59+
{
60+
label: 'View',
61+
submenu: [
62+
{ role: 'reload' },
63+
{ role: 'forceReload' },
64+
{ role: 'toggleDevTools' },
65+
{ type: 'separator' },
66+
{ role: 'resetZoom' },
67+
{ role: 'zoomIn' },
68+
{ role: 'zoomOut' },
69+
{ type: 'separator' },
70+
{ role: 'togglefullscreen' }
71+
]
72+
},
73+
]
74+
const menu = Menu.buildFromTemplate(template)
75+
76+
let win;
77+
let pluginName;
78+
79+
switch (process.platform) {
80+
case "win32":
81+
pluginName = process.arch == 'x64' ? 'x64/pepflashplayer.dll' : 'x32/pepflashplayer32.dll';
82+
break;
83+
case 'linux':
84+
pluginName = 'libpepflashplayer.so'
85+
break;
86+
default:
87+
pluginName = 'x64/pepflashplayer.dll';
88+
break;
89+
}
90+
91+
app.commandLine.appendSwitch(
92+
"ppapi-flash-path",
93+
path.join(__dirname + pluginName)
94+
);
95+
app.commandLine.appendSwitch("ppapi-flash-version", "32.0.0.371");
96+
97+
98+
function createWindow() {
99+
Menu.setApplicationMenu(menu)
100+
win = new BrowserWindow({
101+
webPreferences: {
102+
nodeIntegration: false,
103+
contextIsolation: false,
104+
plugins: true,
105+
},
106+
});
107+
108+
109+
win.maximize();
110+
win.loadURL("https://sploder.us.to/play.php");}
111+
112+
app.whenReady().then(() => {
113+
createWindow();
114+
115+
app.on("activate", function () {
116+
if (BrowserWindow.getAllWindows().length === 0) createWindow();
117+
});
118+
});
119+
120+
app.on("window-all-closed", function () {
121+
if (process.platform !== "darwin") app.quit();
122+
});
123+
124+
125+
const clientId = '915116210570539058';
126+
const rpc = new DiscordRPC.Client({ transport: 'ipc' });
127+
const startTimestamp = new Date();
128+
129+
async function setActivity() {
130+
if (!rpc || !win) {
131+
return;
132+
}
133+
const boops = await win.webContents.executeJavaScript('window.boops');
134+
135+
// You'll need to have snek_large and snek_small assets uploaded to
136+
// https://discord.com/developers/applications/<application_id>/rich-presence/assets
137+
rpc.setActivity({
138+
details: `${boops}`,
139+
startTimestamp,
140+
largeImageKey: 'icon',
141+
largeImageText: `${boops}`
142+
});
143+
}
144+
145+
rpc.on('ready', () => {
146+
setActivity();
147+
148+
// activity can only be set every 15 seconds
149+
setInterval(() => {
150+
setActivity();
151+
}, 15e3);
152+
});
153+
154+
rpc.login({ clientId }).catch(console.error);
155+

src/renderer/index.js

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)