-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
167 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
 | ||
 | ||
|
||
> The most pragmatic and efficient way to orchestrate multiple Minecraft servers. |
File renamed without changes
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import React from "react"; | ||
import { InstanceOptions } from "../types"; | ||
|
||
import fabricLogo from "../../img/fabric_logo.png"; | ||
import paperLogo from "../../img/paper_logo.png"; | ||
import vanillaLogo from "../../img/vanilla_logo.png"; | ||
|
||
const images = { | ||
fabric: fabricLogo, | ||
paper: paperLogo, | ||
vanilla: vanillaLogo, | ||
} as const; | ||
|
||
interface InstanceProps { | ||
info: InstanceOptions; | ||
} | ||
|
||
const Instance = ({ info }: InstanceProps): JSX.Element => { | ||
return ( | ||
<div className="rounded-md border-2 border-gray-800 p-1 m-2 flex flex-col justify-center items-center"> | ||
<img src={images[info.type]} width={64} /> | ||
<p>{info.name}</p> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Instance; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { app } from "electron"; | ||
|
||
import path from "path"; | ||
|
||
export const resourcesPath = app.isPackaged | ||
? process.resourcesPath | ||
: path.join(process.cwd(), "resources"); | ||
|
||
export const instancesPath = path.join(app.getPath("userData"), "instances"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import fs from "fs/promises"; | ||
import path from "path"; | ||
|
||
import type { InstanceOptions, InstanceInfo } from "../../types"; | ||
import { instancesPath } from "../constants"; | ||
|
||
export async function getInstances(): Promise<InstanceInfo[]> { | ||
const instances = await fs.readdir(instancesPath); | ||
|
||
return Promise.all( | ||
instances.map(async (instance) => { | ||
const conf = await fs.readFile( | ||
path.join(instancesPath, instance, "multiserver.config.json"), | ||
"utf8" | ||
); | ||
|
||
return { | ||
path: path.join(instancesPath, instance), | ||
info: JSON.parse(conf) as InstanceOptions, | ||
}; | ||
}) | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,19 @@ | ||
export interface InstanceOptions { | ||
name: string; | ||
type: | ||
| "vanilla" | ||
| "spigot" | ||
| "bukkit" | ||
| "paper" | ||
| "fabric" | ||
| "purpur" | ||
| "tuinity" | ||
| "fabric"; | ||
|
||
type: "vanilla" | "paper" | "fabric"; | ||
version: string; | ||
javaPath?: string; | ||
jvmArgs?: string; | ||
} | ||
|
||
export interface InstanceInfo { | ||
path: string; | ||
info: InstanceOptions; | ||
} | ||
|
||
export type IpcChannels = { | ||
newInstanceWindow: () => void; | ||
createInstance: (opts: InstanceOptions) => Promise<boolean>; | ||
closeWindow: () => void; | ||
getInstances: () => Promise<InstanceInfo[]>; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters