diff --git a/frontend/src/components/Slider.tsx b/frontend/src/components/Slider.tsx new file mode 100644 index 0000000..af0b05d --- /dev/null +++ b/frontend/src/components/Slider.tsx @@ -0,0 +1,30 @@ +import React from "react"; +import {server} from "../../wailsjs/go/models"; +import {Input, Slider as Sl} from "@mui/joy"; +type Props = { + value: number; + onChange: (value: number) => void; + className?: string; + sliderMax?: number; + sliderStep?: number; + sliderMin?: number; + disabled?: boolean; + +} + +export function Slider({value, onChange, className, sliderMax, sliderStep, sliderMin, disabled}:Props) { + return ( +
+
+ { + let val = v as number + onChange(val); + }} > + { + let val = parseInt(e.target.value); + onChange(val); + }}> +
+
+ ); +} \ No newline at end of file diff --git a/frontend/src/pages/Server.tsx b/frontend/src/pages/Server.tsx index 2bfeecc..8f73aaa 100644 --- a/frontend/src/pages/Server.tsx +++ b/frontend/src/pages/Server.tsx @@ -31,7 +31,8 @@ import {Console} from "./server/Console"; import {UpdaterModal} from "./UpdaterModal"; import {InstallUpdateVerify} from "../../wailsjs/go/installer/InstallerController"; import {SendRconCommand} from "../../wailsjs/go/helpers/HelpersController"; -import {Settings} from "./server/Settings"; +import {Mods} from "./server/Mods"; +import {Multipliers} from "./server/Multipliers"; type Props = { @@ -217,12 +218,14 @@ export const Server = ({id, className}: Props) => { Console General Settings - Server Settings + Mods + Multipliers Administration - + + CheckServerInstalled(serv.id).then((val) => setIsInstalled(val)).catch((reason) => console.error(reason))}/> ) : ( setIsInstalled(true)}/>)} diff --git a/frontend/src/pages/server/Administration.tsx b/frontend/src/pages/server/Administration.tsx index abeaaae..8febc0c 100644 --- a/frontend/src/pages/server/Administration.tsx +++ b/frontend/src/pages/server/Administration.tsx @@ -306,7 +306,7 @@ function ExtraSettingsCard({setServ, serv}: {setServ: React.Dispatch + diff --git a/frontend/src/pages/server/General.tsx b/frontend/src/pages/server/General.tsx index fabb811..3e6aadc 100644 --- a/frontend/src/pages/server/General.tsx +++ b/frontend/src/pages/server/General.tsx @@ -6,13 +6,14 @@ import { Select, TabPanel, Typography, - Option, + Option, Autocomplete, Textarea, Tooltip, Checkbox, } from "@mui/joy"; import {server} from "../../../wailsjs/go/models"; import React, {useEffect, useState} from "react"; import {GetNetworkInterfacesIp} from "../../../wailsjs/go/server/ServerController"; import {PasswordInput} from "../../components/PasswordInput"; +import {Slider} from "../../components/Slider"; type Props = { setServ: React.Dispatch> @@ -20,28 +21,147 @@ type Props = { } -function ServerNameAndPasswordsCard({ setServ, serv }: {setServ: React.Dispatch>, serv: server.Server}) { +function GeneralSettings({ setServ, serv }: {setServ: React.Dispatch>, serv: server.Server}) { return ( - Server Name and Passwords + Server Name and Passwords - - Server Name: - setServ((p) => ({ ...p, serverName: e.target.value, convertValues: p.convertValues }))} > -
-
+
+
+ Server Name: + setServ((p) => ({ ...p, serverName: e.target.value, convertValues: p.convertValues }))} > +
+
Server Password: - setServ((p) => ({ ...p, serverPassword: e.target.value, convertValues: p.convertValues }))} > + setServ((p) => ({ ...p, serverPassword: e.target.value, convertValues: p.convertValues }))} >
-
+
Admin Password: setServ((p) => ({ ...p, adminPassword: e.target.value, convertValues: p.convertValues }))} >
-
+
Spectator Password: - setServ((p) => ({ ...p, spectatorPassword: e.target.value, convertValues: p.convertValues }))} > + setServ((p) => ({ ...p, spectatorPassword: e.target.value, convertValues: p.convertValues }))} > +
+
+ + Server Map + + +
+
+ Map Name of Mod Map path: + setServ((p) => ({ ...p, serverMap: v, convertValues: p.convertValues }))} > +
+
+ + Auto Save + + +
+
+ Auto Save interval: + + { + if (v >= 0) { + setServ((p) => { + const newState = {...p, convertValues: p.convertValues}; + newState.gameUserSettings.serverSettings.autoSavePeriodMinutes = v; + return newState; + }) + } + }} + /> + + +
+
+ + Message of the Day + + +
+
+ Message + +
+
+ Duration: + + { + if (v >= 0) { + setServ((p) => { + const newState = {...p, convertValues: p.convertValues}; + newState.gameUserSettings.messageOfTheDay.duration = v; + return newState; + }) + } + }} + /> + + +
+
+ + Server Settings + + +
+
+
+ Max Players: + { + if (v >= 0) { + setServ((p) => { + const newState = {...p, convertValues: p.convertValues}; + newState.maxPlayers = v; + return newState; + }) + } + }} + /> +
+
+ + setServ((p) => ({ ...p, kickIdlePlayers: e.target.checked, convertValues: p.convertValues }))}/> Kick Idle Players Period: + + { + if (v >= 0) { + setServ((p) => { + const newState = {...p, convertValues: p.convertValues}; + newState.gameUserSettings.serverSettings.kickIdlePlayersPeriod = v; + return newState; + }) + } + }} + /> + +
@@ -120,7 +240,7 @@ function NetworkingCard({ setServ, serv }: {setServ: React.Dispatch - + ); diff --git a/frontend/src/pages/server/Settings.tsx b/frontend/src/pages/server/Mods.tsx similarity index 65% rename from frontend/src/pages/server/Settings.tsx rename to frontend/src/pages/server/Mods.tsx index 5aebb1a..5cf66c8 100644 --- a/frontend/src/pages/server/Settings.tsx +++ b/frontend/src/pages/server/Mods.tsx @@ -15,27 +15,17 @@ type Props = { function GeneralServerSettingsCard({ setServ, serv }: {setServ: React.Dispatch>, serv: server.Server}) { return ( - - General Server Settings - - -
Mods (e.g.: modid1,modid2,modid3) (for now you need to set "ACTIVEMODS" to ini manually) setServ((p) => ({ ...p, mods: e.target.value, convertValues: p.convertValues }))}> - Player limit - { - if (parseInt(e.target.value) > 0) { - setServ((p) => ({...p, maxPlayers: parseInt(e.target.value), convertValues: p.convertValues})) - }}}>
) } -export function Settings({setServ, serv}: Props) { +export function Mods({setServ, serv}: Props) { return ( diff --git a/frontend/src/pages/server/Multipliers.tsx b/frontend/src/pages/server/Multipliers.tsx new file mode 100644 index 0000000..30c95cb --- /dev/null +++ b/frontend/src/pages/server/Multipliers.tsx @@ -0,0 +1,1470 @@ +import React from "react"; +import {server} from "../../../wailsjs/go/models"; +import { + Card, + Divider, FormLabel, Input, + TabPanel, Tooltip, + Typography +} from "@mui/joy"; +import {Slider} from "../../components/Slider"; + +type Props = { + setServ: React.Dispatch> + serv: server.Server; +} + + +function GeneralMultipliers({ setServ, serv }: {setServ: React.Dispatch>, serv: server.Server}) { + return ( +
+ + General Multipliers + + +
+
+ + Item Stack Size Multiplier + + { + if (v >= 0) { + setServ((p) => { + const newState = {...p, convertValues: p.convertValues}; + newState.gameUserSettings.serverSettings.itemStackSizeMultiplier = v; + return newState; + }) + } + }} + /> +
+
+ + XP Multiplier + + { + if (v >= 0) { + setServ((p) => { + const newState = {...p, convertValues: p.convertValues}; + newState.gameUserSettings.serverSettings.xPMultiplier = v; + return newState; + }) + } + }} + /> +
+
+ + Base Temperature Multiplier + + { + if (v >= 0) { + setServ((p) => { + const newState = {...p, convertValues: p.convertValues}; + newState.game.ScriptShootergameShootergamemode.baseTemperatureMultiplier = v; + return newState; + }) + } + }} + /> +
+
+ + Crop Decay Speed Multiplier + + { + if (v >= 0) { + setServ((p) => { + const newState = {...p, convertValues: p.convertValues}; + newState.game.ScriptShootergameShootergamemode.cropDecaySpeedMultiplier = v; + return newState; + }) + } + }} + /> +
+
+ + Crop Growth Speed Multiplier + + { + if (v >= 0) { + setServ((p) => { + const newState = {...p, convertValues: p.convertValues}; + newState.game.ScriptShootergameShootergamemode.cropGrowthSpeedMultiplier = v; + return newState; + }) + } + }} + /> +
+
+ + Custom Recipe Effectiveness Multiplier + + { + if (v >= 0) { + setServ((p) => { + const newState = {...p, convertValues: p.convertValues}; + newState.game.ScriptShootergameShootergamemode.customRecipeEffectivenessMultiplier = v; + return newState; + }) + } + }} + /> +
+
+ + Custom Recipe Effectiveness Multiplier + + { + if (v >= 0) { + setServ((p) => { + const newState = {...p, convertValues: p.convertValues}; + newState.game.ScriptShootergameShootergamemode.customRecipeEffectivenessMultiplier = v; + return newState; + }) + } + }} + /> +
+
+ + Custom Recipe Skill Multiplier + + { + if (v >= 0) { + setServ((p) => { + const newState = {...p, convertValues: p.convertValues}; + newState.game.ScriptShootergameShootergamemode.customRecipeSkillMultiplier = v; + return newState; + }) + } + }} + /> +
+
+ + Fishing Loot Quality Multiplier + + { + if (v >= 0) { + setServ((p) => { + const newState = {...p, convertValues: p.convertValues}; + newState.game.ScriptShootergameShootergamemode.fishingLootQualityMultiplier = v; + return newState; + }) + } + }} + /> +
+
+ + Fuel Consumption Interval Multiplier + + { + if (v >= 0) { + setServ((p) => { + const newState = {...p, convertValues: p.convertValues}; + newState.game.ScriptShootergameShootergamemode.fuelConsumptionIntervalMultiplier = v; + return newState; + }) + } + }} + /> +
+
+ + Generic XP Multiplier + + { + if (v >= 0) { + setServ((p) => { + const newState = {...p, convertValues: p.convertValues}; + newState.game.ScriptShootergameShootergamemode.genericXPMultiplier = v; + return newState; + }) + } + }} + /> +
+
+ + Global Corpse Decomposition Time Multiplier + + { + if (v >= 0) { + setServ((p) => { + const newState = {...p, convertValues: p.convertValues}; + newState.game.ScriptShootergameShootergamemode.globalCorpseDecompositionTimeMultiplier = v; + return newState; + }) + } + }} + /> +
+
+ + Global Item Decomposition Time Multiplier + + { + if (v >= 0) { + setServ((p) => { + const newState = {...p, convertValues: p.convertValues}; + newState.game.ScriptShootergameShootergamemode.globalItemDecompositionTimeMultiplier = v; + return newState; + }) + } + }} + /> +
+
+ + Global Spoiling Time Multiplier + + { + if (v >= 0) { + setServ((p) => { + const newState = {...p, convertValues: p.convertValues}; + newState.game.ScriptShootergameShootergamemode.globalSpoilingTimeMultiplier = v; + return newState; + }) + } + }} + /> +
+
+ + Increase PvP Respawn Interval Multiplier + + { + if (v >= 0) { + setServ((p) => { + const newState = {...p, convertValues: p.convertValues}; + newState.game.ScriptShootergameShootergamemode.increasePvPRespawnIntervalMultiplier = v; + return newState; + }) + } + }} + /> +
+
+ + Kill XP Multiplier + + { + if (v >= 0) { + setServ((p) => { + const newState = {...p, convertValues: p.convertValues}; + newState.game.ScriptShootergameShootergamemode.killXPMultiplier = v; + return newState; + }) + } + }} + /> +
+
+ + Max Fall Speed Multiplier + + { + if (v >= 0) { + setServ((p) => { + const newState = {...p, convertValues: p.convertValues}; + newState.game.ScriptShootergameShootergamemode.maxFallSpeedMultiplier = v; + return newState; + }) + } + }} + /> +
+
+ + Special XP Multiplier + + { + if (v >= 0) { + setServ((p) => { + const newState = {...p, convertValues: p.convertValues}; + newState.game.ScriptShootergameShootergamemode.specialXPMultiplier = v; + return newState; + }) + } + }} + /> +
+
+ + Supply Crate Loot Quality Multiplier + + { + if (v >= 0) { + setServ((p) => { + const newState = {...p, convertValues: p.convertValues}; + newState.game.ScriptShootergameShootergamemode.supplyCrateLootQualityMultiplier = v; + return newState; + }) + } + }} + /> +
+
+ + Use Corpse Life Span Multiplier + + { + if (v >= 0) { + setServ((p) => { + const newState = {...p, convertValues: p.convertValues}; + newState.game.ScriptShootergameShootergamemode.useCorpseLifeSpanMultiplier = v; + return newState; + }) + } + }} + /> +
+ {/*
+ + Per Platform Max Structures Multiplier + + { + if (v >= 0) { + setServ((p) => { + const newState = {...p, convertValues: p.convertValues}; + newState.gameUserSettings.serverSettings.perPlatformMaxStructuresMultiplier = v; + return newState; + }) + } + }} + /> +
*/} +
+ + PvE Structure Decay Period Multiplier + + { + if (v >= 0) { + setServ((p) => { + const newState = {...p, convertValues: p.convertValues}; + newState.gameUserSettings.serverSettings.pveStructureDecayPeriodMultiplier = v; + return newState; + }) + } + }} + /> +
+
+
+ ) +} + +function DinoMultipliers({ setServ, serv }: {setServ: React.Dispatch>, serv: server.Server}) { + return ( +
+ + Dino Multipliers + + +
+
+ + Dino Character Food Drain Multiplier + + { + if (v >= 0) { + setServ((p) => { + const newState = {...p, convertValues: p.convertValues}; + newState.gameUserSettings.serverSettings.dinoCharacterFoodDrainMultiplier = v; + return newState; + }) + } + }} + /> +
+
+ + Dino Character Health Recovery Multiplier + + { + if (v >= 0) { + setServ((p) => { + const newState = {...p, convertValues: p.convertValues}; + newState.gameUserSettings.serverSettings.dinoCharacterFoodDrainMultiplier = v; + return newState; + }) + } + }} + /> +
+
+ + Dino Character Health Recovery Multiplier + + { + if (v >= 0) { + setServ((p) => { + const newState = {...p, convertValues: p.convertValues}; + newState.gameUserSettings.serverSettings.dinoCharacterHealthRecoveryMultiplier = v; + return newState; + }) + } + }} + /> +
+
+ + Dino Character Stamina Drain Multiplier + + { + if (v >= 0) { + setServ((p) => { + const newState = {...p, convertValues: p.convertValues}; + newState.gameUserSettings.serverSettings.dinoCharacterStaminaDrainMultiplier = v; + return newState; + }) + } + }} + /> +
+
+ + Dino Count Multiplier + + { + if (v >= 0) { + setServ((p) => { + const newState = {...p, convertValues: p.convertValues}; + newState.gameUserSettings.serverSettings.dinoCountMultiplier = v; + return newState; + }) + } + }} + /> +
+
+ + Dino Damage Multiplier + + { + if (v >= 0) { + setServ((p) => { + const newState = {...p, convertValues: p.convertValues}; + newState.gameUserSettings.serverSettings.dinoDamageMultiplier = v; + return newState; + }) + } + }} + /> +
+
+ + Raid Dino Character Food Drain Multiplier + + { + if (v >= 0) { + setServ((p) => { + const newState = {...p, convertValues: p.convertValues}; + newState.gameUserSettings.serverSettings.raidDinoCharacterFoodDrainMultiplier = v; + return newState; + }) + } + }} + /> +
+
+ + Tamed Dino Damage Multiplier + + { + if (v >= 0) { + setServ((p) => { + const newState = {...p, convertValues: p.convertValues}; + newState.gameUserSettings.serverSettings.tamedDinoDamageMultiplier = v; + return newState; + }) + } + }} + /> +
+
+ + Tamed Dino Resistance Multiplier + + { + if (v >= 0) { + setServ((p) => { + const newState = {...p, convertValues: p.convertValues}; + newState.gameUserSettings.serverSettings.tamedDinoResistanceMultiplier = v; + return newState; + }) + } + }} + /> +
+
+ + Taming Speed Multiplier + + { + if (v >= 0) { + setServ((p) => { + const newState = {...p, convertValues: p.convertValues}; + newState.gameUserSettings.serverSettings.tamingSpeedMultiplier = v; + return newState; + }) + } + }} + /> +
+
+ + Baby Cuddle Grace Period Multiplier + + { + if (v >= 0) { + setServ((p) => { + const newState = {...p, convertValues: p.convertValues}; + newState.game.ScriptShootergameShootergamemode.babyCuddleGracePeriodMultiplier = v; + return newState; + }) + } + }} + /> +
+
+ + Baby Cuddle Interval Multiplier + + { + if (v >= 0) { + setServ((p) => { + const newState = {...p, convertValues: p.convertValues}; + newState.game.ScriptShootergameShootergamemode.babyCuddleIntervalMultiplier = v; + return newState; + }) + } + }} + /> +
+
+ + Baby Cuddle Lose Imprint Quality Speed Multiplier + + { + if (v >= 0) { + setServ((p) => { + const newState = {...p, convertValues: p.convertValues}; + newState.game.ScriptShootergameShootergamemode.babyCuddleLoseImprintQualitySpeedMultiplier = v; + return newState; + }) + } + }} + /> +
+
+ + Baby Food Consumption Speed Multiplier + + { + if (v >= 0) { + setServ((p) => { + const newState = {...p, convertValues: p.convertValues}; + newState.game.ScriptShootergameShootergamemode.babyFoodConsumptionSpeedMultiplier = v; + return newState; + }) + } + }} + /> +
+
+ + Baby Imprint Amount Multiplier + + { + if (v >= 0) { + setServ((p) => { + const newState = {...p, convertValues: p.convertValues}; + newState.game.ScriptShootergameShootergamemode.babyImprintAmountMultiplier = v; + return newState; + }) + } + }} + /> +
+
+ + Baby Imprinting Stat Scale Multiplier + + { + if (v >= 0) { + setServ((p) => { + const newState = {...p, convertValues: p.convertValues}; + newState.game.ScriptShootergameShootergamemode.babyImprintingStatScaleMultiplier = v; + return newState; + }) + } + }} + /> +
+
+ + Baby Mature Speed Multiplier + + { + if (v >= 0) { + setServ((p) => { + const newState = {...p, convertValues: p.convertValues}; + newState.game.ScriptShootergameShootergamemode.babyMatureSpeedMultiplier = v; + return newState; + }) + } + }} + /> +
+
+ + Dino Harvesting Damage Multiplier + + { + if (v >= 0) { + setServ((p) => { + const newState = {...p, convertValues: p.convertValues}; + newState.game.ScriptShootergameShootergamemode.dinoHarvestingDamageMultiplier = v; + return newState; + }) + } + }} + /> +
+
+ + Dino Turret Damage Multiplier + + { + if (v >= 0) { + setServ((p) => { + const newState = {...p, convertValues: p.convertValues}; + newState.game.ScriptShootergameShootergamemode.dinoTurretDamageMultiplier = v; + return newState; + }) + } + }} + /> +
+
+ + Egg Hatch Speed Multiplier + + { + if (v >= 0) { + setServ((p) => { + const newState = {...p, convertValues: p.convertValues}; + newState.game.ScriptShootergameShootergamemode.eggHatchSpeedMultiplier = v; + return newState; + }) + } + }} + /> +
+
+ + Lay Egg Interval Multiplier + + { + if (v >= 0) { + setServ((p) => { + const newState = {...p, convertValues: p.convertValues}; + newState.game.ScriptShootergameShootergamemode.layEggIntervalMultiplier = v; + return newState; + }) + } + }} + /> +
+
+ + Mating Interval Multiplier + + { + if (v >= 0) { + setServ((p) => { + const newState = {...p, convertValues: p.convertValues}; + newState.game.ScriptShootergameShootergamemode.matingIntervalMultiplier = v; + return newState; + }) + } + }} + /> +
+
+ + Mating Speed Multiplier + + { + if (v >= 0) { + setServ((p) => { + const newState = {...p, convertValues: p.convertValues}; + newState.game.ScriptShootergameShootergamemode.matingSpeedMultiplier = v; + return newState; + }) + } + }} + /> +
+
+ + Passive Tame Interval Multiplier + + { + if (v >= 0) { + setServ((p) => { + const newState = {...p, convertValues: p.convertValues}; + newState.game.ScriptShootergameShootergamemode.passiveTameIntervalMultiplier = v; + return newState; + }) + } + }} + /> +
+
+ + Tamed Dino Character Food Drain Multiplier + + { + if (v >= 0) { + setServ((p) => { + const newState = {...p, convertValues: p.convertValues}; + newState.game.ScriptShootergameShootergamemode.tamedDinoCharacterFoodDrainMultiplier = v; + return newState; + }) + } + }} + /> +
+
+ + Tamed Dino Torpor Drain Multiplier + + { + if (v >= 0) { + setServ((p) => { + const newState = {...p, convertValues: p.convertValues}; + newState.game.ScriptShootergameShootergamemode.tamedDinoTorporDrainMultiplier = v; + return newState; + }) + } + }} + /> +
+
+ + Wild Dino Character Food Drain Multiplier + + { + if (v >= 0) { + setServ((p) => { + const newState = {...p, convertValues: p.convertValues}; + newState.game.ScriptShootergameShootergamemode.wildDinoCharacterFoodDrainMultiplier = v; + return newState; + }) + } + }} + /> +
+
+ + Wild Dino Torpor Drain Multiplier + + { + if (v >= 0) { + setServ((p) => { + const newState = {...p, convertValues: p.convertValues}; + newState.game.ScriptShootergameShootergamemode.wildDinoTorporDrainMultiplier = v; + return newState; + }) + } + }} + /> +
+
+
+ ) +} + +function HarvestingMultipliers({ setServ, serv }: {setServ: React.Dispatch>, serv: server.Server}) { + return ( +
+ + Harvesting Multipliers + + +
+
+ + Harvest Amount Multiplier + + { + if (v >= 0) { + setServ((p) => { + const newState = {...p, convertValues: p.convertValues}; + newState.gameUserSettings.serverSettings.harvestAmountMultiplier = v; + return newState; + }) + } + }} + /> +
+
+ + Harvest Health Multiplier + + { + if (v >= 0) { + setServ((p) => { + const newState = {...p, convertValues: p.convertValues}; + newState.gameUserSettings.serverSettings.harvestHealthMultiplier = v; + return newState; + }) + } + }} + /> +
+
+ + Resources Respawn Period Multiplier + + { + if (v >= 0) { + setServ((p) => { + const newState = {...p, convertValues: p.convertValues}; + newState.gameUserSettings.serverSettings.resourcesRespawnPeriodMultiplier = v; + return newState; + }) + } + }} + /> +
+
+ + Harvest XP Multiplier + + { + if (v >= 0) { + setServ((p) => { + const newState = {...p, convertValues: p.convertValues}; + newState.game.ScriptShootergameShootergamemode.harvestXPMultiplier = v; + return newState; + }) + } + }} + /> +
+
+
+ ) +} + +function PlayerMultipliers({ setServ, serv }: {setServ: React.Dispatch>, serv: server.Server}) { + return ( +
+ + Player Multipliers + + +
+
+ + Oxygen Swim Speed Stat Multiplier + + { + if (v >= 0) { + setServ((p) => { + const newState = {...p, convertValues: p.convertValues}; + newState.gameUserSettings.serverSettings.oxygenSwimSpeedStatMultiplier = v; + return newState; + }) + } + }} + /> +
+
+ + Player Character Food Drain Multiplier + + { + if (v >= 0) { + setServ((p) => { + const newState = {...p, convertValues: p.convertValues}; + newState.gameUserSettings.serverSettings.playerCharacterFoodDrainMultiplier = v; + return newState; + }) + } + }} + /> +
+
+ + Player Character Health Recovery Multiplier + + { + if (v >= 0) { + setServ((p) => { + const newState = {...p, convertValues: p.convertValues}; + newState.gameUserSettings.serverSettings.playerCharacterHealthRecoveryMultiplier = v; + return newState; + }) + } + }} + /> +
+
+ + Player Character Stamina Drain Multiplier + + { + if (v >= 0) { + setServ((p) => { + const newState = {...p, convertValues: p.convertValues}; + newState.gameUserSettings.serverSettings.playerCharacterStaminaDrainMultiplier = v; + return newState; + }) + } + }} + /> +
+
+ + Player Character Water Drain Multiplier + + { + if (v >= 0) { + setServ((p) => { + const newState = {...p, convertValues: p.convertValues}; + newState.gameUserSettings.serverSettings.playerCharacterWaterDrainMultiplier = v; + return newState; + }) + } + }} + /> +
+
+ + Player Damage Multiplier + + { + if (v >= 0) { + setServ((p) => { + const newState = {...p, convertValues: p.convertValues}; + newState.gameUserSettings.serverSettings.playerDamageMultiplier = v; + return newState; + }) + } + }} + /> +
+
+ + Player Resistance Multiplier + + { + if (v >= 0) { + setServ((p) => { + const newState = {...p, convertValues: p.convertValues}; + newState.gameUserSettings.serverSettings.playerResistanceMultiplier = v; + return newState; + }) + } + }} + /> +
+
+ + Crafting Skill Bonus Multiplier + + { + if (v >= 0) { + setServ((p) => { + const newState = {...p, convertValues: p.convertValues}; + newState.game.ScriptShootergameShootergamemode.craftingSkillBonusMultiplier = v; + return newState; + }) + } + }} + /> +
+
+ + Craft XP Multiplier + + { + if (v >= 0) { + setServ((p) => { + const newState = {...p, convertValues: p.convertValues}; + newState.game.ScriptShootergameShootergamemode.craftXPMultiplier = v; + return newState; + }) + } + }} + /> +
+
+ + Hair Growth Speed Multiplier + + { + if (v >= 0) { + setServ((p) => { + const newState = {...p, convertValues: p.convertValues}; + newState.game.ScriptShootergameShootergamemode.hairGrowthSpeedMultiplier = v; + return newState; + }) + } + }} + /> +
+
+ + Player Harvesting Damage Multiplier + + { + if (v >= 0) { + setServ((p) => { + const newState = {...p, convertValues: p.convertValues}; + newState.game.ScriptShootergameShootergamemode.playerHarvestingDamageMultiplier = v; + return newState; + }) + } + }} + /> +
+
+ + Poop Interval Multiplier + + { + if (v >= 0) { + setServ((p) => { + const newState = {...p, convertValues: p.convertValues}; + newState.game.ScriptShootergameShootergamemode.poopIntervalMultiplier = v; + return newState; + }) + } + }} + /> +
+ +
+
+ ) +} + +function StructureBuildingMultipliers({ setServ, serv }: {setServ: React.Dispatch>, serv: server.Server}) { + return ( +
+ + Structure/building Multipliers + + +
+
+ + Per Platform Max Structures Multiplier + + { + if (v >= 0) { + setServ((p) => { + const newState = {...p, convertValues: p.convertValues}; + newState.gameUserSettings.serverSettings.perPlatformMaxStructuresMultiplier = v; + return newState; + }) + } + }} + /> +
+
+ + Platform Saddle Build Area Bounds Multiplier + + { + if (v >= 0) { + setServ((p) => { + const newState = {...p, convertValues: p.convertValues}; + newState.gameUserSettings.serverSettings.platformSaddleBuildAreaBoundsMultiplier = v; + return newState; + }) + } + }} + /> +
+
+ + Structure Damage Multiplier + + { + if (v >= 0) { + setServ((p) => { + const newState = {...p, convertValues: p.convertValues}; + newState.gameUserSettings.serverSettings.structureDamageMultiplier = v; + return newState; + }) + } + }} + /> +
+
+ + Structure Prevent Resource Radius Multiplier + + { + if (v >= 0) { + setServ((p) => { + const newState = {...p, convertValues: p.convertValues}; + newState.gameUserSettings.serverSettings.structurePreventResourceRadiusMultiplier = v; + return newState; + }) + } + }} + /> +
+ + Structure Resistance Multiplier + + { + if (v >= 0) { + setServ((p) => { + const newState = {...p, convertValues: p.convertValues}; + newState.gameUserSettings.serverSettings.structureResistanceMultiplier = v; + return newState; + }) + } + }} + /> +
+
+
+ + PvP Zone Structure Damage Multiplier + + { + if (v >= 0) { + setServ((p) => { + const newState = {...p, convertValues: p.convertValues}; + newState.game.ScriptShootergameShootergamemode.pvPZoneStructureDamageMultiplier = v; + return newState; + }) + } + }} + /> +
+
+
+ ) +} + +function AllMultipliersCard({ setServ, serv }: {setServ: React.Dispatch>, serv: server.Server}) { + return ( + + + + + + + + + ) +} + +export function Multipliers({setServ, serv}: Props) { + return ( + + + + ); +} \ No newline at end of file diff --git a/server/game.go b/server/game.go index e133598..689d205 100644 --- a/server/game.go +++ b/server/game.go @@ -122,7 +122,7 @@ type ScriptShootergameShootergamemode struct { TribeSlotReuseCooldown float32 `json:"tribeSlotReuseCooldown" ini:"TribeSlotReuseCooldown"` UseCorpseLifeSpanMultiplier float32 `json:"useCorpseLifeSpanMultiplier" ini:"UseCorpseLifeSpanMultiplier"` WildDinoCharacterFoodDrainMultiplier float32 `json:"wildDinoCharacterFoodDrainMultiplier" ini:"WildDinoCharacterFoodDrainMultiplier"` - WildDinoTorporDrainMultiplier float32 `json:"WildDinoTorporDrainMultiplier" ini:"WildDinoTorporDrainMultiplier"` + WildDinoTorporDrainMultiplier float32 `json:"wildDinoTorporDrainMultiplier" ini:"WildDinoTorporDrainMultiplier"` BHardLimitTurretsInRange bool `json:"bHardLimitTurretsInRange" ini:"bHardLimitTurretsInRange"` BLimitTurretsInRange bool `json:"bLimitTurretsInRange" ini:"bLimitTurretsInRange"` LimitTurretsNum int `json:"limitTurretsNum" ini:"LimitTurretsNum"` diff --git a/server/gus.go b/server/gus.go index c25d4f9..537e78e 100644 --- a/server/gus.go +++ b/server/gus.go @@ -214,7 +214,7 @@ type GameUserSettings struct { Ragnarok Ragnarok `json:"ragnarok" ini:"Ragnarok"` - MessageOfTheDay MessageOfTheDay + MessageOfTheDay MessageOfTheDay `json:"messageOfTheDay" ini:"MessageOfTheDay"` } func generateNewDefaultGameUserSettings() GameUserSettings { @@ -461,6 +461,11 @@ func (s *Server) SaveGameUserSettingsIni() error { return err } + err = replaceForwardSlashInFile(filepath.Join(s.ServerPath, "ShooterGame\\Saved\\Config\\WindowsServer\\GameUserSettings.ini")) + if err != nil { + return err + } + runtime.EventsEmit(s.ctx, "reloadServers") return nil diff --git a/server/helpers.go b/server/helpers.go index 615c02c..5cb38c2 100644 --- a/server/helpers.go +++ b/server/helpers.go @@ -2,22 +2,45 @@ package server import ( "fmt" + "github.com/JensvandeWiel/ArkAscendedServerManager/helpers" + "github.com/go-ini/ini" + "github.com/sethvargo/go-password/password" + "github.com/wailsapp/wails/v2/pkg/runtime" "io" + "io/ioutil" "net" "os" "path/filepath" "strconv" - - "github.com/JensvandeWiel/ArkAscendedServerManager/helpers" - "github.com/go-ini/ini" - "github.com/sethvargo/go-password/password" - "github.com/wailsapp/wails/v2/pkg/runtime" + "strings" ) var iniOpts = ini.LoadOptions{ AllowShadows: true, } +func replaceForwardSlashInFile(filePath string) error { + // Read the content of the file + content, err := os.ReadFile(filePath) + if err != nil { + return fmt.Errorf("error reading file: %v", err) + } + + // Convert content to string + contentString := string(content) + + // Replace all occurrences of %2F with / + replacedString := strings.Replace(contentString, "/", "%2F", -1) + + // Write the modified content back to the file + err = ioutil.WriteFile(filePath, []byte(replacedString), 0644) + if err != nil { + return fmt.Errorf("error writing to file: %v", err) + } + + return nil +} + // findHighestKey returns the highest key in a map with int as key func findHighestKey(m map[int]*Server) int { var highestKey int = -1 diff --git a/server/server.go b/server/server.go index 04b99df..634ed41 100644 --- a/server/server.go +++ b/server/server.go @@ -34,6 +34,7 @@ type Server struct { ExtraDashArgs string `json:"extraDashArgs"` ExtraQuestionmarkArguments string `json:"extraQuestionmarkArguments"` + KickIdlePlayers bool `json:"kickIdlePlayers"` Mods string `json:"mods"` @@ -253,6 +254,9 @@ func (s *Server) CreateArguments() []string { //args = append(args, "?ServerAdminPassword="+s.AdminPassword) args = append(args, "-WinLiveMaxPlayers="+strconv.Itoa(s.MaxPlayers)) + if s.KickIdlePlayers { + args = append(args, "-EnableIdlePlayerKick") + } extraArgs := strings.Split(s.ExtraDashArgs, " ")