This repository has been archived by the owner on Oct 9, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Npcs, GetRoles() Optimization, Test Command
Added a testing command so I can test the plugin on my own, made GetRoles() not be called 7 times per check, no longer checks player objects without a userid
- Loading branch information
Build
committed
Feb 20, 2021
1 parent
747242f
commit aa32051
Showing
3 changed files
with
41 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
namespace EndConditions.Commands | ||
{ | ||
using CommandSystem; | ||
using Exiled.API.Enums; | ||
using Exiled.Events.EventArgs; | ||
using Exiled.Permissions.Extensions; | ||
using System; | ||
|
||
[CommandHandler(typeof(RemoteAdminCommandHandler))] | ||
public class TestConditions : ICommand | ||
{ | ||
public bool Execute(ArraySegment<string> arguments, ICommandSender sender, out string response) | ||
{ | ||
if (!sender.CheckPermission("ec.test")) | ||
{ | ||
response = "Insufficient permission. Required: ec.test"; | ||
return false; | ||
} | ||
|
||
EndConditions.EventHandlers.OnCheckRoundEnd(new EndingRoundEventArgs(LeadingTeam.Draw, default, false)); | ||
response = "Fired event."; | ||
return true; | ||
} | ||
|
||
public string Command { get; } = "testconditions"; | ||
public string[] Aliases { get; } = Array.Empty<string>(); | ||
public string Description { get; } = "Fires the EndingRound method once. Used for debugging."; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters