Skip to content
This repository has been archived by the owner on Feb 28, 2021. It is now read-only.

Commit

Permalink
Fixed commands
Browse files Browse the repository at this point in the history
  • Loading branch information
PintTheDragon committed Jul 20, 2020
1 parent 6e03284 commit 304f1f1
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 11 deletions.
3 changes: 1 addition & 2 deletions src/Buddy.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
Expand All @@ -35,10 +36,8 @@
<Compile Include="Buddy.cs" />
<Compile Include="BuddyAcceptCommand.cs" />
<Compile Include="BuddyCommand.cs" />
<Compile Include="CommandHandler.cs" />
<Compile Include="Config.cs" />
<Compile Include="EventHandlers.cs" />
<Compile Include="ICommandPint.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="UnBuddyCommand.cs" />
</ItemGroup>
Expand Down
6 changes: 3 additions & 3 deletions src/BuddyAcceptCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace Buddy
{
[CommandHandler(typeof(GameConsoleCommandHandler))]
[CommandHandler(typeof(ClientCommandHandler))]
class BuddyAcceptCommand : ICommand
{
public string Command => Buddy.singleton.getLang("buddyAcceptCommand");
Expand All @@ -19,9 +19,9 @@ public bool Execute(ArraySegment<string> arguments, ICommandSender sender, out s
{
response = "";
string[] args = arguments.ToArray();
if (sender is PlayerCommandSender p)
if (sender is PlayerCommandSender)
{
Player player = Player.Get(p.Processor._hub);
Player player = Player.Get(((CommandSender)sender).SenderId);
response = handleBuddyAcceptCommand(player, new string[] { });
return true;
}
Expand Down
6 changes: 3 additions & 3 deletions src/BuddyCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace Buddy
{
[CommandHandler(typeof(GameConsoleCommandHandler))]
[CommandHandler(typeof(ClientCommandHandler))]
class BuddyCommand : ICommand
{
public string Command => Buddy.singleton.getLang("buddyCommand");
Expand All @@ -19,9 +19,9 @@ public bool Execute(ArraySegment<string> arguments, ICommandSender sender, out s
{
response = "";
string[] args = arguments.ToArray();
if(sender is PlayerCommandSender p)
if(sender is PlayerCommandSender)
{
Player player = Player.Get(p.Processor._hub);
Player player = Player.Get(((CommandSender)sender).SenderId);
if (args.Length != 1)
{
response = Buddy.singleton.getLang("invalidUsage");
Expand Down
6 changes: 3 additions & 3 deletions src/UnBuddyCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace Buddy
{
[CommandHandler(typeof(GameConsoleCommandHandler))]
[CommandHandler(typeof(ClientCommandHandler))]
class UnBuddyCommand : ICommand
{
public string Command => Buddy.singleton.getLang("buddyUnbuddyCommand");
Expand All @@ -19,9 +19,9 @@ public bool Execute(ArraySegment<string> arguments, ICommandSender sender, out s
{
response = "";
string[] args = arguments.ToArray();
if (sender is PlayerCommandSender p)
if (sender is PlayerCommandSender)
{
Player player = Player.Get(p.Processor._hub);
Player player = Player.Get(((CommandSender)sender).SenderId);
response = handleUnBuddyCommand(player);
return true;
}
Expand Down

0 comments on commit 304f1f1

Please sign in to comment.