mirror of
https://github.com/EasyTier/EasytierGame.git
synced 2025-05-19 10:27:56 +00:00
25 lines
717 B
TypeScript
25 lines
717 B
TypeScript
import useMainStore from "@/stores/index";
|
|
export const getServerArgs = () => {
|
|
const mainStore = useMainStore();
|
|
const args = [];
|
|
if (!mainStore.serverConfig.port) {
|
|
mainStore.serverConfig.port = "11010";
|
|
}
|
|
args.push("-l", mainStore.serverConfig.port);
|
|
if (mainStore.serverConfig.relayAllPeerrpc) {
|
|
args.push("--relay-all-peer-rpc");
|
|
}
|
|
const whiteList = mainStore.serverConfig.serverWhiteList
|
|
.trim()
|
|
.split("\n")
|
|
.map(el => el.trim())
|
|
.filter(el => el)
|
|
if (whiteList && mainStore.serverConfig.enableWhiteList) {
|
|
args.push("--relay-network-whitelist", ...whiteList);
|
|
}
|
|
if (!whiteList && mainStore.serverConfig.enableWhiteList) {
|
|
args.push("--relay-network-whitelist");
|
|
}
|
|
return args;
|
|
};
|