Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ee7502269f | |||
| 79ba39076e | |||
| 38f20beaa6 | |||
| a028dc8242 | |||
| 53b35c13b4 | |||
| 8996cbbfa0 |
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "acc-server-manager-web",
|
||||
"version": "0.24.1",
|
||||
"version": "0.24.3",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "next dev --turbopack",
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
'use client';
|
||||
|
||||
import type { EventConfig, Session } from '@/lib/schemas/config';
|
||||
import { TRACKS } from '@/lib/constants/tracks';
|
||||
|
||||
interface EventConfigEditorProps {
|
||||
formData: EventConfig;
|
||||
@@ -69,31 +70,11 @@ export function EventConfigEditor({ formData, disabled, onFormDataChange }: Even
|
||||
onChange={(e) => handleInputChange('track', e.target.value)}
|
||||
className="form-select w-full"
|
||||
>
|
||||
<option value="barcelona">Barcelona</option>
|
||||
<option value="brands_hatch">Brands Hatch</option>
|
||||
<option value="donington">Donington</option>
|
||||
<option value="cota">COTA</option>
|
||||
<option value="hungaroring">Hungaroring</option>
|
||||
<option value="imola">Imola</option>
|
||||
<option value="indianapolis">Indianapolis</option>
|
||||
<option value="kyalami">Kyalami</option>
|
||||
<option value="laguna_seca">Laguna Seca</option>
|
||||
<option value="misano">Misano</option>
|
||||
<option value="monza">Monza</option>
|
||||
<option value="mount_panorama">Mount Panorama</option>
|
||||
<option value="nurburgring">Nurburgring</option>
|
||||
<option value="nurburgring_24h">Nurburgring 24h</option>
|
||||
<option value="oulton_park">Oulton Park</option>
|
||||
<option value="paul_ricard">Paul Ricard</option>
|
||||
<option value="red_bull_ring">Red Bull Ring</option>
|
||||
<option value="silverstone">Silverstone</option>
|
||||
<option value="snetterton">Snetterton</option>
|
||||
<option value="spa">Spa-Francorchamps</option>
|
||||
<option value="suzuka">Suzuka</option>
|
||||
<option value="valencia">Valencia</option>
|
||||
<option value="zandvoort">Zandvoort</option>
|
||||
<option value="zolder">Zolder</option>
|
||||
<option value="watkins_glen">Watkins Glen</option>
|
||||
{Object.entries(TRACKS).map(([key, name]) => (
|
||||
<option key={key} value={key}>
|
||||
{name}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
</div>
|
||||
|
||||
@@ -107,7 +88,7 @@ export function EventConfigEditor({ formData, disabled, onFormDataChange }: Even
|
||||
value={formData.preRaceWaitingTimeSeconds}
|
||||
onChange={(e) => handleInputChange('preRaceWaitingTimeSeconds', e.target.value)}
|
||||
className="form-input w-full"
|
||||
min="0"
|
||||
min="30"
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -9,12 +9,6 @@ interface EventRulesEditorProps {
|
||||
}
|
||||
|
||||
const numberFields = [
|
||||
{
|
||||
key: 'qualifyStandingType' as keyof EventRules,
|
||||
label: 'Qualify Standing Type',
|
||||
min: -1,
|
||||
max: 1
|
||||
},
|
||||
{
|
||||
key: 'pitWindowLengthSec' as keyof EventRules,
|
||||
label: 'Pit Window Length (seconds)',
|
||||
@@ -28,7 +22,7 @@ const numberFields = [
|
||||
{
|
||||
key: 'mandatoryPitstopCount' as keyof EventRules,
|
||||
label: 'Mandatory Pitstop Count',
|
||||
min: -1,
|
||||
min: 0,
|
||||
max: 5
|
||||
},
|
||||
{
|
||||
@@ -36,6 +30,12 @@ const numberFields = [
|
||||
label: 'Max Total Driving Time (seconds)',
|
||||
min: -1
|
||||
},
|
||||
{
|
||||
key: 'maxDriversCount' as keyof EventRules,
|
||||
label: 'Max Drivers Count',
|
||||
min: 1,
|
||||
max: 10
|
||||
},
|
||||
{
|
||||
key: 'tyreSetCount' as keyof EventRules,
|
||||
label: 'Tyre Set Count',
|
||||
@@ -77,6 +77,18 @@ export function EventRulesEditor({ formData, disabled, onFormDataChange }: Event
|
||||
<div className="space-y-6">
|
||||
<h3 className="border-b border-border-muted pb-2 text-sm font-semibold text-primary">Race Rules</h3>
|
||||
<div className="grid grid-cols-1 gap-6 md:grid-cols-2">
|
||||
<div>
|
||||
<label className="mb-1.5 block text-sm font-medium text-secondary">Qualify Standing Type</label>
|
||||
<select
|
||||
disabled={disabled}
|
||||
value={formData.qualifyStandingType}
|
||||
onChange={(e) => handleInputChange('qualifyStandingType', parseInt(e.target.value))}
|
||||
className="form-select w-full"
|
||||
>
|
||||
<option value={1}>Fastest Lap</option>
|
||||
<option value={2}>Average Lap</option>
|
||||
</select>
|
||||
</div>
|
||||
{numberFields.map(({ key, label, min, max }) => (
|
||||
<div key={key}>
|
||||
<label className="mb-1.5 block text-sm font-medium text-secondary">{label}</label>
|
||||
|
||||
@@ -42,7 +42,7 @@ const numberFields = [
|
||||
{
|
||||
key: 'trackMedalsRequirement' as keyof ServerSettings,
|
||||
label: 'Track Medals Requirement',
|
||||
min: -1,
|
||||
min: 0,
|
||||
max: 3
|
||||
},
|
||||
{
|
||||
@@ -80,6 +80,10 @@ const selectFields = [
|
||||
key: 'shortFormationLap' as keyof ServerSettings,
|
||||
label: 'Short Formation Lap'
|
||||
},
|
||||
{
|
||||
key: 'dumpEntryList' as keyof ServerSettings,
|
||||
label: 'Dump Entry List'
|
||||
},
|
||||
{
|
||||
key: 'ignorePrematureDisconnects' as keyof ServerSettings,
|
||||
label: 'Ignore Premature Disconnects'
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
import Link from 'next/link';
|
||||
import { useTransition } from 'react';
|
||||
import { Server, ServiceStatus, serviceStatusToString } from '@/lib/schemas';
|
||||
import { getTrackDisplayName } from '@/lib/constants/tracks';
|
||||
import {
|
||||
startServerEventAction,
|
||||
restartServerEventAction,
|
||||
@@ -55,8 +56,8 @@ export function ServerCard({ server }: ServerCardProps) {
|
||||
const isRunning = server.status === ServiceStatus.Running;
|
||||
|
||||
return (
|
||||
<div className="overflow-hidden rounded-lg border border-border bg-canvas transition-colors hover:border-blue/40">
|
||||
<Link href={`/dashboard/server/${server.id}`} className="block p-4">
|
||||
<div className="flex flex-col overflow-hidden rounded-lg border border-border bg-canvas transition-colors hover:border-blue/40">
|
||||
<Link href={`/dashboard/server/${server.id}`} className="flex flex-1 flex-col p-4">
|
||||
<div className="flex items-start justify-between">
|
||||
<span className="text-sm font-semibold text-primary">{server.name}</span>
|
||||
<StatusDot status={server.status} />
|
||||
@@ -72,12 +73,12 @@ export function ServerCard({ server }: ServerCardProps) {
|
||||
<div>
|
||||
<div className="text-xs text-subtle">Track</div>
|
||||
<div className="truncate text-sm font-semibold text-primary">
|
||||
{server.state?.track || 'N/A'}
|
||||
{server.state?.track ? getTrackDisplayName(server.state.track) : 'N/A'}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="mt-3 flex items-center justify-between gap-2">
|
||||
<div className="mt-auto pt-3 flex items-center justify-between gap-2">
|
||||
<Badge variant={statusBadgeVariant(server.status)}>
|
||||
{serviceStatusToString(server.status)}
|
||||
</Badge>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
'use client';
|
||||
|
||||
import { Configurations, ServerTab } from '@/lib/schemas/config';
|
||||
import { type Configurations, ServerTab } from '@/lib/schemas/config';
|
||||
import { ConfigurationEditor } from '@/components/configuration/ConfigurationEditor';
|
||||
import { AssistRulesEditor } from '@/components/configuration/AssistRulesEditor';
|
||||
import { EventConfigEditor } from '@/components/configuration/EventConfigEditor';
|
||||
@@ -54,30 +54,34 @@ export function ServerConfigurationTabs({
|
||||
const [eventData, setEventData] = useState(configurations.event);
|
||||
const [eventRulesData, setEventRulesData] = useState(configurations.eventRules);
|
||||
const [settingsData, setSettingsData] = useState(configurations.settings);
|
||||
const [dirtyConfigs, setDirtyConfigs] = useState<Set<keyof Configurations>>(new Set());
|
||||
|
||||
const [restart, setRestart] = useState(true);
|
||||
const [isSubmitting, setIsSubmitting] = useState(false);
|
||||
const [saveError, setSaveError] = useState<string | null>(null);
|
||||
const [saveSuccess, setSaveSuccess] = useState(false);
|
||||
|
||||
const markDirty = (key: keyof Configurations) =>
|
||||
setDirtyConfigs((prev) => new Set(prev).add(key));
|
||||
|
||||
const handleSaveAll = async () => {
|
||||
if (dirtyConfigs.size === 0) return;
|
||||
|
||||
setIsSubmitting(true);
|
||||
setSaveError(null);
|
||||
setSaveSuccess(false);
|
||||
|
||||
const result = await bulkUpdateConfigurationsAction(
|
||||
serverId,
|
||||
{
|
||||
configuration: configData,
|
||||
assistRules: assistData,
|
||||
event: eventData,
|
||||
eventRules: eventRulesData,
|
||||
settings: settingsData
|
||||
},
|
||||
restart
|
||||
);
|
||||
const payload: Partial<Configurations> = {};
|
||||
if (dirtyConfigs.has('configuration')) payload.configuration = configData;
|
||||
if (dirtyConfigs.has('assistRules')) payload.assistRules = assistData;
|
||||
if (dirtyConfigs.has('event')) payload.event = eventData;
|
||||
if (dirtyConfigs.has('eventRules')) payload.eventRules = eventRulesData;
|
||||
if (dirtyConfigs.has('settings')) payload.settings = settingsData;
|
||||
|
||||
const result = await bulkUpdateConfigurationsAction(serverId, payload, restart);
|
||||
|
||||
if (result.success) {
|
||||
setDirtyConfigs(new Set());
|
||||
setSaveSuccess(true);
|
||||
setTimeout(() => setSaveSuccess(false), 3000);
|
||||
} else {
|
||||
@@ -99,7 +103,7 @@ export function ServerConfigurationTabs({
|
||||
<ConfigurationEditor
|
||||
formData={configData}
|
||||
disabled={isSubmitting}
|
||||
onFormDataChange={setConfigData}
|
||||
onFormDataChange={(data) => { setConfigData(data); markDirty('configuration'); }}
|
||||
/>
|
||||
);
|
||||
|
||||
@@ -108,7 +112,7 @@ export function ServerConfigurationTabs({
|
||||
<AssistRulesEditor
|
||||
formData={assistData}
|
||||
disabled={isSubmitting}
|
||||
onFormDataChange={setAssistData}
|
||||
onFormDataChange={(data) => { setAssistData(data); markDirty('assistRules'); }}
|
||||
/>
|
||||
);
|
||||
|
||||
@@ -117,7 +121,7 @@ export function ServerConfigurationTabs({
|
||||
<EventConfigEditor
|
||||
formData={eventData}
|
||||
disabled={isSubmitting}
|
||||
onFormDataChange={setEventData}
|
||||
onFormDataChange={(data) => { setEventData(data); markDirty('event'); }}
|
||||
/>
|
||||
);
|
||||
|
||||
@@ -126,7 +130,7 @@ export function ServerConfigurationTabs({
|
||||
<EventRulesEditor
|
||||
formData={eventRulesData}
|
||||
disabled={isSubmitting}
|
||||
onFormDataChange={setEventRulesData}
|
||||
onFormDataChange={(data) => { setEventRulesData(data); markDirty('eventRules'); }}
|
||||
/>
|
||||
);
|
||||
|
||||
@@ -135,7 +139,7 @@ export function ServerConfigurationTabs({
|
||||
<ServerSettingsEditor
|
||||
formData={settingsData}
|
||||
disabled={isSubmitting}
|
||||
onFormDataChange={setSettingsData}
|
||||
onFormDataChange={(data) => { setSettingsData(data); markDirty('settings'); }}
|
||||
/>
|
||||
);
|
||||
|
||||
@@ -203,7 +207,7 @@ export function ServerConfigurationTabs({
|
||||
</label>
|
||||
<button
|
||||
onClick={handleSaveAll}
|
||||
disabled={isSubmitting}
|
||||
disabled={isSubmitting || dirtyConfigs.size === 0}
|
||||
className="rounded-md bg-btn-green border border-btn-green px-5 py-2 text-sm font-medium text-white transition-colors hover:bg-btn-green-hover disabled:cursor-not-allowed disabled:opacity-40"
|
||||
>
|
||||
{isSubmitting ? 'Saving…' : 'Save All'}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
'use client';
|
||||
import Link from 'next/link';
|
||||
import { Server, serviceStatusToString, ServiceStatus } from '@/lib/schemas/server';
|
||||
import { getTrackDisplayName } from '@/lib/constants/tracks';
|
||||
import {
|
||||
startServerEventAction,
|
||||
restartServerEventAction,
|
||||
@@ -72,7 +73,7 @@ export function ServerHeader({ server, user }: ServerHeaderProps) {
|
||||
|
||||
<div className="flex flex-wrap gap-6 border-b border-border-muted px-5 py-3">
|
||||
{[
|
||||
{ label: 'Track', value: server.state?.track ?? 'N/A' },
|
||||
{ label: 'Track', value: server.state?.track ? getTrackDisplayName(server.state.track) : 'N/A' },
|
||||
{ label: 'Players', value: `${server.state?.playerCount ?? 0} / ${server.state?.maxConnections ?? 0}` },
|
||||
{ label: 'Session', value: server.state?.session ?? 'N/A' },
|
||||
].map(({ label, value }) => (
|
||||
|
||||
@@ -60,7 +60,7 @@ export function ServerListWithActions({ servers, user }: ServerListWithActionsPr
|
||||
{/* Card grid — desktop only */}
|
||||
<div
|
||||
className="hidden gap-3 md:grid"
|
||||
style={{ gridTemplateColumns: 'repeat(auto-fill, minmax(360px, 1fr))' }}
|
||||
style={{ gridTemplateColumns: 'repeat(auto-fill, minmax(420px, 1fr))' }}
|
||||
>
|
||||
{servers.map((server) => (
|
||||
<ServerCard key={server.id} server={server} />
|
||||
|
||||
@@ -4,6 +4,7 @@ import { useTransition } from 'react';
|
||||
import { useRouter } from 'next/navigation';
|
||||
import Link from 'next/link';
|
||||
import { Server, ServiceStatus } from '@/lib/schemas';
|
||||
import { getTrackDisplayName } from '@/lib/constants/tracks';
|
||||
import {
|
||||
startServerEventAction,
|
||||
restartServerEventAction,
|
||||
@@ -51,7 +52,7 @@ export function ServerRow({ server }: ServerRowProps) {
|
||||
<div className="min-w-0">
|
||||
<div className="truncate text-sm font-semibold text-primary">{server.name}</div>
|
||||
<div className="truncate text-xs text-muted">
|
||||
{server.state?.track ?? 'No track'} · {server.state?.playerCount ?? 0} players
|
||||
{server.state?.track ? getTrackDisplayName(server.state.track) : 'No track'} · {server.state?.playerCount ?? 0} players
|
||||
</div>
|
||||
</div>
|
||||
</Link>
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import { getTrackDisplayName } from '@/lib/constants/tracks';
|
||||
|
||||
interface RecentSession {
|
||||
id: string;
|
||||
date: string;
|
||||
@@ -70,7 +72,7 @@ export function RecentSessions({ sessions }: RecentSessionsProps) {
|
||||
{session.type === 'R' ? 'Race' : session.type === 'Q' ? 'Qualify' : 'Practice'}
|
||||
</span>
|
||||
</td>
|
||||
<td className="px-4 py-3 text-sm text-secondary">{session.track}</td>
|
||||
<td className="px-4 py-3 text-sm text-secondary">{getTrackDisplayName(session.track)}</td>
|
||||
<td className="px-4 py-3 text-sm text-muted">
|
||||
{formatDuration(session.duration)}
|
||||
</td>
|
||||
|
||||
@@ -114,6 +114,7 @@ export async function updateServerSettingsAction(serverId: string, formData: For
|
||||
centralEntryListPath: formData.get('centralEntryListPath') as string,
|
||||
allowAutoDQ: parseInt(formData.get('allowAutoDQ') as string),
|
||||
shortFormationLap: parseInt(formData.get('shortFormationLap') as string),
|
||||
dumpEntryList: parseInt(formData.get('dumpEntryList') as string),
|
||||
formationLapType: parseInt(formData.get('formationLapType') as string),
|
||||
ignorePrematureDisconnects: parseInt(formData.get('ignorePrematureDisconnects') as string)
|
||||
};
|
||||
@@ -201,6 +202,7 @@ export async function updateEventRulesAction(serverId: string, formData: FormDat
|
||||
driverStintTimeSec: parseInt(formData.get('driverStintTimeSec') as string),
|
||||
mandatoryPitstopCount: parseInt(formData.get('mandatoryPitstopCount') as string),
|
||||
maxTotalDrivingTime: parseInt(formData.get('maxTotalDrivingTime') as string),
|
||||
maxDriversCount: parseInt(formData.get('maxDriversCount') as string),
|
||||
isRefuellingAllowedInRace: boolToInt(formData.get('isRefuellingAllowedInRace') === 'true'),
|
||||
isRefuellingTimeFixed: boolToInt(formData.get('isRefuellingTimeFixed') === 'true'),
|
||||
isMandatoryPitstopRefuellingRequired:
|
||||
@@ -237,13 +239,13 @@ export async function updateEventRulesAction(serverId: string, formData: FormDat
|
||||
|
||||
export async function bulkUpdateConfigurationsAction(
|
||||
serverId: string,
|
||||
configs: Configurations,
|
||||
configs: Partial<Configurations>,
|
||||
restart: boolean
|
||||
) {
|
||||
try {
|
||||
const session = await requireAuth();
|
||||
|
||||
const validated = configurationsSchema.safeParse(configs);
|
||||
const validated = configurationsSchema.partial().safeParse(configs);
|
||||
if (!validated.success) {
|
||||
return { success: false, message: validated.error.message };
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ export async function updateServerConfiguration(
|
||||
export async function bulkUpdateServerConfigurations(
|
||||
token: string,
|
||||
serverId: string,
|
||||
configs: Configurations,
|
||||
configs: Partial<Configurations>,
|
||||
restart = false
|
||||
): Promise<void> {
|
||||
await fetchServerAPI<ConfigAuditRecord[]>(
|
||||
|
||||
31
src/lib/constants/tracks.ts
Normal file
31
src/lib/constants/tracks.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
export const TRACKS: Record<string, string> = {
|
||||
barcelona: 'Barcelona',
|
||||
brands_hatch: 'Brands Hatch',
|
||||
cota: 'COTA',
|
||||
donington: 'Donington',
|
||||
hungaroring: 'Hungaroring',
|
||||
imola: 'Imola',
|
||||
indianapolis: 'Indianapolis',
|
||||
kyalami: 'Kyalami',
|
||||
laguna_seca: 'Laguna Seca',
|
||||
misano: 'Misano',
|
||||
monza: 'Monza',
|
||||
mount_panorama: 'Mount Panorama',
|
||||
nurburgring: 'Nürburgring',
|
||||
nurburgring_24h: 'Nürburgring 24h',
|
||||
oulton_park: 'Oulton Park',
|
||||
paul_ricard: 'Paul Ricard',
|
||||
red_bull_ring: 'Red Bull Ring',
|
||||
silverstone: 'Silverstone',
|
||||
snetterton: 'Snetterton',
|
||||
spa: 'Spa-Francorchamps',
|
||||
suzuka: 'Suzuka',
|
||||
valencia: 'Valencia',
|
||||
watkins_glen: 'Watkins Glen',
|
||||
zandvoort: 'Zandvoort',
|
||||
zolder: 'Zolder'
|
||||
};
|
||||
|
||||
export function getTrackDisplayName(key: string): string {
|
||||
return TRACKS[key] ?? key.replace(/_/g, ' ').replace(/\b\w/g, (c) => c.toUpperCase());
|
||||
}
|
||||
@@ -51,7 +51,7 @@ export const serverSettingsSchema = z.object({
|
||||
serverName: z.string().min(3).max(150),
|
||||
adminPassword: z.string().min(6).max(50).or(z.literal('').nullable()),
|
||||
carGroup: z.string().min(1).max(50),
|
||||
trackMedalsRequirement: z.number().min(-1).max(3),
|
||||
trackMedalsRequirement: z.number().min(0).max(3),
|
||||
safetyRatingRequirement: z.number().min(-1).max(99),
|
||||
racecraftRatingRequirement: z.number().min(-1).max(99),
|
||||
password: z.string().max(50).optional().or(z.literal('')),
|
||||
@@ -63,16 +63,17 @@ export const serverSettingsSchema = z.object({
|
||||
centralEntryListPath: z.string().max(255).optional().or(z.literal('')),
|
||||
allowAutoDQ: z.number().min(0).max(1).default(0),
|
||||
shortFormationLap: z.number().min(0).max(1).default(0),
|
||||
formationLapType: z.number().min(0).max(3).default(0),
|
||||
ignorePrematureDisconnects: z.number().min(0).max(1).default(0)
|
||||
dumpEntryList: z.number().min(0).max(1).default(0),
|
||||
formationLapType: z.number().min(0).max(3).default(3),
|
||||
ignorePrematureDisconnects: z.number().min(0).max(1).default(1)
|
||||
});
|
||||
|
||||
export type ServerSettings = z.infer<typeof serverSettingsSchema>;
|
||||
|
||||
export const sessionSchema = z.object({
|
||||
hourOfDay: z.number().min(1).max(24).default(14),
|
||||
hourOfDay: z.number().min(0).max(23).default(14),
|
||||
dayOfWeekend: z.number().min(1).max(3).default(1),
|
||||
timeMultiplier: z.number().min(1).max(120).default(1),
|
||||
timeMultiplier: z.number().min(0).max(24).default(1),
|
||||
sessionType: z.string().min(1).max(20),
|
||||
sessionDurationMinutes: z.number().min(1).max(180).default(20)
|
||||
});
|
||||
@@ -81,7 +82,7 @@ export type Session = z.infer<typeof sessionSchema>;
|
||||
|
||||
export const eventConfigSchema = z.object({
|
||||
track: z.string().min(1).max(100),
|
||||
preRaceWaitingTimeSeconds: z.number().min(0).max(600).default(30),
|
||||
preRaceWaitingTimeSeconds: z.number().min(30).max(600).default(30),
|
||||
sessionOverTimeSeconds: z.number().min(0).max(300).default(30),
|
||||
ambientTemp: z.number().min(0).max(50).default(24),
|
||||
cloudLevel: z.number().min(0).max(1).default(0),
|
||||
@@ -97,17 +98,18 @@ export const eventConfigSchema = z.object({
|
||||
export type EventConfig = z.infer<typeof eventConfigSchema>;
|
||||
|
||||
export const eventRulesSchema = z.object({
|
||||
qualifyStandingType: z.number().min(-1).max(1).default(0),
|
||||
pitWindowLengthSec: z.number().min(-1).max(3600).default(30),
|
||||
driverStintTimeSec: z.number().min(-1).max(7200).default(30),
|
||||
mandatoryPitstopCount: z.number().min(-1).max(5).default(0),
|
||||
maxTotalDrivingTime: z.number().min(-1).max(14400).default(60),
|
||||
isRefuellingAllowedInRace: z.number().min(0).max(1).default(0),
|
||||
qualifyStandingType: z.number().min(1).max(2).default(1),
|
||||
pitWindowLengthSec: z.number().min(-1).max(3600).default(-1),
|
||||
driverStintTimeSec: z.number().min(-1).max(7200).default(-1),
|
||||
mandatoryPitstopCount: z.number().min(0).max(5).default(0),
|
||||
maxTotalDrivingTime: z.number().min(-1).max(14400).default(-1),
|
||||
maxDriversCount: z.number().min(1).max(10).default(1),
|
||||
isRefuellingAllowedInRace: z.number().min(0).max(1).default(1),
|
||||
isRefuellingTimeFixed: z.number().min(0).max(1).default(0),
|
||||
isMandatoryPitstopRefuellingRequired: z.number().min(0).max(1).default(0),
|
||||
isMandatoryPitstopTyreChangeRequired: z.number().min(0).max(1).default(0),
|
||||
isMandatoryPitstopSwapDriverRequired: z.number().min(0).max(1).default(0),
|
||||
tyreSetCount: z.number().min(0).max(50).default(0)
|
||||
tyreSetCount: z.number().min(0).max(50).default(50)
|
||||
});
|
||||
|
||||
export type EventRules = z.infer<typeof eventRulesSchema>;
|
||||
|
||||
Reference in New Issue
Block a user