Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions components/MatchOptions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,35 @@ import SettingHeader from "~/components/match/SettingHeader.vue";
</FormItem>
</FormField>

<FormField v-slot="{ value, handleChange }" name="anti_wallhack">
<FormItem>
<div
class="flex flex-row items-center justify-between cursor-pointer"
@click="handleChange(!value)"
>
<div class="space-y-0.5">
<SettingHeader>{{
$t("match.options.advanced.anti_wallhack.label")
}}</SettingHeader>
<FormDescription>
{{
$t(
"match.options.advanced.anti_wallhack.description",
)
}}
</FormDescription>
</div>
<FormControl>
<Switch
class="pointer-events-none"
:model-value="value"
@update:model-value="handleChange"
/>
</FormControl>
</div>
</FormItem>
</FormField>

<FormField v-slot="{ componentField }" name="mr">
<FormItem>
<SettingHeader>{{
Expand Down
20 changes: 20 additions & 0 deletions components/match/MatchMaps.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import {
PlayCircle,
RefreshCw,
MoreVertical,
Shield,
ShieldOff,
} from "lucide-vue-next";
import { Spinner } from "~/components/ui/spinner";
import MatchSelectMapWinner from "~/components/match/MatchSelectMapWinner.vue";
Expand Down Expand Up @@ -85,6 +87,19 @@ import cleanMapName from "~/utilities/cleanMapName";
class="text-xs px-2 py-0.5 backdrop-blur-sm"
>{{ $t("match.decider") }}</Badge
>
<Tooltip v-if="matchMap.anti_wallhack_active != null">
<TooltipTrigger as-child>
<Badge
:variant="matchMap.anti_wallhack_active ? 'secondary' : 'outline'"
class="hidden sm:inline-flex text-xs px-2 py-0.5 backdrop-blur-sm"
>
<Shield v-if="matchMap.anti_wallhack_active" class="w-3 h-3" />
<ShieldOff v-else class="w-3 h-3" />
<span class="sr-only">{{ antiWallhackLabel }}</span>
</Badge>
</TooltipTrigger>
<TooltipContent>{{ antiWallhackLabel }}</TooltipContent>
</Tooltip>
<template v-if="hasDemo && hasDemoMetadata">
<Tooltip v-if="mapHasRadar">
<TooltipTrigger as-child>
Expand Down Expand Up @@ -495,6 +510,11 @@ export default {
? "/img/teams/t_logo.svg"
: "/img/teams/ct_logo.svg";
},
antiWallhackLabel() {
return this.matchMap.anti_wallhack_active
? this.$t("match.anti_wallhack.protected")
: this.$t("match.anti_wallhack.not_active");
},
},
methods: {
async parseDemo() {
Expand Down
6 changes: 6 additions & 0 deletions components/match/MatchOptionsDisplay.vue
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,12 @@ const BooleanPill = defineComponent({
}}</dt>
<dd><BooleanPill :value="options.knife_round" /></dd>
</div>
<div class="settings-row">
<dt class="settings-row__label">{{
$t("match.options.anti_wallhack")
}}</dt>
<dd><BooleanPill :value="options.anti_wallhack" /></dd>
</div>
<div class="settings-row">
<dt class="settings-row__label">{{
$t("match.options.default_player_models")
Expand Down
4 changes: 4 additions & 0 deletions components/tournament/TournamentStageForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1400,6 +1400,7 @@ export default {
type: tournamentOptions.type,
best_of: tournamentOptions.best_of,
knife_round: tournamentOptions.knife_round,
anti_wallhack: tournamentOptions.anti_wallhack,
default_models: tournamentOptions.default_models,
overtime: tournamentOptions.overtime,
coaches: tournamentOptions.coaches,
Expand Down Expand Up @@ -1431,6 +1432,7 @@ export default {
type: $("type", "e_match_types_enum!"),
best_of: $("best_of", "Int!"),
knife_round: $("knife_round", "Boolean!"),
anti_wallhack: $("anti_wallhack", "Boolean!"),
default_models: $("default_models", "Boolean!"),
overtime: $("overtime", "Boolean!"),
coaches: $("coaches", "Boolean!"),
Expand Down Expand Up @@ -1470,6 +1472,7 @@ export default {
type: tournamentOptions.type,
best_of: tournamentOptions.best_of,
knife_round: tournamentOptions.knife_round,
anti_wallhack: tournamentOptions.anti_wallhack,
default_models: tournamentOptions.default_models,
overtime: tournamentOptions.overtime,
coaches: tournamentOptions.coaches,
Expand Down Expand Up @@ -1498,6 +1501,7 @@ export default {
type: $("type", "e_match_types_enum!"),
best_of: $("best_of", "Int!"),
knife_round: $("knife_round", "Boolean!"),
anti_wallhack: $("anti_wallhack", "Boolean!"),
default_models: $("default_models", "Boolean!"),
overtime: $("overtime", "Boolean!"),
coaches: $("coaches", "Boolean!"),
Expand Down
Loading