Skip to content

Commit

Permalink
Release v1.4.6
Browse files Browse the repository at this point in the history
  • Loading branch information
K4ryuu committed Sep 17, 2024
1 parent 44ea6d1 commit 71a6f99
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
-- 2024.09.17 - 1.4.6

- fix: Cancel challanges if opponent gets to AFK to prevent exploits (Thanks to Siudzix)

-- 2024.09.17 - 1.4.5

- feat: MVPs adding only when playing in arena 1
Expand Down
2 changes: 0 additions & 2 deletions src-plugin/Plugin/PluginCommands.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ namespace K4Arenas
using CounterStrikeSharp.API.Core;
using CounterStrikeSharp.API.Modules.Commands;
using CounterStrikeSharp.API.Modules.Commands.Targeting;
using CounterStrikeSharp.API.Modules.Entities.Constants;
using CounterStrikeSharp.API.Modules.Utils;
using K4Arenas.Models;
using Microsoft.Extensions.Logging;

public sealed partial class Plugin : BasePlugin
{
Expand Down
14 changes: 14 additions & 0 deletions src-plugin/Plugin/PluginEvents.cs
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,20 @@ public void Initialize_Events()
{
ChallengeModel challenge = challengeList.Dequeue()!;

bool player1IsAvailable = challenge.Player1.IsValid && challenge.Player1.Controller.Team > CsTeam.Spectator;
bool player2IsAvailable = challenge.Player2.IsValid && challenge.Player2.Controller.Team > CsTeam.Spectator;

if (!player1IsAvailable || !player2IsAvailable)
{
if (challenge.Player1.IsValid)
challenge.Player1.Controller.PrintToChat($"{Localizer["k4.general.prefix"]} {Localizer["k4.general.challenge.cancelled"]}");

if (challenge.Player2.IsValid)
challenge.Player2.Controller.PrintToChat($"{Localizer["k4.general.prefix"]} {Localizer["k4.general.challenge.cancelled"]}");

continue;
}

List<ArenaPlayer> team1 = [challenge.Player1];
List<ArenaPlayer> team2 = [challenge.Player2];

Expand Down
2 changes: 1 addition & 1 deletion src-plugin/Plugin/PluginManifest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public sealed partial class Plugin : BasePlugin

public override string ModuleAuthor => "K4ryuu";

public override string ModuleVersion => "1.4.5 " +
public override string ModuleVersion => "1.4.6 " +
#if RELEASE
"(release)";
#else
Expand Down
1 change: 1 addition & 0 deletions src-plugin/lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"k4.general.challenge.inchallenge": "{lightred}Challenge can be only requested, if both players are not in a challenge.",
"k4.general.challenge.notinarena": "{lightred}Challenge can be only requested, if both players are in the arena.",
"k4.general.challenge.notchallenged": "{lightred}You have no challenge requests or they have expired.",
"k4.general.challenge.cancelled": "{lightred}Your challenge has been cancelled due to AFK or the opponent left.",

"k4.general.commandclientonly": "{lightred}This command can only be used by clients.",
"k4.general.commandhelp": "{silver}Expected Usage: {lime}!{0} {1}",
Expand Down
Binary file modified src-shared/K4-ArenaSharedApi.dll
Binary file not shown.

0 comments on commit 71a6f99

Please sign in to comment.