Skip to content

Commit

Permalink
Upload files
Browse files Browse the repository at this point in the history
  • Loading branch information
Sploder-Saptarshi committed Sep 11, 2022
0 parents commit f8042e2
Show file tree
Hide file tree
Showing 8 changed files with 199 additions and 0 deletions.
Binary file added build/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions build_win32.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
call npm run dist-32bit
pause
Echo "Command Finished Successfully!"
39 changes: 39 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"name": "Sploder",
"version": "1.0.0",
"author": "Saptarshi",
"description": "Sploder Launcher",
"license": "MIT",
"scripts": {
"dev": "electron-webpack dev",
"compile": "electron-webpack",
"dist": "yarn compile && electron-builder",
"dist-32bit": "yarn compile && electron-builder --ia32",
"dist:dir": "yarn dist --dir -c.compression=store -c.mac.identity=null"
},
"dependencies": {
"source-map-support": "^0.5.16"
},
"devDependencies": {
"electron": "^8.2.0",
"electron-builder": "^22.4.1",
"electron-devtools-installer": "^3.2.0",
"electron-webpack": "^2.8.2",
"webpack": "~4.42.1"
},
"build": {
"appId": "com.sploder",
"productName": "Sploder",
"nsis": {
"allowElevation": "true",
"oneClick": "false",
"perMachine": "true",
"allowToChangeInstallationDirectory": "true",
"deleteAppDataOnUninstall": "true",
"runAfterFinish": "true"
},
"extraResources": [
"./plugins/**"
]
}
}
Binary file added plugins/libpepflashplayer.so
Binary file not shown.
Binary file added plugins/x32/pepflashplayer32.dll
Binary file not shown.
Binary file added plugins/x64/pepflashplayer.dll
Binary file not shown.
155 changes: 155 additions & 0 deletions src/main/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
const { app, BrowserWindow } = require("electron");
const path = require("path");
const fs = require("fs");
const { Menu } = require('electron')
const isMac = process.platform === 'darwin'
const template = [
// { role: 'appMenu' }
...(isMac ? [{
label: app.name,
submenu: [
{ role: 'about' },
{ type: 'separator' },
{ role: 'services' },
{ type: 'separator' },
{ role: 'hide' },
{ role: 'hideOthers' },
{ role: 'unhide' },
{ type: 'separator' },
{ role: 'quit' }
]
}] : []),
// { role: 'fileMenu' }
{
label: 'File',
submenu: [
isMac ? { role: 'close' } : { role: 'quit' }
]
},
// { role: 'editMenu' }
{
label: 'Edit',
submenu: [
{ role: 'undo' },
{ role: 'redo' },
{ type: 'separator' },
{ role: 'cut' },
{ role: 'copy' },
{ role: 'paste' },
...(isMac ? [
{ role: 'pasteAndMatchStyle' },
{ role: 'delete' },
{ role: 'selectAll' },
{ type: 'separator' },
{
label: 'Speech',
submenu: [
{ role: 'startSpeaking' },
{ role: 'stopSpeaking' }
]
}
] : [
{ role: 'delete' },
{ type: 'separator' },
{ role: 'selectAll' }
])
]
},
// { role: 'viewMenu' }
{
label: 'View',
submenu: [
{ role: 'reload' },
{ role: 'forceReload' },
{ role: 'toggleDevTools' },
{ type: 'separator' },
{ role: 'resetZoom' },
{ role: 'zoomIn' },
{ role: 'zoomOut' },
{ type: 'separator' },
{ role: 'togglefullscreen' }
]
},
]
const menu = Menu.buildFromTemplate(template)

let win;
let pluginName;

switch (process.platform) {
case "win32":
pluginName = process.arch == 'x64' ? 'x64/pepflashplayer.dll' : 'x32/pepflashplayer32.dll';
break;
case 'linux':
pluginName = 'libpepflashplayer.so'
break;
default:
pluginName = 'x64/pepflashplayer.dll';
break;
}

app.commandLine.appendSwitch(
"ppapi-flash-path",
path.join(__dirname + pluginName)
);
app.commandLine.appendSwitch("ppapi-flash-version", "32.0.0.371");


function createWindow() {
Menu.setApplicationMenu(menu)
win = new BrowserWindow({
webPreferences: {
nodeIntegration: false,
contextIsolation: false,
plugins: true,
},
});


win.maximize();
win.loadURL("https://sploder.us.to/play.php");}

app.whenReady().then(() => {
createWindow();

app.on("activate", function () {
if (BrowserWindow.getAllWindows().length === 0) createWindow();
});
});

app.on("window-all-closed", function () {
if (process.platform !== "darwin") app.quit();
});


const clientId = '915116210570539058';
const rpc = new DiscordRPC.Client({ transport: 'ipc' });
const startTimestamp = new Date();

async function setActivity() {
if (!rpc || !win) {
return;
}
const boops = await win.webContents.executeJavaScript('window.boops');

// You'll need to have snek_large and snek_small assets uploaded to
// https://discord.com/developers/applications/<application_id>/rich-presence/assets
rpc.setActivity({
details: `${boops}`,
startTimestamp,
largeImageKey: 'icon',
largeImageText: `${boops}`
});
}

rpc.on('ready', () => {
setActivity();

// activity can only be set every 15 seconds
setInterval(() => {
setActivity();
}, 15e3);
});

rpc.login({ clientId }).catch(console.error);

2 changes: 2 additions & 0 deletions src/renderer/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f8042e2

Please sign in to comment.