Skip to content

Commit

Permalink
[0.4.4] Fixed some minor issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Ipmake committed Jun 10, 2023
1 parent a147495 commit 7275adb
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 12 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "knockoutcitylauncher",
"description": "Unofficial Knockout City Launcher",
"version": "0.4.3",
"version": "0.4.4",
"private": true,
"homepage": "./",
"main": "public/electron.js",
Expand Down
32 changes: 25 additions & 7 deletions public/electron.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ function createWindow () {
largeImageKey: 'logo',
largeImageText: 'Knockout City',
instance: false,

}).catch(console.error);


Expand Down Expand Up @@ -277,7 +276,7 @@ function createWindow () {
console.log(error.message);
// Make the directory using sudoer and edit the permissions of the directory to allow everyone to write to it windows only
await new Promise((resolve, reject) => {
sudo.exec(`mkdir "${arg.path}" && icacls "${arg.path}" /grant ${os.userInfo().username}:(OI)(CI)F /T`, { name: 'Knockout City Launcher' }, (error, stdout, stderr) => {
sudo.exec(`mkdir "${arg.path}" && icacls "${arg.path}" /grant "${os.userInfo().username}":(OI)(CI)F /T`, { name: 'Knockout City Launcher' }, (error, stdout, stderr) => {
if (error)
reject(new Error(error.message)), console.log(error);
else {
Expand All @@ -294,7 +293,7 @@ function createWindow () {
console.log(error.message);
// Make the directory using sudoer and edit the permissions of the directory to allow everyone to write to it windows only
await new Promise((resolve, reject) => {
sudo.exec(`icacls "${arg.path}" /grant ${os.userInfo().username}:(OI)(CI)F /T`, { name: 'Knockout City Launcher' }, (error, stdout, stderr) => {
sudo.exec(`icacls "${arg.path}" /grant "${os.userInfo().username}":(OI)(CI)F /T`, { name: 'Knockout City Launcher' }, (error, stdout, stderr) => {
if (error)
reject(new Error(error.message)), console.log(error);
else
Expand Down Expand Up @@ -521,14 +520,14 @@ function createWindow () {
state: rpcSettings.displayName ? `Server: ${arg.serverName}` : undefined,
startTimestamp: Date.now(),
largeImageKey: "logo",
largeImageText: "Running the Ip man launcher",
largeImageText: gimmeEmoji().repeat(5),
instance: true,

// partyId: rpcSettings.partyId,
// partySize: rpcSettings.partySize,
// partyMax: rpcSettings.partyMax,
// joinSecret: rpcSettings.joinSecret,
})
}).catch(console.error);
})

game.once('close', (code) => {
Expand Down Expand Up @@ -745,7 +744,7 @@ async function setUpPermission(path) {
console.log(error.message);
// Make the directory using sudoer and edit the permissions of the directory to allow everyone to write to it windows only
await new Promise((resolve, reject) => {
sudo.exec(`icacls "${path}" /grant ${os.userInfo().username}:(OI)(CI)F /T`, { name: 'Knockout City Launcher' }, (error, stdout, stderr) => {
sudo.exec(`icacls "${path}" /grant "${os.userInfo().username}":(OI)(CI)F /T`, { name: 'Knockout City Launcher' }, (error, stdout, stderr) => {
if (error) reject("Could not raise permissions"), console.log(error);
else resolve();
});
Expand Down Expand Up @@ -782,4 +781,23 @@ process.on('unhandledRejection', function (err) {
message: "An unexpected error occurred. Error: " + err.message
})
console.log(err);
});
});

function gimmeEmoji() {
let i = Math.floor(Math.random() * 10)

let emojis = [
"💀",
"💯",
"🤓",
"🎈",
"🗿",
"👋",
"🏀",
"🎖️",
"🎉",
"🎊"
];

return emojis[i]
}
12 changes: 8 additions & 4 deletions src/components/ServersMenu.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,15 @@ function ServersMenu(props) {
<Table>
<TableHead>
<TableRow style={{ position: 'sticky' }}>
<TableCell></TableCell>
<TableCell width='20px' style={{
paddingRight: '0px',
}}></TableCell>
<TableCell>Name</TableCell>
<TableCell align="right">Region</TableCell>
<TableCell align="right" style={{
paddingLeft: '0px',
}}>Region</TableCell>
<TableCell align="right">Players</TableCell>
<TableCell align="right">
<TableCell align="right" width='20px'>
<IconButton onClick={() => {
setPublicServers("loading")
fetchservers()
Expand All @@ -63,7 +67,7 @@ function ServersMenu(props) {
<TableBody>
{publicServers.map((server, i) => (
<TableRow key={i}>
<TableCell size="small" width='40px'><Avatar
<TableCell size="small" width='40px' style={{ paddingRight: '0px' }}><Avatar
sx={{ bgcolor: server.status === 'online' ? 'green' : 'red', width: '20px', height: '20px', fontSize: '20px'}}
sizes="small"
>&#8203;
Expand Down

0 comments on commit 7275adb

Please sign in to comment.